Quellcode durchsuchen

批量修改物料产品时,去除空值的查询

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@9374 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
hejq vor 8 Jahren
Ursprung
Commit
436e98c2c8

+ 7 - 3
src/main/java/com/uas/platform/b2b/service/impl/ProductServiceImpl.java

@@ -205,7 +205,7 @@ public class ProductServiceImpl implements ProductService {
 
 	@Override
 	public List<Product> getBrands(UpdateByBatchParameter param) {
-		String sql = "select distinct p.pr_brand brand from products p where p.pr_cmpuuid is null and p.pr_enuu = "
+		String sql = "select distinct p.pr_brand brand from products p where p.pr_cmpuuid is null and p.pr_brand is not null and p.pr_enuu = "
 				+ SystemSession.getUser().getEnterprise().getUu();
 		if (param.getType().equals(UpdateType.sale)) {
 			sql = sql + " and p.pr_isale = 1";
@@ -218,7 +218,7 @@ public class ProductServiceImpl implements ProductService {
 
 	@Override
 	public List<Product> getTitles(UpdateByBatchParameter param) {
-		String sql = "select distinct p.pr_title title from products p where p.pr_cmpuuid is null and p.pr_enuu = "
+		String sql = "select distinct p.pr_title title from products p where p.pr_cmpuuid is null and p.pr_title is not null and p.pr_enuu = "
 				+ SystemSession.getUser().getEnterprise().getUu();
 		if (param.getType().equals(UpdateType.sale)) {
 			sql = sql + " and p.pr_isale = 1";
@@ -290,7 +290,11 @@ public class ProductServiceImpl implements ProductService {
 		// map.put("error", "暂未查询到当前企业的非标准的物料信息");
 		// }
 		String num = productDao.upateResultByEnuu(SystemSession.getUser().getEnterprise().getUu());
-		map.put("size", num);
+		if (null == num) {
+			map.put("size", 0);
+		} else {
+			map.put("size", num);
+		}
 		return map;
 	}