xiaoyong931011
2022-09-23 8d1be6f3ab9489cc5cca15b01a0d8e47b1cce862
src/main/java/cc/mrbird/febs/mall/quartz/OrderOvertimeJob.java
@@ -60,17 +60,17 @@
                            throw new FebsException("购买商品或sku不存在");
                        }
                        if (sku.getStock() < mallOrderItem.getCnt()) {
                            throw new FebsException(sku.getSkuName() + "库存不足");
                        }
//                        if (sku.getStock() < mallOrderItem.getCnt()) {
//                            throw new FebsException(sku.getSkuName() + "库存不足");
//                        }
                        MallGoods mallGoods = mallGoodsMapper.selectById(sku.getGoodsId());
                        Integer goodsResult = mallGoodsMapper.upDateStockAndVolumeByGoodsId(mallGoods.getId(), mallOrderItem.getCnt());
                        Integer goodsResult = mallGoodsMapper.updateStockAndVolumeByGoodsId(mallGoods.getId(), mallOrderItem.getCnt());
                        if(1 != goodsResult){
                            throw new FebsException(mallGoods.getGoodsName() + "库存不足");
                        }
                        Integer skuResult = mallGoodsSkuMapper.upDateStockAndVolumeBySkuId(sku.getId(),mallOrderItem.getCnt());
                        Integer skuResult = mallGoodsSkuMapper.updateStockAndVolumeBySkuId(sku.getId(),mallOrderItem.getCnt());
                        if(1 != skuResult){
                            throw new FebsException(sku.getSkuName() + "库存不足");
                        }