|
|
|
|
@ -656,10 +656,24 @@ public class CollectionParamsManageServiceImpl implements ICollectionParamsManag
|
|
|
|
|
@Override |
|
|
|
|
public List<HotWaterNowDataDTO> monitorList(String systemType, String floorId) { |
|
|
|
|
// 根据楼栋id查询对应的楼层列表,根据_进行分割
|
|
|
|
|
List<String> floorList = Arrays.asList(floorId.split("_")); |
|
|
|
|
if (systemType.equals("6")) { |
|
|
|
|
return lifeWaterLevel(systemType, floorId); |
|
|
|
|
} |
|
|
|
|
List<String> floorList = null; |
|
|
|
|
if (floorId.contains("_")) { |
|
|
|
|
floorList = List.of(floorId.split("_")); |
|
|
|
|
} else { |
|
|
|
|
floorList = new ArrayList<>(); |
|
|
|
|
floorList.add(floorId); |
|
|
|
|
} |
|
|
|
|
String buildingId = floorList.get(0); |
|
|
|
|
String floorName = floorList.get(1); |
|
|
|
|
List<FloorInfo> floorInfos = floorInfoMapper.selectList(new LambdaQueryWrapper<FloorInfo>().eq(FloorInfo::getBuildingId, buildingId).like(FloorInfo::getFloorName, floorName)); |
|
|
|
|
List<FloorInfo> floorInfos = new ArrayList<>(); |
|
|
|
|
if (floorList.size() == 1) { |
|
|
|
|
floorInfos = floorInfoMapper.selectList(new LambdaQueryWrapper<FloorInfo>().eq(FloorInfo::getBuildingId, buildingId)); |
|
|
|
|
} else { |
|
|
|
|
String floorName = floorList.get(1); |
|
|
|
|
floorInfos = floorInfoMapper.selectList(new LambdaQueryWrapper<FloorInfo>().eq(FloorInfo::getBuildingId, buildingId).like(FloorInfo::getFloorName, floorName)); |
|
|
|
|
} |
|
|
|
|
if (floorInfos.isEmpty()) { |
|
|
|
|
return List.of(); |
|
|
|
|
} |
|
|
|
|
@ -882,6 +896,26 @@ public class CollectionParamsManageServiceImpl implements ICollectionParamsManag
|
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private List<HotWaterNowDataDTO> lifeWaterLevel(String systemType, String floorId) { |
|
|
|
|
List<DeviceMonitorVO> lifeWaterLevel = collectionParamsManageMapper.selectHotWaterBySystemTypeAndBuildingIdAndDeviceType(systemType, floorId, "16"); |
|
|
|
|
List<DeviceMonitorVO> list = lifeWaterLevel.stream().filter(vo -> "11".equals(vo.getParamType())).toList(); |
|
|
|
|
if (!list.isEmpty()) { |
|
|
|
|
return list.stream().map(vo -> { |
|
|
|
|
HotWaterNowDataDTO dto = new HotWaterNowDataDTO(); |
|
|
|
|
dto.setId(vo.getId()); |
|
|
|
|
dto.setCurDate(vo.getCollectTime().toString()); |
|
|
|
|
dto.setBuildingId(vo.getDeviceLedgerId()); |
|
|
|
|
dto.setBuildingName(vo.getDeviceName()); |
|
|
|
|
dto.setTankId(vo.getDeviceLedgerId()); |
|
|
|
|
dto.setTankName(vo.getDeviceName()); |
|
|
|
|
dto.setWaterLevel1(vo.getCollectValue()); |
|
|
|
|
dto.setOrderNum(1); |
|
|
|
|
return dto; |
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<HotWaterControlDTO> operateList(String systemType, String floorId) { |
|
|
|
|
List<HotWaterControlListVO> hotWaterControlListVOS = collectionParamsManageMapper.selectHotWaterBySystemTypeAndBuildingId(systemType, floorId); |
|
|
|
|
|