|
|
|
@ -186,11 +186,11 @@ public class AlarmServiceImpl extends BaseServiceImpl<AlarmMapper, AlarmEntity>
|
|
|
|
|
// 站点查询
|
|
|
|
|
List<StationEntity> stations = this.stations(); |
|
|
|
|
if(CollectionUtil.isEmpty(stations)){ |
|
|
|
|
return null; |
|
|
|
|
return new TextMessage(new ArrayList().toString()); |
|
|
|
|
} |
|
|
|
|
List<String> effectives = stations.stream().filter(station->depts.contains(station.getRefDept())).map(StationEntity::getCode).collect(Collectors.toList()); |
|
|
|
|
if(CollectionUtil.isEmpty(effectives)){ |
|
|
|
|
return null; |
|
|
|
|
return new TextMessage(new ArrayList().toString()); |
|
|
|
|
} |
|
|
|
|
// 条件过滤
|
|
|
|
|
QueryWrapper<AlarmEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
@ -205,7 +205,7 @@ public class AlarmServiceImpl extends BaseServiceImpl<AlarmMapper, AlarmEntity>
|
|
|
|
|
} |
|
|
|
|
List<AlarmEntity> alarms = this.list(queryWrapper); |
|
|
|
|
if(CollectionUtil.isEmpty(alarms)){ |
|
|
|
|
return null; |
|
|
|
|
return new TextMessage(new ArrayList().toString()); |
|
|
|
|
} |
|
|
|
|
return new TextMessage(JSONObject.toJSONString(alarms.stream().sorted(Comparator.comparing(AlarmEntity::getAlarmTime).reversed()).collect(Collectors.toList()))); |
|
|
|
|
} |
|
|
|
|