|
@@ -46,7 +46,7 @@ public class AlarmHistoryController {
|
|
@ApiImplicitParam(name = "begin", value = "开始时间", required = true, dataType = "string", paramType = "query"),
|
|
@ApiImplicitParam(name = "begin", value = "开始时间", required = true, dataType = "string", paramType = "query"),
|
|
@ApiImplicitParam(name = "end", value = "结束时间", required = true, dataType = "string", paramType = "query"),
|
|
@ApiImplicitParam(name = "end", value = "结束时间", required = true, dataType = "string", paramType = "query"),
|
|
@ApiImplicitParam(name = "alarmType", value = "报警类型 booststation:升压站报警,windturbine:设备报警,custom:自定义报警", required = true, dataType = "string", paramType = "query"),
|
|
@ApiImplicitParam(name = "alarmType", value = "报警类型 booststation:升压站报警,windturbine:设备报警,custom:自定义报警", required = true, dataType = "string", paramType = "query"),
|
|
- @ApiImplicitParam(name = "stationid", value = "场站编号", required = false, dataType = "string", paramType = "query"),
|
|
|
|
|
|
+ @ApiImplicitParam(name = "stationid", value = "场站编号", required = true, dataType = "string", paramType = "query"),
|
|
@ApiImplicitParam(name = "deviceid", value = "设备编号", required = false, dataType = "string", paramType = "query"),
|
|
@ApiImplicitParam(name = "deviceid", value = "设备编号", required = false, dataType = "string", paramType = "query"),
|
|
@ApiImplicitParam(name = "description", value = "描述", required = false, dataType = "string", paramType = "query"),
|
|
@ApiImplicitParam(name = "description", value = "描述", required = false, dataType = "string", paramType = "query"),
|
|
@ApiImplicitParam(name = "modelId", value = "型号", required = false, dataType = "string", paramType = "query"),
|
|
@ApiImplicitParam(name = "modelId", value = "型号", required = false, dataType = "string", paramType = "query"),
|
|
@@ -58,7 +58,7 @@ public class AlarmHistoryController {
|
|
@RequestParam(value = "begin", required = true) String begin,
|
|
@RequestParam(value = "begin", required = true) String begin,
|
|
@RequestParam(value = "end", required = true) String end,
|
|
@RequestParam(value = "end", required = true) String end,
|
|
@RequestParam(value = "alarmType", required = true) String alarmType,
|
|
@RequestParam(value = "alarmType", required = true) String alarmType,
|
|
- @RequestParam(value = "stationid", required = false) String stationid,
|
|
|
|
|
|
+ @RequestParam(value = "stationid", required = true) String stationid,
|
|
@RequestParam(value = "deviceid", required = false) String deviceid,
|
|
@RequestParam(value = "deviceid", required = false) String deviceid,
|
|
@RequestParam(value = "description", required = false) String description,
|
|
@RequestParam(value = "description", required = false) String description,
|
|
@RequestParam(value = "modelId", required = false) String modelId,
|
|
@RequestParam(value = "modelId", required = false) String modelId,
|
|
@@ -69,7 +69,7 @@ public class AlarmHistoryController {
|
|
|
|
|
|
) throws Exception {
|
|
) throws Exception {
|
|
|
|
|
|
- SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
|
+ SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
Date beginDate = df.parse(begin);
|
|
Date beginDate = df.parse(begin);
|
|
Date endDate = df.parse(end);
|
|
Date endDate = df.parse(end);
|
|
Map<String,Object> map = alarmHistoryService.findAlarmlist(modelId,beginDate.getTime(), endDate.getTime(), alarmType, stationid,deviceid, description,deviceType,components, pageNum, pageSize);
|
|
Map<String,Object> map = alarmHistoryService.findAlarmlist(modelId,beginDate.getTime(), endDate.getTime(), alarmType, stationid,deviceid, description,deviceType,components, pageNum, pageSize);
|
|
@@ -79,37 +79,42 @@ public class AlarmHistoryController {
|
|
|
|
|
|
@GetMapping(value = "/history/findAlarmByTypelist")
|
|
@GetMapping(value = "/history/findAlarmByTypelist")
|
|
@ApiOperation(value = "获取升压站、设备、自定义报警报警信息查询", notes = "报警信息查询")
|
|
@ApiOperation(value = "获取升压站、设备、自定义报警报警信息查询", notes = "报警信息查询")
|
|
- public AjaxResult findAlarmByTypelist() throws Exception {
|
|
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(name = "type", value = "报警类型 booststation:升压站报警,windturbine:设备报警,custom:自定义报警", required = true, dataType = "string", paramType = "query")
|
|
|
|
+ })
|
|
|
|
+ public AjaxResult findAlarmByTypelist(String type) throws Exception {
|
|
|
|
|
|
|
|
|
|
- Map<String,Object> map = alarmHistoryService.findAlarmByTypelist();
|
|
|
|
- return AjaxResult.successData(AjaxStatus.success.code, map);
|
|
|
|
|
|
+ List<AlarmVo> ls = alarmHistoryService.findAlarmByTypelist(type);
|
|
|
|
+ return AjaxResult.successData(AjaxStatus.success.code, ls);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- @GetMapping(value = "/history/findFeatureStat")
|
|
|
|
- @ApiOperation(value = "查询报警类型、报警时长、报警次数", notes = "查询报警类型、报警时长、报警次数")
|
|
|
|
|
|
+ @GetMapping(value = "/history/findWtFeatureStat")
|
|
|
|
+ @ApiOperation(value = "查询原始报警类型、报警时长、报警次数", notes = "查询报警类型、报警时长、报警次数")
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
|
|
|
|
@ApiImplicitParam(name = "begin", value = "开始时间", required = true, dataType = "string", paramType = "query"),
|
|
@ApiImplicitParam(name = "begin", value = "开始时间", required = true, dataType = "string", paramType = "query"),
|
|
@ApiImplicitParam(name = "end", value = "结束时间", required = true, dataType = "string", paramType = "query"),
|
|
@ApiImplicitParam(name = "end", value = "结束时间", required = true, dataType = "string", paramType = "query"),
|
|
@ApiImplicitParam(name = "stationid", value = "场站编号", required = true, dataType = "string", paramType = "query"),
|
|
@ApiImplicitParam(name = "stationid", value = "场站编号", required = true, dataType = "string", paramType = "query"),
|
|
|
|
+ @ApiImplicitParam(name = "modelId", value = "型号编号", required = true, dataType = "string", paramType = "query"),
|
|
@ApiImplicitParam(name = "components", value = "部件编号", required = true, dataType = "string", paramType = "query")
|
|
@ApiImplicitParam(name = "components", value = "部件编号", required = true, dataType = "string", paramType = "query")
|
|
})
|
|
})
|
|
- public List<Map.Entry<String, List<AlarmStatVo>>> findFeatureStat(
|
|
|
|
|
|
+ public List<Map.Entry<String, List<AlarmStatVo>>> findWtFeatureStat(
|
|
|
|
|
|
@RequestParam(value = "begin", required = true) String begin,
|
|
@RequestParam(value = "begin", required = true) String begin,
|
|
@RequestParam(value = "end", required = true) String end,
|
|
@RequestParam(value = "end", required = true) String end,
|
|
@RequestParam(value = "stationid", required = true) String stId,
|
|
@RequestParam(value = "stationid", required = true) String stId,
|
|
|
|
+ @RequestParam(value = "modelId", required = true) String modelId,
|
|
@RequestParam(value = "components", required = true) String components
|
|
@RequestParam(value = "components", required = true) String components
|
|
) throws ParseException {
|
|
) throws ParseException {
|
|
|
|
|
|
|
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
Date dtStart = sdf.parse(begin);
|
|
Date dtStart = sdf.parse(begin);
|
|
Date dtEnd = sdf.parse(end);
|
|
Date dtEnd = sdf.parse(end);
|
|
- List<AlarmStatVo> pressureList = alarmHistoryService.findByCondition(stId, dtStart, dtEnd,components);
|
|
|
|
|
|
+ List<AlarmStatVo> pressureList = alarmHistoryService.findWtFeatureStat(stId,modelId, dtStart, dtEnd,components);
|
|
|
|
|
|
//
|
|
//
|
|
// Map<String, List<AlarmStatVo>> map=new TreeMap<>();
|
|
// Map<String, List<AlarmStatVo>> map=new TreeMap<>();
|
|
@@ -147,6 +152,68 @@ public class AlarmHistoryController {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ @GetMapping(value = "/history/findCtFeatureStat")
|
|
|
|
+ @ApiOperation(value = "查询自定义报警类型、报警时长、报警次数", notes = "查询报警类型、报警时长、报警次数")
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
+
|
|
|
|
+ @ApiImplicitParam(name = "begin", value = "开始时间", required = true, dataType = "string", paramType = "query"),
|
|
|
|
+ @ApiImplicitParam(name = "end", value = "结束时间", required = true, dataType = "string", paramType = "query"),
|
|
|
|
+ @ApiImplicitParam(name = "stationid", value = "场站编号", required = true, dataType = "string", paramType = "query"),
|
|
|
|
+ @ApiImplicitParam(name = "modelId", value = "型号编号", required = true, dataType = "string", paramType = "query"),
|
|
|
|
+ @ApiImplicitParam(name = "description", value = "规则描述", required = true, dataType = "string", paramType = "query")
|
|
|
|
+ })
|
|
|
|
+ public List<Map.Entry<String, List<AlarmStatVo>>> findCtFeatureStat(
|
|
|
|
+
|
|
|
|
+ @RequestParam(value = "begin", required = true) String begin,
|
|
|
|
+ @RequestParam(value = "end", required = true) String end,
|
|
|
|
+ @RequestParam(value = "stationid", required = true) String stId,
|
|
|
|
+ @RequestParam(value = "modelId", required = true) String modelId,
|
|
|
|
+ @RequestParam(value = "description", required = true) String description
|
|
|
|
+ ) throws ParseException {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
+ Date dtStart = sdf.parse(begin);
|
|
|
|
+ Date dtEnd = sdf.parse(end);
|
|
|
|
+ List<AlarmStatVo> pressureList = alarmHistoryService.findCtFeatureStat(stId,modelId, dtStart, dtEnd,description);
|
|
|
|
+
|
|
|
|
+//
|
|
|
|
+// Map<String, List<AlarmStatVo>> map=new TreeMap<>();
|
|
|
|
+//
|
|
|
|
+// for(AlarmStatVo vo:pressureList)
|
|
|
|
+// {
|
|
|
|
+// if(map.containsKey(vo.getRelateParts()))
|
|
|
|
+// {
|
|
|
|
+// List<AlarmStatVo>
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+ //根据风机编号分组
|
|
|
|
+ Map<String, List<AlarmStatVo>> alarmStatMapGroupbyWindturbineId = pressureList.stream().collect(Collectors.groupingBy(AlarmStatVo::getWindturbineId));
|
|
|
|
+
|
|
|
|
+ Map<String, List<AlarmStatVo>> resultMap = new TreeMap<>();
|
|
|
|
+
|
|
|
|
+ for (Map.Entry<String, List<AlarmStatVo>> entry : alarmStatMapGroupbyWindturbineId.entrySet()) {
|
|
|
|
+ String windturbineId = entry.getKey();
|
|
|
|
+ resultMap.put(windturbineId, entry.getValue());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //根据风机编号进行排序
|
|
|
|
+ List<Map.Entry<String, List<AlarmStatVo>>> list = new ArrayList<>(resultMap.entrySet());
|
|
|
|
+ Collections.sort(list, new Comparator<Map.Entry<String, List<AlarmStatVo>>>() {
|
|
|
|
+ @Override
|
|
|
|
+ public int compare(Map.Entry<String, List<AlarmStatVo>> o1, Map.Entry<String, List<AlarmStatVo>> o2) {
|
|
|
|
+ String key1=o1.getKey();
|
|
|
|
+ String key2=o1.getKey();
|
|
|
|
+ return key1.compareTo(key2);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ return list;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|