puzhibing
2023-03-18 c0f0b2825ed3dbef86b381c2490277164446dc10
driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/util/TaskUtil.java
@@ -1,6 +1,8 @@
package com.supersavedriving.driver.modular.system.util;
import com.supersavedriving.driver.modular.system.service.IDriverService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@@ -10,6 +12,9 @@
 */
@Component
public class TaskUtil {
    @Autowired
    private IDriverService driverService;
@@ -39,16 +44,29 @@
//    }
//
//    /**
//     * 每月第一天的1点执行的任务
//     */
//    @Scheduled(cron = "0 0 1 1 * *")
//    public void taskMonth(){
//        try {
//
//        }catch (Exception e){
//            e.printStackTrace();
//        }
//    }
    /**
     * 每月1日凌晨执行的任务
     */
    @Scheduled(cron = "0 0 0 1 * *")
    public void taskMonth1(){
        try {
            driverService.emptyIntegral();
        }catch (Exception e){
            e.printStackTrace();
        }
    }
    /**
     * 每月16日凌晨执行的任务
     */
    @Scheduled(cron = "0 0 0 16 * *")
    public void taskMonth16(){
        try {
            driverService.emptyIntegral();
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}