Pu Zhibing
1 天以前 fac94f9e4c24f436662170d8194d238bfa4ad363
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.ruoyi.integration.util;
//
//import com.ruoyi.integration.mongodb.service.*;
//import org.springframework.boot.web.context.WebServerInitializedEvent;
//import org.springframework.context.ApplicationListener;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Component;
//
//import javax.annotation.Resource;
//
///**
// * 定时任务工具类
// * @author zhibing.pu
// * @Date 2025/5/21 11:43
// */
//@Component
//public class TaskUtil implements ApplicationListener<WebServerInitializedEvent> {
//
//    @Resource
//    private AcquisitionBillingModeReplyService acquisitionBillingModeReplyService;
//
//    @Resource
//    private AcquisitionBillingModeService acquisitionBillingModeService;
//
//    @Resource
//    private BillingModeVerifyReplyService billingModeVerifyReplyService;
//
//    @Resource
//    private BillingModeVerifyService billingModeVerifyService;
//
//    @Resource
//    private BmsAbortService bmsAbortService;
//
//    @Resource
//    private BmsDemandAndChargerExportationService bmsDemandAndChargerExportationService;
//
//    @Resource
//    private BmsInformationService bmsInformationService;
//
//    @Resource
//    private ChargingHandshakeService chargingHandshakeService;
//
//    private Integer port = null;
//
//    @Override
//    public void onApplicationEvent(WebServerInitializedEvent event) {
//        port = event.getWebServer().getPort();
//    }
//
//
//    /**
//     * 定时任务
//     */
//    @Scheduled(cron = "0 0 9 * * ?")
//    public void run(){
//        if(null != port && port == 5701){
//            acquisitionBillingModeReplyService.taskDelete();
//            acquisitionBillingModeService.taskDelete();
//            billingModeVerifyReplyService.taskDelete();
//            billingModeVerifyService.taskDelete();
//            bmsAbortService.taskDelete();
//            bmsDemandAndChargerExportationService.taskDelete();
//            bmsInformationService.taskDelete();
//            chargingHandshakeService.taskDelete();
//        }
//    }
//}