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

[卡券][修改]:自动作废已经没有商户的卡券

release_toaliyun_real
hupeng 7 лет назад
Родитель
Сommit
fcbc16f4f9
3 измененных файлов: 9 добавлений и 1 удалений
  1. +3
    -1
      mallinkAdmin/src/main/java/com/iformall/schedule/CouponExpiringSchedule.java
  2. +1
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java
  3. +5
    -0
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml

+ 3
- 1
mallinkAdmin/src/main/java/com/iformall/schedule/CouponExpiringSchedule.java Просмотреть файл

@@ -25,10 +25,12 @@ public class CouponExpiringSchedule {
@Scheduled(cron = "0 5 0 * * ?") // 每天凌晨00:05
//@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次
public void couponExpiringSchedule() {

wxCouponMapper.offExpiriedCouponByValidDate();
wxCouponMapper.offExpiriedCouponByMerchantStatus();
}

@Scheduled(cron = "0 5 0 * * ?") // 每天凌晨00:05
@Scheduled(cron = "0 3 0 * * ?") // 每天凌晨00:03
//@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次
public void couponChannelExpiringSchedule() {



+ 1
- 0
mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java Просмотреть файл

@@ -16,4 +16,5 @@ public interface WxCouponMapper extends CommonMapper<WxCoupon, Long> {
void reduceInventory(@Param("id")Long id,@Param("number")Integer number);

void offExpiriedCouponByValidDate();
void offExpiriedCouponByMerchantStatus();
}

+ 5
- 0
mallinkService/src/main/resources/mapper/WxCouponMapper.xml Просмотреть файл

@@ -252,4 +252,9 @@
where status = 0 and valid_type = 1 and valid_end_date &lt; now()
</update>

<update id="offExpiriedCouponByMerchantStatus">
update wx_coupon c, wx_merchant m SET c.status = 1, c.update_date = now()
where c.status = 0 and m.status = 0 and m.id = c.merchant_id
</update>

</mapper>

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