hjg
2024-01-20 4a3404efc438b16044fd9170814e6545a3f86fae
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
package com.mandi.quartz;
 
import javax.annotation.PostConstruct;
 
import org.quartz.CronScheduleBuilder;
import org.quartz.Trigger;
import org.quartz.TriggerBuilder;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
 
import com.mandi.fendan.util.SendcmErrsheetJob;
 
@Service
@Scope("singleton")
public class JOBInitializer {
    @PostConstruct
    public void init(){
        checkcmErr();
    }
 
    //检查出门发送nc错误的:5分钟执行1次
    public void checkcmErr(){
 
        String timer="0 */5 * * * ?";
        //todo 先注销了,防止影响调试
        /*try{
            TriggerBuilder<Trigger> tb=TriggerBuilder.newTrigger();
            tb.withIdentity("sendcmErrsheettg", "sendcmErrsheetgp").withSchedule(CronScheduleBuilder.cronSchedule(timer));
            Trigger tr=tb.build();
            Quartzjob.runJob("sendcmErrsheettask",SendcmErrsheetJob.class, tr);
        }catch(Exception e){
            e.printStackTrace();
        }*/
 
 
    }
}