Browse Source

处理根据保存物料更新用户上架临时表报错的问题吧

yujia 7 years ago
parent
commit
bc43fa10c9

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

@@ -1869,6 +1869,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 		}
         long l2 = System.currentTimeMillis();
         System.err.println("打印l2 ----------- l1" + (l2 - l1));
+		List<ReleaseProductByBatch> reList = new ArrayList<>();
 		if (productsfromRelease.size() != 0) {
             productService.saveByJdbcTemplate(productsfromRelease);
 			List<Product> productes = productService.findProductsByProdNums(proNums);
@@ -1884,6 +1885,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 				for (ReleaseProductByBatch releaseProductByBatch : productsfromRelease) {
 					if (StringUtilB2C.equals(releaseProductByBatch.getProductNum(), producte.getProdNum())) {
 						releaseProductByBatch.setProductid(producte.getId());
+						reList.add(releaseProductByBatch);
 					}
 				}
 			}
@@ -1891,8 +1893,8 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 
         long l3 = System.currentTimeMillis();
         System.err.println("打印l3 ----------- l2" + (l3 - l2));
-		if (CollectionUtils.isNotEmpty(productsfromRelease)) {
-            udpatePridAndRrodnum(productsfromRelease);
+		if (CollectionUtils.isNotEmpty(reList)) {
+            udpatePridAndRrodnum(reList);
 		}
         long l4 = System.currentTimeMillis();
         System.err.println("打印l4 ----------- l3" + (l4 - l3));