Browse Source

【商务平台】 财务对账,更新关键词拼接方法,将“-”改为“,”,增加物料名称和物料规格过滤条件

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@6792 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
hejq 9 years ago
parent
commit
9f2aed6f8a

+ 37 - 1
src/main/java/com/uas/platform/b2b/service/impl/ErpProdIODetailServiceImpl.java

@@ -58,7 +58,7 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
 				+ " p.pd_thischeckqty thisCheckQty, p.custuu custUu, p.custname custName, p.enuu enUu, p.sourceid sourceId, p.pi_sourcetable sourceTable, p.pi_rate rate, p.pi_receivecode receiveCode,"
 				+ " p.pi_receivename receiveName , p.pd_factory factory, p.sendcode sendcode from erp$prodiodetail p where enuu = ?";
 		if (!StringUtils.isEmpty(keyword)) {
-			String[] strs = keyword.split("-");
+			String[] strs = keyword.split(",");
 			if (strs.length == 1) {
 				sql = sql + " and custname = '" + strs[0] + "'";
 			}
@@ -68,6 +68,42 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
 				}
 				sql = sql + " and pi_receivename = '" + strs[1] + "'";
 			}
+			if (strs.length == 3) {
+				if (strs[0].length() != 0) {
+					sql = sql + " and custname = '" + strs[0] + "'";
+				}
+				if (strs[1].length() != 0) {
+					sql = sql + " and pi_receivename = '" + strs[1] + "'";
+				}
+				sql = sql + " and pd_factory = '" + strs[2] + "'";
+			}
+			if (strs.length == 4) {
+				if (strs[0].length() != 0) {
+					sql = sql + " and custname = '" + strs[0] + "'";
+				}
+				if (strs[1].length() != 0) {
+					sql = sql + " and pi_receivename = '" + strs[1] + "'";
+				}
+				if (strs[2].length() != 0) {
+					sql = sql + " and pd_factory = '" + strs[2] + "'";
+				}
+				sql = sql + " and pr_title = '" + strs[3] + "'";
+			}
+			if (strs.length == 5) {
+				if (strs[0].length() != 0) {
+					sql = sql + " and custname = '" + strs[0] + "'";
+				}
+				if (strs[1].length() != 0) {
+					sql = sql + " and pi_receivename = '" + strs[1] + "'";
+				}
+				if (strs[2].length() != 0) {
+					sql = sql + " and pd_factory = '" + strs[2] + "'";
+				}
+				if (strs[3].length() != 0) {
+					sql = sql + " and pr_title = '" + strs[3] + "'";
+				}
+				sql = sql + " and pr_spec = '" + strs[4] + "'";
+			}
 		}
 		if (fromDate != null) {
 			sql = sql + " and pi_date>" + "to_date('" + new java.sql.Date(new Date(fromDate).getTime())