|
|
|
@ -73,7 +73,7 @@ public class AbnormalAlarmServiceImpl extends BaseServiceImpl<AbnormalAlarmMappe
|
|
|
|
|
query.setStationIds(stations.stream().map(StationEntity::getCode).collect(Collectors.toList())); |
|
|
|
|
Calendar calendar = Calendar.getInstance(); |
|
|
|
|
query.setEndTime(LocalDateTime.parse(DateUtil.format(calendar.getTime(), DateUtil.PATTERN_DATETIME),DateUtil.DATETIME_FORMATTER)); |
|
|
|
|
calendar.add(Calendar.MINUTE,-2); |
|
|
|
|
calendar.add(Calendar.MINUTE,-10); |
|
|
|
|
query.setBeginTime(LocalDateTime.parse(DateUtil.format(calendar.getTime() , DateUtil.PATTERN_DATETIME),DateUtil.DATETIME_FORMATTER)); |
|
|
|
|
query.setNeedPage(false); |
|
|
|
|
query.setPage(1); |
|
|
|
@ -83,8 +83,18 @@ public class AbnormalAlarmServiceImpl extends BaseServiceImpl<AbnormalAlarmMappe
|
|
|
|
|
if(!result.isSuccess() || ObjectUtil.isEmpty(result.getData()) || CollectionUtil.isEmpty(result.getData().getRecords())) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
List<SoeData> soes = result.getData().getRecords(); |
|
|
|
|
// 过滤已经当天存储得告警数据
|
|
|
|
|
List<HistoryAbnormalAlarmEntity> history = historyAbnormalAlarmService.list(Wrappers.<HistoryAbnormalAlarmEntity>lambdaQuery() |
|
|
|
|
.in(HistoryAbnormalAlarmEntity::getAlarmId,soes.stream().map(SoeData::getId).collect(Collectors.toList())) |
|
|
|
|
.ge(HistoryAbnormalAlarmEntity::getStartTime,DateUtil.format(new Date(),DateUtil.PATTERN_DATE) + " 00:00:00") |
|
|
|
|
); |
|
|
|
|
if(CollectionUtil.isNotEmpty(history)){ |
|
|
|
|
soes = result.getData().getRecords().stream().filter(soe-> !history.stream().map(HistoryAbnormalAlarmEntity::getAlarmId).collect(Collectors.toList()).contains(soe.getId())).collect(Collectors.toList()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 遍历告警信息
|
|
|
|
|
result.getData().getRecords().forEach(item -> { |
|
|
|
|
soes.forEach(item -> { |
|
|
|
|
if(!AbnormalAlarmConstant.INTERRUPT_LIST.contains(item.getSoeType())){ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|