|
|
@@ -1887,7 +1887,6 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
*/
|
|
|
public Integer releaseToGoods(List<ReleaseProductByBatch> list, Integer ignoreImport, Set<Long> idSet) {
|
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
|
- List<Goods> goodses = new ArrayList<>();
|
|
|
Goods goods = null;
|
|
|
TradeDeliveryDelayTime delayTime = getDelayTime(list.get(0));
|
|
|
List<Goods> goodlist = null;
|
|
|
@@ -1927,19 +1926,16 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
goods = new Goods();
|
|
|
goods.setGoodsByReleaseProductByBatch(releaseProductByBatch, delayTime);
|
|
|
goodsHistoryList.add(goodsHistoryService.converTGoodsHist(goods, GoodsHistory.OperateType.Publish.getPhrase(), false));
|
|
|
- goodses.add(goods);
|
|
|
+ updateGoods.add(goods);
|
|
|
}
|
|
|
}
|
|
|
- if (CollectionUtils.isNotEmpty(goodses)) {
|
|
|
- commonDao.save(goodses, Goods.class);
|
|
|
- }
|
|
|
if (CollectionUtils.isNotEmpty(updateGoods)) {
|
|
|
goodsDao.save(updateGoods);
|
|
|
}
|
|
|
if (CollectionUtils.isNotEmpty(goodsHistoryList)) {
|
|
|
goodsHistoryService.save(goodsHistoryList);
|
|
|
}
|
|
|
- return (goodses.size() + updateGoods.size());
|
|
|
+ return updateGoods.size();
|
|
|
} else {
|
|
|
return 0;
|
|
|
}
|
|
|
@@ -2178,41 +2174,10 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
final Runnable afterPublishToGoodsRunnable = new Runnable() {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
-
|
|
|
- //创建历史库存
|
|
|
-// List<Goods> goodses1 = goodsService.findByBatchId(batchid);
|
|
|
-// List<GoodsHistory> list = new ArrayList<>();
|
|
|
-// for (Goods goods : goodses1) {
|
|
|
-// GoodsHistory goodsHistory = goodsHistoryService.converTGoodsHist(goods, GoodsHistory.OperateType.Publish.getPhrase(), false);
|
|
|
-// list.add(goodsHistory);
|
|
|
-// }
|
|
|
-// if (CollectionUtils.isNotEmpty(list)) {
|
|
|
-// goodsHistoryService.save(list);
|
|
|
-// }
|
|
|
//创建物料的私有信息
|
|
|
productPrivateService.newProductPrivateIfNotExist(productIds);
|
|
|
//添加个人关系
|
|
|
restTemplate.postForEntity(productServiceIp + "/product/assign/batch?userUU=" + userUU, productIds, String.class).getBody();
|
|
|
-
|
|
|
-// if ((reIds != null) && (reIds.size() != 0)) {
|
|
|
-// List<ReleaseProductByBatch> productByBatches = releaseProductByBatchDao.findAll(reIds);
|
|
|
-// List<Long> prIds = new ArrayList<>();
|
|
|
-// for (ReleaseProductByBatch productByBatch : productByBatches) {
|
|
|
-// if (productByBatch.getProductid() != null) {
|
|
|
-// prIds.add(productByBatch.getProductid());
|
|
|
-// }
|
|
|
-// }
|
|
|
-// List<Product> products = productService.findByProductId(prIds);
|
|
|
-// for (Product product : products) {
|
|
|
-// for (ReleaseProductByBatch productByBatch : productByBatches) {
|
|
|
-// if ((productByBatch.getProductid() != null) && (product.getId().longValue() == productByBatch.getProductid().longValue())) {
|
|
|
-// product.setSpec(productByBatch.getSpec());
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// List<Goods> goodses = goodsDao.findByProductIds(prIds);
|
|
|
-// goodsService.updateSpecByProducts(products, goodses);
|
|
|
-// }
|
|
|
}
|
|
|
};
|
|
|
try {
|