liujie
2023-07-24 8e9440ea0a09fc6d9cea1c205904c51ccbf62a2a
driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/util/TaskUtil.java
@@ -1,7 +1,9 @@
package com.supersavedriving.driver.modular.system.util;
import com.supersavedriving.driver.modular.system.service.IAccountChangeDetailService;
import com.supersavedriving.driver.modular.system.service.IDriverService;
import com.supersavedriving.driver.modular.system.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@@ -16,6 +18,12 @@
    @Autowired
    private IDriverService driverService;
    @Autowired
    private IAccountChangeDetailService accountChangeDetailService;
    @Autowired
    private IOrderService orderService;
@@ -25,23 +33,24 @@
    @Scheduled(fixedRate = 1000 * 60)
    public void taskMinute(){
        try {
            orderService.completeCollection();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
//    /**
//     * 每天的凌晨执行的任务
//     */
//    @Scheduled(cron = "0 0 0 * * *")
//    public void taskDay(){
//        try {
//        }catch (Exception e){
//            e.printStackTrace();
//        }
//    }
    /**
     * 每天的凌晨执行的任务
     */
    @Scheduled(cron = "0 0 0 * * *")
    public void taskDay(){
        try {
            accountChangeDetailService.deductionInsurance();
        }catch (Exception e){
            e.printStackTrace();
        }
    }