Просмотр исходного кода

//..coupon_

release_toaliyun_real
xhxu 2 лет назад
Родитель
Сommit
d633af5581
3 измененных файлов: 27 добавлений и 21 удалений
  1. +3
    -3
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java
  2. +18
    -15
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java
  3. +6
    -3
      mallinkService/src/main/resources/mapper/WxCUserCarMapper.xml

+ 3
- 3
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());


+ 18
- 15
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);


+ 6
- 3
mallinkService/src/main/resources/mapper/WxCUserCarMapper.xml Просмотреть файл

@@ -46,9 +46,12 @@
<!-- <if test=" null != carNumber ">
and `car_number` like concat('%', #{carNumber},'%')
</if> -->
<if test=" null != createDate ">
and wcuc.`create_date` = #{createDate}

<if test=" null != startDate ">
and wcuc.`create_date` &gt;= #{startDate}
</if>
<if test=" null != endDate">
and wcuc.`create_date` &lt;= #{endDate}
</if>
<if test=" null != vendorType ">


Загрузка…
Отмена
Сохранить