|
|
|
@@ -693,22 +693,25 @@ public class WxCouponServiceImpl implements WxCouponService { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"该券状态不允许修改"); |
|
|
|
} |
|
|
|
} |
|
|
|
record.setRemainInventory(null); |
|
|
|
record.setInventory(null); |
|
|
|
|
|
|
|
// if(record.getInventory() != null && record.getRemainInventory() != null) { |
|
|
|
// // 库存修改检查 |
|
|
|
// WxCoupon oldCoupon = wxCouponMapper.selectById(record.getId(),record.getTenantId()); |
|
|
|
// if (Objects.equals(oldCoupon.getRemainInventory(), record.getRemainInventory())) { |
|
|
|
// // 库存未变, 不更新库存 |
|
|
|
// record.setRemainInventory(null); |
|
|
|
// record.setInventory(null); |
|
|
|
// } else { |
|
|
|
// // TODO bug记录 |
|
|
|
// logger.info("设置库存:record.getRemainInventory {},oldCoupon.getRemainInventory {},oldCoupon.getInventory {}", |
|
|
|
// record.getRemainInventory(), oldCoupon.getRemainInventory(), oldCoupon.getInventory()); |
|
|
|
// // 库存增加,要同时增加, 库存减少,要同时减少 |
|
|
|
// record.setInventory(oldCoupon.getInventory() + record.getRemainInventory() - oldCoupon.getRemainInventory()); |
|
|
|
// } |
|
|
|
// } |
|
|
|
|
|
|
|
if(record.getInventory() != null && record.getRemainInventory() != null) { |
|
|
|
// 库存修改检查 |
|
|
|
WxCoupon oldCoupon = wxCouponMapper.selectById(record.getId(),record.getTenantId()); |
|
|
|
if (Objects.equals(oldCoupon.getRemainInventory(), record.getRemainInventory())) { |
|
|
|
// 库存未变, 不更新库存 |
|
|
|
record.setRemainInventory(null); |
|
|
|
record.setInventory(null); |
|
|
|
} else { |
|
|
|
// TODO bug记录 |
|
|
|
logger.info("设置库存:record.getRemainInventory {},oldCoupon.getRemainInventory {},oldCoupon.getInventory {}", |
|
|
|
record.getRemainInventory(), oldCoupon.getRemainInventory(), oldCoupon.getInventory()); |
|
|
|
// 库存增加,要同时增加, 库存减少,要同时减少 |
|
|
|
record.setInventory(oldCoupon.getInventory() + record.getRemainInventory() - oldCoupon.getRemainInventory()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (EnumCouponType.checkCreateWithMerchants(record.getType())) { |
|
|
|
try { |
|
|
|
updateCouponMerchants(record,idWorker); |
|
|
|
|