wangdy пре 8 година
родитељ
комит
ada1ecf651

+ 4 - 2
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ReleaseProductByBatchServiceImpl.java

@@ -1050,8 +1050,9 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 			// TODO 什么接口
 			String result = restTemplate.postForEntity(productServiceIp + "/product/update", products, String.class).getBody();
 			productIds = JSON.parseArray(result, Long.class);
+			Set<Long> idSet = new HashSet<>(productIds);
 			List<ProductPrivate> productPrivates = new ArrayList<>();
-			for (Long prId : productIds) {
+			for (Long prId : idSet) {
 				ProductPrivate productPrivate = findByPrId(prId);
 				if (null == productPrivate) {
 					productPrivate = new ProductPrivate();
@@ -1173,7 +1174,8 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
             String res  = restTemplate.postForEntity(productServiceIp + "/product/assign/batch?userUU=" + SystemSession.getUser().getUserUU(), productIds, String.class).getBody();
             // 默认为b2c Enable开启
             List<ProductPrivate> productPrivates = new ArrayList<>();
-            for (Long prId : productIds) {
+			Set<Long> idSet = new HashSet<>(productIds);
+            for (Long prId : idSet) {
                 ProductPrivate productPrivate = findByPrId(prId);
                 if (null == productPrivate) {
                     productPrivate = new ProductPrivate();