EquipmentSingleStatisticsController.java
8.2 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
package com.skua.modules.equipment.controller;
import com.skua.core.api.vo.Result;
import com.skua.modules.equipment.service.IEquipmentSingleStatisticsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
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 java.util.List;
import java.util.Map;
/**
* <pre>
* 单台设备统计分析
* </pre>
* @author Li Yuanyuan
* @version V0.1, 2024年1月24日 下午2:21:28
*/
@Slf4j
@Api(tags = "/设备管理/设备台账/单台设备统计分析")
@RestController
@RequestMapping("/equipment/statistics/single")
public class EquipmentSingleStatisticsController {
@Autowired
private IEquipmentSingleStatisticsService equipmentSingleStatisticsService;
/**
* <pre>
* 设备看板-设备故障分析
* </pre>
* @param equipmentId
* @param startTime
* @param endTime
* @return
* @author Li Yuanyuan, 2024年2月4日 下午2:40:30
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@ApiOperation(value = "设备看板-设备故障分析", notes = "设备看板-设备故障分析,timePeriod【month/quarter/year】")
@GetMapping(value = "/getEquipmentOverview")
public Result<Map<String,Object>> getAlarmOverview(String equipmentId,String timePeriod,String startTime,String endTime) {
Result<Map<String,Object>> result = new Result<>();
try {
Map<String,Object> map = equipmentSingleStatisticsService.getAlarmOverview(equipmentId,timePeriod,startTime,endTime);
result.setSuccess(true);
result.setResult(map);
} catch (Exception e) {
log.error("设备故障分析统计失败", e.getMessage());
result.error500("设备故障分析统计失败");
}
return result;
}
/**
* <pre>
* 设备看板-故障类型分布
* </pre>
* @param equipmentId
* @param timePeriod
* @param startTime
* @param endTime
* @return
* @author Li Yuanyuan, 2024年1月30日 上午9:30:49
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@ApiOperation(value = "设备看板-故障类型分布", notes = "设备看板-故障类型分布,故障信号产生次数从getEquipmentOverview接口中获取alarmFaultCount属性")
@GetMapping(value = "/getEquipmentFaultTypeDistribution")
public Result<List<Map<String,Object>>> getEquipmentFaultTypeDistribution(String equipmentId,String timePeriod,String startTime,String endTime) {
Result<List<Map<String,Object>>> result = new Result<>();
try {
List<Map<String,Object>> list = equipmentSingleStatisticsService.getEquipmentFaultTypeDistribution(equipmentId,timePeriod,startTime,endTime);
result.setSuccess(true);
result.setResult(list);
} catch (Exception e) {
log.error("故障类型分布统计失败", e.getMessage());
result.error500("故障类型分布统计失败");
}
return result;
}
/**
* <pre>
* 设备看板-故障程度分布
* </pre>
* @param equipmentId
* @param timePeriod
* @param startTime
* @param endTime
* @return
* @author Li Yuanyuan, 2024年1月30日 上午9:30:49
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@ApiOperation(value = "设备看板-故障程度分布", notes = "设备看板-故障程度分布")
@GetMapping(value = "/getEquipmentFaultLevelDistribution")
public Result<List<Map<String,Object>>> getEquipmentFaultLevelDistribution(String equipmentId,String timePeriod,String startTime,String endTime) {
Result<List<Map<String,Object>>> result = new Result<>();
try {
List<Map<String,Object>> list = equipmentSingleStatisticsService.getEquipmentFaultLevelDistribution(equipmentId,timePeriod,startTime,endTime);
result.setSuccess(true);
result.setResult(list);
} catch (Exception e) {
log.error("故障类型分布统计失败", e.getMessage());
result.error500("故障类型分布统计失败");
}
return result;
}
/**
* <pre>
* 设备看板-维修工单情况
* </pre>
* @param equipmentId
* @param timePeriod
* @param startTime
* @param endTime
* @return
* @author Li Yuanyuan, 2024年1月30日 上午9:30:49
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@ApiOperation(value = "设备看板-维修工单情况", notes = "设备看板-维修工单情况,timePeriod【month/quarter/year】")
@GetMapping(value = "/getEquipmentWorkOrderInfo")
public Result<List<Map<String,Object>>> getEquipmentWorkOrderInfo(String equipmentId,String timePeriod,String startTime,String endTime) {
Result<List<Map<String,Object>>> result = new Result<>();
try {
List<Map<String,Object>> list = equipmentSingleStatisticsService.getEquipmentWorkOrderInfo(equipmentId,timePeriod,startTime,endTime);
result.setSuccess(true);
result.setResult(list);
} catch (Exception e) {
log.error("故障类型分布统计失败", e.getMessage());
result.error500("故障类型分布统计失败");
}
return result;
}
/**
* <pre>
* 设备看板-设备报警类型
* </pre>
* @param equipmentId
* @param timePeriod
* @param startTime
* @param endTime
* @return
* @author Li Yuanyuan, 2024年1月30日 上午9:30:49
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@ApiOperation(value = "设备看板-设备报警类型", notes = "设备看板-设备报警类型,timePeriod【month/quarter/year】")
@GetMapping(value = "/getEquipmentAlarmInfo")
public Result<Map<String,Object>> getEquipmentAlarmInfo(String equipmentId,String timePeriod,String startTime,String endTime) {
Result<Map<String,Object>> result = new Result<>();
try {
Map<String,Object> map = equipmentSingleStatisticsService.getEquipmentAlarmInfo(equipmentId,timePeriod,startTime,endTime);
result.setSuccess(true);
result.setResult(map);
} catch (Exception e) {
log.error("设备报警类型统计失败", e.getMessage());
result.error500("设备报警类型统计失败");
}
return result;
}
@ApiOperation(value = "设备看板-设备维护情况", notes = "设备看板-设备维护情况,timePeriod【month/quarter/year】")
@GetMapping(value = "/getEquipmentMaintainInfo")
public Result<Map<String,Object>> getEquipmentMaintainInfo(String equipmentId,String timePeriod,String startTime,String endTime) {
Result<Map<String,Object>> result = new Result<>();
try {
Map<String,Object> map = equipmentSingleStatisticsService.getEquipmentMaintainInfo(equipmentId,timePeriod,startTime,endTime);
result.setSuccess(true);
result.setResult(map);
} catch (Exception e) {
log.error("设备维护情况统计失败", e.getMessage());
result.error500("设备维护情况统计失败");
}
return result;
}
@ApiOperation(value = "设备看板-巡检情况", notes = "设备看板-设备巡检情况,timePeriod【month/quarter/year】")
@GetMapping(value = "/getEquipmentInspectionInfo")
public Result<Map<String,Object>> getEquipmentInspectionInfo(String equipmentId,String timePeriod,String startTime,String endTime) {
Result<Map<String,Object>> result = new Result<>();
try {
Map<String,Object> map = equipmentSingleStatisticsService.getEquipmentInspectionInfo(equipmentId,timePeriod,startTime,endTime);
result.setSuccess(true);
result.setResult(map);
} catch (Exception e) {
log.error("设备维护情况统计失败", e.getMessage());
result.error500("设备维护情况统计失败");
}
return result;
}
@ApiOperation(value = "设备看板-设备备件更换情况", notes = "设备看板-设备备件更换情况,timePeriod【month/quarter/year】")
@GetMapping(value = "/getEquipmentSparepartInfo")
public Result<List<Map<String,Object>>> getEquipmentSparepartInfo(String equipmentId,String timePeriod,String startTime,String endTime) {
Result<List<Map<String,Object>>> result = new Result<>();
try {
List<Map<String,Object>> list = equipmentSingleStatisticsService.getEquipmentSparepartInfo(equipmentId,timePeriod,startTime,endTime);
result.setSuccess(true);
result.setResult(list);
} catch (Exception e) {
log.error("设备备件更换情况统计失败", e.getMessage());
result.error500("设备备件更换情况统计失败");
}
return result;
}
}