Explorar el Código

fix bug

release_toaliyun_real
winter hace 4 años
padre
commit
b1b868f25b
Se han modificado 1 ficheros con 8 adiciones y 8 borrados
  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 Ver fichero

@@ -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


Cargando…
Cancelar
Guardar