diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/AlarmScheduledTask.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/AlarmScheduledTask.java index 6f4721d..f6b7552 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/AlarmScheduledTask.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/AlarmScheduledTask.java @@ -39,4 +39,14 @@ public class AlarmScheduledTask { service.startStopAlarm(param); return new ReturnT<>("SUCCESS"); } + + @XxlJob(START_STOP_ALARM) + //@Scheduled(cron = "0/40 * * * * ? ") + public ReturnT interruptAlarm(String param) { + if (Func.isBlank(param)) { + param = DateUtil.format(new Date(), "yyyy-MM"); + } + service.interruptAlarm(param); + return new ReturnT<>("SUCCESS"); + } } \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/AlarmQueryService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/AlarmQueryService.java index 5b8f793..ff85d1c 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/AlarmQueryService.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/AlarmQueryService.java @@ -16,4 +16,6 @@ public interface AlarmQueryService extends BaseService { List bells(List codes); List aborts(List codes); + + void interruptAlarm(String param); } \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmQueryServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmQueryServiceImpl.java index fd31272..a922504 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmQueryServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmQueryServiceImpl.java @@ -178,14 +178,23 @@ public class AlarmQueryServiceImpl extends BaseServiceImpl(); } - return alarms.stream().collect(Collectors.groupingBy(AlarmEntity::getStationId)).entrySet().stream().map(entry->{ + return alarms.stream().collect(Collectors.groupingBy(AlarmEntity::getStationId)).values().stream().map(alarmEntities -> { // 站点最近的一条数据中断、数据异常告警 - AlarmEntity alarm = entry.getValue().stream().sorted(Comparator.comparing(AlarmEntity::getCreateTime).reversed()).collect(Collectors.toList()).get(0); + AlarmEntity alarm = alarmEntities.stream().sorted(Comparator.comparing(AlarmEntity::getCreateTime).reversed()).collect(Collectors.toList()).get(0); // 状态为中断 - if(alarm.getAlarmStatus().equals(0)){ + if (alarm.getAlarmStatus().equals(0)) { return alarm.getStationId(); } return ""; }).filter(StringUtil::isBlank).distinct().collect(Collectors.toList()); } + + /** + * 数据中断告警 + * @param param + */ + @Override + public void interruptAlarm(String param) { + + } } \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/impl/ReportServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/impl/ReportServiceImpl.java index 81b5dae..373edb3 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/impl/ReportServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/impl/ReportServiceImpl.java @@ -862,7 +862,7 @@ public class ReportServiceImpl implements ReportService { List alarms = this.hz3000Alarm(code,start,end); // FIXME 设备实例:一级告警 // FDP智能预警 - // alarms.addAll(this.intelligentEarly(code,start,end)); + alarms.addAll(this.intelligentEarly(code,start,end)); return JSONObject.toJSONString(alarms); } @@ -904,7 +904,7 @@ public class ReportServiceImpl implements ReportService { StbAnalysisDTO param = new StbAnalysisDTO(); param.setStartTime(LocalDateTime.parse(start,DateUtil.DATETIME_FORMATTER)); param.setEndTime(LocalDateTime.parse(end, DateUtil.DATETIME_FORMATTER)); - param.setStation(code); + param.setStations(Collections.singletonList(code)); param.setPage(0); param.setPageSize(100000); Result> result = soeDataClient.pageStbAnalysis(param);