AlarmJobTestController.java
5.5 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
package com.skua.modules.controller;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.skua.core.api.vo.Result;
import com.skua.modules.quartz.DeviceStatusJob;
import com.skua.modules.quartz.EquipAlarmJob;
import com.skua.modules.quartz.EquipmentMaintainReminderJob;
import com.skua.modules.quartz.EquipmentRepairAlarmJob;
import com.skua.modules.quartz.RealTimeAlarmJob;
import com.skua.modules.quartz.RelevanceAlarmJob;
import com.skua.modules.quartz.SuddenIncreaseAlarmJob;
import com.skua.modules.quartz.XtDataSameJob;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
/**
* @Description 报警分析控制层
* @Date 2020-12-16 17:08
* @Param
* @return
**/
@Slf4j
@RestController
@RequestMapping("/alarm/testJob")
@Api(tags = "报警定时测试服务")
public class AlarmJobTestController {
@Autowired
private RealTimeAlarmJob realTimeAlarmJob;
@Autowired
private DeviceStatusJob deviceStatusJob;
@Autowired
private EquipAlarmJob xtEquipAlarmJob;
@Autowired
private RelevanceAlarmJob relevanceAlarmJob;
@Autowired
private EquipmentRepairAlarmJob equipmentRepairAlarmJob;
@Autowired
private EquipmentMaintainReminderJob equipmentMaintainReminderJob;
@Autowired
private SuddenIncreaseAlarmJob suddenIncreaseAlarmJob;
@Autowired
private XtDataSameJob dataSameJob;
@ApiOperation(value = "测试实时数据报警定时服务", notes = "测试实时数据报警定时服务")
@GetMapping(value = "/testRealTimeAlarmJob")
public Result<String> testRealTimeAlarmJob() {
Result<String> result = new Result<>();
try {
realTimeAlarmJob.execute(null);
} catch (JobExecutionException e) {
e.printStackTrace();
}
result.setResult("成功");
result.setSuccess(true);
return result;
}
@ApiOperation(value = "测试关联报警定时服务", notes = "测试关联报警定时服务")
@GetMapping(value = "/testRelevanceAlarmJob")
public Result<String> testRelevanceAlarmJob() {
Result<String> result = new Result<>();
try {
relevanceAlarmJob.execute(null);
} catch (JobExecutionException e) {
e.printStackTrace();
}
result.setResult("成功");
result.setSuccess(true);
return result;
}
@ApiOperation(value = "测试设备频繁维修定时服务", notes = "测试设备频繁维修报警定时服务")
@GetMapping(value = "/testEquipmentRepairAlarmJob")
public Result<String> testEquipmentRepairAlarmJob() {
Result<String> result = new Result<>();
try {
equipmentRepairAlarmJob.execute("20220523133125362420190458314219");
} catch (Exception e) {
e.printStackTrace();
}
result.setResult("成功");
result.setSuccess(true);
return result;
}
@ApiOperation(value = "测试设备到期提醒定时服务", notes = "测试设备到期提醒定时服务")
@GetMapping(value = "/testEquipmentMaintainReminderJob")
public Result<String> testEquipmentMaintainReminderJob() {
Result<String> result = new Result<>();
try {
equipmentMaintainReminderJob.execute(null);
} catch (Exception e) {
e.printStackTrace();
}
result.setResult("成功");
result.setSuccess(true);
return result;
}
@ApiOperation(value = "测试指标突增报警定时服务", notes = "测试指标突增报警定时服务")
@GetMapping(value = "/testSuddenIncreaseAlarmJob")
public Result<String> testSuddenIncreaseAlarmJob() {
Result<String> result = new Result<>();
try {
suddenIncreaseAlarmJob.execute(null);
} catch (Exception e) {
e.printStackTrace();
}
result.setResult("成功");
result.setSuccess(true);
return result;
}
@ApiOperation(value = "测试设备故障报警定时服务", notes = "测试设备故障报警定时服务")
@GetMapping(value = "/testEquipAlarmJob")
public Result<String> testEquipAlarmJob() {
Result<String> result = new Result<>();
try {
xtEquipAlarmJob.execute(null);
} catch (JobExecutionException e) {
e.printStackTrace();
}
result.setResult("成功");
result.setSuccess(true);
return result;
}
@ApiOperation(value = "数据长期不变报警定时服务", notes = "数据长期不变报警定时服务")
@GetMapping(value = "/testDataSameJob")
public Result<String> testDataSameJob() {
Result<String> result = new Result<>();
try {
dataSameJob.execute(null);
} catch (JobExecutionException e) {
e.printStackTrace();
}
result.setResult("成功");
result.setSuccess(true);
return result;
}
@ApiOperation(value = "测试设备在、离线报警定时服务", notes = "测试设备在、离线报警定时服务")
@GetMapping(value = "/testDeviceStatusJob")
public Result<String> testDeviceStatusJob() {
Result<String> result = new Result<>();
try {
dataSameJob.execute(null);
} catch (JobExecutionException e) {
e.printStackTrace();
}
result.setResult("成功");
result.setSuccess(true);
return result;
}
}