|
|
|
|
@ -4,7 +4,6 @@ import com.mh.common.utils.StringUtils;
|
|
|
|
|
import com.mh.user.constants.Constant; |
|
|
|
|
import com.mh.user.dto.*; |
|
|
|
|
import com.mh.user.entity.CollectionParamsManageEntity; |
|
|
|
|
import com.mh.user.entity.DeviceInstallEntity; |
|
|
|
|
import com.mh.user.mapper.CollectionParamsManageMapper; |
|
|
|
|
import com.mh.user.model.SanShiFengDatas; |
|
|
|
|
import com.mh.user.service.CollectionParamsManageService; |
|
|
|
|
@ -59,7 +58,7 @@ public class CollectionParamsManageServiceImpl implements CollectionParamsManage
|
|
|
|
|
.map(this::convertToHotWaterControlDTO2) |
|
|
|
|
.sorted(Comparator.comparingInt(HotWaterControlDTO::getOrderNum)) |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 对每个DTO的children进行二次分组
|
|
|
|
|
List<HotWaterControlDTO> result = dtos.stream() |
|
|
|
|
.map(dto -> { |
|
|
|
|
@ -67,7 +66,7 @@ public class CollectionParamsManageServiceImpl implements CollectionParamsManage
|
|
|
|
|
newDto.setId(dto.getId()); |
|
|
|
|
newDto.setName(dto.getName()); |
|
|
|
|
newDto.setOrderNum(dto.getOrderNum()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取原始children列表
|
|
|
|
|
List<?> originalChildren = dto.getChildren(); |
|
|
|
|
if (originalChildren != null && !originalChildren.isEmpty()) { |
|
|
|
|
@ -77,11 +76,11 @@ public class CollectionParamsManageServiceImpl implements CollectionParamsManage
|
|
|
|
|
} else { |
|
|
|
|
newDto.setChildren(Collections.emptyList()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return newDto; |
|
|
|
|
}) |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -148,14 +147,15 @@ public class CollectionParamsManageServiceImpl implements CollectionParamsManage
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 根据设备类型和orderNum对children进行二次分组 |
|
|
|
|
* @param children 原始children列表 |
|
|
|
|
* |
|
|
|
|
* @param children 原始children列表 |
|
|
|
|
* @param deviceType 设备类型 |
|
|
|
|
* @return 分组后的HotWaterControlDTO列表 |
|
|
|
|
*/ |
|
|
|
|
private List<HotWaterControlDTO> groupChildrenByCategory(List<?> children, String deviceType) { |
|
|
|
|
// 定义分组规则
|
|
|
|
|
Map<String, int[]> categoryRules = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ("运行参数".equals(deviceType)) { |
|
|
|
|
// 运行参数分组规则
|
|
|
|
|
categoryRules.put("探头监控数据", new int[]{1, 13}); |
|
|
|
|
@ -171,7 +171,7 @@ public class CollectionParamsManageServiceImpl implements CollectionParamsManage
|
|
|
|
|
// 定时参数1分组规则
|
|
|
|
|
categoryRules.put("定时参数1", new int[]{1, 5}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 如果没有定义分组规则,直接返回原children包装成的DTO列表
|
|
|
|
|
if (categoryRules.isEmpty()) { |
|
|
|
|
return children.stream() |
|
|
|
|
@ -185,13 +185,13 @@ public class CollectionParamsManageServiceImpl implements CollectionParamsManage
|
|
|
|
|
}) |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 按类别分组
|
|
|
|
|
Map<String, List<Object>> categorizedMap = new LinkedHashMap<>(); |
|
|
|
|
for (String category : categoryRules.keySet()) { |
|
|
|
|
categorizedMap.put(category, new ArrayList<>()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 将children分配到对应的类别中
|
|
|
|
|
for (Object child : children) { |
|
|
|
|
int orderNum = getOrderNumFromObject(child); |
|
|
|
|
@ -200,7 +200,7 @@ public class CollectionParamsManageServiceImpl implements CollectionParamsManage
|
|
|
|
|
categorizedMap.get(assignedCategory).add(child); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 转换为HotWaterControlDTO列表
|
|
|
|
|
List<HotWaterControlDTO> result = new ArrayList<>(); |
|
|
|
|
int index = 1; |
|
|
|
|
@ -210,7 +210,7 @@ public class CollectionParamsManageServiceImpl implements CollectionParamsManage
|
|
|
|
|
categoryDto.setId("category_" + index); |
|
|
|
|
categoryDto.setName(entry.getKey()); |
|
|
|
|
categoryDto.setOrderNum(index); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 将该类别下的children设置为子项
|
|
|
|
|
List<Object> categoryChildren = entry.getValue().stream() |
|
|
|
|
.sorted((o1, o2) -> Integer.compare(getOrderNumFromObject(o1), getOrderNumFromObject(o2))) |
|
|
|
|
@ -261,13 +261,14 @@ public class CollectionParamsManageServiceImpl implements CollectionParamsManage
|
|
|
|
|
index++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 根据orderNum分配到对应的类别 |
|
|
|
|
* @param orderNum 排序号 |
|
|
|
|
* |
|
|
|
|
* @param orderNum 排序号 |
|
|
|
|
* @param categoryRules 分类规则 |
|
|
|
|
* @return 分配的类别名称 |
|
|
|
|
*/ |
|
|
|
|
@ -280,9 +281,10 @@ public class CollectionParamsManageServiceImpl implements CollectionParamsManage
|
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 从对象中获取ID |
|
|
|
|
* |
|
|
|
|
* @param obj 对象 |
|
|
|
|
* @return ID字符串 |
|
|
|
|
*/ |
|
|
|
|
@ -302,9 +304,10 @@ public class CollectionParamsManageServiceImpl implements CollectionParamsManage
|
|
|
|
|
} |
|
|
|
|
return ""; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 从对象中获取名称 |
|
|
|
|
* |
|
|
|
|
* @param obj 对象 |
|
|
|
|
* @return 名称字符串 |
|
|
|
|
*/ |
|
|
|
|
@ -348,6 +351,13 @@ public class CollectionParamsManageServiceImpl implements CollectionParamsManage
|
|
|
|
|
return createSupplyPumpControlVO(dlEntry, dlItems, parentDto); |
|
|
|
|
case "回水泵": |
|
|
|
|
return createBackPumpControlVO(dlEntry, dlItems, parentDto); |
|
|
|
|
case "电动阀": |
|
|
|
|
return createElectricValveControlVO(dlEntry, dlItems, parentDto); |
|
|
|
|
case "单箱电磁阀": |
|
|
|
|
case "多箱电磁阀": |
|
|
|
|
return createSolenoidValveControlVO(dlEntry, dlItems, parentDto); |
|
|
|
|
case "补水电磁阀": |
|
|
|
|
return createHydrateSolenoidValveControlVO(dlEntry, dlItems, parentDto); |
|
|
|
|
case "设备校准": |
|
|
|
|
return createDeviceCalibrationControlVO(dlEntry, dlItems, parentDto); |
|
|
|
|
case "电表": |
|
|
|
|
@ -358,6 +368,273 @@ public class CollectionParamsManageServiceImpl implements CollectionParamsManage
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private HydrateSolenoidValveControlVO createHydrateSolenoidValveControlVO(Map.Entry<String, List<HotWaterControlListVO>> dlEntry, List<HotWaterControlListVO> dlItems, HotWaterControlDTO parentDto) { |
|
|
|
|
HydrateSolenoidValveControlVO circuitPumpVo = new HydrateSolenoidValveControlVO(); |
|
|
|
|
setupBasicDeviceInfo(circuitPumpVo, dlEntry, dlItems, parentDto); |
|
|
|
|
|
|
|
|
|
dlItems.forEach(item -> { |
|
|
|
|
switch (item.getParamTypeId()) { |
|
|
|
|
case "1": |
|
|
|
|
// 启停控制
|
|
|
|
|
circuitPumpVo.setStartStopControl(item.getCurValue().intValue()); |
|
|
|
|
circuitPumpVo.setStartStopControlId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "2": |
|
|
|
|
// 运行状态
|
|
|
|
|
circuitPumpVo.setRunState(item.getCurValue().intValue()); |
|
|
|
|
circuitPumpVo.setRunStateId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "3": |
|
|
|
|
// 故障状态
|
|
|
|
|
circuitPumpVo.setFault(item.getCurValue().intValue()); |
|
|
|
|
circuitPumpVo.setFaultId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "4": |
|
|
|
|
// 时控
|
|
|
|
|
handleTimeParameters(circuitPumpVo, item); |
|
|
|
|
break; |
|
|
|
|
case "8": |
|
|
|
|
// 温差
|
|
|
|
|
circuitPumpVo.setTempDiff(item.getCurValue()); |
|
|
|
|
circuitPumpVo.setTempDiffId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "9": |
|
|
|
|
// 温差设置
|
|
|
|
|
circuitPumpVo.setTempDiffSet(item.getCurValue()); |
|
|
|
|
circuitPumpVo.setTempDiffSetId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "15": |
|
|
|
|
// 开延时时间
|
|
|
|
|
circuitPumpVo.setOpenDelayTime(item.getCurValue().intValue()); |
|
|
|
|
circuitPumpVo.setOpenDelayTimeId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "16": |
|
|
|
|
// 累计运行时间
|
|
|
|
|
if (item.getOtherName().contains("小时")) { |
|
|
|
|
circuitPumpVo.setRunTime(item.getCurValue()); |
|
|
|
|
circuitPumpVo.setRunTimeId(item.getCpmId()); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case "21": |
|
|
|
|
// 一键启动
|
|
|
|
|
circuitPumpVo.setStartOneKey(item.getCurValue().intValue()); |
|
|
|
|
circuitPumpVo.setStartOneKeyId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "22": |
|
|
|
|
// 手动自动切换
|
|
|
|
|
circuitPumpVo.setManualAutoSwitch(item.getCurValue().intValue()); |
|
|
|
|
circuitPumpVo.setManualAutoSwitchId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "26": |
|
|
|
|
// 液位上限
|
|
|
|
|
// 判断是否是单箱或者多箱
|
|
|
|
|
if (parentDto.getName().contains("单箱")) { |
|
|
|
|
circuitPumpVo.setSetSingleUpperLimit(item.getCurValue()); |
|
|
|
|
circuitPumpVo.setSetSingleUpperLimitId(item.getCpmId()); |
|
|
|
|
} else { |
|
|
|
|
circuitPumpVo.setSetMultiUpperLimit(item.getCurValue()); |
|
|
|
|
circuitPumpVo.setSetMultiUpperLimitId(item.getCpmId()); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case "27": |
|
|
|
|
// 液位下限
|
|
|
|
|
if (parentDto.getName().contains("单箱")) { |
|
|
|
|
circuitPumpVo.setSetSingleLowerLimit(item.getCurValue()); |
|
|
|
|
circuitPumpVo.setSetSingleLowerLimitId(item.getCpmId()); |
|
|
|
|
} else { |
|
|
|
|
circuitPumpVo.setSetMultiLowerLimit(item.getCurValue()); |
|
|
|
|
circuitPumpVo.setSetMultiLowerLimitId(item.getCpmId()); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case "39": |
|
|
|
|
// 液位设置
|
|
|
|
|
if (parentDto.getName().contains("单箱")) { |
|
|
|
|
circuitPumpVo.setSetSingleLevel(item.getCurValue()); |
|
|
|
|
circuitPumpVo.setSetSingleLevelId(item.getCpmId()); |
|
|
|
|
} else { |
|
|
|
|
circuitPumpVo.setSetMultiLevel(item.getCurValue()); |
|
|
|
|
circuitPumpVo.setSetMultiLevelId(item.getCpmId()); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case "41": |
|
|
|
|
// 控制模式
|
|
|
|
|
circuitPumpVo.setControlMode(item.getCurValue().intValue()); |
|
|
|
|
circuitPumpVo.setControlModeId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
if (circuitPumpVo.getOneHourTimeOpenSetOneId() != null |
|
|
|
|
&& circuitPumpVo.getOneHourTimeCloseSetOneId() != null |
|
|
|
|
&& circuitPumpVo.getOneMinTimeOpenSetOneId() != null |
|
|
|
|
&& circuitPumpVo.getOneMinTimeCloseSetOneId() != null) { |
|
|
|
|
// 设置时分开写入oneHourMinTimeOpenSetOneStr,oneHourMinTimeCloseSetOneStr
|
|
|
|
|
circuitPumpVo.setOneHourMinTimeOpenSetOneStr(String.format("%02d:%02d", circuitPumpVo.getOneHourTimeOpenSetOne(), circuitPumpVo.getOneMinTimeOpenSetOne())); |
|
|
|
|
circuitPumpVo.setOneHourMinTimeCloseSetOneStr(String.format("%02d:%02d", circuitPumpVo.getOneHourTimeCloseSetOne(), circuitPumpVo.getOneMinTimeCloseSetOne())); |
|
|
|
|
} |
|
|
|
|
return circuitPumpVo; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private SolenoidValveControlVO createSolenoidValveControlVO(Map.Entry<String, List<HotWaterControlListVO>> dlEntry, List<HotWaterControlListVO> dlItems, HotWaterControlDTO parentDto) { |
|
|
|
|
SolenoidValveControlVO circuitPumpVo = new SolenoidValveControlVO(); |
|
|
|
|
setupBasicDeviceInfo(circuitPumpVo, dlEntry, dlItems, parentDto); |
|
|
|
|
|
|
|
|
|
dlItems.forEach(item -> { |
|
|
|
|
switch (item.getParamTypeId()) { |
|
|
|
|
case "1": |
|
|
|
|
// 启停控制
|
|
|
|
|
circuitPumpVo.setStartStopControl(item.getCurValue().intValue()); |
|
|
|
|
circuitPumpVo.setStartStopControlId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "2": |
|
|
|
|
// 运行状态
|
|
|
|
|
circuitPumpVo.setRunState(item.getCurValue().intValue()); |
|
|
|
|
circuitPumpVo.setRunStateId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "3": |
|
|
|
|
// 故障状态
|
|
|
|
|
circuitPumpVo.setFault(item.getCurValue().intValue()); |
|
|
|
|
circuitPumpVo.setFaultId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "4": |
|
|
|
|
// 时控
|
|
|
|
|
handleTimeParameters(circuitPumpVo, item); |
|
|
|
|
break; |
|
|
|
|
case "8": |
|
|
|
|
// 温差
|
|
|
|
|
circuitPumpVo.setTempDiff(item.getCurValue()); |
|
|
|
|
circuitPumpVo.setTempDiffId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "9": |
|
|
|
|
// 温差设置
|
|
|
|
|
circuitPumpVo.setTempDiffSet(item.getCurValue()); |
|
|
|
|
circuitPumpVo.setTempDiffSetId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "15": |
|
|
|
|
// 开延时时间
|
|
|
|
|
circuitPumpVo.setOpenDelayTime(item.getCurValue().intValue()); |
|
|
|
|
circuitPumpVo.setOpenDelayTimeId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "16": |
|
|
|
|
// 累计运行时间
|
|
|
|
|
if (item.getOtherName().contains("小时")) { |
|
|
|
|
circuitPumpVo.setRunTime(item.getCurValue()); |
|
|
|
|
circuitPumpVo.setRunTimeId(item.getCpmId()); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case "21": |
|
|
|
|
// 一键启动
|
|
|
|
|
circuitPumpVo.setStartOneKey(item.getCurValue().intValue()); |
|
|
|
|
circuitPumpVo.setStartOneKeyId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "22": |
|
|
|
|
// 手动自动切换
|
|
|
|
|
circuitPumpVo.setManualAutoSwitch(item.getCurValue().intValue()); |
|
|
|
|
circuitPumpVo.setManualAutoSwitchId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "26": |
|
|
|
|
// 温度上限
|
|
|
|
|
circuitPumpVo.setSetUpperLimit(item.getCurValue()); |
|
|
|
|
circuitPumpVo.setSetUpperLimitId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "27": |
|
|
|
|
// 温度下限
|
|
|
|
|
circuitPumpVo.setSetLowerLimit(item.getCurValue()); |
|
|
|
|
circuitPumpVo.setSetLowerLimitId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "41": |
|
|
|
|
// 控制模式
|
|
|
|
|
circuitPumpVo.setControlMode(item.getCurValue().intValue()); |
|
|
|
|
circuitPumpVo.setControlModeId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
if (circuitPumpVo.getOneHourTimeOpenSetOneId() != null |
|
|
|
|
&& circuitPumpVo.getOneHourTimeCloseSetOneId() != null |
|
|
|
|
&& circuitPumpVo.getOneMinTimeOpenSetOneId() != null |
|
|
|
|
&& circuitPumpVo.getOneMinTimeCloseSetOneId() != null) { |
|
|
|
|
// 设置时分开写入oneHourMinTimeOpenSetOneStr,oneHourMinTimeCloseSetOneStr
|
|
|
|
|
circuitPumpVo.setOneHourMinTimeOpenSetOneStr(String.format("%02d:%02d", circuitPumpVo.getOneHourTimeOpenSetOne(), circuitPumpVo.getOneMinTimeOpenSetOne())); |
|
|
|
|
circuitPumpVo.setOneHourMinTimeCloseSetOneStr(String.format("%02d:%02d", circuitPumpVo.getOneHourTimeCloseSetOne(), circuitPumpVo.getOneMinTimeCloseSetOne())); |
|
|
|
|
} |
|
|
|
|
return circuitPumpVo; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private ElecValveControlVO createElectricValveControlVO(Map.Entry<String, List<HotWaterControlListVO>> dlEntry, List<HotWaterControlListVO> dlItems, HotWaterControlDTO parentDto) { |
|
|
|
|
ElecValveControlVO circuitPumpVo = new ElecValveControlVO(); |
|
|
|
|
setupBasicDeviceInfo(circuitPumpVo, dlEntry, dlItems, parentDto); |
|
|
|
|
|
|
|
|
|
dlItems.forEach(item -> { |
|
|
|
|
switch (item.getParamTypeId()) { |
|
|
|
|
case "1": |
|
|
|
|
// 启停控制
|
|
|
|
|
circuitPumpVo.setStartStopControl(item.getCurValue().intValue()); |
|
|
|
|
circuitPumpVo.setStartStopControlId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "2": |
|
|
|
|
// 运行状态
|
|
|
|
|
circuitPumpVo.setRunState(item.getCurValue().intValue()); |
|
|
|
|
circuitPumpVo.setRunStateId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "3": |
|
|
|
|
// 故障状态
|
|
|
|
|
circuitPumpVo.setFault(item.getCurValue().intValue()); |
|
|
|
|
circuitPumpVo.setFaultId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "4": |
|
|
|
|
// 时控
|
|
|
|
|
handleTimeParameters(circuitPumpVo, item); |
|
|
|
|
break; |
|
|
|
|
case "8": |
|
|
|
|
// 温差
|
|
|
|
|
circuitPumpVo.setTempDiff(item.getCurValue()); |
|
|
|
|
circuitPumpVo.setTempDiffId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "9": |
|
|
|
|
// 温差设置
|
|
|
|
|
circuitPumpVo.setTempDiffSet(item.getCurValue()); |
|
|
|
|
circuitPumpVo.setTempDiffSetId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "15": |
|
|
|
|
// 开延时时间
|
|
|
|
|
circuitPumpVo.setOpenDelayTime(item.getCurValue().intValue()); |
|
|
|
|
circuitPumpVo.setOpenDelayTimeId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "16": |
|
|
|
|
// 累计运行时间
|
|
|
|
|
if (item.getOtherName().contains("小时")) { |
|
|
|
|
circuitPumpVo.setRunTime(item.getCurValue()); |
|
|
|
|
circuitPumpVo.setRunTimeId(item.getCpmId()); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case "21": |
|
|
|
|
// 一键启动
|
|
|
|
|
circuitPumpVo.setStartOneKey(item.getCurValue().intValue()); |
|
|
|
|
circuitPumpVo.setStartOneKeyId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "22": |
|
|
|
|
// 手动自动切换
|
|
|
|
|
circuitPumpVo.setManualAutoSwitch(item.getCurValue().intValue()); |
|
|
|
|
circuitPumpVo.setManualAutoSwitchId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
if (circuitPumpVo.getOneHourTimeOpenSetOneId() != null |
|
|
|
|
&& circuitPumpVo.getOneHourTimeCloseSetOneId() != null |
|
|
|
|
&& circuitPumpVo.getOneMinTimeOpenSetOneId() != null |
|
|
|
|
&& circuitPumpVo.getOneMinTimeCloseSetOneId() != null) { |
|
|
|
|
// 设置时分开写入oneHourMinTimeOpenSetOneStr,oneHourMinTimeCloseSetOneStr
|
|
|
|
|
circuitPumpVo.setOneHourMinTimeOpenSetOneStr(String.format("%02d:%02d", circuitPumpVo.getOneHourTimeOpenSetOne(), circuitPumpVo.getOneMinTimeOpenSetOne())); |
|
|
|
|
circuitPumpVo.setOneHourMinTimeCloseSetOneStr(String.format("%02d:%02d", circuitPumpVo.getOneHourTimeCloseSetOne(), circuitPumpVo.getOneMinTimeCloseSetOne())); |
|
|
|
|
} |
|
|
|
|
return circuitPumpVo; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private HotWaterSupplyPumpControlVO createSupplyPumpControlVO( |
|
|
|
|
Map.Entry<String, List<HotWaterControlListVO>> dlEntry, |
|
|
|
|
List<HotWaterControlListVO> dlItems, |
|
|
|
|
@ -385,7 +662,7 @@ public class CollectionParamsManageServiceImpl implements CollectionParamsManage
|
|
|
|
|
break; |
|
|
|
|
case "4": |
|
|
|
|
// 时控
|
|
|
|
|
handleSupplyPumpTimeParameters(supplyPumpVo, item); |
|
|
|
|
handleTimeParameters(supplyPumpVo, item); |
|
|
|
|
break; |
|
|
|
|
case "7": |
|
|
|
|
// 温度设置
|
|
|
|
|
@ -394,8 +671,17 @@ public class CollectionParamsManageServiceImpl implements CollectionParamsManage
|
|
|
|
|
break; |
|
|
|
|
case "15": |
|
|
|
|
// 时间
|
|
|
|
|
supplyPumpVo.setOpenDelayTime(item.getCurValue().intValue()); |
|
|
|
|
supplyPumpVo.setOpenDelayTimeId(item.getCpmId()); |
|
|
|
|
// 判断是否是加延时
|
|
|
|
|
if (item.getOtherName().contains("加")) { |
|
|
|
|
supplyPumpVo.setAddPumpDelayTimeSet(item.getCurValue()); |
|
|
|
|
supplyPumpVo.setAddPumpDelayTimeSetId(item.getCpmId()); |
|
|
|
|
} else if (item.getOtherName().contains("减")) { |
|
|
|
|
supplyPumpVo.setReducePumpDelayTimeSet(item.getCurValue()); |
|
|
|
|
supplyPumpVo.setReducePumpDelayTimeSetId(item.getCpmId()); |
|
|
|
|
} else { |
|
|
|
|
supplyPumpVo.setOpenDelayTime(item.getCurValue().intValue()); |
|
|
|
|
supplyPumpVo.setOpenDelayTimeId(item.getCpmId()); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case "16": |
|
|
|
|
// 累积运行时间
|
|
|
|
|
@ -410,9 +696,15 @@ public class CollectionParamsManageServiceImpl implements CollectionParamsManage
|
|
|
|
|
supplyPumpVo.setStartOneKeyId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "22": |
|
|
|
|
// 手动自动切换
|
|
|
|
|
supplyPumpVo.setManualAutoSwitch(item.getCurValue().intValue()); |
|
|
|
|
supplyPumpVo.setManualAutoSwitchId(item.getCpmId()); |
|
|
|
|
// 判断是不是频率手自动
|
|
|
|
|
if (item.getOtherName().contains("频率")) { |
|
|
|
|
supplyPumpVo.setFrequencyManualAutoSwitch(item.getCurValue().intValue()); |
|
|
|
|
supplyPumpVo.setFrequencyManualAutoSwitchId(item.getCpmId()); |
|
|
|
|
} else { |
|
|
|
|
// 手动自动切换
|
|
|
|
|
supplyPumpVo.setManualAutoSwitch(item.getCurValue().intValue()); |
|
|
|
|
supplyPumpVo.setManualAutoSwitchId(item.getCpmId()); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case "25": |
|
|
|
|
// 两台回水泵启动
|
|
|
|
|
@ -429,6 +721,46 @@ public class CollectionParamsManageServiceImpl implements CollectionParamsManage
|
|
|
|
|
supplyPumpVo.setTempSetLowerLimit(item.getCurValue()); |
|
|
|
|
supplyPumpVo.setTempSetLowerLimitId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "32": |
|
|
|
|
// 压力设置
|
|
|
|
|
supplyPumpVo.setPressureSet(item.getCurValue()); |
|
|
|
|
supplyPumpVo.setPressureSetId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "34": |
|
|
|
|
// 压差设置
|
|
|
|
|
if (item.getOtherName().contains("加")) { |
|
|
|
|
supplyPumpVo.setAddPumpPressureSet(item.getCurValue()); |
|
|
|
|
supplyPumpVo.setAddPumpPressureSetId(item.getCpmId()); |
|
|
|
|
} else if (item.getOtherName().contains("减")) { |
|
|
|
|
supplyPumpVo.setReducePumpPressureSet(item.getCurValue()); |
|
|
|
|
supplyPumpVo.setReducePumpPressureSetId(item.getCpmId()); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case "36": |
|
|
|
|
// 频率设置
|
|
|
|
|
supplyPumpVo.setFrequencyManualSet(item.getCurValue()); |
|
|
|
|
supplyPumpVo.setFrequencyManualSetId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "39": |
|
|
|
|
// 水箱液位设置
|
|
|
|
|
if (item.getOtherName().contains("单箱")) { |
|
|
|
|
supplyPumpVo.setSingleBoxLevelSet(item.getCurValue().intValue()); |
|
|
|
|
supplyPumpVo.setSingleBoxLevelSetId(item.getCpmId()); |
|
|
|
|
} else if (item.getOtherName().contains("多箱")) { |
|
|
|
|
supplyPumpVo.setMultiBoxLevelSet(item.getCurValue().intValue()); |
|
|
|
|
supplyPumpVo.setMultiBoxLevelSetId(item.getCpmId()); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case "40": |
|
|
|
|
// 压差设置
|
|
|
|
|
if (item.getOtherName().contains("加")) { |
|
|
|
|
supplyPumpVo.setAddPumpErrorSet(item.getCurValue()); |
|
|
|
|
supplyPumpVo.setAddPumpErrorSetId(item.getCpmId()); |
|
|
|
|
} else if (item.getOtherName().contains("减")) { |
|
|
|
|
supplyPumpVo.setReducePumpErrorSet(item.getCurValue()); |
|
|
|
|
supplyPumpVo.setReducePumpErrorSetId(item.getCpmId()); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
@ -460,50 +792,51 @@ public class CollectionParamsManageServiceImpl implements CollectionParamsManage
|
|
|
|
|
return supplyPumpVo; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void handleSupplyPumpTimeParameters(HotWaterSupplyPumpControlVO backPumpVo, HotWaterControlListVO item) { |
|
|
|
|
private <T extends TimeControlVO> void handleTimeParameters(T vo, HotWaterControlListVO item) { |
|
|
|
|
String otherName = item.getOtherName(); |
|
|
|
|
int value = item.getCurValue().intValue(); |
|
|
|
|
String cpmId = item.getCpmId(); |
|
|
|
|
|
|
|
|
|
if (otherName.contains("定时_时开1")) { |
|
|
|
|
backPumpVo.setOneHourTimeOpenSetOne(value); |
|
|
|
|
backPumpVo.setOneHourTimeOpenSetOneId(cpmId); |
|
|
|
|
vo.setOneHourTimeOpenSetOne(value); |
|
|
|
|
vo.setOneHourTimeOpenSetOneId(cpmId); |
|
|
|
|
} else if (otherName.contains("定时_时关1")) { |
|
|
|
|
backPumpVo.setOneHourTimeCloseSetOne(value); |
|
|
|
|
backPumpVo.setOneHourTimeCloseSetOneId(cpmId); |
|
|
|
|
vo.setOneHourTimeCloseSetOne(value); |
|
|
|
|
vo.setOneHourTimeCloseSetOneId(cpmId); |
|
|
|
|
} else if (otherName.contains("定时_分开1")) { |
|
|
|
|
backPumpVo.setOneMinTimeOpenSetOne(value); |
|
|
|
|
backPumpVo.setOneMinTimeOpenSetOneId(cpmId); |
|
|
|
|
vo.setOneMinTimeOpenSetOne(value); |
|
|
|
|
vo.setOneMinTimeOpenSetOneId(cpmId); |
|
|
|
|
} else if (otherName.contains("定时_分关1")) { |
|
|
|
|
backPumpVo.setOneMinTimeCloseSetOne(value); |
|
|
|
|
backPumpVo.setOneMinTimeCloseSetOneId(cpmId); |
|
|
|
|
vo.setOneMinTimeCloseSetOne(value); |
|
|
|
|
vo.setOneMinTimeCloseSetOneId(cpmId); |
|
|
|
|
} else if (otherName.contains("定时_时开2")) { |
|
|
|
|
backPumpVo.setOneHourTimeOpenSetTwo(value); |
|
|
|
|
backPumpVo.setOneHourTimeOpenSetTwoId(cpmId); |
|
|
|
|
vo.setOneHourTimeOpenSetTwo(value); |
|
|
|
|
vo.setOneHourTimeOpenSetTwoId(cpmId); |
|
|
|
|
} else if (otherName.contains("定时_时关2")) { |
|
|
|
|
backPumpVo.setOneHourTimeCloseSetTwo(value); |
|
|
|
|
backPumpVo.setOneHourTimeCloseSetTwoId(cpmId); |
|
|
|
|
vo.setOneHourTimeCloseSetTwo(value); |
|
|
|
|
vo.setOneHourTimeCloseSetTwoId(cpmId); |
|
|
|
|
} else if (otherName.contains("定时_分开2")) { |
|
|
|
|
backPumpVo.setOneMinTimeOpenSetTwo(value); |
|
|
|
|
backPumpVo.setOneMinTimeOpenSetTwoId(cpmId); |
|
|
|
|
vo.setOneMinTimeOpenSetTwo(value); |
|
|
|
|
vo.setOneMinTimeOpenSetTwoId(cpmId); |
|
|
|
|
} else if (otherName.contains("定时_分关2")) { |
|
|
|
|
backPumpVo.setOneMinTimeCloseSetTwo(value); |
|
|
|
|
backPumpVo.setOneMinTimeCloseSetTwoId(cpmId); |
|
|
|
|
vo.setOneMinTimeCloseSetTwo(value); |
|
|
|
|
vo.setOneMinTimeCloseSetTwoId(cpmId); |
|
|
|
|
} else if (otherName.contains("定时_时开3")) { |
|
|
|
|
backPumpVo.setOneHourTimeOpenSetThree(value); |
|
|
|
|
backPumpVo.setOneHourTimeOpenSetThreeId(cpmId); |
|
|
|
|
vo.setOneHourTimeOpenSetThree(value); |
|
|
|
|
vo.setOneHourTimeOpenSetThreeId(cpmId); |
|
|
|
|
} else if (otherName.contains("定时_时关3")) { |
|
|
|
|
backPumpVo.setOneHourTimeCloseSetThree(value); |
|
|
|
|
backPumpVo.setOneHourTimeCloseSetThreeId(cpmId); |
|
|
|
|
vo.setOneHourTimeCloseSetThree(value); |
|
|
|
|
vo.setOneHourTimeCloseSetThreeId(cpmId); |
|
|
|
|
} else if (otherName.contains("定时_分开3")) { |
|
|
|
|
backPumpVo.setOneMinTimeOpenSetThree(value); |
|
|
|
|
backPumpVo.setOneMinTimeOpenSetThreeId(cpmId); |
|
|
|
|
vo.setOneMinTimeOpenSetThree(value); |
|
|
|
|
vo.setOneMinTimeOpenSetThreeId(cpmId); |
|
|
|
|
} else if (otherName.contains("定时_分关3")) { |
|
|
|
|
backPumpVo.setOneMinTimeCloseSetThree(value); |
|
|
|
|
backPumpVo.setOneMinTimeCloseSetThreeId(cpmId); |
|
|
|
|
vo.setOneMinTimeCloseSetThree(value); |
|
|
|
|
vo.setOneMinTimeCloseSetThreeId(cpmId); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private HotWaterSystemControlVO createSystemControlVO( |
|
|
|
|
Map.Entry<String, List<HotWaterControlListVO>> dlEntry, |
|
|
|
|
List<HotWaterControlListVO> dlItems, |
|
|
|
|
@ -532,7 +865,7 @@ public class CollectionParamsManageServiceImpl implements CollectionParamsManage
|
|
|
|
|
vo.setPressure(item.getCurValue()); |
|
|
|
|
vo.setPressureId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "27": |
|
|
|
|
case "32": |
|
|
|
|
// 压力设置
|
|
|
|
|
vo.setPressureSet(item.getCurValue().intValue()); |
|
|
|
|
vo.setPressureSetId(item.getCpmId()); |
|
|
|
|
@ -557,7 +890,7 @@ public class CollectionParamsManageServiceImpl implements CollectionParamsManage
|
|
|
|
|
// 时间
|
|
|
|
|
handleSystemTimeParameters(vo, item); |
|
|
|
|
break; |
|
|
|
|
case "26": |
|
|
|
|
case "31": |
|
|
|
|
// 水箱高度和液位
|
|
|
|
|
if (item.getOtherName().contains("单箱液位")) { |
|
|
|
|
vo.setSingleBoxLevel(item.getCurValue().intValue()); |
|
|
|
|
@ -1146,6 +1479,13 @@ public class CollectionParamsManageServiceImpl implements CollectionParamsManage
|
|
|
|
|
deviceCalibrationVo.setCalibrationValue(item.getCurValue()); |
|
|
|
|
deviceCalibrationVo.setCalibrationValueId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
case "5": |
|
|
|
|
case "6": |
|
|
|
|
case "31": |
|
|
|
|
// 实时值
|
|
|
|
|
deviceCalibrationVo.setRealTimeValue(item.getCurValue()); |
|
|
|
|
deviceCalibrationVo.setRealTimeValueId(item.getCpmId()); |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|