luodangjia
2024-12-12 d7b3c61e01aadf99ce6a1d8ebf18c4e6dd81cc2b
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
package com.ruoyi.other.task;
 
 
import com.ruoyi.other.service.VipSettingService;
 
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 javax.annotation.Resource;
import java.util.Date;
import java.util.List;
 
 
/**
 * 定时任务工具类
 */
@Component
public class TaskUtil {
 
        @Resource
        private VipSettingService vipSettingService;
 
 
    /**
     * 每天的凌晨执行的任务
     */
    @Scheduled(cron = "0 0 0 * * *")
    public void taskDay(){
        try {
 
 
            vipSettingService.downUsers();
        }catch (Exception e){
            e.printStackTrace();
        }
    }
 
 
 
}