fix:使用台站状态枚举类
This commit is contained in:
parent
3ed1af0b33
commit
6b69e226d4
|
@ -150,7 +150,7 @@ public class GardsDetectorsServiceImpl extends ServiceImpl<GardsDetectorsMapper,
|
||||||
redisUtil.del("detectorsMap", "detectorsUsedList");
|
redisUtil.del("detectorsMap", "detectorsUsedList");
|
||||||
List<GardsDetectorsSystem> gardsDetectors = this.baseMapper.selectList(new LambdaQueryWrapper<>());
|
List<GardsDetectorsSystem> gardsDetectors = this.baseMapper.selectList(new LambdaQueryWrapper<>());
|
||||||
Map<Integer, String> detectorsMap = gardsDetectors.stream().collect(Collectors.toMap(GardsDetectorsSystem::getDetectorId, GardsDetectorsSystem::getDetectorCode));
|
Map<Integer, String> detectorsMap = gardsDetectors.stream().collect(Collectors.toMap(GardsDetectorsSystem::getDetectorId, GardsDetectorsSystem::getDetectorCode));
|
||||||
List<Integer> detectorsUsedList = gardsDetectors.stream().filter(item -> item.getStatus()!=null && "Operating".equals(item.getStatus().trim())).map(GardsDetectorsSystem::getStationId).collect(Collectors.toList());
|
List<Integer> detectorsUsedList = gardsDetectors.stream().filter(item -> item.getStatus()!=null && DetectorStatus.ON.getValue().equals(item.getStatus().trim())).map(GardsDetectorsSystem::getStationId).collect(Collectors.toList());
|
||||||
redisUtil.set("detectorsMap",detectorsMap);
|
redisUtil.set("detectorsMap",detectorsMap);
|
||||||
redisUtil.set("detectorsUsedList", detectorsUsedList);
|
redisUtil.set("detectorsUsedList", detectorsUsedList);
|
||||||
}
|
}
|
||||||
|
@ -163,7 +163,7 @@ public class GardsDetectorsServiceImpl extends ServiceImpl<GardsDetectorsMapper,
|
||||||
queryWrapper.in(GardsDetectorsSystem::getStationId, stationIds);
|
queryWrapper.in(GardsDetectorsSystem::getStationId, stationIds);
|
||||||
List<GardsDetectorsSystem> detectorsList = this.baseMapper.selectList(queryWrapper);
|
List<GardsDetectorsSystem> detectorsList = this.baseMapper.selectList(queryWrapper);
|
||||||
for (String stationId:stationIds) {
|
for (String stationId:stationIds) {
|
||||||
List<GardsDetectorsSystem> detectors = detectorsList.stream().filter(item -> item.getStationId()!=null && item.getStationId().equals(Integer.valueOf(stationId)) && item.getStatus()!=null && item.getStatus().trim().equals("Operating")).collect(Collectors.toList());
|
List<GardsDetectorsSystem> detectors = detectorsList.stream().filter(item -> item.getStationId()!=null && item.getStationId().equals(Integer.valueOf(stationId)) && item.getStatus()!=null && item.getStatus().trim().equals(DetectorStatus.ON.getValue())).collect(Collectors.toList());
|
||||||
map.put(stationId, detectors);
|
map.put(stationId, detectors);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user