Explorar el Código

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

release_toaliyun_real
xmzhao71 hace 2 años
padre
commit
a95fc9dc9f
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  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 Ver fichero

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


Cargando…
Cancelar
Guardar