Browse Source

公共询价单报价保存物料接口,查询重复使用pcmpcode和pbranden字段判断

dongbw 7 years ago
parent
commit
a47ec14bd5

+ 2 - 2
src/main/java/com/uas/ps/product/service/impl/ProductServiceImpl.java

@@ -344,7 +344,7 @@ public class ProductServiceImpl implements ProductService {
         Long userUU = product.getUserUU();
         if (null == userUU) {
             map.put("success", false);
-            map.put("message", "已存在对应个人产品记录");
+            map.put("message", "新增物料用户UU为空");
             return map;
         }
         SimpleDateFormat sdf = new SimpleDateFormat("yyMMddHHmmss");
@@ -352,7 +352,7 @@ public class ProductServiceImpl implements ProductService {
             String code = sdf.format(new Date()) + StringUtil.getRandomString(3);
             product.setCode(code);
         }
-        List<Product> existedProds = productDao.findByEnUUAndCmpCodeAndBrandAndSpec(product.getEnUU(), product.getCmpCode(), product.getBrand(), product.getSpec());
+        List<Product> existedProds = productDao.findByEnUUAndPCmpCodeAndPBrandEn(product.getEnUU(), product.getpCmpCode(), product.getpBrandEn());
         if (CollectionUtils.isEmpty(existedProds)) {
             List<Product> products = productDao.findByEnUUAndCode(product.getEnUU(), product.getCode());
             while (!CollectionUtils.isEmpty(products)) {