Browse Source

调整部分代码

yujia 7 years ago
parent
commit
6209485cff

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

@@ -1869,7 +1869,6 @@ 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);
@@ -1882,10 +1881,9 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 
 				prIds.add(producte.getId());
 
-				for (ReleaseProductByBatch releaseProductByBatch : releaseProductByBatchList) {
+				for (ReleaseProductByBatch releaseProductByBatch : productsfromRelease) {
 					if (StringUtilB2C.equals(releaseProductByBatch.getProductNum(), producte.getProdNum())) {
 						releaseProductByBatch.setProductid(producte.getId());
-						reList.add(releaseProductByBatch);
 					}
 				}
 			}
@@ -1893,8 +1891,8 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 
         long l3 = System.currentTimeMillis();
         System.err.println("打印l3 ----------- l2" + (l3 - l2));
-		if (CollectionUtils.isNotEmpty(reList)) {
-            udpatePridAndRrodnum(reList);
+		if (CollectionUtils.isNotEmpty(productsfromRelease)) {
+            udpatePridAndRrodnum(productsfromRelease);
 		}
         long l4 = System.currentTimeMillis();
         System.err.println("打印l4 ----------- l3" + (l4 - l3));