|
|
@@ -330,8 +330,8 @@ public class VendorsServiceImpl implements VendorService {
|
|
|
long start = System.currentTimeMillis();
|
|
|
// final Long enUU = SystemSession.getUser().getEnterprise().getUu();
|
|
|
if (null == enUU) {
|
|
|
- // 设置测试企业 - 优软测试二
|
|
|
- enUU = 10030994L;
|
|
|
+ // 设置不存在的企业
|
|
|
+ enUU = 100411660L;
|
|
|
}
|
|
|
if (StringUtils.isEmpty(productMatchCondition) || productMatchCondition.contains("1=1")) {
|
|
|
productMatchCondition = " 1=1 ";
|
|
|
@@ -344,7 +344,7 @@ public class VendorsServiceImpl implements VendorService {
|
|
|
// 查询所有的企业信息
|
|
|
StringBuffer enterpriseSql = new StringBuffer();
|
|
|
enterpriseSql.append("select en.en_uu, en.en_name, en.en_shortname, en.en_address, en.en_tel, en.en_email, en.en_corporation, en.en_businesscode, en.en_profession, en.en_tags, en.en_contactman, en.en_contacttel from sec$enterprises en right join (" +
|
|
|
- " select en_uu, count(1) as counts from sec$enterprises left join v$products on en_uu = pr_enuu where ").append(productMatchCondition).append(" and en_uu <> ")
|
|
|
+ " select en_uu, count(1) as counts from sec$enterprises left join products on en_uu = pr_enuu where ").append(productMatchCondition).append(" and en_uu <> ")
|
|
|
.append(enUU).append(" and en_name not like '%测试%' and lower(en_name) not like '%test%' and ").append(enterpriseMatchCondition).append(" group by en_uu order by count(1) desc" +
|
|
|
" ) a on en.en_uu = a.en_uu order by en.en_weight desc, counts desc");
|
|
|
// rownum 控制
|
|
|
@@ -358,7 +358,7 @@ public class VendorsServiceImpl implements VendorService {
|
|
|
.append(") isVendor from (select t.*,rownum as r1 from (").append(enterpriseSql).append(rownumSql);
|
|
|
// 因为需求更改为所有有销售产品的企业都会被返回,所以total直接取除本企业外其他有销售产品的企业数即可,之前的匹配企业数不再返回
|
|
|
StringBuffer totalSql = new StringBuffer().append(" select count(1) from (select en_uu from sec$enterprises left join " +
|
|
|
- " v$products on en_uu = pr_enuu where en_name not like '%测试%' and lower(en_name) not like '%test%' and en_uu <> ")
|
|
|
+ " products on en_uu = pr_enuu where en_name not like '%测试%' and lower(en_name) not like '%test%' and en_uu <> ")
|
|
|
.append(enUU).append(" and ").append(productMatchCondition).append(" and ").append(enterpriseMatchCondition).append(" group by en_uu)");
|
|
|
// System.out.println("SQL:" + vendorRecommendUusSql.toString());
|
|
|
// System.out.println("NUM_SQL:" + totalSql.toString());
|
|
|
@@ -375,7 +375,7 @@ public class VendorsServiceImpl implements VendorService {
|
|
|
* @param page 页数
|
|
|
* @param size 每页条数
|
|
|
* @param vendUU 推荐供应商企业UU
|
|
|
- * @param productMatchCondition 列表的物料匹配搜索条件
|
|
|
+ * @param productMatchCondition 列表的物料匹配搜索条件 -- 需求变更中,此条件已弃用
|
|
|
* @param whereCondition where条件(product的筛选条件拼接)
|
|
|
* @return
|
|
|
*/
|
|
|
@@ -459,7 +459,7 @@ public class VendorsServiceImpl implements VendorService {
|
|
|
}
|
|
|
String value = field.replace("pr_", "");
|
|
|
String productSql = "select " + field + " as " + value +" from (" +
|
|
|
- " select " + field + " from v$products where " + condition + " group by " + field + " order by count(1) desc" +
|
|
|
+ " select " + field + " from v$products where " + condition + " group by " + field +
|
|
|
") where rownum <= 10";
|
|
|
return commonDao.query(productSql, Product.class);
|
|
|
}
|