Przeglądaj źródła

[卡券][修复]:定向发券自动下架

release_toaliyun_real
hupeng 7 lat temu
rodzic
commit
2796636b70
3 zmienionych plików z 25 dodań i 7 usunięć
  1. +12
    -2
      mallinkAdmin/src/main/java/com/iformall/schedule/CouponExpiringSchedule.java
  2. +2
    -4
      mallinkService/src/main/java/com/iformall/mapper/WxCouponSendMapper.java
  3. +11
    -1
      mallinkService/src/main/resources/mapper/WxCouponSendMapper.xml

+ 12
- 2
mallinkAdmin/src/main/java/com/iformall/schedule/CouponExpiringSchedule.java Wyświetl plik

@@ -20,9 +20,11 @@ public class CouponExpiringSchedule {
@Autowired @Autowired
private WxCouponChannelMapper wxCouponChannelMapper; private WxCouponChannelMapper wxCouponChannelMapper;


@Autowired
private WxCouponSendMapper wxCouponSendMapper;




@Scheduled(cron = "0 5 0 * * ?") // 每天凌晨00:05
@Scheduled(cron = "0 10 0 * * ?") // 每天凌晨00:05 作废过期券,商户禁用券
//@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次
public void couponExpiringSchedule() { public void couponExpiringSchedule() {


@@ -30,7 +32,15 @@ public class CouponExpiringSchedule {
wxCouponMapper.offExpiriedCouponByMerchantStatus(); wxCouponMapper.offExpiriedCouponByMerchantStatus();
} }


@Scheduled(cron = "0 3 0 * * ?") // 每天凌晨00:03
@Scheduled(cron = "0 5 0 * * ?") // 每天凌晨00:10 下架定向发放
//@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次
public void couponSendExpiringSchedule() {
wxCouponSendMapper.offExpiriedCouponSendBySendEndTime();
wxCouponSendMapper.offExpiriedCouponSendByCouponStatus();
}


@Scheduled(cron = "0 5 0 * * ?") // 每天凌晨00:10 下架主动领取
//@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次
public void couponChannelExpiringSchedule() { public void couponChannelExpiringSchedule() {




+ 2
- 4
mallinkService/src/main/java/com/iformall/mapper/WxCouponSendMapper.java Wyświetl plik

@@ -9,10 +9,8 @@ public interface WxCouponSendMapper extends CommonMapper<WxCouponSend, String> {
List<WxCouponSend> findList(WxCouponSend wxCouponSend); List<WxCouponSend> findList(WxCouponSend wxCouponSend);


void updateStatusByCouponId(WxCouponSend wxCouponSend); void updateStatusByCouponId(WxCouponSend wxCouponSend);


void offExpiriedCouponSendBySendEndTime();
void offExpiriedCouponSendByCouponStatus();
} }

+ 11
- 1
mallinkService/src/main/resources/mapper/WxCouponSendMapper.xml Wyświetl plik

@@ -101,8 +101,18 @@
</update> </update>




<update id="offExpiriedCouponSendByCouponStatus">
update wx_coupon_send cs, wx_coupon c
set cs.status=1, cs.update_date = now()
where (cs.status = 0 and c.status = 1 and c.id = cs.coupon_id)
or (cs.status = 0 and c.valid_type = 1 and c.valid_end_date &lt; now())
</update>



<update id="offExpiriedCouponSendBySendEndTime">
update wx_coupon_send
set status=1, update_date = now()
where status = 0 and send_end_time &lt; now()
</update>




</mapper> </mapper>

Ładowanie…
Anuluj
Zapisz