Browse Source

供应商调整,没有满足条件的企业时,isStore为空。避免显示错误

dongbw 7 years ago
parent
commit
c37bd36da1

+ 9 - 4
src/main/java/com/uas/platform/b2c/trade/vendor/service/impl/VendorIntroductionServiceImpl.java

@@ -65,8 +65,6 @@ public class VendorIntroductionServiceImpl implements VendorIntroductionService
 		// 拼接查询条件
 		if (!StringUtils.isEmpty(keyword)) {
             keyword = keyword.trim();
-			enterpriseCondition = "(en_name like '%" + keyword + "%' or en_address like '%" + keyword + "%' or en_industry like '% "
-					+ keyword + "%')";
             if (!StringUtils.isEmpty(field)) {
             	switch (field) {
 					case KIND_EQUAL :
@@ -78,8 +76,15 @@ public class VendorIntroductionServiceImpl implements VendorIntroductionService
 					case PBRANDEN_EQUAL :
 						productCondition = "pr_pbranden = '" + keyword + "'";
 						break;
+                    default :
+                        enterpriseCondition = "(en_name like '%" + keyword + "%' or en_address like '%" + keyword + "%' or en_industry like '% "
+                                + keyword + "%')";
+                        break;
 				}
-			}
+			} else {
+                enterpriseCondition = "(en_name like '%" + keyword + "%' or en_address like '%" + keyword + "%' or en_industry like '% "
+                        + keyword + "%')";
+            }
         }
         Long enUU = 0L;
         if (null != SystemSession.getUser() && null != SystemSession.getUser().getEnterprise()) {
@@ -161,7 +166,7 @@ public class VendorIntroductionServiceImpl implements VendorIntroductionService
 		StringBuilder vendorIntroductionUusSql = new StringBuilder();
 		// 行数 控制
 		String rownumSql = ") s order by isStore desc,prodCounts desc,enUU asc limit " + (page - 1) * size + "," + size ;
-		vendorIntroductionUusSql.append("select s.*, if( st_uuid is not null and st_status = 'OPENED', 1, 0) isStore");
+		vendorIntroductionUusSql.append("select s.*, if( st_uuid is not null and st_status = 'OPENED', 1, null) isStore");
 		vendorIntroductionUusSql.append(",(select count(1) from ( select pr_enuu from v$product$private where ").append(productCondition)
 				.append(" and ifnull(pr_b2cenabled, 1) = 1 and pr_pbranden is not null and pr_pcmpcode is not null) p1 where pr_enuu = enUU) prodCounts");
 		vendorIntroductionUusSql.append(" from (").append(enterpriseSql).append(rownumSql);