puzhibing
2023-02-11 521efb9bc33d52ef4772f0b30f8a371ba4b0070c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package com.stylefeng.guns.modular.system.util;
 
 
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.stylefeng.guns.modular.system.model.TDriver;
import com.stylefeng.guns.modular.system.service.ITDriverService;
import com.stylefeng.guns.modular.system.service.ITLocationService;
import com.stylefeng.guns.modular.system.service.IUserCouponRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
 
import java.util.List;
 
 
/**
 * 定时任务工具类
 */
@Component
public class TaskUtil {
 
    @Autowired
    private ITLocationService locationService;
 
    @Autowired
    private ITDriverService driverService;
 
 
 
    /**
     * 每隔一分钟去处理的定时任务
     */
    @Scheduled(fixedRate = 1000 * 60)
    public void taskMinute(){
        try {
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
 
 
    /**
     * 每天的凌晨执行的任务
     */
    @Scheduled(cron = "0 0 0 * * *")
    public void taskDay(){
        try {
            locationService.updateFence();//更新线上电子围栏
        }catch (Exception e){
            e.printStackTrace();
        }
    }
 
 
 
    /**
     * 每月第一天的1点执行的任务
     */
    @Scheduled(cron = "0 0 1 1 * *")
    public void taskMonth(){
        try {
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}