|
|
@@ -2928,16 +2928,18 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
orderService.save(orders);
|
|
|
|
|
|
Boolean aBoolean = floorsService.updateHomeInfo(goods.getBatchCode());
|
|
|
- //先做下架记录
|
|
|
- goods.setStatus(Status.REMOVED.value());
|
|
|
- GoodsHistory goodsHistoryRemoved = goodsHistoryService.converTGoodsHist(goods, OperateType.Down.getPhrase());
|
|
|
+ List<GoodsHistory> histories = new ArrayList<>();
|
|
|
+ if (goods.getStatus().equals(Status.AVAILABLE.value()) || goods.getStatus().equals(Status.UNAVAILABLE.value())) {
|
|
|
+ //先做下架记录
|
|
|
+ goods.setStatus(Status.REMOVED.value());
|
|
|
+ GoodsHistory goodsHistoryRemoved = goodsHistoryService.converTGoodsHist(goods, OperateType.Down.getPhrase());
|
|
|
+ histories.add(goodsHistoryRemoved);
|
|
|
+ }
|
|
|
|
|
|
goods.setStatus(Status.GOODS_DELETE.value());
|
|
|
//删除库存信息
|
|
|
GoodsHistory goodsHistoryDelete = goodsHistoryService.converTGoodsHist(goods, OperateType.DELETE.getPhrase());
|
|
|
- List<GoodsHistory> histories = new ArrayList<>();
|
|
|
- histories.add(goodsHistoryRemoved);
|
|
|
- histories.add(goodsHistoryRemoved);
|
|
|
+ histories.add(goodsHistoryDelete);
|
|
|
goodsHistoryService.save(histories);
|
|
|
|
|
|
goodsDao.deleteByBatchCode(goods.getBatchCode());
|
|
|
@@ -2999,12 +3001,14 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
|
|
|
Boolean aBoolean = floorsService.updateHomeInfo(goods.getBatchCode());
|
|
|
|
|
|
- goods.setStatus(Status.REMOVED.value());
|
|
|
- GoodsHistory goodsHistoryRemoved = goodsHistoryService.converTGoodsHist(goods, OperateType.Down.getPhrase());
|
|
|
+ if (goods.getStatus().equals(Status.AVAILABLE.value()) || goods.getStatus().equals(Status.UNAVAILABLE.value())) {
|
|
|
+ goods.setStatus(Status.REMOVED.value());
|
|
|
+ GoodsHistory goodsHistoryRemoved = goodsHistoryService.converTGoodsHist(goods, OperateType.Down.getPhrase());
|
|
|
+ histories.add(goodsHistoryRemoved);
|
|
|
+ }
|
|
|
//删除库存信息
|
|
|
goods.setStatus(Status.GOODS_DELETE.value());
|
|
|
GoodsHistory goodsHistoryDelete = goodsHistoryService.converTGoodsHist(goods, OperateType.DELETE.getPhrase());
|
|
|
- histories.add(goodsHistoryRemoved);
|
|
|
histories.add(goodsHistoryDelete);
|
|
|
goodses1.add(goods);
|
|
|
gids.add(goods.getId());
|