Browse Source

//售卖期

release_toaliyun_real
xhxu 3 years ago
parent
commit
5cef56f9b4
1 changed files with 10 additions and 14 deletions
  1. +10
    -14
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java

+ 10
- 14
mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java View File

@@ -1303,14 +1303,9 @@ public class WxCouponServiceImpl implements WxCouponService {
logger.error("总库存数要大于等于可用库存数");
return new ResultData(ErrorCode.COUPON_STOCK_ERR.getCode(), "总库存数要大于等于可用库存数");
}
if(wxCoupon.getInventory() < wxCoupon.getRemainInventory()) {
// 总库存数要大于等于可用库存数
logger.error("总库存数要大于等于可用库存数");
return new ResultData(ErrorCode.COUPON_STOCK_ERR.getCode(), "总库存数要大于等于可用库存数");
}
if(wxCoupon.getInventory() <= oldCoupon.getInventory() - oldCoupon.getRemainInventory()) {
// 库存可增, 可减, 但是要保证,总库存数要大于已售卖数
logger.error("总库存数要大于等于可用库存数");
logger.error("总库存数要大于已售卖数");
return new ResultData(ErrorCode.COUPON_STOCK_ERR.getCode(), "总库存数要大于已售卖数");
}

@@ -1371,14 +1366,15 @@ public class WxCouponServiceImpl implements WxCouponService {
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "数据库更新数量错误");
}

// 5. 更新coupon channel 有效期
if(wxCoupon.getValidType().equals(EnumCouponValidType.BETWEEN_TWO_TIME.getCode())) {
WxCouponChannel couponChannel = new WxCouponChannel();
couponChannel.updateTenantInfo(wxCoupon);
couponChannel.setCouponId(wxCoupon.getId());
couponChannel.setEndTime(wxCoupon.getValidEndDate());
wxCouponChannelMapper.updateEndTimeByCouponId(couponChannel);
}
// 5. 更新coupon channel 有效期 todo 延期只延有效期, 不管售卖期
// if(oldCoupon.getSoldStartTime() == null && oldCoupon.getSoldEndTime() == null
// && wxCoupon.getValidType().equals(EnumCouponValidType.BETWEEN_TWO_TIME.getCode())) {
// WxCouponChannel couponChannel = new WxCouponChannel();
// couponChannel.updateTenantInfo(wxCoupon);
// couponChannel.setCouponId(wxCoupon.getId());
// couponChannel.setEndTime(wxCoupon.getValidEndDate());
// wxCouponChannelMapper.updateEndTimeByCouponId(couponChannel);
// }

// 免审修改
try{


Loading…
Cancel
Save