src/main/java/com/mzl/flower/schedule/ScheduleService.java
@@ -9,6 +9,7 @@
import com.mzl.flower.mapper.flower.FlowerCategoryMapper;
import com.mzl.flower.mapper.partner.PartnerMapper;
import com.mzl.flower.mapper.payment.OrderMapper;
import com.mzl.flower.service.coupon.CouponRecordService;
import com.mzl.flower.service.flower.FlowerCategoryService;
import com.mzl.flower.service.flower.FlowerService;
import com.mzl.flower.service.payment.*;
@@ -56,6 +57,9 @@
    @Autowired
    private OrderItemSettlementService orderItemSettlementService;
    @Autowired
    private CouponRecordService couponRecordService;
    @Scheduled(cron = "1 0/20 * * * ?")
    public void calculateAvePrice() {
@@ -133,7 +137,12 @@
    @Scheduled(cron = "1 20 0/1 * * ?")
    public void autoReceive() {
        log.info("自动收货开始:" + DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
        orderService.autoReceive();
        List<Order> ls = orderService.autoReceive();
        if(ls != null && ls.size() > 0){
            for(Order o : ls){
                orderService.processAfterReceive(o);
            }
        }
        log.info("自动收货结束:" + DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
    }
@@ -164,6 +173,7 @@
            for(Transfer t : ls){
                try {
                    paymentV3Service.checkTransferStatus(t);
                    settlementService.updateSettlementStatus(t.getId());
                } catch (Exception e) {
                    log.error(e.getMessage(), e);
                }
@@ -179,4 +189,19 @@
        billService.generateBill(date.plusDays(-1));
        log.info("账单结束:" + DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
    }
    @Scheduled(cron = "0 30 0 1 * ?")
    public void grantVipCouponRecordList() {
        log.info("会员优惠券开始:" + DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
        couponRecordService.grantVipCouponRecordList();
        log.info("会员优惠券结束:" + DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
    }
    @Scheduled(cron = "0 30 0 1 * ?")
    public void expiredVipCouponRecordList() {
        log.info("会员优惠券过期开始:" + DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
        couponRecordService.expiredCouponRecordByListCurMonth();
        log.info("会员优惠券过期结束:" + DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
    }
}