Преглед на файлове

ProductService.getRelatedPackges, check pkgId but not productId while scaning relatedPkgs

xuchaolang преди 6 години
родител
ревизия
4c631931cd
променени са 1 файла, в които са добавени 4 реда и са изтрити 4 реда
  1. 4 4
      rankin-product-service/src/main/java/cn/rankin/productservice/service/ProductService.java

+ 4 - 4
rankin-product-service/src/main/java/cn/rankin/productservice/service/ProductService.java

@@ -161,13 +161,13 @@ public class ProductService {
 
         for(PackageProductRelation rel : currentRelationList){
             //skip pid not belong merchant
-
-            if(null == merchantProductRepository.findByPidAndMerchantId(pid, merchantId)){
-                log.info("Skip, Pid not Belong Merchant, pid={}, merchantId={}", pid, merchantId);
+            String pkgId = rel.getPkgId();
+            if(null == pkgId || null == merchantProductRepository.findByPidAndMerchantId(pkgId, merchantId)){
+                log.info("Skip, pkgId not Belong Merchant, pkgId={}, merchantId={}", pkgId, merchantId);
                 continue;
             }
 
-            pids.add(rel.getPkgId());
+            pids.add(pkgId);
         }
 
         if (pids.isEmpty()){