ZhjTask.java
1.62 KB
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
package com.pashanhoo.common;
import com.pashanhoo.zhj.service.ZhjDatasSynService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
@Configuration
@EnableScheduling
public class ZhjTask {
@Autowired
private ZhjDatasSynService zhjDatasSynService;
@Scheduled(cron="0 0 21 * * ? ")
public void execute() {
System.out.println("===========每天晚上九点定时任务进来了=========");
zhjDatasSynService.send_bdcYwInfo();
System.out.println("===========每天晚上九点定时任务走了=========");
}
@Scheduled(cron="0 0 20 15 * ? ")
public void executeQyInfo() {
System.out.println("===========每天晚上九点定时任务进来了=========");
zhjDatasSynService.synQyInfo();
System.out.println("===========每天晚上九点定时任务走了=========");
}
@Scheduled(cron="0 0 18 * * ? ")
public void executeYcfInfo() {
System.out.println("===========每天晚上九点定时任务进来了=========");
zhjDatasSynService.synYcfInfo();
System.out.println("===========每天晚上九点定时任务走了=========");
}
@Scheduled(cron="0 0 22 * * ? ")
public void executeCfInfo() {
System.out.println("===========每天晚上九点定时任务进来了=========");
zhjDatasSynService.synCfInfo();
System.out.println("===========每天晚上九点定时任务走了=========");
}
}