Pārlūkot izejas kodu

企业物料库bug修改3

wangdy 7 gadi atpakaļ
vecāks
revīzija
2ee5b912f6

+ 3 - 2
src/main/java/com/uas/ps/product/controller/ProductController.java

@@ -2,6 +2,7 @@ package com.uas.ps.product.controller;
 
 import com.alibaba.fastjson.JSONObject;
 import com.uas.ps.core.util.CollectionUtils;
+import com.uas.ps.core.util.StringUtils;
 import com.uas.ps.entity.Product;
 import com.uas.ps.entity.Status;
 import com.uas.ps.product.entity.Prod;
@@ -86,7 +87,7 @@ public class ProductController {
     }
 
     /**
-     * 批量更新物料信息(子应用做验证,这里只负责存)
+     * 批量更新物料信息(子应用做验证,这里只负责存) (商城与b2b)
      *
      * @param data 物料信息
      * @return
@@ -99,7 +100,7 @@ public class ProductController {
         List<Long> resultProducts = new ArrayList<>();
 
         for (Product product : productInfo) {
-            List<Product> products = productService.findByEnUUAndCmpCodeAndBrand(product.getEnUU(),product.getCmpCode(),product.getBrand());
+            List<Product> products = productService.findByEnUUAndPCmpCodeAndPBrandEn(product.getEnUU(),product.getpCmpCode(),product.getpBrandEn());
             if (org.apache.commons.collections.CollectionUtils.isEmpty(products)) {
                 Product product1 = productService.save(product);
                 resultProducts.add(product1.getId());

+ 10 - 0
src/main/java/com/uas/ps/product/service/ProductService.java

@@ -95,6 +95,16 @@ public interface ProductService {
      */
     List<Product> findByEnUUAndCmpCodeAndBrand(Long enUU, String cmpCode, String brand);
 
+    /**
+     * 通过所属企业UU、型号和器件查询物料信息
+     *
+     * @param enUU
+     * @param pCmpCode
+     * @param pBrandEn
+     * @return
+     */
+    List<Product> findByEnUUAndPCmpCodeAndPBrandEn(Long enUU, String pCmpCode, String pBrandEn);
+
     /**
      * 物料下载成功,更新下载状态
      *