|
|
@@ -2930,22 +2930,22 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
/**
|
|
|
* 删除重复的SKU编码
|
|
|
*/
|
|
|
- List<Long> greaterThenTwo = goodsDao.findSameGoodsGreaterThenTwo();
|
|
|
- List<GoodsHistory> histories = new ArrayList<>();
|
|
|
- for (Long aLong : greaterThenTwo) {
|
|
|
- Goods goods = goodsDao.findOne(aLong);
|
|
|
- List<Goods> goodsInProductId = goodsDao.findRepeatGoodsInProductId(goods.getProductid(), goods.getProduceDate(), goods.getPackaging(), goods.getMinPackQty(), goods.getMinBuyQty(), goods.getMaxDelivery(), goods.getMinDelivery(), goods.getUnit());
|
|
|
- Integer count = 0;
|
|
|
- for (Goods goods1 : goodsInProductId) {
|
|
|
- if(goods1.getId().longValue() != aLong.longValue()) {
|
|
|
- goods1.setStatus(Status.GOODS_DELETE.value());
|
|
|
- GoodsHistory goodsHistory = goodsHistoryService.converTGoodsHist(goods1, OperateType.DELETE.getPhrase());
|
|
|
- histories.add(goodsHistory);
|
|
|
- goodsDao.delete(goods1.getId());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- goodsHistoryService.save(histories);
|
|
|
+// List<Long> greaterThenTwo = goodsDao.findSameGoodsGreaterThenTwo();
|
|
|
+// List<GoodsHistory> histories = new ArrayList<>();
|
|
|
+// for (Long aLong : greaterThenTwo) {
|
|
|
+// Goods goods = goodsDao.findOne(aLong);
|
|
|
+// List<Goods> goodsInProductId = goodsDao.findRepeatGoodsInProductId(goods.getProductid(), goods.getProduceDate(), goods.getPackaging(), goods.getMinPackQty(), goods.getMinBuyQty(), goods.getMaxDelivery(), goods.getMinDelivery(), goods.getUnit());
|
|
|
+// Integer count = 0;
|
|
|
+// for (Goods goods1 : goodsInProductId) {
|
|
|
+// if(goods1.getId().longValue() != aLong.longValue()) {
|
|
|
+// goods1.setStatus(Status.GOODS_DELETE.value());
|
|
|
+// GoodsHistory goodsHistory = goodsHistoryService.converTGoodsHist(goods1, OperateType.DELETE.getPhrase());
|
|
|
+// histories.add(goodsHistory);
|
|
|
+// goodsDao.delete(goods1.getId());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// goodsHistoryService.save(histories);
|
|
|
/**
|
|
|
* 关联在售和产品库的信息, 分页获取 productid
|
|
|
*/
|
|
|
@@ -2996,21 +2996,21 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
productDao.save(products);
|
|
|
}
|
|
|
|
|
|
- List<GoodsHistory> failHistory = new ArrayList<>();
|
|
|
- List<Goods> goodses = goodsDao.findGoodsByTagIsNull();
|
|
|
- for (Goods goods : goodses) {
|
|
|
- if(goods.getProductid() != null) {
|
|
|
- Product product = productDao.findOne(goods.getProductid());
|
|
|
- if(product == null) {
|
|
|
- goods.setStatus(Status.GOODS_DELETE.value());
|
|
|
- GoodsHistory goodsHistory = goodsHistoryService.converTGoodsHist(goods, OperateType.DELETE.getPhrase());
|
|
|
- failHistory.add(goodsHistory);
|
|
|
- goodsDao.delete(goods.getId());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- goodsHistoryService.save(failHistory);
|
|
|
- return "存在" + greaterThenTwo.size() + "条重复的记录" + ",删除" + histories.size() + "记录";
|
|
|
+// List<GoodsHistory> failHistory = new ArrayList<>();
|
|
|
+// List<Goods> goodses = goodsDao.findGoodsByTagIsNull();
|
|
|
+// for (Goods goods : goodses) {
|
|
|
+// if(goods.getProductid() != null) {
|
|
|
+// Product product = productDao.findOne(goods.getProductid());
|
|
|
+// if(product == null) {
|
|
|
+// goods.setStatus(Status.GOODS_DELETE.value());
|
|
|
+// GoodsHistory goodsHistory = goodsHistoryService.converTGoodsHist(goods, OperateType.DELETE.getPhrase());
|
|
|
+// failHistory.add(goodsHistory);
|
|
|
+// goodsDao.delete(goods.getId());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// goodsHistoryService.save(failHistory);
|
|
|
+ return String.valueOf(end);
|
|
|
}
|
|
|
|
|
|
|