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