From 0ef2ea54b85d11f537a761e2028a40ec1ec1df1b Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Mon, 13 Feb 2023 15:55:31 +0800 Subject: [PATCH] 订单发货设置 --- 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