Просмотр исходного кода

feat:修改砍价订单库存不足时处理逻辑

release_toaliyun_real
xmzhao71 2 лет назад
Родитель
Сommit
a95fc9dc9f
1 измененных файлов: 3 добавлений и 2 удалений
  1. +3
    -2
      mallinkService/src/main/java/com/iformall/service/helper/WxOrderServiceHelper.java

+ 3
- 2
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());
}
});


Загрузка…
Отмена
Сохранить