2021与蓝度共同重构项目,服务端
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
package com.sandu.ximon.admin.schedule;
 
import com.sandu.ximon.admin.service.C3mOrderService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
 
/**
 * @author LiuHaoNan
 * @date 2022/6/29
 */
@Component
@Slf4j
@AllArgsConstructor
@EnableScheduling
public class C3mOrderSchedule {
 
    private final C3mOrderService c3mOrderService;
 
    //每10分钟运行一次   删除超时订单
//    @Scheduled(cron = "0 0/10 * * * ? ")
    public void deleteOvertimeOrders() {
        c3mOrderService.deleteOrderListByCreateTime();
        log.error("删除超时订单定时任务执行成功");
    }
}