Skip to content

Commit

Permalink
修复了添加或修改商品库存数量变为NULL的BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
a6678696 committed Mar 27, 2022
1 parent 3b59637 commit a41c080
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,11 @@ public String genGoodsCode() {
public Map<String, Object> save(Goods goods) throws Exception {
Map<String, Object> resultMap = new HashMap<>(16);
if (goods.getId() != null) {
goods.setInventoryQuantity(goodsService.findById(goods.getId()).getInventoryQuantity());
logService.save(new Log(Log.UPDATE_ACTION, "更新商品信息" + goods));
} else {
logService.save(new Log(Log.ADD_ACTION, "添加商品信息" + goods));
goods.setInventoryQuantity(0);
goods.setLastPurchasingPrice(goods.getPurchasingPrice());
}
goodsService.save(goods);
Expand Down

0 comments on commit a41c080

Please sign in to comment.