From a95fc9dc9f5f2cd9a862afb31d80bba1833c9d1f Mon Sep 17 00:00:00 2001 From: xmzhao71 Date: Mon, 4 Sep 2023 14:22:59 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E4=BF=AE=E6=94=B9=E7=A0=8D?= =?UTF-8?q?=E4=BB=B7=E8=AE=A2=E5=8D=95=E5=BA=93=E5=AD=98=E4=B8=8D=E8=B6=B3?= =?UTF-8?q?=E6=97=B6=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/service/helper/WxOrderServiceHelper.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/helper/WxOrderServiceHelper.java b/mallinkService/src/main/java/com/iformall/service/helper/WxOrderServiceHelper.java index b3cc03ebc..e2b01ff2f 100644 --- a/mallinkService/src/main/java/com/iformall/service/helper/WxOrderServiceHelper.java +++ b/mallinkService/src/main/java/com/iformall/service/helper/WxOrderServiceHelper.java @@ -5,6 +5,7 @@ import com.iformall.domain.po.WxCoupon; import com.iformall.domain.po.base.TenantEntity; import com.iformall.enums.EnumCacheKey; import com.iformall.enums.EnumOrderStatus; +import com.iformall.enums.EnumYesOrNo; import com.iformall.exception.MallinkException; import com.iformall.service.WxCouponChannelService; import com.iformall.service.WxCouponService; @@ -67,9 +68,9 @@ public class WxOrderServiceHelper { } } - // 如果是砍价订单,当库存不足时自动取消进行中的订单 + // 砍价订单,支付时扣库存,库存不足 则修改砍价订单状态 CompletableFuture.runAsync(() -> { - if (isPressOrder && stock <= 0) { + if (isPressOrder && null != coupon.getPressPayReduceStock() && coupon.getPressPayReduceStock().intValue() == EnumYesOrNo.YES.getCode().intValue() && stock <= 0 ) { wxOrderService.updateStatusByPressCouponId(coupon.getTenantId(), coupon.getCouponId(), EnumOrderStatus.ORDER_STATUS_PRESS_CANCEL.getCode()); } });