|
|
|
@@ -0,0 +1,55 @@ |
|
|
|
package com.simple.schedule; |
|
|
|
|
|
|
|
import com.simple.common.IdWorker; |
|
|
|
import com.simple.domain.po.WxCouponOrder; |
|
|
|
import com.simple.domain.po.WxDateAmountRecord; |
|
|
|
import com.simple.domain.po.WxMall; |
|
|
|
import com.simple.domain.po.WxMerchant; |
|
|
|
import com.simple.enums.EnumDateAmtType; |
|
|
|
import com.simple.mapper.*; |
|
|
|
import com.simple.service.WxDateAmountRecordService; |
|
|
|
import org.apache.log4j.Logger; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.scheduling.annotation.Scheduled; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
import org.springframework.transaction.annotation.Propagation; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.text.ParseException; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
@Component |
|
|
|
public class CouponExpiringSchedule { |
|
|
|
|
|
|
|
private final Logger logger = Logger.getLogger(CouponExpiringSchedule.class); |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
private WxMallMapper wxMallMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private WxCouponChannelMapper wxCouponChannelMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private WxCouponMapper wxCouponMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 30 0 * * ?") // 每天凌晨 |
|
|
|
//@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 |
|
|
|
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) |
|
|
|
public void couponExpiringSchedule() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Scheduled(cron = "0 5 0 * * ?") // 每天凌晨 |
|
|
|
//@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 |
|
|
|
public void couponChannelExpiringSchedule() { |
|
|
|
|
|
|
|
wxCouponChannelMapper.offExpiriedCouponChannelByEndTime(); |
|
|
|
wxCouponChannelMapper.offExpiriedCouponChannelByValidDate(); |
|
|
|
} |
|
|
|
} |