AlarmAnalysisController.java
8.8 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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
package com.skua.modules.controller;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.skua.modules.alarmtmp.service.AlarmRecordHistoryService;
import com.skua.modules.alarmtmp.vo.AlarmRecordHistoryVO;
import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.core.util.DateUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* @Description 报警分析控制层
* @Date 2020-12-16 17:08
* @Param
* @return
**/
@Slf4j
@RestController
@RequestMapping("/alarm/analysis")
@Api(tags = "报警分析页面")
public class AlarmAnalysisController {
@Autowired
private AlarmRecordHistoryService alarmRecordHistoryService;
/**
* 重要报警排序列表 (type 1 出水水质 2重要设备)
*/
@AutoLog(value = "重要报警排序列表查询")
@ApiOperation(value = "重要报警排序列表查询", notes = "重要报警排序列表查询")
@GetMapping(value = "/getAlarmImportantList")
public Result<List<Map<String, Object>>> getAlarmImportantList(String time, String type) {
Result<List<Map<String, Object>>> result = new Result<>();
List<Map<String, Object>> data = Lists.newArrayList();
if (StringUtils.isBlank(time)) {
//time = DateUtils.getLastMonthOfMonth(DateUtils.getDate("yyyy-MM"));
time = DateUtils.getDate("yyyy-MM");
}
data = alarmRecordHistoryService.getAlarmImportantList(time, type);
result.setResult(data);
result.setSuccess(true);
return result;
}
@AutoLog(value = "数据断线列表查询")
@ApiOperation(value = "数据断线列表查询", notes = "数据断线列表查询")
@GetMapping(value = "/getOffLineList")
public Result<Map<String, Object>> getOffLineList(String time) {
Result<Map<String, Object>> result = new Result<>();
Map<String, Object> data = Maps.newHashMap();
if (StringUtils.isBlank(time)) {
time = DateUtils.getDate("yyyy-MM");
}
data = alarmRecordHistoryService.getOffLineList(time);
result.setResult(data);
result.setSuccess(true);
return result;
}
@AutoLog(value = "报警类型分析查询")
@ApiOperation(value = "报警类型分析查询", notes = "报警类型分析查询")
@GetMapping(value = "/getAlarmTypeAnalysis")
public Result<Map<String, Object>> getAlarmTypeAnalysis(String time) {
Result<Map<String, Object>> result = new Result<>();
if (StringUtils.isBlank(time)) {
time = DateUtils.getDate("yyyy-MM");
}
Map<String, Object> data = alarmRecordHistoryService.getAlarmTypeAnalysis(time);
result.setResult(data);
result.setSuccess(true);
return result;
}
@AutoLog(value = "水质报警列表查询")
@ApiOperation(value = "水质报警列表查询", notes = "水质报警列表查询")
@GetMapping(value = "/getWaterAlarmList")
public Result<List<Map<String, Object>>> getWaterAlarmList(String time) {
Result<List<Map<String, Object>>> result = new Result<>();
if (StringUtils.isBlank(time)) {
time = DateUtils.getDate("yyyy-MM");
}
List<Map<String, Object>> data = alarmRecordHistoryService.getWaterAlarmList(time);
result.setResult(data);
result.setSuccess(true);
return result;
}
@AutoLog(value = "过程仪表报警列表查询")
@ApiOperation(value = "过程仪表报警列表查询", notes = "过程仪表报警列表查询")
@GetMapping(value = "/getProcessAlarmList")
public Result<List<Map<String, Object>>> getProcessAlarmList(String time) {
Result<List<Map<String, Object>>> result = new Result<>();
if (StringUtils.isBlank(time)) {
time = DateUtils.getDate("yyyy-MM");
}
List<Map<String, Object>> data = alarmRecordHistoryService.getProcessAlarmList(time);
result.setResult(data);
result.setSuccess(true);
return result;
}
@AutoLog(value = "水量报警列表查询")
@ApiOperation(value = "水量报警列表查询", notes = "水量报警列表查询")
@GetMapping(value = "/getWaterCountAlarmList")
public Result<List<Map<String, Object>>> getWaterCountAlarmList(String time) {
Result<List<Map<String, Object>>> result = new Result<>();
if (StringUtils.isBlank(time)) {
time = DateUtils.getDate("yyyy-MM");
}
List<Map<String, Object>> data = alarmRecordHistoryService.getWaterCountAlarmList(time);
result.setResult(data);
result.setSuccess(true);
return result;
}
@AutoLog(value = "设备报警查询")
@ApiOperation(value = "设备报警查询", notes = "设备报警查询")
@GetMapping(value = "/getEquipAlarm")
public Result<Map<String, Object>> getEquipAlarm(String time) {
Result<Map<String, Object>> result = new Result<>();
if (StringUtils.isBlank(time)) {
time = DateUtils.getDate("yyyy-MM");
}
Map<String, Object> data = alarmRecordHistoryService.getEquipAlarm(time);
result.setResult(data);
result.setSuccess(true);
return result;
}
@AutoLog(value = "质量报警列表查询")
@ApiOperation(value = "质量报警列表查询", notes = "质量报警列表查询")
@GetMapping(value = "/getQualityAlarmList")
public Result<List<Map<String, Object>>> getQualityAlarmList(String time) {
Result<List<Map<String, Object>>> result = new Result<>();
if (StringUtils.isBlank(time)) {
time = DateUtils.getDate("yyyy-MM");
//time = DateUtils.getLastMonthOfMonth(DateUtils.getDate("yyyy-MM"));
}
List<Map<String, Object>> data = alarmRecordHistoryService.getQualityAlarmList(time);
result.setResult(data);
result.setSuccess(true);
return result;
}
@AutoLog(value = "APP报警列表查询")
@ApiOperation(value = "APP报警列表查询", notes = "APP报警列表查询")
@GetMapping(value = "/getAppWaterAlarmList")
public Result<Map<String, Object>> getAppWaterAlarmList(AlarmRecordHistoryVO alarmRecordHistoryVO) {
Result<Map<String, Object>> result = new Result<>();
Map<String, Object> data = alarmRecordHistoryService.getAppWaterAlarmList(alarmRecordHistoryVO);
result.setResult(data);
result.setSuccess(true);
return result;
}
@AutoLog(value = "APP报警详情查询")
@ApiOperation(value = "APP报警详情查询", notes = "APP报警详情查询")
@GetMapping(value = "/getAppWaterAlarmDetail")
public Result<Map<String, Object>> getAppWaterAlarmDetail(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
AlarmRecordHistoryVO alarmRecordHistoryVO) {
Result<Map<String, Object>> result = new Result<>();
Map<String, Object> data = alarmRecordHistoryService.getAppWaterAlarmDetail(alarmRecordHistoryVO,pageNo,pageSize);
result.setResult(data);
result.setSuccess(true);
return result;
}
@AutoLog(value = "APP报警等级次数查询")
@ApiOperation(value = "APP报警等级次数查询", notes = "APP报警等级次数查询")
@GetMapping(value = "/getAppWaterAlarmCount")
public Result<Map<String, Object>> getAppWaterAlarmCount(AlarmRecordHistoryVO alarmRecordHistoryVO) {
Result< Map<String, Object>> result = new Result<>();
Map<String, Object> data = alarmRecordHistoryService.getAppWaterAlarmCount(alarmRecordHistoryVO);
result.setResult(data);
result.setSuccess(true);
return result;
}
@AutoLog(value = "web趋势")
@ApiOperation(value = "web趋势", notes = "web趋势")
@GetMapping(value = "/getSZTreadWeb")
public Result<Map<String, Object>> getSZTreadWeb(String departId, String timeType, String startTime, String endTime,String id) {
Result<Map<String, Object>> result = new Result<>();
Map<String, Object> data = alarmRecordHistoryService.getSZTreadWeb(departId, timeType, startTime,endTime,id);
result.setResult(data);
result.setSuccess(true);
return result;
}
}