|
|
|
@@ -0,0 +1,53 @@ |
|
|
|
package com.simple.schedule; |
|
|
|
|
|
|
|
import com.simple.common.ErrorCode; |
|
|
|
import com.simple.common.ResultData; |
|
|
|
import com.simple.config.PayProperty; |
|
|
|
import com.simple.domain.po.WxAppinfo; |
|
|
|
import com.simple.domain.po.WxCouponOrder; |
|
|
|
import com.simple.domain.po.WxMerchantBUser; |
|
|
|
import com.simple.domain.vo.WxCouponOrderCVo; |
|
|
|
import com.simple.enums.EnumPayWay; |
|
|
|
import com.simple.exception.MallinkException; |
|
|
|
import com.simple.mapper.WxCouponChannelMapper; |
|
|
|
import com.simple.mapper.WxCouponMapper; |
|
|
|
import com.simple.mapper.WxCouponOrderMapper; |
|
|
|
import com.simple.mapper.WxMallMapper; |
|
|
|
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.util.List; |
|
|
|
|
|
|
|
@Component |
|
|
|
public class CouponOrderExpiringSchedule { |
|
|
|
|
|
|
|
private final Logger logger = Logger.getLogger(CouponOrderExpiringSchedule.class); |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
private WxCouponOrderMapper wxCouponOrderMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private PayProperty payProperty; |
|
|
|
|
|
|
|
@Scheduled(cron = "0 5 0 * * ?") // 每天凌晨00:05 |
|
|
|
//@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 |
|
|
|
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) |
|
|
|
public void couponOrderExpiringSchedule() { |
|
|
|
wxCouponOrderMapper.offExpiredCouponOrderByValidDate(); |
|
|
|
} |
|
|
|
|
|
|
|
@Scheduled(cron = "0 5 0 * * ?") // 每天凌晨00:05 |
|
|
|
//@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 |
|
|
|
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) |
|
|
|
public void couponOrderRefundSchedule() { |
|
|
|
|
|
|
|
List<WxCouponOrder> list = wxCouponOrderMapper.findExpiredCouponOrderByValidDate(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |