Эх сурвалжийг харах

Merge remote-tracking branch 'origin/feature-201820-wangcz' into feature-201820-wangcz

shenjj 7 жил өмнө
parent
commit
bdff3a031f

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

@@ -1695,6 +1695,9 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 
 	@Override
 	public String publishByBatch(String batch, boolean isPcb) {
+        if (StringUtils.isEmpty(batch)) {
+            return "0";
+        }
 		List<ReleaseProductByBatch> releaseProductByBatchList =
 				releaseProductByBatchDao.findByRelbatchid(batch);
 		if (CollectionUtils.isEmpty(releaseProductByBatchList)) {
@@ -1702,7 +1705,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 		}
 		Map<String, Object> map = convertProduct(releaseProductByBatchList, false, isPcb);
 		if (map == null || map.size() == 0) {
-			return "fail";
+			return "0";
 		}
 		Set<Long> idSet = (Set<Long>) map.get("prIds");
 		if (isPcb) {
@@ -1922,10 +1925,10 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 	 * 批量发布之后,需要做的事情,内部使用线程,不需要让用户等结果
 	 */
 	public void afterPublishToGoodsDo(final List<Long> productIds, final Set<Long> reIds, String batchid) {
-        final List<Goods> goodses = goodsService.findByBatchId(batchid);
-        if (CollectionUtils.isEmpty(productIds)) {
+        if (CollectionUtils.isEmpty(productIds) || StringUtils.isEmpty(batchid)) {
 			return ;
 		}
+//        final List<Goods> goodses = goodsService.findByBatchId(batchid);
 		final Runnable afterPublishToGoodsRunnable = new Runnable() {
 			@Override
 			public void run() {
@@ -1950,14 +1953,14 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 					goodsService.updateSpecByProducts(products, goodses);
 				}
 
-                List<GoodsHistory> list = new ArrayList<>();
-                for (Goods goodse : goodses) {
-                    GoodsHistory goodsHistory = goodsHistoryService.converTGoodsHist(goodse, GoodsHistory.OperateType.Publish.getPhrase(), false);
-                    list.add(goodsHistory);
-                }
-                if (CollectionUtils.isNotEmpty(list)) {
-                    commonDao.save(list, GoodsHistory.class);
-                }
+//                List<GoodsHistory> list = new ArrayList<>();
+//                for (Goods goodse : goodses) {
+//                    GoodsHistory goodsHistory = goodsHistoryService.converTGoodsHist(goodse, GoodsHistory.OperateType.Publish.getPhrase(), false);
+//                    list.add(goodsHistory);
+//                }
+//                if (CollectionUtils.isNotEmpty(list)) {
+//                    commonDao.save(list, GoodsHistory.class);
+//                }
             }
 		};
 		try {