Browse Source

1、生活水箱液位前后端对接;

dev_mz
25604 3 weeks ago
parent
commit
bf81ca52c9
  1. 38
      mh-system/src/main/java/com/mh/system/service/device/impl/CollectionParamsManageServiceImpl.java
  2. 4
      mh-system/src/main/java/com/mh/system/service/space/impl/HouseInfoServiceImpl.java

38
mh-system/src/main/java/com/mh/system/service/device/impl/CollectionParamsManageServiceImpl.java

@ -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);
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);
List<FloorInfo> floorInfos = floorInfoMapper.selectList(new LambdaQueryWrapper<FloorInfo>().eq(FloorInfo::getBuildingId, buildingId).like(FloorInfo::getFloorName, floorName));
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);

4
mh-system/src/main/java/com/mh/system/service/space/impl/HouseInfoServiceImpl.java

@ -284,8 +284,12 @@ public class HouseInfoServiceImpl implements IHouseInfoService {
public List<SpaceTreeSelect> buildFloorTree(String systemType) {
QueryWrapper<AreaInfo> areaInfoQueryWrapper = new QueryWrapper<>();
if (!StringUtils.isEmpty(systemType)) {
if ("1".equals(systemType)) {
areaInfoQueryWrapper.in("system_type", "1", "6");
} else {
areaInfoQueryWrapper.eq("system_type", systemType);
}
}
areaInfoQueryWrapper.orderByAsc("order_num");
List<AreaInfo> areaInfos = areaInfoMapper.selectList(areaInfoQueryWrapper);
if (areaInfos != null && !areaInfos.isEmpty()) {

Loading…
Cancel
Save