最新价格查询增加物料备注查询条件

This commit is contained in:
mzr 2025-04-17 16:39:02 +08:00
parent 6e7f80cab5
commit ce12efdb62
2 changed files with 39 additions and 15 deletions

View File

@ -82,7 +82,7 @@ public class SupPriceQryRule {
return "";
} else {
ConditionVO[] copyconvos = (ConditionVO[])CloneUtil.deepClone(convos);
List<ConditionVO> list = new ArrayList();
for(ConditionVO vo : copyconvos) {
if (vo.getFieldCode().equals(SupPriceRptConst.DBUSINESSDATE)) {
int month = Integer.valueOf(vo.getValue());
@ -91,17 +91,23 @@ public class SupPriceQryRule {
vo.setFieldCode(htablealias + ".dbilldate");
vo.setOperaCode("between");
vo.setDataType(3);
String var10001 = befdate.toString();
vo.setValue(var10001 + " ," + curdate.toString() + " ");
String befdateStr = befdate.toString();
vo.setValue(befdateStr + " ," + curdate.toString() + " ");
} else if (vo.getFieldCode().equals("pk_supplier")) {
vo.setFieldCode(htablealias + ".cvendorid");
} else if (vo.getFieldCode().equalsIgnoreCase("memo")) {
tranMap.put("memo", vo);
} else {
vo.setFieldCode(htablealias + "." + vo.getFieldCode());
}
if (!vo.getFieldCode().equalsIgnoreCase("memo")) {
list.add(vo);
}
}
StringBuilder sql = new StringBuilder("");
sql.append((new ConditionVO()).getSQLStr(copyconvos));
ConditionVO[] array = list.toArray(new ConditionVO[0]);
sql.append((new ConditionVO()).getSQLStr(array));
this.addMarWhere(sql, tranMap, rptutils, btablealias);
return sql.toString();
}
@ -162,9 +168,11 @@ public class SupPriceQryRule {
vo.setFieldCode(htablealias + ".dbilldate");
vo.setOperaCode("between");
vo.setDataType(3);
String var10001 = befdate.toString();
vo.setValue(var10001 + " ," + curdate.toString() + " ");
String befdateStr = befdate.toString();
vo.setValue(befdateStr + " ," + curdate.toString() + " ");
list.add(vo);
} else if (vo.getFieldCode().equalsIgnoreCase("memo")) {
tranMap.put("memo", vo);
} else if (!vo.getFieldCode().equals("bsc")) {
vo.setFieldCode(htablealias + "." + vo.getFieldCode());
list.add(vo);
@ -184,7 +192,7 @@ public class SupPriceQryRule {
return "";
} else {
ConditionVO[] copyconvos = (ConditionVO[])CloneUtil.deepClone(convos);
List<ConditionVO> list = new ArrayList();
for(ConditionVO vo : copyconvos) {
if (vo.getFieldCode().equals(SupPriceRptConst.DBUSINESSDATE)) {
int month = Integer.valueOf(vo.getValue());
@ -193,19 +201,25 @@ public class SupPriceQryRule {
vo.setFieldCode(tablealias + ".dvaliddate");
vo.setOperaCode("between");
vo.setDataType(3);
String var10001 = befdate.toString();
vo.setValue(var10001 + " ," + curdate.toString() + " ");
String befdateStr = befdate.toString();
vo.setValue(befdateStr + " ," + curdate.toString() + " ");
} else if (vo.getDataType() == 3 && vo.getOperaCode().equalsIgnoreCase("=")) {
UFDate date = new UFDate(vo.getValue());
vo.setValue(date.toLocalString());
vo.setFieldCode(tablealias + "." + vo.getFieldCode());
} else if (vo.getFieldCode().equalsIgnoreCase("memo")) {
tranMap.put("memo", vo);
} else {
vo.setFieldCode(tablealias + "." + vo.getFieldCode());
}
if (!vo.getFieldCode().equalsIgnoreCase("memo")) {
list.add(vo);
}
}
StringBuilder sql = new StringBuilder("");
sql.append((new ConditionVO()).getSQLStr(copyconvos));
ConditionVO[] array = list.toArray(new ConditionVO[0]);
sql.append((new ConditionVO()).getSQLStr(array));
this.addMarWhere(sql, tranMap, rptutils, tablealias);
return sql.toString();
}

View File

@ -5,8 +5,6 @@
package nc.vo.pp.report.util;
import java.util.HashMap;
import java.util.Map;
import nc.bs.ic.icreport.pub.RPMetaDataUtil;
import nc.bs.pubapp.report.ReportPermissionUtils;
import nc.pub.smart.context.SmartContext;
@ -22,6 +20,9 @@ import nc.vo.pubapp.pattern.model.meta.entity.view.IDataViewMeta;
import nc.vo.scmbd.pub.SCMESAPI;
import nc.vo.scmpub.util.ArrayUtil;
import java.util.HashMap;
import java.util.Map;
/**
* ×îм۸ñ²éѯ
* 2005ÊÊÅä2312
@ -96,7 +97,8 @@ public class PurpRptUtils {
ConditionVO codeVO = this.getMarCondVO(tranMap, marcodeKey);
ConditionVO nameVO = this.getMarCondVO(tranMap, marnameKey);
ConditionVO classVO = this.getMarCondVO(tranMap, marclassKey);
if (null == codeVO && null == nameVO && null == classVO) {
boolean flag = tranMap.get("memo") == null;
if (null == codeVO && null == nameVO && null == classVO && flag) {
return "";
} else {
StringBuilder wheresql = new StringBuilder();
@ -116,6 +118,11 @@ public class PurpRptUtils {
wheresql.append(" and ");
this.setMarWhere(classVO, "bd_material.pk_marbasclass", wheresql);
}
if (!flag) {
ConditionVO memoVo = (ConditionVO) tranMap.get("memo");
wheresql.append(" and ");
this.setMarWhere(memoVo, "bd_material.memo", wheresql);
}
wheresql.append(" ) ");
return wheresql.toString();
@ -169,6 +176,9 @@ public class PurpRptUtils {
} else if (condvo.getOperaCode().equals("left like")) {
String value = condvo.getValue().replaceAll("\\(", "").replaceAll("\\)", "");
wheresql.append(field + " like '" + SCMESAPI.sqlEncodeGeneral(value) + "%' ");
} else if (condvo.getOperaCode().equals("like")) {
String value = condvo.getValue().replaceAll("\\(", "").replaceAll("\\)", "");
wheresql.append(field + " like '%" + SCMESAPI.sqlEncodeGeneral(value) + "%' ");
}
}