瀏覽代碼

fix bug

release_toaliyun_real
winter 4 年之前
父節點
當前提交
b1b868f25b
共有 1 個文件被更改,包括 8 次插入8 次删除
  1. +8
    -8
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java

+ 8
- 8
mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java 查看文件

@@ -711,19 +711,19 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService {
//释放渠道库存 //释放渠道库存
WxCouponChannel couponChannel = wxCouponChannelMapper.selectById(record.getId(), record.getTenantId()); WxCouponChannel couponChannel = wxCouponChannelMapper.selectById(record.getId(), record.getTenantId());
if(null == couponChannel.getChannelStock()){ if(null == couponChannel.getChannelStock()){
throw new MallinkException(ErrorCode.REMAIN_BACK_FAIL.getCode(),"暂无可释放库存");
throw new MallinkException(ErrorCode.REMAIN_BACK_FAIL.getCode(),"库存已经释放,无需再次操作.");
} }

int num = wxCouponChannelMapper.clearChannelStock(record.getId(), record.getTenantId()); int num = wxCouponChannelMapper.clearChannelStock(record.getId(), record.getTenantId());
if (num == 0) { if (num == 0) {
throw new MallinkException(ErrorCode.REMAIN_BACK_FAIL); throw new MallinkException(ErrorCode.REMAIN_BACK_FAIL);
} }
//减掉券库存
int num1 = wxCouponMapper.backInventory(record.getCouponId(), record.getTenantId(), couponChannel.getChannelStock());
if (num1 == 0) {
throw new MallinkException(ErrorCode.REMAIN_BACK_FAIL);
}
if (couponChannel.getChannelStock() > 0 ) {
//减掉券库存
int num1 = wxCouponMapper.backInventory(record.getCouponId(), record.getTenantId(), couponChannel.getChannelStock());
if (num1 == 0) {
throw new MallinkException(ErrorCode.REMAIN_BACK_FAIL);
}
}
} }


@Override @Override


Loading…
取消
儲存