|
|
@@ -339,7 +339,7 @@ public class VendorsServiceImpl implements VendorService {
|
|
|
final Long enUU = SystemSession.getUser().getEnterprise().getUu();
|
|
|
// 先查询当前企业的采购物料(待购&&不在售)的标准物料标准料号
|
|
|
String cmpCodesSql = "select distinct(pr.pr_cmpcode) from products pr left join sec$enterprises en on pr.pr_enuu = en.en_uu " +
|
|
|
- "where pr.pr_ispurchase = 1 and pr.pr_issale != 1 and pr.pr_standard = 1 and pr.pr_enuu = " + enUU +
|
|
|
+ " where pr.pr_ispurchase = 1 and pr.pr_issale != 1 and pr.pr_standard = 1 and pr.pr_enuu = " + enUU +
|
|
|
" and pr.pr_code like '%" + code + "%' and pr.pr_cmpcode like '%" + cmpCode + "%' and pr.pr_brand like '%" + brand + "%'";
|
|
|
// 根据标准料号找出对应的供应商UU
|
|
|
String vendUUsSql = "select distinct(ve_vendenuu) from purc$vendors left join products on pr_enuu = ve_vendenuu" +
|
|
|
@@ -348,7 +348,7 @@ public class VendorsServiceImpl implements VendorService {
|
|
|
System.out.println(cmpCodesSql);
|
|
|
final List<String> cmpCodes = commonDao.queryForList(cmpCodesSql, String.class);
|
|
|
// rownum 控制
|
|
|
- String rownumSql = " and rownum > " + (page - 1) * size + "and rownum <= " + page * size + " group by en_uu order by count(en_uu) desc";
|
|
|
+ String rownumSql = " and rownum > " + (page - 1) * size + " and rownum <= " + page * size + " group by en_uu order by count(en_uu) desc";
|
|
|
// 查找非供应商的卖当前商品的企业UU
|
|
|
StringBuffer vendorRecommendUusSql = new StringBuffer();
|
|
|
StringBuffer vendorRecommendUuNumSql = new StringBuffer();
|
|
|
@@ -425,9 +425,9 @@ public class VendorsServiceImpl implements VendorService {
|
|
|
// rownum 控制
|
|
|
String rownumSql = " and rownum > " + (page - 1) * size + "and rownum <= " + page * size;
|
|
|
// 查找匹配物料的语句
|
|
|
- String productsMatchSql = "select * from products where pr_enuu = " + vendUU + " and pr_cmpcode in " + cmpCodesSql;
|
|
|
+ String productsMatchSql = "select * from products where pr_enuu = " + vendUU + " and pr_cmpcode in (" + cmpCodesSql + ") and " + whereCondition;
|
|
|
// 查找所有物料的语句
|
|
|
- String allProductsSql = "select * from products where pr_enuu = " + vendUU + " and pr_cmpcode is not null";
|
|
|
+ String allProductsSql = "select * from products where pr_enuu = " + vendUU + " and pr_cmpcode is not null and " + whereCondition;
|
|
|
// 物料id
|
|
|
StringBuffer idSql = new StringBuffer();
|
|
|
StringBuffer countSql = new StringBuffer();
|