From ece2f207cb4ae03e76c32941d2bca42721a15f06 Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Sat, 24 Sep 2022 12:41:28 +0800 Subject: [PATCH] 20220902 --- src/main/java/cc/mrbird/febs/mall/quartz/OrderOvertimeJob.java | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/cc/mrbird/febs/mall/quartz/OrderOvertimeJob.java b/src/main/java/cc/mrbird/febs/mall/quartz/OrderOvertimeJob.java index 2ff512f..5241080 100644 --- a/src/main/java/cc/mrbird/febs/mall/quartz/OrderOvertimeJob.java +++ b/src/main/java/cc/mrbird/febs/mall/quartz/OrderOvertimeJob.java @@ -12,6 +12,7 @@ import cn.hutool.core.date.DateUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; @@ -24,6 +25,7 @@ **/ @Slf4j @Component +@ConditionalOnProperty(prefix = "system", name = "job", havingValue = "true") public class OrderOvertimeJob { @Autowired @@ -60,9 +62,9 @@ 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()); -- Gitblit v1.9.1