|
|
|
@ -10,10 +10,7 @@ import com.mh.user.service.CollectionParamsManageService; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.*; |
|
|
|
import java.util.Comparator; |
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
@ -34,6 +31,7 @@ public class CollectionParamsManageServiceImpl implements CollectionParamsManage |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<HotWaterNowDataDTO> monitorList(String buildingId) { |
|
|
|
public List<HotWaterNowDataDTO> monitorList(String buildingId) { |
|
|
|
|
|
|
|
// 查询nowData表中数据
|
|
|
|
return Collections.emptyList(); |
|
|
|
return Collections.emptyList(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -45,36 +43,86 @@ public class CollectionParamsManageServiceImpl implements CollectionParamsManage |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return hotWaterControlListVOS.stream() |
|
|
|
return hotWaterControlListVOS.stream() |
|
|
|
// .peek(vo -> System.out.println(vo.getHiOrderNum()))
|
|
|
|
|
|
|
|
.collect(Collectors.groupingBy(HotWaterControlListVO::getDeviceType)) |
|
|
|
.collect(Collectors.groupingBy(HotWaterControlListVO::getDeviceType)) |
|
|
|
.entrySet().stream() |
|
|
|
.entrySet().stream() |
|
|
|
.map(houseEntry -> { |
|
|
|
.map(this::convertToHotWaterControlDTO) |
|
|
|
|
|
|
|
.sorted(Comparator.comparingInt(HotWaterControlDTO::getOrderNum)) |
|
|
|
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private HotWaterControlDTO convertToHotWaterControlDTO(Map.Entry<String, List<HotWaterControlListVO>> houseEntry) { |
|
|
|
HotWaterControlDTO dto = new HotWaterControlDTO(); |
|
|
|
HotWaterControlDTO dto = new HotWaterControlDTO(); |
|
|
|
dto.setId(houseEntry.getKey()); |
|
|
|
dto.setId(houseEntry.getKey()); |
|
|
|
dto.setName(houseEntry.getValue().get(0).getDeviceType()); |
|
|
|
dto.setName(houseEntry.getValue().get(0).getDeviceType()); |
|
|
|
dto.setOrderNum(houseEntry.getValue().get(0).getCtOrderNum()); |
|
|
|
dto.setOrderNum(houseEntry.getValue().get(0).getCtOrderNum()); |
|
|
|
|
|
|
|
|
|
|
|
List<?> children = houseEntry.getValue().stream() |
|
|
|
// 不需要强制转换,直接使用Object类型
|
|
|
|
|
|
|
|
List<Object> children = houseEntry.getValue().stream() |
|
|
|
.collect(Collectors.groupingBy(HotWaterControlListVO::getDeviceId)) |
|
|
|
.collect(Collectors.groupingBy(HotWaterControlListVO::getDeviceId)) |
|
|
|
.entrySet().stream() |
|
|
|
.entrySet().stream() |
|
|
|
.map(dlEntry -> { |
|
|
|
.map(dlEntry -> createDeviceVO(dlEntry, dto)) |
|
|
|
|
|
|
|
.sorted((obj1, obj2) -> { |
|
|
|
|
|
|
|
// 根据实际对象类型获取orderNum进行排序
|
|
|
|
|
|
|
|
int order1 = getOrderNumFromObject(obj1); |
|
|
|
|
|
|
|
int order2 = getOrderNumFromObject(obj2); |
|
|
|
|
|
|
|
return Integer.compare(order1, order2); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dto.setChildren(children); |
|
|
|
|
|
|
|
return dto; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 辅助方法:从不同的VO对象中获取orderNum
|
|
|
|
|
|
|
|
private int getOrderNumFromObject(Object obj) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
if (obj != null) { |
|
|
|
|
|
|
|
// 使用反射获取orderNum字段
|
|
|
|
|
|
|
|
java.lang.reflect.Method getOrderNumMethod = obj.getClass().getMethod("getOrderNum"); |
|
|
|
|
|
|
|
return (int) getOrderNumMethod.invoke(obj); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
// 如果发生异常,默认返回0
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Object createDeviceVO(Map.Entry<String, List<HotWaterControlListVO>> dlEntry, HotWaterControlDTO parentDto) { |
|
|
|
List<HotWaterControlListVO> dlItems = dlEntry.getValue(); |
|
|
|
List<HotWaterControlListVO> dlItems = dlEntry.getValue(); |
|
|
|
switch (dto.getName()) { |
|
|
|
String deviceTypeName = parentDto.getName(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch (deviceTypeName) { |
|
|
|
case "系统": |
|
|
|
case "系统": |
|
|
|
HotWaterSystemControlVO vo = new HotWaterSystemControlVO(); |
|
|
|
return createSystemControlVO(dlEntry, dlItems, parentDto); |
|
|
|
vo.setId(dlEntry.getKey()); |
|
|
|
case "热泵": |
|
|
|
if (StringUtils.isBlank(dlItems.get(0).getDeviceName())) { |
|
|
|
return createHotPumpControlVO(dlEntry, dlItems, parentDto); |
|
|
|
// 如果设备名称为空,则使用房间号
|
|
|
|
case "循环泵": |
|
|
|
vo.setName(dto.getName()); |
|
|
|
return createCircuitPumpControlVO(dlEntry, dlItems, parentDto); |
|
|
|
} else { |
|
|
|
case "回水泵": |
|
|
|
vo.setName(dlItems.get(0).getDeviceName()); |
|
|
|
return createBackPumpControlVO(dlEntry, dlItems, parentDto); |
|
|
|
|
|
|
|
case "设备校准": |
|
|
|
|
|
|
|
return createDeviceCalibrationControlVO(dlEntry, dlItems, parentDto); |
|
|
|
|
|
|
|
case "电表": |
|
|
|
|
|
|
|
case "水表": |
|
|
|
|
|
|
|
return createDeviceControlVO(dlEntry, dlItems, parentDto); |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
vo.setOrderNum(dlItems.get(0).getDlOrderNum()); |
|
|
|
|
|
|
|
// 单独对系统参数
|
|
|
|
private HotWaterSystemControlVO createSystemControlVO( |
|
|
|
|
|
|
|
Map.Entry<String, List<HotWaterControlListVO>> dlEntry, |
|
|
|
|
|
|
|
List<HotWaterControlListVO> dlItems, |
|
|
|
|
|
|
|
HotWaterControlDTO parentDto) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HotWaterSystemControlVO vo = new HotWaterSystemControlVO(); |
|
|
|
|
|
|
|
setupBasicDeviceInfo(vo, dlEntry, dlItems, parentDto); |
|
|
|
|
|
|
|
|
|
|
|
dlItems.forEach(item -> { |
|
|
|
dlItems.forEach(item -> { |
|
|
|
switch (item.getParamTypeId()) { |
|
|
|
switch (item.getParamTypeId()) { |
|
|
|
case "1": |
|
|
|
case "1": |
|
|
|
// 启用写入时间
|
|
|
|
// 时间写入控制
|
|
|
|
vo.setTimeSet(item.getCurValue().intValue()); |
|
|
|
vo.setTimeSet(item.getCurValue().intValue()); |
|
|
|
vo.setTimeSetId(item.getCpmId()); |
|
|
|
vo.setTimeSetId(item.getCpmId()); |
|
|
|
break; |
|
|
|
break; |
|
|
|
@ -84,6 +132,7 @@ public class CollectionParamsManageServiceImpl implements CollectionParamsManage |
|
|
|
vo.setPressureId(item.getCpmId()); |
|
|
|
vo.setPressureId(item.getCpmId()); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "6": |
|
|
|
case "6": |
|
|
|
|
|
|
|
case "12": |
|
|
|
// 回水温度
|
|
|
|
// 回水温度
|
|
|
|
vo.setInTemp(item.getCurValue()); |
|
|
|
vo.setInTemp(item.getCurValue()); |
|
|
|
vo.setInTempId(item.getCpmId()); |
|
|
|
vo.setInTempId(item.getCpmId()); |
|
|
|
@ -93,209 +142,284 @@ public class CollectionParamsManageServiceImpl implements CollectionParamsManage |
|
|
|
vo.setTankTemp(item.getCurValue()); |
|
|
|
vo.setTankTemp(item.getCurValue()); |
|
|
|
vo.setTankTempId(item.getCpmId()); |
|
|
|
vo.setTankTempId(item.getCpmId()); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "19": |
|
|
|
case "20": |
|
|
|
// 太阳能温度
|
|
|
|
// 太阳能温度
|
|
|
|
vo.setSolarTemp(item.getCurValue()); |
|
|
|
vo.setSolarTemp(item.getCurValue()); |
|
|
|
vo.setSolarTempId(item.getCpmId()); |
|
|
|
vo.setSolarTempId(item.getCpmId()); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "15": |
|
|
|
case "15": |
|
|
|
// 时间
|
|
|
|
// 时间
|
|
|
|
if ("年_读".equals(item.getOtherName())) { |
|
|
|
handleSystemTimeParameters(vo, item); |
|
|
|
vo.setYearTimeRead(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
vo.setYearTimeReadId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if ("月_读".equals(item.getOtherName())) { |
|
|
|
|
|
|
|
vo.setMonthTimeRead(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
vo.setMonthTimeReadId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if ("日_读".equals(item.getOtherName())) { |
|
|
|
|
|
|
|
vo.setDayTimeRead(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
vo.setDayTimeReadId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if ("时_读".equals(item.getOtherName())) { |
|
|
|
|
|
|
|
vo.setHourTimeRead(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
vo.setHourTimeReadId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if ("分_读".equals(item.getOtherName())) { |
|
|
|
|
|
|
|
vo.setMinTimeRead(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
vo.setMinTimeReadId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if ("秒_读".equals(item.getOtherName())) { |
|
|
|
|
|
|
|
vo.setSTimeSet(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
vo.setSTimeSetId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if ("年_写".equals(item.getOtherName())) { |
|
|
|
|
|
|
|
vo.setYearTimeSet(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
vo.setYearTimeSetId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if ("月_写".equals(item.getOtherName())) { |
|
|
|
|
|
|
|
vo.setMonthTimeSet(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
vo.setMonthTimeSetId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if ("日_写".equals(item.getOtherName())) { |
|
|
|
|
|
|
|
vo.setDayTimeSet(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
vo.setDayTimeSetId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if ("时_写".equals(item.getOtherName())) { |
|
|
|
|
|
|
|
vo.setHourTimeSet(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
vo.setHourTimeSetId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if ("分_写".equals(item.getOtherName())) { |
|
|
|
|
|
|
|
vo.setMinTimeSet(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
vo.setMinTimeSetId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if ("秒_写".equals(item.getOtherName())) { |
|
|
|
|
|
|
|
vo.setSTimeSet(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
vo.setSTimeSetId(item.getCpmId()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
// 开始组装时间,写入plcTime
|
|
|
|
|
|
|
|
vo.setPlcTime(getPlcTime(vo)); |
|
|
|
return vo; |
|
|
|
return vo; |
|
|
|
case "热泵": |
|
|
|
|
|
|
|
HotWaterHotPumpControlVO hotPumpVo = new HotWaterHotPumpControlVO(); // 修改类名
|
|
|
|
|
|
|
|
hotPumpVo.setId(dlEntry.getKey()); |
|
|
|
|
|
|
|
if (StringUtils.isBlank(dlItems.get(0).getDeviceName())) { |
|
|
|
|
|
|
|
// 如果设备名称为空,则使用房间号
|
|
|
|
|
|
|
|
hotPumpVo.setName(dto.getName()); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
hotPumpVo.setName(dlItems.get(0).getDeviceName()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
hotPumpVo.setOrderNum(dlItems.get(0).getDlOrderNum()); |
|
|
|
|
|
|
|
// 判断只有存在一个故障点,那么当前设备就是故障
|
|
|
|
private String getPlcTime(HotWaterSystemControlVO vo) { |
|
|
|
if (dlItems.stream().anyMatch(item -> ("3".equals(item.getParamTypeId()) && "1".equals(item.getCurValue().toString())))) { |
|
|
|
return String.format("%04d-%02d-%02d %02d:%02d:%02d", |
|
|
|
hotPumpVo.setFault(1); // 去除pump前缀
|
|
|
|
vo.getYearTimeRead(), vo.getMonthTimeRead(), vo.getDayTimeRead(), |
|
|
|
|
|
|
|
vo.getHourTimeRead(), vo.getMinTimeRead(), vo.getScTimeRead()); |
|
|
|
} |
|
|
|
} |
|
|
|
// 单独对系统参数
|
|
|
|
|
|
|
|
|
|
|
|
private void handleSystemTimeParameters(HotWaterSystemControlVO vo, HotWaterControlListVO item) { |
|
|
|
|
|
|
|
String otherName = item.getOtherName(); |
|
|
|
|
|
|
|
int value = item.getCurValue().intValue(); |
|
|
|
|
|
|
|
String cpmId = item.getCpmId(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch (otherName) { |
|
|
|
|
|
|
|
case "年_读": |
|
|
|
|
|
|
|
vo.setYearTimeRead(Integer.parseInt("20" + value)); |
|
|
|
|
|
|
|
vo.setYearTimeReadId(cpmId); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "月_读": |
|
|
|
|
|
|
|
vo.setMonthTimeRead(value); |
|
|
|
|
|
|
|
vo.setMonthTimeReadId(cpmId); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "日_读": |
|
|
|
|
|
|
|
vo.setDayTimeRead(value); |
|
|
|
|
|
|
|
vo.setDayTimeReadId(cpmId); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "时_读": |
|
|
|
|
|
|
|
vo.setHourTimeRead(value); |
|
|
|
|
|
|
|
vo.setHourTimeReadId(cpmId); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "分_读": |
|
|
|
|
|
|
|
vo.setMinTimeRead(value); |
|
|
|
|
|
|
|
vo.setMinTimeReadId(cpmId); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "秒_读": |
|
|
|
|
|
|
|
vo.setScTimeRead(value); |
|
|
|
|
|
|
|
vo.setScTimeReadId(cpmId); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "秒_写": |
|
|
|
|
|
|
|
vo.setScTimeSet(value); |
|
|
|
|
|
|
|
vo.setScTimeSetId(cpmId); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "年_写": |
|
|
|
|
|
|
|
vo.setYearTimeSet(Integer.parseInt("20" + value)); |
|
|
|
|
|
|
|
vo.setYearTimeSetId(cpmId); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "月_写": |
|
|
|
|
|
|
|
vo.setMonthTimeSet(value); |
|
|
|
|
|
|
|
vo.setMonthTimeSetId(cpmId); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "日_写": |
|
|
|
|
|
|
|
vo.setDayTimeSet(value); |
|
|
|
|
|
|
|
vo.setDayTimeSetId(cpmId); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "时_写": |
|
|
|
|
|
|
|
vo.setHourTimeSet(value); |
|
|
|
|
|
|
|
vo.setHourTimeSetId(cpmId); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "分_写": |
|
|
|
|
|
|
|
vo.setMinTimeSet(value); |
|
|
|
|
|
|
|
vo.setMinTimeSetId(cpmId); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private HotWaterHotPumpControlVO createHotPumpControlVO( |
|
|
|
|
|
|
|
Map.Entry<String, List<HotWaterControlListVO>> dlEntry, |
|
|
|
|
|
|
|
List<HotWaterControlListVO> dlItems, |
|
|
|
|
|
|
|
HotWaterControlDTO parentDto) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HotWaterHotPumpControlVO hotPumpVo = new HotWaterHotPumpControlVO(); |
|
|
|
|
|
|
|
setupBasicDeviceInfo(hotPumpVo, dlEntry, dlItems, parentDto); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 判断故障状态
|
|
|
|
|
|
|
|
if (dlItems.stream().anyMatch(item -> |
|
|
|
|
|
|
|
"3".equals(item.getParamTypeId()) && "1".equals(item.getCurValue().toString()))) { |
|
|
|
|
|
|
|
hotPumpVo.setFault(1); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
dlItems.forEach(item -> { |
|
|
|
dlItems.forEach(item -> { |
|
|
|
switch (item.getParamTypeId()) { |
|
|
|
switch (item.getParamTypeId()) { |
|
|
|
case "4": |
|
|
|
case "4": |
|
|
|
// 定时开关
|
|
|
|
// 时控
|
|
|
|
if (item.getOtherName().contains("12定时_时开1")) { |
|
|
|
handleHotPumpTimeParameters(hotPumpVo, item); |
|
|
|
hotPumpVo.setOneHourTimeOpenSetOne(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
hotPumpVo.setOneHourTimeOpenSetOneId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("12定时_时关1")) { |
|
|
|
|
|
|
|
hotPumpVo.setOneHourTimeCloseSetOne(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
hotPumpVo.setOneHourTimeCloseSetOneId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("12定时_时开2")) { |
|
|
|
|
|
|
|
hotPumpVo.setOneHourTimeOpenSetTwo(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
hotPumpVo.setOneHourTimeOpenSetTwoId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("12定时_时关2")) { |
|
|
|
|
|
|
|
hotPumpVo.setOneHourTimeCloseSetTwo(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
hotPumpVo.setOneHourTimeCloseSetTwoId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("12定时_时开3")) { |
|
|
|
|
|
|
|
hotPumpVo.setOneHourTimeOpenSetThree(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
hotPumpVo.setOneHourTimeOpenSetThreeId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("12定时_时关3")) { |
|
|
|
|
|
|
|
hotPumpVo.setOneHourTimeCloseSetThree(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
hotPumpVo.setOneHourTimeCloseSetThreeId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("12定时_分开1")) { // 新增分钟设置
|
|
|
|
|
|
|
|
hotPumpVo.setOneMinTimeOpenSetOne(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
hotPumpVo.setOneMinTimeOpenSetOneId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("12定时_分关1")) { // 新增分钟设置
|
|
|
|
|
|
|
|
hotPumpVo.setOneMinTimeCloseSetOne(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
hotPumpVo.setOneMinTimeCloseSetOneId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("12定时_分开2")) { // 新增分钟设置
|
|
|
|
|
|
|
|
hotPumpVo.setOneMinTimeOpenSetTwo(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
hotPumpVo.setOneMinTimeOpenSetTwoId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("12定时_分关2")) { // 新增分钟设置
|
|
|
|
|
|
|
|
hotPumpVo.setOneMinTimeCloseSetTwo(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
hotPumpVo.setOneMinTimeCloseSetTwoId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("12定时_分开3")) { // 新增分钟设置
|
|
|
|
|
|
|
|
hotPumpVo.setOneMinTimeOpenSetThree(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
hotPumpVo.setOneMinTimeOpenSetThreeId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("12定时_分关3")) { // 新增分钟设置
|
|
|
|
|
|
|
|
hotPumpVo.setOneMinTimeCloseSetThree(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
hotPumpVo.setOneMinTimeCloseSetThreeId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("34定时_时开1")) { |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourTimeOpenSetOne(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourTimeOpenSetOneId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("34定时_时关1")) { |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourTimeCloseSetOne(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourTimeCloseSetOneId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("34定时_时开2")) { |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourTimeOpenSetTwo(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourTimeOpenSetTwoId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("34定时_时关2")) { |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourTimeCloseSetTwo(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourTimeCloseSetTwoId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("34定时_时开3")) { |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourTimeOpenSetThree(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourTimeOpenSetThreeId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("34定时_时关3")) { |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourTimeCloseSetThree(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourTimeCloseSetThreeId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("34定时_分开1")) { // 新增分钟设置
|
|
|
|
|
|
|
|
hotPumpVo.setTwoMinTimeOpenSetOne(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
hotPumpVo.setTwoMinTimeOpenSetOneId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("34定时_分关1")) { // 新增分钟设置
|
|
|
|
|
|
|
|
hotPumpVo.setTwoMinTimeCloseSetOne(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
hotPumpVo.setTwoMinTimeCloseSetOneId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("34定时_分开2")) { // 新增分钟设置
|
|
|
|
|
|
|
|
hotPumpVo.setTwoMinTimeOpenSetTwo(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
hotPumpVo.setTwoMinTimeOpenSetTwoId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("34定时_分关2")) { // 新增分钟设置
|
|
|
|
|
|
|
|
hotPumpVo.setTwoMinTimeCloseSetTwo(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
hotPumpVo.setTwoMinTimeCloseSetTwoId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("34定时_分开3")) { // 新增分钟设置
|
|
|
|
|
|
|
|
hotPumpVo.setTwoMinTimeOpenSetThree(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
hotPumpVo.setTwoMinTimeOpenSetThreeId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("34定时_分关3")) { // 新增分钟设置
|
|
|
|
|
|
|
|
hotPumpVo.setTwoMinTimeCloseSetThree(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
hotPumpVo.setTwoMinTimeCloseSetThreeId(item.getCpmId()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
case "1": |
|
|
|
case "1": |
|
|
|
// 启停控制
|
|
|
|
// 启停控制
|
|
|
|
hotPumpVo.setStartStopControl(item.getCurValue().intValue()); // 去除pump前缀
|
|
|
|
if (item.getOtherName().equals("12")) { |
|
|
|
hotPumpVo.setStartStopControlId(item.getCpmId()); // 去除pump前缀
|
|
|
|
hotPumpVo.setStartStopControlOne(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
hotPumpVo.setStartStopControlOneId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().equals("34")) { |
|
|
|
|
|
|
|
hotPumpVo.setStartStopControlTwo(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
hotPumpVo.setStartStopControlTwoId(item.getCpmId()); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
hotPumpVo.setStartStopControl(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
hotPumpVo.setStartStopControlId(item.getCpmId()); |
|
|
|
|
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "2": |
|
|
|
case "2": |
|
|
|
// 运行状态
|
|
|
|
// 运行状态
|
|
|
|
hotPumpVo.setRunState(item.getCurValue().intValue()); // 去除pump前缀
|
|
|
|
hotPumpVo.setRunState(item.getCurValue().intValue()); |
|
|
|
hotPumpVo.setRunStateId(item.getCpmId()); // 去除pump前缀
|
|
|
|
hotPumpVo.setRunStateId(item.getCpmId()); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "10": |
|
|
|
case "10": |
|
|
|
// 水箱温度
|
|
|
|
// 水箱温度
|
|
|
|
hotPumpVo.setTankTemp(item.getCurValue()); // 去除pump前缀
|
|
|
|
hotPumpVo.setTankTemp(item.getCurValue()); |
|
|
|
hotPumpVo.setTankTempId(item.getCpmId()); // 去除pump前缀
|
|
|
|
hotPumpVo.setTankTempId(item.getCpmId()); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "11": |
|
|
|
case "11": |
|
|
|
// 出水温度
|
|
|
|
// 出水温度
|
|
|
|
hotPumpVo.setOutWaterTemp(item.getCurValue()); // 去除pump前缀
|
|
|
|
hotPumpVo.setOutWaterTemp(item.getCurValue()); |
|
|
|
hotPumpVo.setOutWaterTempId(item.getCpmId()); // 去除pump前缀
|
|
|
|
hotPumpVo.setOutWaterTempId(item.getCpmId()); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "12": |
|
|
|
case "12": |
|
|
|
// 回水温度
|
|
|
|
/// 回水温度
|
|
|
|
hotPumpVo.setInWaterTemp(item.getCurValue()); // 去除pump前缀
|
|
|
|
hotPumpVo.setInWaterTemp(item.getCurValue()); |
|
|
|
hotPumpVo.setInWaterTempId(item.getCpmId()); // 去除pump前缀
|
|
|
|
hotPumpVo.setInWaterTempId(item.getCpmId()); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "16": |
|
|
|
case "16": |
|
|
|
// 累计运行时间
|
|
|
|
// 累积运行时间
|
|
|
|
hotPumpVo.setRunTime(item.getCurValue()); // 去除pump前缀
|
|
|
|
hotPumpVo.setRunTime(item.getCurValue()); |
|
|
|
hotPumpVo.setRunTimeId(item.getCpmId()); // 去除pump前缀
|
|
|
|
hotPumpVo.setRunTimeId(item.getCpmId()); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "17": |
|
|
|
case "17": |
|
|
|
// 开机
|
|
|
|
// 开
|
|
|
|
hotPumpVo.setStart(item.getCurValue().toString()); // 去除pump前缀
|
|
|
|
hotPumpVo.setStart(item.getCurValue().toString()); |
|
|
|
hotPumpVo.setStartId(item.getCpmId()); // 去除pump前缀
|
|
|
|
hotPumpVo.setStartId(item.getCpmId()); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "18": |
|
|
|
case "18": |
|
|
|
// 关机
|
|
|
|
// 关
|
|
|
|
hotPumpVo.setStop(item.getCurValue().toString()); // 去除pump前缀
|
|
|
|
hotPumpVo.setStop(item.getCurValue().toString()); |
|
|
|
hotPumpVo.setStopId(item.getCpmId()); // 去除pump前缀
|
|
|
|
hotPumpVo.setStopId(item.getCpmId()); |
|
|
|
break; |
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
// 开始拼接时间,写入oneHourMinTimeOpenSetOneStr等时间参数
|
|
|
|
|
|
|
|
if (hotPumpVo.getOneHourTimeOpenSetOneId() != null && hotPumpVo.getOneMinTimeCloseSetOneId() != null) { |
|
|
|
|
|
|
|
hotPumpVo.setOneHourMinTimeOpenSetOneStr(String.format("%02d:%02d", hotPumpVo.getOneHourTimeOpenSetOne(), hotPumpVo.getOneMinTimeOpenSetOne())); |
|
|
|
|
|
|
|
hotPumpVo.setOneHourMinTimeCloseSetOneStr(String.format("%02d:%02d", hotPumpVo.getOneHourTimeCloseSetOne(), hotPumpVo.getOneMinTimeCloseSetOne())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (hotPumpVo.getTwoHourTimeOpenSetOneId() != null && hotPumpVo.getTwoMinTimeCloseSetOneId() != null) { |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourMinTimeOpenSetOneStr(String.format("%02d:%02d", hotPumpVo.getTwoHourTimeOpenSetOne(), hotPumpVo.getTwoMinTimeOpenSetOne())); |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourMinTimeCloseSetOneStr(String.format("%02d:%02d", hotPumpVo.getTwoHourTimeCloseSetOne(), hotPumpVo.getTwoMinTimeCloseSetOne())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (hotPumpVo.getOneHourTimeOpenSetTwoId() != null && hotPumpVo.getOneMinTimeCloseSetTwoId() != null) { |
|
|
|
|
|
|
|
hotPumpVo.setOneHourMinTimeOpenSetTwoStr(String.format("%02d:%02d", hotPumpVo.getOneHourTimeOpenSetTwo(), hotPumpVo.getOneMinTimeOpenSetTwo())); |
|
|
|
|
|
|
|
hotPumpVo.setOneHourMinTimeCloseSetTwoStr(String.format("%02d:%02d", hotPumpVo.getOneHourTimeCloseSetTwo(), hotPumpVo.getOneMinTimeCloseSetTwo())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (hotPumpVo.getTwoHourTimeOpenSetTwoId() != null && hotPumpVo.getTwoMinTimeCloseSetTwoId() != null) { |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourMinTimeOpenSetTwoStr(String.format("%02d:%02d", hotPumpVo.getTwoHourTimeOpenSetTwo(), hotPumpVo.getTwoMinTimeOpenSetTwo())); |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourMinTimeCloseSetTwoStr(String.format("%02d:%02d", hotPumpVo.getTwoHourTimeCloseSetTwo(), hotPumpVo.getTwoMinTimeCloseSetTwo())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (hotPumpVo.getOneHourTimeOpenSetThreeId() != null && hotPumpVo.getOneMinTimeCloseSetThreeId() != null) { |
|
|
|
|
|
|
|
hotPumpVo.setOneHourMinTimeOpenSetThreeStr(String.format("%02d:%02d", hotPumpVo.getOneHourTimeOpenSetThree(), hotPumpVo.getOneMinTimeOpenSetThree())); |
|
|
|
|
|
|
|
hotPumpVo.setOneHourMinTimeCloseSetThreeStr(String.format("%02d:%02d", hotPumpVo.getOneHourTimeCloseSetThree(), hotPumpVo.getOneMinTimeCloseSetThree())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (hotPumpVo.getTwoHourTimeOpenSetThreeId() != null && hotPumpVo.getTwoMinTimeCloseSetThreeId() != null) { |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourMinTimeOpenSetThreeStr(String.format("%02d:%02d", hotPumpVo.getTwoHourTimeOpenSetThree(), hotPumpVo.getTwoMinTimeOpenSetThree())); |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourMinTimeCloseSetThreeStr(String.format("%02d:%02d", hotPumpVo.getTwoHourTimeCloseSetThree(), hotPumpVo.getTwoMinTimeCloseSetThree())); |
|
|
|
|
|
|
|
} |
|
|
|
return hotPumpVo; |
|
|
|
return hotPumpVo; |
|
|
|
case "循环泵": |
|
|
|
|
|
|
|
HotWaterCircuitPumpControlVO circuitPumpVo = new HotWaterCircuitPumpControlVO(); |
|
|
|
|
|
|
|
circuitPumpVo.setId(dlEntry.getKey()); |
|
|
|
|
|
|
|
if (StringUtils.isBlank(dlItems.get(0).getDeviceName())) { |
|
|
|
|
|
|
|
// 如果设备名称为空,则使用房间号
|
|
|
|
|
|
|
|
circuitPumpVo.setName(dto.getName()); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
circuitPumpVo.setName(dlItems.get(0).getDeviceName()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
circuitPumpVo.setOrderNum(dlItems.get(0).getDlOrderNum()); |
|
|
|
|
|
|
|
// 单独对系统参数
|
|
|
|
private void handleHotPumpTimeParameters(HotWaterHotPumpControlVO hotPumpVo, HotWaterControlListVO item) { |
|
|
|
|
|
|
|
String otherName = item.getOtherName(); |
|
|
|
|
|
|
|
int value = item.getCurValue().intValue(); |
|
|
|
|
|
|
|
String cpmId = item.getCpmId(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 12定时组
|
|
|
|
|
|
|
|
if (otherName.contains("12定时_时开1")) { |
|
|
|
|
|
|
|
hotPumpVo.setOneHourTimeOpenSetOne(value); |
|
|
|
|
|
|
|
hotPumpVo.setOneHourTimeOpenSetOneId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("12定时_时关1")) { |
|
|
|
|
|
|
|
hotPumpVo.setOneHourTimeCloseSetOne(value); |
|
|
|
|
|
|
|
hotPumpVo.setOneHourTimeCloseSetOneId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("12定时_时开2")) { |
|
|
|
|
|
|
|
hotPumpVo.setOneHourTimeOpenSetTwo(value); |
|
|
|
|
|
|
|
hotPumpVo.setOneHourTimeOpenSetTwoId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("12定时_时关2")) { |
|
|
|
|
|
|
|
hotPumpVo.setOneHourTimeCloseSetTwo(value); |
|
|
|
|
|
|
|
hotPumpVo.setOneHourTimeCloseSetTwoId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("12定时_时开3")) { |
|
|
|
|
|
|
|
hotPumpVo.setOneHourTimeOpenSetThree(value); |
|
|
|
|
|
|
|
hotPumpVo.setOneHourTimeOpenSetThreeId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("12定时_时关3")) { |
|
|
|
|
|
|
|
hotPumpVo.setOneHourTimeCloseSetThree(value); |
|
|
|
|
|
|
|
hotPumpVo.setOneHourTimeCloseSetThreeId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("12定时_分开1")) { |
|
|
|
|
|
|
|
hotPumpVo.setOneMinTimeOpenSetOne(value); |
|
|
|
|
|
|
|
hotPumpVo.setOneMinTimeOpenSetOneId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("12定时_分关1")) { |
|
|
|
|
|
|
|
hotPumpVo.setOneMinTimeCloseSetOne(value); |
|
|
|
|
|
|
|
hotPumpVo.setOneMinTimeCloseSetOneId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("12定时_分开2")) { |
|
|
|
|
|
|
|
hotPumpVo.setOneMinTimeOpenSetTwo(value); |
|
|
|
|
|
|
|
hotPumpVo.setOneMinTimeOpenSetTwoId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("12定时_分关2")) { |
|
|
|
|
|
|
|
hotPumpVo.setOneMinTimeCloseSetTwo(value); |
|
|
|
|
|
|
|
hotPumpVo.setOneMinTimeCloseSetTwoId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("12定时_分开3")) { |
|
|
|
|
|
|
|
hotPumpVo.setOneMinTimeOpenSetThree(value); |
|
|
|
|
|
|
|
hotPumpVo.setOneMinTimeOpenSetThreeId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("12定时_分关3")) { |
|
|
|
|
|
|
|
hotPumpVo.setOneMinTimeCloseSetThree(value); |
|
|
|
|
|
|
|
hotPumpVo.setOneMinTimeCloseSetThreeId(cpmId); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 34定时组
|
|
|
|
|
|
|
|
else if (otherName.contains("34定时_时开1")) { |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourTimeOpenSetOne(value); |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourTimeOpenSetOneId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("34定时_时关1")) { |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourTimeCloseSetOne(value); |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourTimeCloseSetOneId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("34定时_时开2")) { |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourTimeOpenSetTwo(value); |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourTimeOpenSetTwoId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("34定时_时关2")) { |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourTimeCloseSetTwo(value); |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourTimeCloseSetTwoId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("34定时_时开3")) { |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourTimeOpenSetThree(value); |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourTimeOpenSetThreeId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("34定时_时关3")) { |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourTimeCloseSetThree(value); |
|
|
|
|
|
|
|
hotPumpVo.setTwoHourTimeCloseSetThreeId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("34定时_分开1")) { |
|
|
|
|
|
|
|
hotPumpVo.setTwoMinTimeOpenSetOne(value); |
|
|
|
|
|
|
|
hotPumpVo.setTwoMinTimeOpenSetOneId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("34定时_分关1")) { |
|
|
|
|
|
|
|
hotPumpVo.setTwoMinTimeCloseSetOne(value); |
|
|
|
|
|
|
|
hotPumpVo.setTwoMinTimeCloseSetOneId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("34定时_分开2")) { |
|
|
|
|
|
|
|
hotPumpVo.setTwoMinTimeOpenSetTwo(value); |
|
|
|
|
|
|
|
hotPumpVo.setTwoMinTimeOpenSetTwoId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("34定时_分关2")) { |
|
|
|
|
|
|
|
hotPumpVo.setTwoMinTimeCloseSetTwo(value); |
|
|
|
|
|
|
|
hotPumpVo.setTwoMinTimeCloseSetTwoId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("34定时_分开3")) { |
|
|
|
|
|
|
|
hotPumpVo.setTwoMinTimeOpenSetThree(value); |
|
|
|
|
|
|
|
hotPumpVo.setTwoMinTimeOpenSetThreeId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("34定时_分关3")) { |
|
|
|
|
|
|
|
hotPumpVo.setTwoMinTimeCloseSetThree(value); |
|
|
|
|
|
|
|
hotPumpVo.setTwoMinTimeCloseSetThreeId(cpmId); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private HotWaterCircuitPumpControlVO createCircuitPumpControlVO( |
|
|
|
|
|
|
|
Map.Entry<String, List<HotWaterControlListVO>> dlEntry, |
|
|
|
|
|
|
|
List<HotWaterControlListVO> dlItems, |
|
|
|
|
|
|
|
HotWaterControlDTO parentDto) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HotWaterCircuitPumpControlVO circuitPumpVo = new HotWaterCircuitPumpControlVO(); |
|
|
|
|
|
|
|
setupBasicDeviceInfo(circuitPumpVo, dlEntry, dlItems, parentDto); |
|
|
|
|
|
|
|
|
|
|
|
dlItems.forEach(item -> { |
|
|
|
dlItems.forEach(item -> { |
|
|
|
switch (item.getParamTypeId()) { |
|
|
|
switch (item.getParamTypeId()) { |
|
|
|
case "1": |
|
|
|
case "1": |
|
|
|
// 启停
|
|
|
|
// 启停控制
|
|
|
|
circuitPumpVo.setStartStopControl(item.getCurValue().intValue()); |
|
|
|
circuitPumpVo.setStartStopControl(item.getCurValue().intValue()); |
|
|
|
circuitPumpVo.setStartStopControlId(item.getCpmId()); |
|
|
|
circuitPumpVo.setStartStopControlId(item.getCpmId()); |
|
|
|
break; |
|
|
|
break; |
|
|
|
@ -305,58 +429,93 @@ public class CollectionParamsManageServiceImpl implements CollectionParamsManage |
|
|
|
circuitPumpVo.setRunStateId(item.getCpmId()); |
|
|
|
circuitPumpVo.setRunStateId(item.getCpmId()); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "3": |
|
|
|
case "3": |
|
|
|
// 故障
|
|
|
|
// 故障状态
|
|
|
|
circuitPumpVo.setFault(item.getCurValue().intValue()); |
|
|
|
circuitPumpVo.setFault(item.getCurValue().intValue()); |
|
|
|
circuitPumpVo.setFaultId(item.getCpmId()); |
|
|
|
circuitPumpVo.setFaultId(item.getCpmId()); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "4": |
|
|
|
case "4": |
|
|
|
// 时控
|
|
|
|
// 时控
|
|
|
|
if (item.getOtherName().contains("定时_时开1")) { |
|
|
|
handleCircuitPumpTimeParameters(circuitPumpVo, item); |
|
|
|
circuitPumpVo.setOneHourTimeOpenSetOne(item.getCurValue().intValue()); |
|
|
|
break; |
|
|
|
circuitPumpVo.setOneHourTimeOpenSetOneId(item.getCpmId()); |
|
|
|
case "8": |
|
|
|
} else if (item.getOtherName().contains("定时_时关1")) { |
|
|
|
// 温差
|
|
|
|
circuitPumpVo.setOneHourTimeCloseSetOne(item.getCurValue().intValue()); |
|
|
|
circuitPumpVo.setTempDiff(item.getCurValue()); |
|
|
|
circuitPumpVo.setOneHourTimeCloseSetOneId(item.getCpmId()); |
|
|
|
circuitPumpVo.setTempDiffId(item.getCpmId()); |
|
|
|
} else if (item.getOtherName().contains("定时_分开1")) { |
|
|
|
break; |
|
|
|
circuitPumpVo.setOneMinTimeOpenSetOne(item.getCurValue().intValue()); |
|
|
|
case "9": |
|
|
|
circuitPumpVo.setOneMinTimeOpenSetOneId(item.getCpmId()); |
|
|
|
// 温差设置
|
|
|
|
} else if (item.getOtherName().contains("定时_分关1")) { |
|
|
|
circuitPumpVo.setTempDiffSet(item.getCurValue()); |
|
|
|
circuitPumpVo.setOneMinTimeCloseSetOne(item.getCurValue().intValue()); |
|
|
|
circuitPumpVo.setTempDiffSetId(item.getCpmId()); |
|
|
|
circuitPumpVo.setOneMinTimeCloseSetOneId(item.getCpmId()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
case "15": |
|
|
|
case "15": |
|
|
|
// 开延时
|
|
|
|
// 开延时时间
|
|
|
|
circuitPumpVo.setOpenDelayTime(item.getCurValue().intValue()); |
|
|
|
circuitPumpVo.setOpenDelayTime(item.getCurValue().intValue()); |
|
|
|
circuitPumpVo.setOpenDelayTimeId(item.getCpmId()); |
|
|
|
circuitPumpVo.setOpenDelayTimeId(item.getCpmId()); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "16": |
|
|
|
case "16": |
|
|
|
if (item.getOtherName().contains("小时")) { |
|
|
|
|
|
|
|
// 累计运行时间
|
|
|
|
// 累计运行时间
|
|
|
|
|
|
|
|
if (item.getOtherName().contains("小时")) { |
|
|
|
circuitPumpVo.setRunTime(item.getCurValue()); |
|
|
|
circuitPumpVo.setRunTime(item.getCurValue()); |
|
|
|
circuitPumpVo.setRunTimeId(item.getCpmId()); |
|
|
|
circuitPumpVo.setRunTimeId(item.getCpmId()); |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
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: |
|
|
|
default: |
|
|
|
break; |
|
|
|
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; |
|
|
|
return circuitPumpVo; |
|
|
|
case "回水泵": |
|
|
|
|
|
|
|
HotWaterBackPumpControlVO backPumpVo = new HotWaterBackPumpControlVO(); |
|
|
|
|
|
|
|
backPumpVo.setId(dlEntry.getKey()); |
|
|
|
|
|
|
|
if (StringUtils.isBlank(dlItems.get(0).getDeviceName())) { |
|
|
|
|
|
|
|
// 如果设备名称为空,则使用房间号
|
|
|
|
|
|
|
|
backPumpVo.setName(dto.getName()); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
backPumpVo.setName(dlItems.get(0).getDeviceName()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
backPumpVo.setOrderNum(dlItems.get(0).getDlOrderNum()); |
|
|
|
|
|
|
|
// 单独对系统参数
|
|
|
|
private void handleCircuitPumpTimeParameters(HotWaterCircuitPumpControlVO circuitPumpVo, HotWaterControlListVO item) { |
|
|
|
|
|
|
|
String otherName = item.getOtherName(); |
|
|
|
|
|
|
|
int value = item.getCurValue().intValue(); |
|
|
|
|
|
|
|
String cpmId = item.getCpmId(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (otherName.contains("定时_时开1")) { |
|
|
|
|
|
|
|
circuitPumpVo.setOneHourTimeOpenSetOne(value); |
|
|
|
|
|
|
|
circuitPumpVo.setOneHourTimeOpenSetOneId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("定时_时关1")) { |
|
|
|
|
|
|
|
circuitPumpVo.setOneHourTimeCloseSetOne(value); |
|
|
|
|
|
|
|
circuitPumpVo.setOneHourTimeCloseSetOneId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("定时_分开1")) { |
|
|
|
|
|
|
|
circuitPumpVo.setOneMinTimeOpenSetOne(value); |
|
|
|
|
|
|
|
circuitPumpVo.setOneMinTimeOpenSetOneId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("定时_分关1")) { |
|
|
|
|
|
|
|
circuitPumpVo.setOneMinTimeCloseSetOne(value); |
|
|
|
|
|
|
|
circuitPumpVo.setOneMinTimeCloseSetOneId(cpmId); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private HotWaterBackPumpControlVO createBackPumpControlVO( |
|
|
|
|
|
|
|
Map.Entry<String, List<HotWaterControlListVO>> dlEntry, |
|
|
|
|
|
|
|
List<HotWaterControlListVO> dlItems, |
|
|
|
|
|
|
|
HotWaterControlDTO parentDto) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HotWaterBackPumpControlVO backPumpVo = new HotWaterBackPumpControlVO(); |
|
|
|
|
|
|
|
setupBasicDeviceInfo(backPumpVo, dlEntry, dlItems, parentDto); |
|
|
|
|
|
|
|
|
|
|
|
dlItems.forEach(item -> { |
|
|
|
dlItems.forEach(item -> { |
|
|
|
switch (item.getParamTypeId()) { |
|
|
|
switch (item.getParamTypeId()) { |
|
|
|
case "1": |
|
|
|
case "1": |
|
|
|
// 启停
|
|
|
|
// 启停控制
|
|
|
|
backPumpVo.setStartStopControl(item.getCurValue().intValue()); |
|
|
|
backPumpVo.setStartStopControl(item.getCurValue().intValue()); |
|
|
|
backPumpVo.setStartStopControlId(item.getCpmId()); |
|
|
|
backPumpVo.setStartStopControlId(item.getCpmId()); |
|
|
|
break; |
|
|
|
break; |
|
|
|
@ -366,101 +525,131 @@ public class CollectionParamsManageServiceImpl implements CollectionParamsManage |
|
|
|
backPumpVo.setRunStateId(item.getCpmId()); |
|
|
|
backPumpVo.setRunStateId(item.getCpmId()); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "3": |
|
|
|
case "3": |
|
|
|
// 故障
|
|
|
|
// 故障状态
|
|
|
|
backPumpVo.setFault(item.getCurValue().intValue()); |
|
|
|
backPumpVo.setFault(item.getCurValue().intValue()); |
|
|
|
backPumpVo.setFaultId(item.getCpmId()); |
|
|
|
backPumpVo.setFaultId(item.getCpmId()); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "4": |
|
|
|
case "4": |
|
|
|
// 时控
|
|
|
|
// 时控
|
|
|
|
if (item.getOtherName().contains("定时_时开1")) { |
|
|
|
handleBackPumpTimeParameters(backPumpVo, item); |
|
|
|
backPumpVo.setOneHourTimeOpenSetOne(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
backPumpVo.setOneHourTimeOpenSetOneId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("定时_时关1")) { |
|
|
|
|
|
|
|
backPumpVo.setOneHourTimeCloseSetOne(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
backPumpVo.setOneHourTimeCloseSetOneId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("定时_分开1")) { |
|
|
|
|
|
|
|
backPumpVo.setOneMinTimeOpenSetOne(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
backPumpVo.setOneMinTimeOpenSetOneId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("定时_分关1")) { |
|
|
|
|
|
|
|
backPumpVo.setOneMinTimeCloseSetOne(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
backPumpVo.setOneMinTimeCloseSetOneId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("定时_时开2")) { |
|
|
|
|
|
|
|
backPumpVo.setOneHourTimeOpenSetTwo(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
backPumpVo.setOneHourTimeOpenSetTwoId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("定时_时关2")) { |
|
|
|
|
|
|
|
backPumpVo.setOneHourTimeCloseSetTwo(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
backPumpVo.setOneHourTimeCloseSetTwoId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("定时_分开2")) { |
|
|
|
|
|
|
|
backPumpVo.setOneMinTimeOpenSetTwo(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
backPumpVo.setOneMinTimeOpenSetTwoId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("定时_分关2")) { |
|
|
|
|
|
|
|
backPumpVo.setOneMinTimeCloseSetTwo(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
backPumpVo.setOneMinTimeCloseSetTwoId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("定时_时开3")) { |
|
|
|
|
|
|
|
backPumpVo.setOneHourTimeOpenSetThree(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
backPumpVo.setOneHourTimeOpenSetThreeId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("定时_时关3")) { |
|
|
|
|
|
|
|
backPumpVo.setOneHourTimeCloseSetThree(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
backPumpVo.setOneHourTimeCloseSetThreeId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("定时_分开3")) { |
|
|
|
|
|
|
|
backPumpVo.setOneMinTimeOpenSetThree(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
backPumpVo.setOneMinTimeOpenSetThreeId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("定时_分关3")) { |
|
|
|
|
|
|
|
backPumpVo.setOneMinTimeCloseSetThree(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
backPumpVo.setOneMinTimeCloseSetThreeId(item.getCpmId()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
case "7": |
|
|
|
case "7": |
|
|
|
// 回水温度设置
|
|
|
|
// 温度设置
|
|
|
|
backPumpVo.setTempSet(item.getCurValue()); |
|
|
|
backPumpVo.setTempSet(item.getCurValue()); |
|
|
|
backPumpVo.setTempSetId(item.getCpmId()); |
|
|
|
backPumpVo.setTempSetId(item.getCpmId()); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "15": |
|
|
|
case "15": |
|
|
|
// 开延时
|
|
|
|
// 时间
|
|
|
|
backPumpVo.setOpenDelayTime(item.getCurValue().intValue()); |
|
|
|
backPumpVo.setOpenDelayTime(item.getCurValue().intValue()); |
|
|
|
backPumpVo.setOpenDelayTimeId(item.getCpmId()); |
|
|
|
backPumpVo.setOpenDelayTimeId(item.getCpmId()); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "16": |
|
|
|
case "16": |
|
|
|
|
|
|
|
// 累积运行时间
|
|
|
|
if (item.getOtherName().contains("小时")) { |
|
|
|
if (item.getOtherName().contains("小时")) { |
|
|
|
// 累计运行时间
|
|
|
|
|
|
|
|
backPumpVo.setRunTime(item.getCurValue()); |
|
|
|
backPumpVo.setRunTime(item.getCurValue()); |
|
|
|
backPumpVo.setRunTimeId(item.getCpmId()); |
|
|
|
backPumpVo.setRunTimeId(item.getCpmId()); |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case "21": |
|
|
|
|
|
|
|
// 一键启动
|
|
|
|
|
|
|
|
backPumpVo.setStartOneKey(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
backPumpVo.setStartOneKeyId(item.getCpmId()); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "22": |
|
|
|
|
|
|
|
// 手动自动切换
|
|
|
|
|
|
|
|
backPumpVo.setManualAutoSwitch(item.getCurValue().intValue()); |
|
|
|
|
|
|
|
backPumpVo.setManualAutoSwitchId(item.getCpmId()); |
|
|
|
|
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
if (backPumpVo.getOneHourTimeOpenSetOneId() != null |
|
|
|
|
|
|
|
&& backPumpVo.getOneHourTimeCloseSetOneId() != null |
|
|
|
|
|
|
|
&& backPumpVo.getOneMinTimeOpenSetOneId() != null |
|
|
|
|
|
|
|
&& backPumpVo.getOneMinTimeCloseSetOneId() != null) { |
|
|
|
|
|
|
|
// 设置时分开写入oneHourMinTimeOpenSetOneStr,oneHourMinTimeCloseSetOneStr
|
|
|
|
|
|
|
|
backPumpVo.setOneHourMinTimeOpenSetOneStr(String.format("%02d:%02d", backPumpVo.getOneHourTimeOpenSetOne(), backPumpVo.getOneMinTimeOpenSetOne())); |
|
|
|
|
|
|
|
backPumpVo.setOneHourMinTimeCloseSetOneStr(String.format("%02d:%02d", backPumpVo.getOneHourTimeCloseSetOne(), backPumpVo.getOneMinTimeCloseSetOne())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (backPumpVo.getOneHourTimeOpenSetTwoId() != null |
|
|
|
|
|
|
|
&& backPumpVo.getOneHourTimeCloseSetTwoId() != null |
|
|
|
|
|
|
|
&& backPumpVo.getOneMinTimeOpenSetTwoId() != null |
|
|
|
|
|
|
|
&& backPumpVo.getOneMinTimeCloseSetTwoId() != null) { |
|
|
|
|
|
|
|
// 获取时分开写入oneHourMinTimeOpenSetTwoStr,oneHourMinTimeCloseSetTwoStr
|
|
|
|
|
|
|
|
backPumpVo.setOneHourMinTimeOpenSetTwoStr(String.format("%02d:%02d", backPumpVo.getOneHourTimeOpenSetTwo(), backPumpVo.getOneMinTimeOpenSetTwo())); |
|
|
|
|
|
|
|
backPumpVo.setOneHourMinTimeCloseSetTwoStr(String.format("%02d:%02d", backPumpVo.getOneHourTimeCloseSetTwo(), backPumpVo.getOneMinTimeCloseSetTwo())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (backPumpVo.getOneHourTimeOpenSetThreeId() != null |
|
|
|
|
|
|
|
&& backPumpVo.getOneHourTimeCloseSetThreeId() != null |
|
|
|
|
|
|
|
&& backPumpVo.getOneMinTimeOpenSetThreeId() != null |
|
|
|
|
|
|
|
&& backPumpVo.getOneMinTimeCloseSetThreeId() != null) { |
|
|
|
|
|
|
|
// 获取时分开写入oneHourMinTimeOpenSetThreeStr,oneHourMinTimeCloseSetThreeStr
|
|
|
|
|
|
|
|
backPumpVo.setOneHourMinTimeOpenSetThreeStr(String.format("%02d:%02d", backPumpVo.getOneHourTimeOpenSetThree(), backPumpVo.getOneMinTimeOpenSetThree())); |
|
|
|
|
|
|
|
backPumpVo.setOneHourMinTimeCloseSetThreeStr(String.format("%02d:%02d", backPumpVo.getOneHourTimeCloseSetThree(), backPumpVo.getOneMinTimeCloseSetThree())); |
|
|
|
|
|
|
|
} |
|
|
|
return backPumpVo; |
|
|
|
return backPumpVo; |
|
|
|
case "设备校准": |
|
|
|
|
|
|
|
HotWaterDeviceCalibrationControlVO deviceCalibrationVo = new HotWaterDeviceCalibrationControlVO(); |
|
|
|
|
|
|
|
deviceCalibrationVo.setId(dlEntry.getKey()); |
|
|
|
|
|
|
|
if (StringUtils.isBlank(dlItems.get(0).getDeviceName())) { |
|
|
|
|
|
|
|
// 如果设备名称为空,则使用房间号
|
|
|
|
|
|
|
|
deviceCalibrationVo.setName(dto.getName()); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
deviceCalibrationVo.setName(dlItems.get(0).getDeviceName()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
deviceCalibrationVo.setOrderNum(dlItems.get(0).getDlOrderNum()); |
|
|
|
|
|
|
|
// 单独对系统参数
|
|
|
|
private void handleBackPumpTimeParameters(HotWaterBackPumpControlVO backPumpVo, 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); |
|
|
|
|
|
|
|
} else if (otherName.contains("定时_时关1")) { |
|
|
|
|
|
|
|
backPumpVo.setOneHourTimeCloseSetOne(value); |
|
|
|
|
|
|
|
backPumpVo.setOneHourTimeCloseSetOneId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("定时_分开1")) { |
|
|
|
|
|
|
|
backPumpVo.setOneMinTimeOpenSetOne(value); |
|
|
|
|
|
|
|
backPumpVo.setOneMinTimeOpenSetOneId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("定时_分关1")) { |
|
|
|
|
|
|
|
backPumpVo.setOneMinTimeCloseSetOne(value); |
|
|
|
|
|
|
|
backPumpVo.setOneMinTimeCloseSetOneId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("定时_时开2")) { |
|
|
|
|
|
|
|
backPumpVo.setOneHourTimeOpenSetTwo(value); |
|
|
|
|
|
|
|
backPumpVo.setOneHourTimeOpenSetTwoId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("定时_时关2")) { |
|
|
|
|
|
|
|
backPumpVo.setOneHourTimeCloseSetTwo(value); |
|
|
|
|
|
|
|
backPumpVo.setOneHourTimeCloseSetTwoId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("定时_分开2")) { |
|
|
|
|
|
|
|
backPumpVo.setOneMinTimeOpenSetTwo(value); |
|
|
|
|
|
|
|
backPumpVo.setOneMinTimeOpenSetTwoId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("定时_分关2")) { |
|
|
|
|
|
|
|
backPumpVo.setOneMinTimeCloseSetTwo(value); |
|
|
|
|
|
|
|
backPumpVo.setOneMinTimeCloseSetTwoId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("定时_时开3")) { |
|
|
|
|
|
|
|
backPumpVo.setOneHourTimeOpenSetThree(value); |
|
|
|
|
|
|
|
backPumpVo.setOneHourTimeOpenSetThreeId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("定时_时关3")) { |
|
|
|
|
|
|
|
backPumpVo.setOneHourTimeCloseSetThree(value); |
|
|
|
|
|
|
|
backPumpVo.setOneHourTimeCloseSetThreeId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("定时_分开3")) { |
|
|
|
|
|
|
|
backPumpVo.setOneMinTimeOpenSetThree(value); |
|
|
|
|
|
|
|
backPumpVo.setOneMinTimeOpenSetThreeId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("定时_分关3")) { |
|
|
|
|
|
|
|
backPumpVo.setOneMinTimeCloseSetThree(value); |
|
|
|
|
|
|
|
backPumpVo.setOneMinTimeCloseSetThreeId(cpmId); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private HotWaterDeviceCalibrationControlVO createDeviceCalibrationControlVO( |
|
|
|
|
|
|
|
Map.Entry<String, List<HotWaterControlListVO>> dlEntry, |
|
|
|
|
|
|
|
List<HotWaterControlListVO> dlItems, |
|
|
|
|
|
|
|
HotWaterControlDTO parentDto) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HotWaterDeviceCalibrationControlVO deviceCalibrationVo = new HotWaterDeviceCalibrationControlVO(); |
|
|
|
|
|
|
|
setupBasicDeviceInfo(deviceCalibrationVo, dlEntry, dlItems, parentDto); |
|
|
|
|
|
|
|
|
|
|
|
dlItems.forEach(item -> { |
|
|
|
dlItems.forEach(item -> { |
|
|
|
switch (item.getParamTypeId()) { |
|
|
|
switch (item.getParamTypeId()) { |
|
|
|
case "0": |
|
|
|
case "0": |
|
|
|
if (item.getOtherName().contains("工程量上限")) { |
|
|
|
// 上下限
|
|
|
|
deviceCalibrationVo.setEngineeringMaxValue(item.getCurValue()); |
|
|
|
handleCalibrationParameters(deviceCalibrationVo, item); |
|
|
|
deviceCalibrationVo.setEngineeringMaxValueId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("工程量下限")) { |
|
|
|
|
|
|
|
deviceCalibrationVo.setEngineeringMinValue(item.getCurValue()); |
|
|
|
|
|
|
|
deviceCalibrationVo.setEngineeringMinValueId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("数字量上限")) { |
|
|
|
|
|
|
|
deviceCalibrationVo.setDigitalMaxValue(item.getCurValue()); |
|
|
|
|
|
|
|
deviceCalibrationVo.setDigitalMaxValueId(item.getCpmId()); |
|
|
|
|
|
|
|
} else if (item.getOtherName().contains("数字量下限")) { |
|
|
|
|
|
|
|
deviceCalibrationVo.setDigitalMinValue(item.getCurValue()); |
|
|
|
|
|
|
|
deviceCalibrationVo.setDigitalMinValueId(item.getCpmId()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
case "9": |
|
|
|
case "19": |
|
|
|
// 校准值
|
|
|
|
// 校准值
|
|
|
|
deviceCalibrationVo.setCalibrationValue(item.getCurValue()); |
|
|
|
deviceCalibrationVo.setCalibrationValue(item.getCurValue()); |
|
|
|
deviceCalibrationVo.setCalibrationValueId(item.getCpmId()); |
|
|
|
deviceCalibrationVo.setCalibrationValueId(item.getCpmId()); |
|
|
|
@ -469,59 +658,83 @@ public class CollectionParamsManageServiceImpl implements CollectionParamsManage |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return deviceCalibrationVo; |
|
|
|
return deviceCalibrationVo; |
|
|
|
case "电表": |
|
|
|
|
|
|
|
case "水表": |
|
|
|
|
|
|
|
HotWaterDeviceControlVO meterVo = new HotWaterDeviceControlVO(); |
|
|
|
|
|
|
|
meterVo.setId(dlEntry.getKey()); |
|
|
|
|
|
|
|
if (StringUtils.isBlank(dlItems.get(0).getDeviceName())) { |
|
|
|
|
|
|
|
meterVo.setName(dto.getName()); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
meterVo.setName(dlItems.get(0).getDeviceName()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
meterVo.setOrderNum(dlItems.get(0).getDlOrderNum()); |
|
|
|
|
|
|
|
// 单独对系统参数
|
|
|
|
private void handleCalibrationParameters(HotWaterDeviceCalibrationControlVO deviceCalibrationVo, HotWaterControlListVO item) { |
|
|
|
|
|
|
|
String otherName = item.getOtherName(); |
|
|
|
|
|
|
|
BigDecimal value = item.getCurValue(); |
|
|
|
|
|
|
|
String cpmId = item.getCpmId(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (otherName.contains("工程量上限")) { |
|
|
|
|
|
|
|
deviceCalibrationVo.setEngineeringMaxValue(value); |
|
|
|
|
|
|
|
deviceCalibrationVo.setEngineeringMaxValueId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("工程量下限")) { |
|
|
|
|
|
|
|
deviceCalibrationVo.setEngineeringMinValue(value); |
|
|
|
|
|
|
|
deviceCalibrationVo.setEngineeringMinValueId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("数字量上限")) { |
|
|
|
|
|
|
|
deviceCalibrationVo.setDigitalMaxValue(value); |
|
|
|
|
|
|
|
deviceCalibrationVo.setDigitalMaxValueId(cpmId); |
|
|
|
|
|
|
|
} else if (otherName.contains("数字量下限")) { |
|
|
|
|
|
|
|
deviceCalibrationVo.setDigitalMinValue(value); |
|
|
|
|
|
|
|
deviceCalibrationVo.setDigitalMinValueId(cpmId); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private HotWaterDeviceControlVO createDeviceControlVO( |
|
|
|
|
|
|
|
Map.Entry<String, List<HotWaterControlListVO>> dlEntry, |
|
|
|
|
|
|
|
List<HotWaterControlListVO> dlItems, |
|
|
|
|
|
|
|
HotWaterControlDTO parentDto) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HotWaterDeviceControlVO meterVo = new HotWaterDeviceControlVO(); |
|
|
|
|
|
|
|
setupBasicDeviceInfo(meterVo, dlEntry, dlItems, parentDto); |
|
|
|
|
|
|
|
|
|
|
|
dlItems.forEach(item -> { |
|
|
|
dlItems.forEach(item -> { |
|
|
|
switch (item.getParamTypeId()) { |
|
|
|
switch (item.getParamTypeId()) { |
|
|
|
case "13": |
|
|
|
case "13": |
|
|
|
meterVo.setTotalReading(item.getCurValue()); |
|
|
|
|
|
|
|
meterVo.setTotalReadingId(item.getCpmId()); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "14": |
|
|
|
case "14": |
|
|
|
|
|
|
|
// 水电表读数
|
|
|
|
meterVo.setTotalReading(item.getCurValue()); |
|
|
|
meterVo.setTotalReading(item.getCurValue()); |
|
|
|
meterVo.setTotalReadingId(item.getCpmId()); |
|
|
|
meterVo.setTotalReadingId(item.getCpmId()); |
|
|
|
|
|
|
|
meterVo.setCurrentTime(item.getCurTime()); |
|
|
|
|
|
|
|
meterVo.setCurrentTimeId(item.getCpmId()); |
|
|
|
break; |
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return meterVo; |
|
|
|
return meterVo; |
|
|
|
default: |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return null; |
|
|
|
|
|
|
|
}) |
|
|
|
private void setupBasicDeviceInfo(Object vo, Map.Entry<String, List<HotWaterControlListVO>> dlEntry, |
|
|
|
.collect(Collectors.toList()); |
|
|
|
List<HotWaterControlListVO> dlItems, HotWaterControlDTO parentDto) { |
|
|
|
dto.setChildren(children); |
|
|
|
// 使用反射设置基本属性
|
|
|
|
return dto; |
|
|
|
try { |
|
|
|
}) |
|
|
|
vo.getClass().getMethod("setId", String.class).invoke(vo, dlEntry.getKey()); |
|
|
|
// 添加排序操作
|
|
|
|
vo.getClass().getMethod("setOrderNum", int.class).invoke(vo, dlItems.get(0).getDlOrderNum()); |
|
|
|
.sorted(Comparator.comparingInt(HotWaterControlDTO::getOrderNum)) |
|
|
|
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
String deviceName = StringUtils.isBlank(dlItems.get(0).getDeviceName()) ? |
|
|
|
|
|
|
|
parentDto.getName() : dlItems.get(0).getDeviceName(); |
|
|
|
|
|
|
|
vo.getClass().getMethod("setName", String.class).invoke(vo, deviceName); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
// 忽略反射异常
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public CollectionParamsManageEntity selectDeviceInstallByOtherName(String name) { |
|
|
|
public CollectionParamsManageEntity selectDeviceInstallByOtherName(String name, String buildingId) { |
|
|
|
return collectionParamsManageMapper.selectDeviceInstallByOtherName(name); |
|
|
|
return collectionParamsManageMapper.selectDeviceInstallByOtherName(name, buildingId); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void updateCPMByOtherName(String name, BigDecimal value, String time) { |
|
|
|
public void updateCPMByOtherName(String name, BigDecimal value, String time, String buildingId) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
collectionParamsManageMapper.updateCPMByOtherName(name, value, time, "0"); |
|
|
|
collectionParamsManageMapper.updateCPMByOtherName(name, value, time, "0", buildingId); |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
collectionParamsManageMapper.updateCPMByOtherName(name, new BigDecimal(0), time, "-1"); |
|
|
|
collectionParamsManageMapper.updateCPMByOtherName(name, new BigDecimal(0), time, "-1", buildingId); |
|
|
|
; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|