Pu Zhibing
4 天以前 890c290afef9faca8ddaf0fea6197c3daa472141
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
package com.ruoyi.shop.util;
 
import com.ruoyi.shop.service.shop.ShopAppointableTimeService;
import com.ruoyi.shop.service.shop.ShopNonAppointableTimeService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
 
import javax.annotation.Resource;
 
/**
 * @author zhibing.pu
 * @Date 2025/6/3 16:11
 */
@Component
public class TaskUtil {
    
    @Resource
    private ShopAppointableTimeService shopAppointableTimeService;
    
    @Resource
    private ShopNonAppointableTimeService shopNonAppointableTimeService;
    
    
    /**
     * 每天3点执行的定时任务
     */
    @Scheduled(cron="0 0 3 * * ?")
    public void timingTask(){
        shopNonAppointableTimeService.taskDelData();
    }
    
    
    /**
     * 每分钟执行的定时任务
     */
    @Scheduled(cron="0 0/1 * * * ?")
    public void timingTask1(){
        shopAppointableTimeService.taskUpdateStatus();
    }
}