diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java index b2d3df092..7458d1667 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java @@ -242,9 +242,9 @@ public class WxCouponController extends BaseController { result = wxCouponService.disable(wxCoupon, wxCoupon.getId(),getUser()); }else{ result = wxCouponService.saveOrUpdate(wxCoupon, null); - if(wxCoupon.getRemainInventory() != null){ - redisLock.setCouponStock(wxCoupon.getId(), wxCoupon.getRemainInventory()); - } +// if(wxCoupon.getRemainInventory() != null){ +// redisLock.setCouponStock(wxCoupon.getId(), wxCoupon.getRemainInventory()); +// } } CouponCacheUtils.removeCouponCache(redisTemplate, wxCoupon.getId()); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java index f99f78bd4..d9dbb147a 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java @@ -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); diff --git a/mallinkService/src/main/resources/mapper/WxCUserCarMapper.xml b/mallinkService/src/main/resources/mapper/WxCUserCarMapper.xml index d953f2576..2f3d85cb6 100644 --- a/mallinkService/src/main/resources/mapper/WxCUserCarMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCUserCarMapper.xml @@ -46,9 +46,12 @@ - - - and wcuc.`create_date` = #{createDate} + + + and wcuc.`create_date` >= #{startDate} + + + and wcuc.`create_date` <= #{endDate}