|
|
@@ -459,24 +459,24 @@ public class VendorsServiceImpl implements VendorService {
|
|
|
// 先查询当前企业的采购物料(待购&&不在售)的标准物料标准料号
|
|
|
StringBuffer cmpCodesSql = new StringBuffer();
|
|
|
cmpCodesSql.append("select 1 from v$products where pr_cmpcode = p1.pr_cmpcode and pr_enuu = ")
|
|
|
- .append(enUU).append(" and nvl(pr_issale,0) <> 1 and pr_ispurchase = 1 and pr_b2bdisabled <> 1 ");
|
|
|
+ .append(enUU).append(" and pr_b2bdisabled <> 1 ");
|
|
|
if (null != productMatchCondition) {
|
|
|
cmpCodesSql.append(" and ").append(productMatchCondition);
|
|
|
}
|
|
|
// 查找匹配在售物料的语句
|
|
|
StringBuffer productsMatchSql = new StringBuffer();
|
|
|
productsMatchSql.append("select pr_id from (select pr_id from v$products p1 where exists (").append(cmpCodesSql)
|
|
|
- .append(") and p1.pr_enuu = ").append(vendUU).append(" and p1.pr_issale = 1 and p1.pr_b2bdisabled <> 1 and ")
|
|
|
+ .append(") and p1.pr_enuu = ").append(vendUU).append(" and p1.pr_b2bdisabled <> 1 and ")
|
|
|
.append(null != whereCondition ? whereCondition : "").append(" order by pr_code desc)");
|
|
|
// 查找不匹配但是在售物料的语句 union all 方便排序
|
|
|
StringBuffer notMatchProductsSql = new StringBuffer();
|
|
|
notMatchProductsSql.append("select pr_id from (select pr_id from v$products p1 where not exists (").append(cmpCodesSql)
|
|
|
- .append(") and p1.pr_enuu = ").append(vendUU).append(" and p1.pr_issale = 1 and p1.pr_b2bdisabled <> 1 and ")
|
|
|
+ .append(") and p1.pr_enuu = ").append(vendUU).append(" and p1.pr_b2bdisabled <> 1 and ")
|
|
|
.append(null != whereCondition ? whereCondition : "").append(" order by pr_code desc)");
|
|
|
// 物料id
|
|
|
StringBuffer idSql = new StringBuffer();
|
|
|
String countSql = "select count(1) from v$products where pr_enuu = " + vendUU
|
|
|
- + " and pr_issale = 1 and pr_b2bdisabled <> 1";
|
|
|
+ + " and pr_b2bdisabled <> 1";
|
|
|
// rownum 控制
|
|
|
String rownumSql = " t where rownum <= " + page * size + ") where r1 > " + (page - 1) * size;
|
|
|
idSql.append("select pr_id from (select t.*,rownum as r1 from (").append(productsMatchSql).append(" union all ").append(notMatchProductsSql)
|
|
|
@@ -489,7 +489,7 @@ public class VendorsServiceImpl implements VendorService {
|
|
|
Product product = productDao.findOne(id);
|
|
|
if (matchedIds.contains(id)) {
|
|
|
StringBuffer matchCodeSql = new StringBuffer();
|
|
|
- matchCodeSql.append("select wm_concat(pr_code) from v$products where nvl(pr_issale,0) <> 1 and pr_ispurchase = 1 and pr_b2bdisabled <> 1 and pr_enuu = ")
|
|
|
+ matchCodeSql.append("select wm_concat(pr_code) from v$products where pr_b2bdisabled <> 1 and pr_enuu = ")
|
|
|
.append(enUU).append(" and pr_cmpcode = '").append(product.getCmpCode()).append("'").append(" and rownum <= 20");
|
|
|
String matchCodes = commonDao.queryForObject(matchCodeSql.toString(), String.class);
|
|
|
product.setIfMatched(matchCodes);
|