PushJob.java
1.38 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package com.subsidy.jobs;
import com.subsidy.service.PushDataService;
import com.subsidy.service.impl.PushDataServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.io.IOException;
/**
* 核对数据定时任务
*/
@Component
public class PushJob {
@Value("${spring.profiles.active}")
private String env;
@Autowired
private PushDataService pushDataService;
/**
* POST-4:学时
*/
@Scheduled(cron = "0 0 4 * * ?")
public void post4() throws IOException {
if ("prod".equals(env)) {
pushDataService.post4();
}
}
/**
* POST-5: 考试
*/
@Scheduled(cron = "0 10 4 * * ?")
public void post5() throws IOException {
if ("prod".equals(env)) {
pushDataService.post5();
}
}
/**
* POST-6: 答疑
*/
@Scheduled(cron = "0 20 4 * * ?")
public void post6() throws IOException {
if ("prod".equals(env)) {
pushDataService.post6();
}
}
/**
* POST-7:人脸
*/
@Scheduled(cron = "0 30 4 * * ?")
public void post7() throws IOException {
if ("prod".equals(env)) {
pushDataService.post7();
}
}
}