|
|
|
@@ -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()); |
|
|
|
} |
|
|
|
}); |
|
|
|
|