| | |
| | | } |
| | | |
| | | MallGoods mallGoods = mallGoodsMapper.selectById(sku.getGoodsId()); |
| | | |
| | | // 零撸专区购买 |
| | | if (new BigDecimal(mallGoods.getPresentPrice()).compareTo(BigDecimal.ZERO) == 0) { |
| | | List<MallOrderItem> items = mallOrderItemMapper.selectItemByGoodsIdUnCancel(mallGoods.getId(), member.getId()); |
| | |
| | | throw new FebsException(mallGoods.getGoodsName() + "已下架"); |
| | | } |
| | | |
| | | mallGoods.setStock(mallGoods.getStock() - item.getCnt()); |
| | | mallGoods.setVolume(mallGoods.getVolume() + item.getCnt()); |
| | | mallGoodsMapper.updateById(mallGoods); |
| | | |
| | | BigDecimal amount = sku.getPresentPrice().multiply(BigDecimal.valueOf(item.getCnt())); |
| | | orderItem.setAmount(amount); |
| | | orderItem.setCnt(item.getCnt()); |