Compare commits
2 Commits
dev
...
prod_20251
| Author | SHA1 | Date |
|---|---|---|
|
|
10c23f3f5b | 1 week ago |
|
|
9420aa3ac4 | 1 week ago |
70 changed files with 459 additions and 2651 deletions
@ -0,0 +1,62 @@ |
|||||||
|
package com.mh.user.config.mqtt; |
||||||
|
|
||||||
|
import com.mh.user.config.MHConfig; |
||||||
|
import com.mh.user.constants.ChannelName; |
||||||
|
import com.mh.user.constants.TopicEnum; |
||||||
|
import com.mh.user.utils.SpringBeanUtil; |
||||||
|
import lombok.extern.slf4j.Slf4j; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.integration.annotation.Router; |
||||||
|
import org.springframework.integration.mqtt.support.MqttHeaders; |
||||||
|
import org.springframework.integration.router.AbstractMessageRouter; |
||||||
|
import org.springframework.messaging.Message; |
||||||
|
import org.springframework.messaging.MessageChannel; |
||||||
|
import org.springframework.messaging.MessageHeaders; |
||||||
|
import org.springframework.stereotype.Component; |
||||||
|
|
||||||
|
import java.util.Collection; |
||||||
|
import java.util.Collections; |
||||||
|
import java.util.Objects; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project springboot-mqtt-demo |
||||||
|
* @description 入站消息路由分发中心 |
||||||
|
* @date 2024-10-29 17:04:17 |
||||||
|
*/ |
||||||
|
@Slf4j |
||||||
|
@Component |
||||||
|
public class InboundMessageRouter extends AbstractMessageRouter { |
||||||
|
|
||||||
|
/** 系统基础配置 */ |
||||||
|
@Autowired |
||||||
|
private MHConfig mHConfig; |
||||||
|
|
||||||
|
/** |
||||||
|
* 目前只需要这个方式,后期在拓展使用IntegrationFlow方式 |
||||||
|
* @param message |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@Router(inputChannel = ChannelName.INBOUND) |
||||||
|
@Override |
||||||
|
protected Collection<MessageChannel> determineTargetChannels(Message<?> message) { |
||||||
|
MessageHeaders headers = message.getHeaders(); |
||||||
|
String topic = Objects.requireNonNull(headers.get(MqttHeaders.RECEIVED_TOPIC)).toString(); |
||||||
|
// byte[] payload = (byte[]) message.getPayload();
|
||||||
|
// log.info("从当前主题 topic: {}, 接收到的消息:{}", topic, new String(payload));
|
||||||
|
// 判断当前主题是否是当前项目的,温湿度目前写死的
|
||||||
|
if (!topic.startsWith(mHConfig.getName()) && !topic.contains("/temp")) { |
||||||
|
log.info("当前主题 topic: {} 不是当前项目的,直接丢弃", topic); |
||||||
|
return Collections.singleton((MessageChannel) SpringBeanUtil.getBean(ChannelName.DEFAULT_BOUND)); |
||||||
|
} |
||||||
|
// 找到对应的主题消息通道
|
||||||
|
if (topic.contains("/temp")) { |
||||||
|
return Collections.singleton((MessageChannel) SpringBeanUtil.getBean(ChannelName.EVENTS_UPLOAD_INBOUND)); |
||||||
|
} else { |
||||||
|
TopicEnum topicEnum = TopicEnum.find(mHConfig.getName() + "/", topic); |
||||||
|
MessageChannel bean = (MessageChannel) SpringBeanUtil.getBean(topicEnum.getBeanName()); |
||||||
|
return Collections.singleton(bean); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,99 @@ |
|||||||
|
package com.mh.user.config.mqtt; |
||||||
|
|
||||||
|
import com.mh.user.constants.MqttClientOptions; |
||||||
|
import com.mh.user.constants.MqttProtocolEnum; |
||||||
|
import com.mh.user.constants.MqttUseEnum; |
||||||
|
import lombok.Data; |
||||||
|
import org.eclipse.paho.client.mqttv3.MqttConnectOptions; |
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties; |
||||||
|
import org.springframework.context.annotation.Bean; |
||||||
|
import org.springframework.context.annotation.Configuration; |
||||||
|
import org.springframework.integration.mqtt.core.DefaultMqttPahoClientFactory; |
||||||
|
import org.springframework.integration.mqtt.core.MqttPahoClientFactory; |
||||||
|
import org.springframework.util.StringUtils; |
||||||
|
|
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project springboot-mqtt-demo |
||||||
|
* @description mqtt连接配置 |
||||||
|
* @date 2024-10-29 14:44:51 |
||||||
|
*/ |
||||||
|
@Configuration |
||||||
|
@Data |
||||||
|
@ConfigurationProperties |
||||||
|
public class MqttConfig { |
||||||
|
|
||||||
|
private static Map<MqttUseEnum, MqttClientOptions> mqttSpring; |
||||||
|
|
||||||
|
public void setMqttSpring(Map<MqttUseEnum, MqttClientOptions> mqtt) { |
||||||
|
MqttConfig.mqttSpring = mqtt; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 获取mqtt基本配置 |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
static MqttClientOptions getBasicMqttClientOptions() { |
||||||
|
if (!mqttSpring.containsKey(MqttUseEnum.BASIC)) { |
||||||
|
throw new Error("请先配置MQTT的基本连接参数,否则无法启动项目"); |
||||||
|
} |
||||||
|
return mqttSpring.get(MqttUseEnum.BASIC); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 拼接获取对应mqtt的连接地址 |
||||||
|
* @param options |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
public static String getMqttAddress(MqttClientOptions options) { |
||||||
|
StringBuilder addr = new StringBuilder(); |
||||||
|
addr.append(options.getProtocol().getProtocolAddr()) |
||||||
|
.append(options.getHost().trim()) |
||||||
|
.append(":") |
||||||
|
.append(options.getPort()); |
||||||
|
if ((options.getProtocol() == MqttProtocolEnum.WS || options.getProtocol() == MqttProtocolEnum.WSS) |
||||||
|
&& StringUtils.hasText(options.getPath())) { |
||||||
|
addr.append(options.getPath()); |
||||||
|
} |
||||||
|
return addr.toString(); |
||||||
|
} |
||||||
|
|
||||||
|
public static String getBasicMqttAddress() { |
||||||
|
return getMqttAddress(getBasicMqttClientOptions()); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 获取连接参数,注入到spring中 |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@Bean |
||||||
|
public MqttConnectOptions mqttConnectionOptions() { |
||||||
|
|
||||||
|
MqttConnectOptions mqttConnectOptions = new MqttConnectOptions(); |
||||||
|
|
||||||
|
MqttClientOptions customizeOptions = getBasicMqttClientOptions(); |
||||||
|
String basicMqttAddress = getBasicMqttAddress(); |
||||||
|
mqttConnectOptions.setServerURIs(new String[]{basicMqttAddress}); |
||||||
|
mqttConnectOptions.setUserName(StringUtils.hasText(customizeOptions.getUsername()) ? |
||||||
|
customizeOptions.getUsername() : ""); |
||||||
|
mqttConnectOptions.setPassword(StringUtils.hasText(customizeOptions.getPassword()) ? |
||||||
|
customizeOptions.getPassword().toCharArray() : new char[0]); |
||||||
|
// 直接进行自动连接
|
||||||
|
mqttConnectOptions.setAutomaticReconnect(true); |
||||||
|
// 时间间隔时间10s
|
||||||
|
mqttConnectOptions.setKeepAliveInterval(10); |
||||||
|
|
||||||
|
return mqttConnectOptions; |
||||||
|
} |
||||||
|
|
||||||
|
@Bean |
||||||
|
public MqttPahoClientFactory mqttClientFactory() { |
||||||
|
DefaultMqttPahoClientFactory factory = new DefaultMqttPahoClientFactory(); |
||||||
|
factory.setConnectionOptions(mqttConnectionOptions()); |
||||||
|
return factory; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,91 @@ |
|||||||
|
package com.mh.user.config.mqtt; |
||||||
|
|
||||||
|
import com.mh.user.constants.ChannelName; |
||||||
|
import com.mh.user.constants.MqttClientOptions; |
||||||
|
import lombok.extern.slf4j.Slf4j; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.context.annotation.Bean; |
||||||
|
import org.springframework.context.annotation.Configuration; |
||||||
|
import org.springframework.integration.annotation.IntegrationComponentScan; |
||||||
|
import org.springframework.integration.annotation.ServiceActivator; |
||||||
|
import org.springframework.integration.endpoint.MessageProducerSupport; |
||||||
|
import org.springframework.integration.mqtt.core.MqttPahoClientFactory; |
||||||
|
import org.springframework.integration.mqtt.inbound.MqttPahoMessageDrivenChannelAdapter; |
||||||
|
import org.springframework.integration.mqtt.support.DefaultPahoMessageConverter; |
||||||
|
import org.springframework.integration.mqtt.support.MqttHeaders; |
||||||
|
import org.springframework.messaging.MessageChannel; |
||||||
|
import org.springframework.messaging.MessageHandler; |
||||||
|
|
||||||
|
import javax.annotation.Resource; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project springboot-mqtt-demo |
||||||
|
* @description 入站配置 |
||||||
|
* @date 2024-10-29 16:22:10 |
||||||
|
*/ |
||||||
|
@Slf4j |
||||||
|
@Configuration |
||||||
|
@IntegrationComponentScan |
||||||
|
public class MqttInboundConfig { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private MqttPahoClientFactory mqttClientFactory; |
||||||
|
|
||||||
|
@Resource(name = ChannelName.INBOUND) |
||||||
|
private MessageChannel inboundChannel; |
||||||
|
|
||||||
|
private String clientId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 入站适配器 |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@Bean(name = "adapter") |
||||||
|
public MessageProducerSupport mqttInbound() { |
||||||
|
MqttClientOptions options = MqttConfig.getBasicMqttClientOptions(); |
||||||
|
// 此处初始化的时候,默认订阅了配置文件中已经写好的topic
|
||||||
|
// 如果需要订阅多个,可以自己手动订阅,会写一个addTopic()进行添加订阅
|
||||||
|
clientId = options.getClientId() + "_consumer_" + System.currentTimeMillis(); |
||||||
|
MqttPahoMessageDrivenChannelAdapter adapter = new MqttPahoMessageDrivenChannelAdapter( |
||||||
|
clientId, |
||||||
|
mqttClientFactory, |
||||||
|
options.getInboundTopic().split(",")); |
||||||
|
// System.out.println("每一次都会入站适配器吗?"+clientId);
|
||||||
|
DefaultPahoMessageConverter converter = new DefaultPahoMessageConverter(); |
||||||
|
// 统一是字节处理
|
||||||
|
converter.setPayloadAsBytes(true); |
||||||
|
// 设置消息转换器
|
||||||
|
adapter.setConverter(converter); |
||||||
|
// 设置qos(quality of service)
|
||||||
|
// 0:最多一次传输(消息会丢失),
|
||||||
|
// 1:至少一次传输(消息会重复),
|
||||||
|
// 2:只有当消息发送成功时才确认(消息不回丢,但延迟高)。
|
||||||
|
adapter.setQos(0); |
||||||
|
// 设置在接收已经订阅的主题信息后,发送给哪个通道,具体的发送方法需要翻上层的抽象类
|
||||||
|
adapter.setOutputChannel(inboundChannel); |
||||||
|
return adapter; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 默认声明一个消息处理器,用于处理无效的消息 |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@Bean |
||||||
|
@ServiceActivator(inputChannel = ChannelName.DEFAULT_BOUND) |
||||||
|
public MessageHandler handler() { |
||||||
|
return message -> { |
||||||
|
log.info("The default channel does not handle messages." + |
||||||
|
"\nTopic: {}" + |
||||||
|
"\nPayload: {}", |
||||||
|
message.getHeaders().get(MqttHeaders.RECEIVED_TOPIC), |
||||||
|
message.getPayload()); |
||||||
|
}; |
||||||
|
} |
||||||
|
|
||||||
|
public String getClientId() { |
||||||
|
return clientId; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,55 @@ |
|||||||
|
package com.mh.user.config.mqtt; |
||||||
|
|
||||||
|
import com.mh.user.constants.ChannelName; |
||||||
|
import lombok.extern.slf4j.Slf4j; |
||||||
|
import org.springframework.context.annotation.Bean; |
||||||
|
import org.springframework.context.annotation.Configuration; |
||||||
|
import org.springframework.integration.channel.DirectChannel; |
||||||
|
import org.springframework.messaging.MessageChannel; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project springboot-mqtt-demo |
||||||
|
* @description 声明所有通道的定义类 |
||||||
|
* @date 2024-10-29 16:23:32 |
||||||
|
*/ |
||||||
|
@Slf4j |
||||||
|
@Configuration |
||||||
|
public class MqttMessageChannel { |
||||||
|
|
||||||
|
@Bean(name = ChannelName.OUTBOUND) |
||||||
|
public MessageChannel outboundChannel() { |
||||||
|
return new DirectChannel(); |
||||||
|
} |
||||||
|
|
||||||
|
@Bean(name = ChannelName.INBOUND) |
||||||
|
public MessageChannel inboundChannel() { |
||||||
|
return new DirectChannel(); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 事件主动上报通道 |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@Bean(name = ChannelName.EVENTS_UPLOAD_INBOUND) |
||||||
|
public MessageChannel eventsUploadInbound() { |
||||||
|
return new DirectChannel(); |
||||||
|
} |
||||||
|
|
||||||
|
@Bean(name = ChannelName.EVENTS_COLLECTION_INBOUND) |
||||||
|
public MessageChannel eventsCollectionInbound() { |
||||||
|
return new DirectChannel(); |
||||||
|
} |
||||||
|
|
||||||
|
@Bean(name = ChannelName.EVENTS_CONTROL_INBOUND) |
||||||
|
public MessageChannel eventsControlInbound() { |
||||||
|
return new DirectChannel(); |
||||||
|
} |
||||||
|
|
||||||
|
@Bean(name = ChannelName.EVENTS_SEND_INBOUND) |
||||||
|
public MessageChannel eventsSendInbound() { |
||||||
|
return new DirectChannel(); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,51 @@ |
|||||||
|
package com.mh.user.config.mqtt; |
||||||
|
|
||||||
|
import com.mh.user.constants.ChannelName; |
||||||
|
import lombok.extern.slf4j.Slf4j; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.context.annotation.Bean; |
||||||
|
import org.springframework.context.annotation.Configuration; |
||||||
|
import org.springframework.integration.annotation.IntegrationComponentScan; |
||||||
|
import org.springframework.integration.annotation.ServiceActivator; |
||||||
|
import org.springframework.integration.mqtt.core.MqttPahoClientFactory; |
||||||
|
import org.springframework.integration.mqtt.outbound.MqttPahoMessageHandler; |
||||||
|
import org.springframework.integration.mqtt.support.DefaultPahoMessageConverter; |
||||||
|
import org.springframework.messaging.MessageHandler; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project springboot-mqtt-demo |
||||||
|
* @description 入站配置 |
||||||
|
* @date 2024-10-29 16:22:10 |
||||||
|
*/ |
||||||
|
@Slf4j |
||||||
|
@Configuration |
||||||
|
@IntegrationComponentScan |
||||||
|
public class MqttOutboundConfig { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private MqttPahoClientFactory mqttClientFactory; |
||||||
|
|
||||||
|
/** |
||||||
|
* 默认声明一个出站处理器,用于处理无效的消息 |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@Bean |
||||||
|
@ServiceActivator(inputChannel = ChannelName.OUTBOUND) |
||||||
|
public MessageHandler mqttOutbound() { |
||||||
|
MqttPahoMessageHandler messageHandler = new MqttPahoMessageHandler( |
||||||
|
MqttConfig.getBasicMqttClientOptions().getClientId() + "_producer_" + System.currentTimeMillis(), |
||||||
|
mqttClientFactory); |
||||||
|
DefaultPahoMessageConverter converter = new DefaultPahoMessageConverter(); |
||||||
|
// use byte types uniformly
|
||||||
|
converter.setPayloadAsBytes(true); |
||||||
|
|
||||||
|
messageHandler.setAsync(true); |
||||||
|
messageHandler.setDefaultQos(0); |
||||||
|
messageHandler.setConverter(converter); |
||||||
|
return messageHandler; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
@ -1,71 +0,0 @@ |
|||||||
package com.mh.user.controller; |
|
||||||
|
|
||||||
import com.mh.common.http.HttpResult; |
|
||||||
import com.mh.common.utils.StringUtils; |
|
||||||
import com.mh.user.annotation.SysLogger; |
|
||||||
import com.mh.user.entity.CollectionParamsManageEntity; |
|
||||||
import com.mh.user.entity.DeviceInstallEntity; |
|
||||||
import com.mh.user.model.DeviceModel; |
|
||||||
import com.mh.user.service.*; |
|
||||||
import org.apache.poi.hssf.usermodel.HSSFCell; |
|
||||||
import org.apache.poi.hssf.usermodel.HSSFSheet; |
|
||||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
|
||||||
import org.apache.poi.ss.usermodel.CellType; |
|
||||||
import org.springframework.beans.factory.annotation.Autowired; |
|
||||||
import org.springframework.web.bind.annotation.*; |
|
||||||
import org.springframework.web.multipart.MultipartFile; |
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest; |
|
||||||
import java.io.IOException; |
|
||||||
import java.io.InputStream; |
|
||||||
import java.text.SimpleDateFormat; |
|
||||||
import java.util.*; |
|
||||||
|
|
||||||
/** |
|
||||||
* 基表参数信息管理 |
|
||||||
*/ |
|
||||||
@RestController |
|
||||||
@RequestMapping("cpm") |
|
||||||
public class CollectionParamsManageController { |
|
||||||
|
|
||||||
@Autowired |
|
||||||
private CollectionParamsManageService collectionParamsManageService; |
|
||||||
|
|
||||||
//保存
|
|
||||||
@SysLogger(title="基表采集信息",optDesc = "保存基表采集参数信息") |
|
||||||
@PostMapping(value="/save") |
|
||||||
public HttpResult saveDevice(@RequestBody CollectionParamsManageEntity collectionParamsManageEntity) { |
|
||||||
return HttpResult.ok(collectionParamsManageService.insertCPM(collectionParamsManageEntity)); |
|
||||||
} |
|
||||||
|
|
||||||
//修改
|
|
||||||
@SysLogger(title="基表采集参数信息",optDesc = "修改基表采集参数信息") |
|
||||||
@PostMapping(value="/update") |
|
||||||
public HttpResult updateDevice(@RequestBody CollectionParamsManageEntity collectionParamsManageEntity) { |
|
||||||
return HttpResult.ok(collectionParamsManageService.updateCPM(collectionParamsManageEntity)); |
|
||||||
} |
|
||||||
|
|
||||||
// 删除多
|
|
||||||
@PostMapping(value="/deletes") |
|
||||||
public HttpResult deleteDevices(@RequestBody String[] ids) { |
|
||||||
return HttpResult.ok(collectionParamsManageService.deleteByIds(ids)); |
|
||||||
} |
|
||||||
|
|
||||||
// 按条件查询
|
|
||||||
@SysLogger(title="基表采集信息",optDesc = "按条件查询基表采集参数信息") |
|
||||||
@PostMapping(value="/query") |
|
||||||
public HttpResult queryDevice( @RequestParam(value = "deviceInstallId", required = false)String deviceInstallId, |
|
||||||
@RequestParam(value = "buildingId", required = false)String buildingId, |
|
||||||
@RequestParam(value = "otherName", required = false)String otherName, |
|
||||||
@RequestParam(value = "page", required=true)Integer page, |
|
||||||
@RequestParam(value = "limit", required=true)Integer limit) { |
|
||||||
try{ |
|
||||||
int count=collectionParamsManageService.selectCPMListCount(buildingId, deviceInstallId,otherName, page, limit); |
|
||||||
List<CollectionParamsManageEntity> records=collectionParamsManageService.selectCPMList(buildingId, deviceInstallId,otherName, page, limit); |
|
||||||
return HttpResult.ok(count,records); |
|
||||||
}catch (Exception e){ |
|
||||||
return HttpResult.error(e.getMessage()); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
@ -1,52 +0,0 @@ |
|||||||
package com.mh.user.controller; |
|
||||||
|
|
||||||
import com.mh.common.http.HttpResult; |
|
||||||
import com.mh.user.dto.HotWaterControlDTO; |
|
||||||
import com.mh.user.dto.HotWaterNowDataDTO; |
|
||||||
import com.mh.user.service.CollectionParamsManageService; |
|
||||||
import org.springframework.beans.factory.annotation.Autowired; |
|
||||||
import org.springframework.web.bind.annotation.GetMapping; |
|
||||||
import org.springframework.web.bind.annotation.RequestMapping; |
|
||||||
import org.springframework.web.bind.annotation.RequestParam; |
|
||||||
import org.springframework.web.bind.annotation.RestController; |
|
||||||
|
|
||||||
import java.util.List; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author LJF |
|
||||||
* @version 1.0 |
|
||||||
* @project CHWS |
|
||||||
* @description 热水监控 |
|
||||||
* @date 2025-12-16 16:02:20 |
|
||||||
*/ |
|
||||||
@RestController |
|
||||||
@RequestMapping("/device/hotWater") |
|
||||||
public class HotWaterMonitorController { |
|
||||||
|
|
||||||
@Autowired |
|
||||||
private CollectionParamsManageService collectionParamsManageService; |
|
||||||
|
|
||||||
/** |
|
||||||
* 获取生活热水监控热泵信息 |
|
||||||
* @param buildingId |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
@GetMapping("/monitorList") |
|
||||||
public HttpResult monitorList(@RequestParam("buildingId") String buildingId) { |
|
||||||
List<HotWaterNowDataDTO> list = collectionParamsManageService.monitorList(buildingId); |
|
||||||
return HttpResult. ok(list); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 获取生活热水监控操作信息内容 |
|
||||||
* @param buildingId |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
@GetMapping("/operateList") |
|
||||||
public HttpResult operateList(@RequestParam("buildingId") String buildingId) { |
|
||||||
List<HotWaterControlDTO> list = collectionParamsManageService.operateList(buildingId); |
|
||||||
return HttpResult.ok(list); |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
} |
|
||||||
@ -1,144 +0,0 @@ |
|||||||
package com.mh.user.dto; |
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat; |
|
||||||
import lombok.Getter; |
|
||||||
import lombok.Setter; |
|
||||||
|
|
||||||
import java.math.BigDecimal; |
|
||||||
import java.util.StringJoiner; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author LJF |
|
||||||
* @version 1.0 |
|
||||||
* @project EEMCS |
|
||||||
* @description 回水泵热泵控制界面VO |
|
||||||
* @date 2025-03-14 09:00:37 |
|
||||||
*/ |
|
||||||
@Setter |
|
||||||
@Getter |
|
||||||
public class HotWaterBackPumpControlVO { |
|
||||||
|
|
||||||
private String id; |
|
||||||
|
|
||||||
private String name; |
|
||||||
|
|
||||||
private int orderNum; |
|
||||||
|
|
||||||
// 定时_时开1
|
|
||||||
private int oneHourTimeOpenSetOne; |
|
||||||
private String oneHourTimeOpenSetOneId; |
|
||||||
|
|
||||||
// 定时_分开1
|
|
||||||
private int oneMinTimeOpenSetOne; |
|
||||||
private String oneMinTimeOpenSetOneId; |
|
||||||
|
|
||||||
// 定时_时关1
|
|
||||||
private int oneHourTimeCloseSetOne; |
|
||||||
private String oneHourTimeCloseSetOneId; |
|
||||||
|
|
||||||
// 定时_分关1
|
|
||||||
private int oneMinTimeCloseSetOne; |
|
||||||
private String oneMinTimeCloseSetOneId; |
|
||||||
|
|
||||||
// 定时_时开2
|
|
||||||
private int oneHourTimeOpenSetTwo; |
|
||||||
private String oneHourTimeOpenSetTwoId; |
|
||||||
|
|
||||||
// 定时_分开2
|
|
||||||
private int oneMinTimeOpenSetTwo; |
|
||||||
private String oneMinTimeOpenSetTwoId; |
|
||||||
|
|
||||||
// 定时_时关2
|
|
||||||
private int oneHourTimeCloseSetTwo; |
|
||||||
private String oneHourTimeCloseSetTwoId; |
|
||||||
|
|
||||||
// 定时_分关2
|
|
||||||
private int oneMinTimeCloseSetTwo; |
|
||||||
private String oneMinTimeCloseSetTwoId; |
|
||||||
|
|
||||||
// 定时_时开3
|
|
||||||
private int oneHourTimeOpenSetThree; |
|
||||||
private String oneHourTimeOpenSetThreeId; |
|
||||||
|
|
||||||
// 定时_分开3
|
|
||||||
private int oneMinTimeOpenSetThree; |
|
||||||
private String oneMinTimeOpenSetThreeId; |
|
||||||
|
|
||||||
// 定时_时关3
|
|
||||||
private int oneHourTimeCloseSetThree; |
|
||||||
private String oneHourTimeCloseSetThreeId; |
|
||||||
|
|
||||||
// 定时_分关3
|
|
||||||
private int oneMinTimeCloseSetThree; |
|
||||||
private String oneMinTimeCloseSetThreeId; |
|
||||||
|
|
||||||
// 开延时
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private int openDelayTime; |
|
||||||
private String openDelayTimeId; |
|
||||||
|
|
||||||
// 温度设置
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal tempSet; |
|
||||||
private String tempSetId; |
|
||||||
|
|
||||||
// 累计运行时间
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal runTime; |
|
||||||
private String runTimeId; |
|
||||||
|
|
||||||
// 运行状态
|
|
||||||
private int runState; |
|
||||||
private String runStateId; |
|
||||||
|
|
||||||
// 启停控制
|
|
||||||
private int startStopControl; |
|
||||||
private String startStopControlId; |
|
||||||
|
|
||||||
// 故障
|
|
||||||
private int fault; |
|
||||||
private String faultId; |
|
||||||
|
|
||||||
@Override |
|
||||||
public String toString() { |
|
||||||
return new StringJoiner(", ", HotWaterBackPumpControlVO.class.getSimpleName() + "[", "]") |
|
||||||
.add("id='" + id + "'") |
|
||||||
.add("name='" + name + "'") |
|
||||||
.add("orderNum=" + orderNum) |
|
||||||
.add("oneHourTimeOpenSetOne=" + oneHourTimeOpenSetOne) |
|
||||||
.add("oneHourTimeOpenSetOneId='" + oneHourTimeOpenSetOneId + "'") |
|
||||||
.add("oneMinTimeOpenSetOne=" + oneMinTimeOpenSetOne) |
|
||||||
.add("oneMinTimeOpenSetOneId='" + oneMinTimeOpenSetOneId + "'") |
|
||||||
.add("oneHourTimeCloseSetOne=" + oneHourTimeCloseSetOne) |
|
||||||
.add("oneHourTimeCloseSetOneId='" + oneHourTimeCloseSetOneId + "'") |
|
||||||
.add("oneMinTimeCloseSetOne=" + oneMinTimeCloseSetOne) |
|
||||||
.add("oneMinTimeCloseSetOneId='" + oneMinTimeCloseSetOneId + "'") |
|
||||||
.add("oneHourTimeOpenSetTwo=" + oneHourTimeOpenSetTwo) |
|
||||||
.add("oneHourTimeOpenSetTwoId='" + oneHourTimeOpenSetTwoId + "'") |
|
||||||
.add("oneMinTimeOpenSetTwo=" + oneMinTimeOpenSetTwo) |
|
||||||
.add("oneMinTimeOpenSetTwoId='" + oneMinTimeOpenSetTwoId + "'") |
|
||||||
.add("oneHourTimeCloseSetTwo=" + oneHourTimeCloseSetTwo) |
|
||||||
.add("oneHourTimeCloseSetTwoId='" + oneHourTimeCloseSetTwoId + "'") |
|
||||||
.add("oneMinTimeCloseSetTwo=" + oneMinTimeCloseSetTwo) |
|
||||||
.add("oneMinTimeCloseSetTwoId='" + oneMinTimeCloseSetTwoId + "'") |
|
||||||
.add("oneHourTimeOpenSetThree=" + oneHourTimeOpenSetThree) |
|
||||||
.add("oneHourTimeOpenSetThreeId='" + oneHourTimeOpenSetThreeId + "'") |
|
||||||
.add("oneMinTimeOpenSetThree=" + oneMinTimeOpenSetThree) |
|
||||||
.add("oneMinTimeOpenSetThreeId='" + oneMinTimeOpenSetThreeId + "'") |
|
||||||
.add("oneHourTimeCloseSetThree=" + oneHourTimeCloseSetThree) |
|
||||||
.add("oneHourTimeCloseSetThreeId='" + oneHourTimeCloseSetThreeId + "'") |
|
||||||
.add("openDelayTime=" + openDelayTime) |
|
||||||
.add("openDelayTimeId='" + openDelayTimeId + "'") |
|
||||||
.add("tempSet=" + tempSet) |
|
||||||
.add("tempSetId='" + tempSetId + "'") |
|
||||||
.add("runTime=" + runTime) |
|
||||||
.add("runTimeId='" + runTimeId + "'") |
|
||||||
.add("runState=" + runState) |
|
||||||
.add("runStateId='" + runStateId + "'") |
|
||||||
.add("startStopControl=" + startStopControl) |
|
||||||
.add("startStopControlId='" + startStopControlId + "'") |
|
||||||
.add("fault=" + fault) |
|
||||||
.add("faultId='" + faultId + "'") |
|
||||||
.toString(); |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,104 +0,0 @@ |
|||||||
package com.mh.user.dto; |
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat; |
|
||||||
import lombok.Getter; |
|
||||||
import lombok.Setter; |
|
||||||
|
|
||||||
import java.math.BigDecimal; |
|
||||||
import java.util.StringJoiner; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author LJF |
|
||||||
* @version 1.0 |
|
||||||
* @project EEMCS |
|
||||||
* @description 热泵控制界面VO |
|
||||||
* @date 2025-03-14 09:00:37 |
|
||||||
*/ |
|
||||||
@Setter |
|
||||||
@Getter |
|
||||||
public class HotWaterCircuitPumpControlVO { |
|
||||||
|
|
||||||
private String id; |
|
||||||
|
|
||||||
private String name; |
|
||||||
|
|
||||||
private int orderNum; |
|
||||||
|
|
||||||
// 定时_时开1
|
|
||||||
private int oneHourTimeOpenSetOne; |
|
||||||
private String oneHourTimeOpenSetOneId; |
|
||||||
|
|
||||||
// 定时_分开1
|
|
||||||
private int oneMinTimeOpenSetOne; |
|
||||||
private String oneMinTimeOpenSetOneId; |
|
||||||
|
|
||||||
// 定时_时关1
|
|
||||||
private int oneHourTimeCloseSetOne; |
|
||||||
private String oneHourTimeCloseSetOneId; |
|
||||||
|
|
||||||
// 定时_分关1
|
|
||||||
private int oneMinTimeCloseSetOne; |
|
||||||
private String oneMinTimeCloseSetOneId; |
|
||||||
|
|
||||||
// 开延时
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private int openDelayTime; |
|
||||||
private String openDelayTimeId; |
|
||||||
|
|
||||||
// 温差
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal tempDiff; |
|
||||||
private String tempDiffId; |
|
||||||
|
|
||||||
// 温差设置
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal tempDiffSet; |
|
||||||
private String tempDiffSetId; |
|
||||||
|
|
||||||
// 累计运行时间
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal runTime; |
|
||||||
private String runTimeId; |
|
||||||
|
|
||||||
// 运行状态
|
|
||||||
private int runState; |
|
||||||
private String runStateId; |
|
||||||
|
|
||||||
// 启停控制
|
|
||||||
private int startStopControl; |
|
||||||
private String startStopControlId; |
|
||||||
|
|
||||||
// 故障
|
|
||||||
private int fault; |
|
||||||
private String faultId; |
|
||||||
|
|
||||||
@Override |
|
||||||
public String toString() { |
|
||||||
return new StringJoiner(", ", HotWaterCircuitPumpControlVO.class.getSimpleName() + "[", "]") |
|
||||||
.add("id='" + id + "'") |
|
||||||
.add("name='" + name + "'") |
|
||||||
.add("orderNum=" + orderNum) |
|
||||||
.add("oneHourTimeOpenSetOne=" + oneHourTimeOpenSetOne) |
|
||||||
.add("oneHourTimeOpenSetOneId='" + oneHourTimeOpenSetOneId + "'") |
|
||||||
.add("oneMinTimeOpenSetOne=" + oneMinTimeOpenSetOne) |
|
||||||
.add("oneMinTimeOpenSetOneId='" + oneMinTimeOpenSetOneId + "'") |
|
||||||
.add("oneHourTimeCloseSetOne=" + oneHourTimeCloseSetOne) |
|
||||||
.add("oneHourTimeCloseSetOneId='" + oneHourTimeCloseSetOneId + "'") |
|
||||||
.add("oneMinTimeCloseSetOne=" + oneMinTimeCloseSetOne) |
|
||||||
.add("oneMinTimeCloseSetOneId='" + oneMinTimeCloseSetOneId + "'") |
|
||||||
.add("tempDiff=" + tempDiff) |
|
||||||
.add("tempDiffId='" + tempDiffId + "'") |
|
||||||
.add("tempDiffSet=" + tempDiffSet) |
|
||||||
.add("tempDiffSetId='" + tempDiffSetId + "'") |
|
||||||
.add("runTime=" + runTime) |
|
||||||
.add("runTimeId='" + runTimeId + "'") |
|
||||||
.add("runState=" + runState) |
|
||||||
.add("runStateId='" + runStateId + "'") |
|
||||||
.add("startStopControl=" + startStopControl) |
|
||||||
.add("startStopControlId='" + startStopControlId + "'") |
|
||||||
.add("fault=" + fault) |
|
||||||
.add("faultId='" + faultId + "'") |
|
||||||
.toString(); |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
@ -1,38 +0,0 @@ |
|||||||
package com.mh.user.dto; |
|
||||||
|
|
||||||
import lombok.Getter; |
|
||||||
import lombok.Setter; |
|
||||||
import org.apache.poi.ss.formula.functions.T; |
|
||||||
|
|
||||||
import java.util.List; |
|
||||||
import java.util.StringJoiner; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author LJF |
|
||||||
* @version 1.0 |
|
||||||
* @project EEMCS |
|
||||||
* @description 生活热水监控dto |
|
||||||
* @date 2025-03-14 09:13:19 |
|
||||||
*/ |
|
||||||
@Setter |
|
||||||
@Getter |
|
||||||
public class HotWaterControlDTO { |
|
||||||
|
|
||||||
private String id; |
|
||||||
|
|
||||||
private String name; |
|
||||||
|
|
||||||
private int orderNum; |
|
||||||
|
|
||||||
private List<?> children; |
|
||||||
|
|
||||||
@Override |
|
||||||
public String toString() { |
|
||||||
return new StringJoiner(", ", HotWaterControlDTO.class.getSimpleName() + "[", "]") |
|
||||||
.add("id='" + id + "'") |
|
||||||
.add("name='" + name + "'") |
|
||||||
.add("orderNum=" + orderNum) |
|
||||||
.add("children=" + children) |
|
||||||
.toString(); |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,77 +0,0 @@ |
|||||||
package com.mh.user.dto; |
|
||||||
|
|
||||||
import lombok.Getter; |
|
||||||
import lombok.Setter; |
|
||||||
|
|
||||||
import java.math.BigDecimal; |
|
||||||
import java.util.Date; |
|
||||||
import java.util.StringJoiner; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author LJF |
|
||||||
* @version 1.0 |
|
||||||
* @project EEMCS |
|
||||||
* @description 生活热水监控需要的列表信息 |
|
||||||
* @date 2025-03-14 09:07:46 |
|
||||||
*/ |
|
||||||
@Setter |
|
||||||
@Getter |
|
||||||
public class HotWaterControlListVO { |
|
||||||
|
|
||||||
private String cpmId; |
|
||||||
|
|
||||||
private String buildingId; |
|
||||||
|
|
||||||
private String buildingName; |
|
||||||
|
|
||||||
private String deviceType; |
|
||||||
|
|
||||||
private String deviceId; |
|
||||||
|
|
||||||
private String deviceName; |
|
||||||
|
|
||||||
private BigDecimal curValue; |
|
||||||
|
|
||||||
private Date curTime; |
|
||||||
|
|
||||||
private String paramTypeId; |
|
||||||
|
|
||||||
private String otherName; |
|
||||||
|
|
||||||
private int dtOrderNum; |
|
||||||
|
|
||||||
private int dlOrderNum; |
|
||||||
|
|
||||||
private int ctOrderNum; |
|
||||||
|
|
||||||
public BigDecimal getCurValue() { |
|
||||||
return curValue; |
|
||||||
} |
|
||||||
|
|
||||||
public void setCurValue(BigDecimal curValue) { |
|
||||||
if (curValue!= null) { |
|
||||||
// 保留两位小数
|
|
||||||
curValue = curValue.setScale(2, BigDecimal.ROUND_HALF_UP); |
|
||||||
} |
|
||||||
this.curValue = curValue; |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public String toString() { |
|
||||||
return new StringJoiner(", ", HotWaterControlListVO.class.getSimpleName() + "[", "]") |
|
||||||
.add("cpmId='" + cpmId + "'") |
|
||||||
.add("buildingId='" + buildingId + "'") |
|
||||||
.add("buildingName='" + buildingName + "'") |
|
||||||
.add("deviceType='" + deviceType + "'") |
|
||||||
.add("deviceId='" + deviceId + "'") |
|
||||||
.add("deviceName='" + deviceName + "'") |
|
||||||
.add("curValue=" + curValue) |
|
||||||
.add("curTime=" + curTime) |
|
||||||
.add("paramTypeId='" + paramTypeId + "'") |
|
||||||
.add("otherName='" + otherName + "'") |
|
||||||
.add("dtOrderNum=" + dtOrderNum) |
|
||||||
.add("dlOrderNum=" + dlOrderNum) |
|
||||||
.add("ctOrderNum=" + ctOrderNum) |
|
||||||
.toString(); |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,186 +0,0 @@ |
|||||||
package com.mh.user.dto; |
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat; |
|
||||||
import lombok.Getter; |
|
||||||
import lombok.Setter; |
|
||||||
|
|
||||||
import java.math.BigDecimal; |
|
||||||
import java.util.Date; |
|
||||||
import java.util.StringJoiner; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author LJF |
|
||||||
* @version 1.0 |
|
||||||
* @project EEMCS |
|
||||||
* @description 生活热水系统控制界面VO |
|
||||||
* @date 2025-03-14 09:00:37 |
|
||||||
*/ |
|
||||||
@Setter |
|
||||||
@Getter |
|
||||||
public class HotWaterControlVO { |
|
||||||
|
|
||||||
private String id; |
|
||||||
|
|
||||||
private String name; |
|
||||||
|
|
||||||
// 运行状态 1d
|
|
||||||
private int runningStatus; |
|
||||||
private String runningStatusId; |
|
||||||
|
|
||||||
// 启停控制 2
|
|
||||||
private int switchStatus; |
|
||||||
private String switchStatusId; |
|
||||||
|
|
||||||
// 频率设置 3
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal frequencySet; |
|
||||||
private String frequencySetId; |
|
||||||
|
|
||||||
// 频率 4
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal frequency; |
|
||||||
private String frequencyId; |
|
||||||
|
|
||||||
// 故障状态 5
|
|
||||||
private int alarmStatus; |
|
||||||
private String alarmStatusId; |
|
||||||
|
|
||||||
// 手动自动切换 6
|
|
||||||
private int handAutomaticSwitch; |
|
||||||
private String handAutomaticSwitchId; |
|
||||||
|
|
||||||
// 开控制 8
|
|
||||||
private int openSwitch; |
|
||||||
private String openSwitchId; |
|
||||||
|
|
||||||
// 关控制 9
|
|
||||||
private int closeSwitch; |
|
||||||
private String closeSwitchId; |
|
||||||
|
|
||||||
// 水位设置 10
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.0") |
|
||||||
private BigDecimal waterLevelSet; |
|
||||||
private String waterLevelSetId; |
|
||||||
|
|
||||||
// 水位 11
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.0") |
|
||||||
private BigDecimal waterLevel; |
|
||||||
private String waterLevelId; |
|
||||||
|
|
||||||
// 温度 12
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal temp; |
|
||||||
private String tempId; |
|
||||||
|
|
||||||
// 压力 13
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal pressure; |
|
||||||
private String pressureId; |
|
||||||
|
|
||||||
// 温度设置 14
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal tempSet; |
|
||||||
private String tempSetId; |
|
||||||
|
|
||||||
// 压力设置 15
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal pressureSet; |
|
||||||
private String pressureSetId; |
|
||||||
|
|
||||||
// 延时时间设置 34
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal delayTimeSet; |
|
||||||
private String delayTimeSetId; |
|
||||||
|
|
||||||
// 差值设置 35
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal diffValueSet; |
|
||||||
private String diffValueSetId; |
|
||||||
|
|
||||||
// 计数器设置 36
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal counterSet; |
|
||||||
private String counterSetId; |
|
||||||
|
|
||||||
// 切换时间设置 37
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal switchTimeSet; |
|
||||||
private String switchTimeSetId; |
|
||||||
|
|
||||||
// 故障复位状态 38
|
|
||||||
private int faultResetStatus; |
|
||||||
private String faultResetStatusId; |
|
||||||
|
|
||||||
// 急停状态 39
|
|
||||||
private int emergencyStopStatus; |
|
||||||
private String emergencyStopStatusId; |
|
||||||
|
|
||||||
// 最低设置值 44
|
|
||||||
private int minSet; |
|
||||||
private String minSetId; |
|
||||||
|
|
||||||
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|
||||||
private Date curTime; |
|
||||||
|
|
||||||
private int orderNum; |
|
||||||
|
|
||||||
public void setCounterSet(BigDecimal counterSet) { |
|
||||||
if (counterSet != null) { |
|
||||||
counterSet = counterSet.setScale(0, BigDecimal.ROUND_HALF_UP); |
|
||||||
} |
|
||||||
this.counterSet = counterSet; |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public String toString() { |
|
||||||
return new StringJoiner(", ", HotWaterControlVO.class.getSimpleName() + "[", "]") |
|
||||||
.add("id='" + id + "'") |
|
||||||
.add("name='" + name + "'") |
|
||||||
.add("runningStatus=" + runningStatus) |
|
||||||
.add("runningStatusId='" + runningStatusId + "'") |
|
||||||
.add("switchStatus=" + switchStatus) |
|
||||||
.add("switchStatusId='" + switchStatusId + "'") |
|
||||||
.add("frequencySet=" + frequencySet) |
|
||||||
.add("frequencySetId='" + frequencySetId + "'") |
|
||||||
.add("frequency=" + frequency) |
|
||||||
.add("frequencyId='" + frequencyId + "'") |
|
||||||
.add("alarmStatus=" + alarmStatus) |
|
||||||
.add("alarmStatusId='" + alarmStatusId + "'") |
|
||||||
.add("handAutomaticSwitch=" + handAutomaticSwitch) |
|
||||||
.add("handAutomaticSwitchId='" + handAutomaticSwitchId + "'") |
|
||||||
.add("openSwitch=" + openSwitch) |
|
||||||
.add("openSwitchId='" + openSwitchId + "'") |
|
||||||
.add("closeSwitch=" + closeSwitch) |
|
||||||
.add("closeSwitchId='" + closeSwitchId + "'") |
|
||||||
.add("waterLevelSet=" + waterLevelSet) |
|
||||||
.add("waterLevelSetId='" + waterLevelSetId + "'") |
|
||||||
.add("waterLevel=" + waterLevel) |
|
||||||
.add("waterLevelId='" + waterLevelId + "'") |
|
||||||
.add("temp=" + temp) |
|
||||||
.add("tempId='" + tempId + "'") |
|
||||||
.add("pressure=" + pressure) |
|
||||||
.add("pressureId='" + pressureId + "'") |
|
||||||
.add("tempSet=" + tempSet) |
|
||||||
.add("tempSetId='" + tempSetId + "'") |
|
||||||
.add("pressureSet=" + pressureSet) |
|
||||||
.add("pressureSetId='" + pressureSetId + "'") |
|
||||||
.add("delayTimeSet=" + delayTimeSet) |
|
||||||
.add("delayTimeSetId='" + delayTimeSetId + "'") |
|
||||||
.add("diffValueSet=" + diffValueSet) |
|
||||||
.add("diffValueSetId='" + diffValueSetId + "'") |
|
||||||
.add("counterSet=" + counterSet) |
|
||||||
.add("counterSetId='" + counterSetId + "'") |
|
||||||
.add("switchTimeSet=" + switchTimeSet) |
|
||||||
.add("switchTimeSetId='" + switchTimeSetId + "'") |
|
||||||
.add("faultResetStatus=" + faultResetStatus) |
|
||||||
.add("faultResetStatusId='" + faultResetStatusId + "'") |
|
||||||
.add("emergencyStopStatus=" + emergencyStopStatus) |
|
||||||
.add("emergencyStopStatusId='" + emergencyStopStatusId + "'") |
|
||||||
.add("minSet=" + minSet) |
|
||||||
.add("minSetId='" + minSetId + "'") |
|
||||||
.add("curTime=" + curTime) |
|
||||||
.add("orderNum=" + orderNum) |
|
||||||
.toString(); |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,71 +0,0 @@ |
|||||||
package com.mh.user.dto; |
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat; |
|
||||||
import lombok.Getter; |
|
||||||
import lombok.Setter; |
|
||||||
|
|
||||||
import java.math.BigDecimal; |
|
||||||
import java.util.Date; |
|
||||||
import java.util.StringJoiner; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author LJF |
|
||||||
* @version 1.0 |
|
||||||
* @project EEMCS |
|
||||||
* @description 设备校准控制界面VO |
|
||||||
* @date 2025-03-14 09:00:37 |
|
||||||
*/ |
|
||||||
@Setter |
|
||||||
@Getter |
|
||||||
public class HotWaterDeviceCalibrationControlVO { |
|
||||||
|
|
||||||
private String id; |
|
||||||
|
|
||||||
private String name; |
|
||||||
|
|
||||||
private int orderNum; |
|
||||||
|
|
||||||
// 校准值
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal calibrationValue; |
|
||||||
private String calibrationValueId; |
|
||||||
|
|
||||||
// 工程量最低值
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal engineeringMinValue; |
|
||||||
private String engineeringMinValueId; |
|
||||||
|
|
||||||
// 工程量最高值
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal engineeringMaxValue; |
|
||||||
private String engineeringMaxValueId; |
|
||||||
|
|
||||||
// 数字量最低值
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal digitalMinValue; |
|
||||||
private String digitalMinValueId; |
|
||||||
|
|
||||||
// 数字量最高值
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal digitalMaxValue; |
|
||||||
private String digitalMaxValueId; |
|
||||||
|
|
||||||
@Override |
|
||||||
public String toString() { |
|
||||||
return new StringJoiner(", ", HotWaterDeviceCalibrationControlVO.class.getSimpleName() + "[", "]") |
|
||||||
.add("id='" + id + "'") |
|
||||||
.add("name='" + name + "'") |
|
||||||
.add("orderNum=" + orderNum) |
|
||||||
.add("calibrationValue=" + calibrationValue) |
|
||||||
.add("calibrationValueId='" + calibrationValueId + "'") |
|
||||||
.add("engineeringMinValue=" + engineeringMinValue) |
|
||||||
.add("engineeringMinValueId='" + engineeringMinValueId + "'") |
|
||||||
.add("engineeringMaxValue=" + engineeringMaxValue) |
|
||||||
.add("engineeringMaxValueId='" + engineeringMaxValueId + "'") |
|
||||||
.add("digitalMinValue=" + digitalMinValue) |
|
||||||
.add("digitalMinValueId='" + digitalMinValueId + "'") |
|
||||||
.add("digitalMaxValue=" + digitalMaxValue) |
|
||||||
.add("digitalMaxValueId='" + digitalMaxValueId + "'") |
|
||||||
.toString(); |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,43 +0,0 @@ |
|||||||
package com.mh.user.dto; |
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat; |
|
||||||
import lombok.Getter; |
|
||||||
import lombok.Setter; |
|
||||||
|
|
||||||
import java.math.BigDecimal; |
|
||||||
import java.util.Date; |
|
||||||
import java.util.StringJoiner; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author LJF |
|
||||||
* @version 1.0 |
|
||||||
* @project EEMCS |
|
||||||
* @description 生活热水系统控制界面VO |
|
||||||
* @date 2025-03-14 09:00:37 |
|
||||||
*/ |
|
||||||
@Setter |
|
||||||
@Getter |
|
||||||
public class HotWaterDeviceControlVO { |
|
||||||
|
|
||||||
private String id; |
|
||||||
|
|
||||||
private String name; |
|
||||||
|
|
||||||
private int orderNum; |
|
||||||
|
|
||||||
// 累计读数
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING) |
|
||||||
private BigDecimal totalReading; |
|
||||||
private String totalReadingId; |
|
||||||
|
|
||||||
@Override |
|
||||||
public String toString() { |
|
||||||
return new StringJoiner(", ", HotWaterDeviceControlVO.class.getSimpleName() + "[", "]") |
|
||||||
.add("id='" + id + "'") |
|
||||||
.add("name='" + name + "'") |
|
||||||
.add("orderNum=" + orderNum) |
|
||||||
.add("totalReading=" + totalReading) |
|
||||||
.add("totalReadingId='" + totalReadingId + "'") |
|
||||||
.toString(); |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,241 +0,0 @@ |
|||||||
package com.mh.user.dto; |
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat; |
|
||||||
import lombok.Getter; |
|
||||||
import lombok.Setter; |
|
||||||
|
|
||||||
import java.math.BigDecimal; |
|
||||||
import java.util.StringJoiner; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author LJF |
|
||||||
* @version 1.0 |
|
||||||
* @project EEMCS |
|
||||||
* @description 热泵控制界面VO |
|
||||||
* @date 2025-03-14 09:00:37 |
|
||||||
*/ |
|
||||||
@Setter |
|
||||||
@Getter |
|
||||||
public class HotWaterHotPumpControlVO { // 去掉pump后的类名
|
|
||||||
|
|
||||||
private String id; |
|
||||||
|
|
||||||
private String name; |
|
||||||
|
|
||||||
private int orderNum; |
|
||||||
|
|
||||||
// 热泵12定时_时开1
|
|
||||||
private int oneHourTimeOpenSetOne; |
|
||||||
private String oneHourTimeOpenSetOneId; |
|
||||||
|
|
||||||
// 热泵12定时_分开1 (新增分钟设置)
|
|
||||||
private int oneMinTimeOpenSetOne; |
|
||||||
private String oneMinTimeOpenSetOneId; |
|
||||||
|
|
||||||
// 热泵12定时_时关1
|
|
||||||
private int oneHourTimeCloseSetOne; |
|
||||||
private String oneHourTimeCloseSetOneId; |
|
||||||
|
|
||||||
// 热泵12定时_分关1 (新增分钟设置)
|
|
||||||
private int oneMinTimeCloseSetOne; |
|
||||||
private String oneMinTimeCloseSetOneId; |
|
||||||
|
|
||||||
// 热泵12定时_时开2
|
|
||||||
private int oneHourTimeOpenSetTwo; |
|
||||||
private String oneHourTimeOpenSetTwoId; |
|
||||||
|
|
||||||
// 热泵12定时_分开2 (新增分钟设置)
|
|
||||||
private int oneMinTimeOpenSetTwo; |
|
||||||
private String oneMinTimeOpenSetTwoId; |
|
||||||
|
|
||||||
// 热泵12定时_时关2
|
|
||||||
private int oneHourTimeCloseSetTwo; |
|
||||||
private String oneHourTimeCloseSetTwoId; |
|
||||||
|
|
||||||
// 热泵12定时_分关2 (新增分钟设置)
|
|
||||||
private int oneMinTimeCloseSetTwo; |
|
||||||
private String oneMinTimeCloseSetTwoId; |
|
||||||
|
|
||||||
// 热泵12定时_时开3
|
|
||||||
private int oneHourTimeOpenSetThree; |
|
||||||
private String oneHourTimeOpenSetThreeId; |
|
||||||
|
|
||||||
// 热泵12定时_分开3 (新增分钟设置)
|
|
||||||
private int oneMinTimeOpenSetThree; |
|
||||||
private String oneMinTimeOpenSetThreeId; |
|
||||||
|
|
||||||
// 热泵12定时_时关3
|
|
||||||
private int oneHourTimeCloseSetThree; |
|
||||||
private String oneHourTimeCloseSetThreeId; |
|
||||||
|
|
||||||
// 热泵12定时_分关3 (新增分钟设置)
|
|
||||||
private int oneMinTimeCloseSetThree; |
|
||||||
private String oneMinTimeCloseSetThreeId; |
|
||||||
|
|
||||||
// 热泵12定时_时开1
|
|
||||||
private int twoHourTimeOpenSetOne; |
|
||||||
private String twoHourTimeOpenSetOneId; |
|
||||||
|
|
||||||
// 热泵34定时_分开1 (新增分钟设置)
|
|
||||||
private int twoMinTimeOpenSetOne; |
|
||||||
private String twoMinTimeOpenSetOneId; |
|
||||||
|
|
||||||
// 热泵34定时_时关1
|
|
||||||
private int twoHourTimeCloseSetOne; |
|
||||||
private String twoHourTimeCloseSetOneId; |
|
||||||
|
|
||||||
// 热泵34定时_分关1 (新增分钟设置)
|
|
||||||
private int twoMinTimeCloseSetOne; |
|
||||||
private String twoMinTimeCloseSetOneId; |
|
||||||
|
|
||||||
// 热泵34定时_时开2
|
|
||||||
private int twoHourTimeOpenSetTwo; |
|
||||||
private String twoHourTimeOpenSetTwoId; |
|
||||||
|
|
||||||
// 热泵34定时_分开2 (新增分钟设置)
|
|
||||||
private int twoMinTimeOpenSetTwo; |
|
||||||
private String twoMinTimeOpenSetTwoId; |
|
||||||
|
|
||||||
// 热泵34定时_时关2
|
|
||||||
private int twoHourTimeCloseSetTwo; |
|
||||||
private String twoHourTimeCloseSetTwoId; |
|
||||||
|
|
||||||
// 热泵34定时_分关2 (新增分钟设置)
|
|
||||||
private int twoMinTimeCloseSetTwo; |
|
||||||
private String twoMinTimeCloseSetTwoId; |
|
||||||
|
|
||||||
// 热泵34定时_时开3
|
|
||||||
private int twoHourTimeOpenSetThree; |
|
||||||
private String twoHourTimeOpenSetThreeId; |
|
||||||
|
|
||||||
// 热泵34定时_分开3 (新增分钟设置)
|
|
||||||
private int twoMinTimeOpenSetThree; |
|
||||||
private String twoMinTimeOpenSetThreeId; |
|
||||||
|
|
||||||
// 热泵34定时_时关3
|
|
||||||
private int twoHourTimeCloseSetThree; |
|
||||||
private String twoHourTimeCloseSetThreeId; |
|
||||||
|
|
||||||
// 热泵34定时_分关3 (新增分钟设置)
|
|
||||||
private int twoMinTimeCloseSetThree; |
|
||||||
private String twoMinTimeCloseSetThreeId; |
|
||||||
|
|
||||||
// 热泵_开机 -> 去掉pump前缀
|
|
||||||
private String start; |
|
||||||
private String startId; |
|
||||||
|
|
||||||
// 热泵_关机 -> 去掉pump前缀
|
|
||||||
private String stop; |
|
||||||
private String stopId; |
|
||||||
|
|
||||||
// 热泵_运行状态 -> 去掉pump前缀
|
|
||||||
private int runState; |
|
||||||
private String runStateId; |
|
||||||
|
|
||||||
// 热泵_启停控制 -> 去掉pump前缀
|
|
||||||
private int startStopControl; |
|
||||||
private String startStopControlId; |
|
||||||
|
|
||||||
// 热泵_设定温度 -> 去掉pump前缀
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal setTemp; |
|
||||||
private String setTempId; |
|
||||||
|
|
||||||
// 热泵_水箱温度 -> 去掉pump前缀
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal tankTemp; |
|
||||||
private String tankTempId; |
|
||||||
|
|
||||||
// 热泵累计运行时间 -> 去掉pump前缀
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal runTime; |
|
||||||
private String runTimeId; |
|
||||||
|
|
||||||
// 热泵_出水温度 -> 去掉pump前缀
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal outWaterTemp; |
|
||||||
private String outWaterTempId; |
|
||||||
|
|
||||||
// 热泵_进水温度 -> 去掉pump前缀
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal inWaterTemp; |
|
||||||
private String inWaterTempId; |
|
||||||
|
|
||||||
// 热泵_故障 -> 去掉pump前缀
|
|
||||||
private int fault; |
|
||||||
|
|
||||||
@Override |
|
||||||
public String toString() { |
|
||||||
return new StringJoiner(", ", HotWaterHotPumpControlVO.class.getSimpleName() + "[", "]") // 更新类名引用
|
|
||||||
.add("id='" + id + "'") |
|
||||||
.add("name='" + name + "'") |
|
||||||
.add("oneHourTimeOpenSetOne=" + oneHourTimeOpenSetOne) |
|
||||||
.add("oneHourTimeOpenSetOneId='" + oneHourTimeOpenSetOneId + "'") |
|
||||||
.add("oneMinTimeOpenSetOne=" + oneMinTimeOpenSetOne) // 新增分钟字段
|
|
||||||
.add("oneMinTimeOpenSetOneId='" + oneMinTimeOpenSetOneId + "'") // 新增分钟字段
|
|
||||||
.add("oneHourTimeCloseSetOne=" + oneHourTimeCloseSetOne) |
|
||||||
.add("oneHourTimeCloseSetOneId='" + oneHourTimeCloseSetOneId + "'") |
|
||||||
.add("oneMinTimeCloseSetOne=" + oneMinTimeCloseSetOne) // 新增分钟字段
|
|
||||||
.add("oneMinTimeCloseSetOneId='" + oneMinTimeCloseSetOneId + "'") // 新增分钟字段
|
|
||||||
.add("oneHourTimeOpenSetTwo=" + oneHourTimeOpenSetTwo) |
|
||||||
.add("oneHourTimeOpenSetTwoId='" + oneHourTimeOpenSetTwoId + "'") |
|
||||||
.add("oneMinTimeOpenSetTwo=" + oneMinTimeOpenSetTwo) // 新增分钟字段
|
|
||||||
.add("oneMinTimeOpenSetTwoId='" + oneMinTimeOpenSetTwoId + "'") // 新增分钟字段
|
|
||||||
.add("oneHourTimeCloseSetTwo=" + oneHourTimeCloseSetTwo) |
|
||||||
.add("oneHourTimeCloseSetTwoId='" + oneHourTimeCloseSetTwoId + "'") |
|
||||||
.add("oneMinTimeCloseSetTwo=" + oneMinTimeCloseSetTwo) // 新增分钟字段
|
|
||||||
.add("oneMinTimeCloseSetTwoId='" + oneMinTimeCloseSetTwoId + "'") // 新增分钟字段
|
|
||||||
.add("oneHourTimeOpenSetThree=" + oneHourTimeOpenSetThree) |
|
||||||
.add("oneHourTimeOpenSetThreeId='" + oneHourTimeOpenSetThreeId + "'") |
|
||||||
.add("oneMinTimeOpenSetThree=" + oneMinTimeOpenSetThree) // 新增分钟字段
|
|
||||||
.add("oneMinTimeOpenSetThreeId='" + oneMinTimeOpenSetThreeId + "'") // 新增分钟字段
|
|
||||||
.add("oneHourTimeCloseSetThree=" + oneHourTimeCloseSetThree) |
|
||||||
.add("oneHourTimeCloseSetThreeId='" + oneHourTimeCloseSetThreeId + "'") |
|
||||||
.add("oneMinTimeCloseSetThree=" + oneMinTimeCloseSetThree) // 新增分钟字段
|
|
||||||
.add("oneMinTimeCloseSetThreeId='" + oneMinTimeCloseSetThreeId + "'") // 新增分钟字段
|
|
||||||
.add("twoHourTimeOpenSetOne=" + twoHourTimeOpenSetOne) |
|
||||||
.add("twoHourTimeOpenSetOneId='" + twoHourTimeOpenSetOneId + "'") |
|
||||||
.add("twoMinTimeOpenSetOne=" + twoMinTimeOpenSetOne) // 新增分钟字段
|
|
||||||
.add("twoMinTimeOpenSetOneId='" + twoMinTimeOpenSetOneId + "'") // 新增分钟字段
|
|
||||||
.add("twoHourTimeCloseSetOne=" + twoHourTimeCloseSetOne) |
|
||||||
.add("twoHourTimeCloseSetOneId='" + twoHourTimeCloseSetOneId + "'") |
|
||||||
.add("twoMinTimeCloseSetOne=" + twoMinTimeCloseSetOne) // 新增分钟字段
|
|
||||||
.add("twoMinTimeCloseSetOneId='" + twoMinTimeCloseSetOneId + "'") // 新增分钟字段
|
|
||||||
.add("twoHourTimeOpenSetTwo=" + twoHourTimeOpenSetTwo) |
|
||||||
.add("twoHourTimeOpenSetTwoId='" + twoHourTimeOpenSetTwoId + "'") |
|
||||||
.add("twoMinTimeOpenSetTwo=" + twoMinTimeOpenSetTwo) // 新增分钟字段
|
|
||||||
.add("twoMinTimeOpenSetTwoId='" + twoMinTimeOpenSetTwoId + "'") // 新增分钟字段
|
|
||||||
.add("twoHourTimeCloseSetTwo=" + twoHourTimeCloseSetTwo) |
|
||||||
.add("twoHourTimeCloseSetTwoId='" + twoHourTimeCloseSetTwoId + "'") |
|
||||||
.add("twoMinTimeCloseSetTwo=" + twoMinTimeCloseSetTwo) // 新增分钟字段
|
|
||||||
.add("twoMinTimeCloseSetTwoId='" + twoMinTimeCloseSetTwoId + "'") // 新增分钟字段
|
|
||||||
.add("twoHourTimeOpenSetThree=" + twoHourTimeOpenSetThree) |
|
||||||
.add("twoHourTimeOpenSetThreeId='" + twoHourTimeOpenSetThreeId + "'") |
|
||||||
.add("twoMinTimeOpenSetThree=" + twoMinTimeOpenSetThree) // 新增分钟字段
|
|
||||||
.add("twoMinTimeOpenSetThreeId='" + twoMinTimeOpenSetThreeId + "'") // 新增分钟字段
|
|
||||||
.add("twoHourTimeCloseSetThree=" + twoHourTimeCloseSetThree) |
|
||||||
.add("twoHourTimeCloseSetThreeId='" + twoHourTimeCloseSetThreeId + "'") |
|
||||||
.add("twoMinTimeCloseSetThree=" + twoMinTimeCloseSetThree) // 新增分钟字段
|
|
||||||
.add("twoMinTimeCloseSetThreeId='" + twoMinTimeCloseSetThreeId + "'") // 新增分钟字段
|
|
||||||
.add("start='" + start + "'") |
|
||||||
.add("startId='" + startId + "'") |
|
||||||
.add("stop='" + stop + "'") |
|
||||||
.add("stopId='" + stopId + "'") |
|
||||||
.add("runState='" + runState + "'") |
|
||||||
.add("runStateId='" + runStateId + "'") |
|
||||||
.add("startStopControl='" + startStopControl + "'") |
|
||||||
.add("startStopControlId='" + startStopControlId + "'") |
|
||||||
.add("setTemp=" + setTemp) |
|
||||||
.add("setTempId='" + setTempId + "'") |
|
||||||
.add("tankTemp=" + tankTemp) |
|
||||||
.add("tankTempId='" + tankTempId + "'") |
|
||||||
.add("runTime=" + runTime) |
|
||||||
.add("runTimeId='" + runTimeId + "'") |
|
||||||
.add("outWaterTemp=" + outWaterTemp) |
|
||||||
.add("outWaterTempId='" + outWaterTempId + "'") |
|
||||||
.add("inWaterTemp=" + inWaterTemp) |
|
||||||
.add("inWaterTempId='" + inWaterTempId + "'") |
|
||||||
.add("fault=" + fault) |
|
||||||
.toString(); |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,55 +0,0 @@ |
|||||||
package com.mh.user.dto; |
|
||||||
|
|
||||||
import lombok.Data; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author LJF |
|
||||||
* @version 1.0 |
|
||||||
* @project EEMCS |
|
||||||
* @description 热水实时监控列表数据 |
|
||||||
* @date 2025-03-10 15:43:36 |
|
||||||
*/ |
|
||||||
@Data |
|
||||||
public class HotWaterNowDataDTO { |
|
||||||
|
|
||||||
private String id; |
|
||||||
private String curDate; //日期
|
|
||||||
private String buildingId; //楼栋编号
|
|
||||||
private String buildingName; //楼栋名称
|
|
||||||
private String pumpId; //热泵编号
|
|
||||||
private String pumpName; //热泵名称
|
|
||||||
private String tempSet; //水温设定
|
|
||||||
private String waterTemp; //水箱水温
|
|
||||||
private String runState; //运行状态
|
|
||||||
private String isFault; //是否故障
|
|
||||||
private String levelSet1; //水位设置
|
|
||||||
private String levelSet2; //水位设置
|
|
||||||
private String waterLevel1; //实际水位
|
|
||||||
private String waterLevel2; //实际水位
|
|
||||||
private String tankId; //水箱编号
|
|
||||||
private String tankName; //水箱名称
|
|
||||||
private String envTemp; //环境温度
|
|
||||||
|
|
||||||
private String upWaterState1; // 供水1泵状态
|
|
||||||
|
|
||||||
private String freq1; // 供水频率1
|
|
||||||
|
|
||||||
private String upWaterState2; // 供水2泵状态
|
|
||||||
|
|
||||||
private String freq2; // 供水频率2
|
|
||||||
|
|
||||||
private String upWaterState3; // 供水3泵状态
|
|
||||||
|
|
||||||
private String freq3; // 供水频率3
|
|
||||||
|
|
||||||
private String upWaterState4; // 供水4泵状态
|
|
||||||
|
|
||||||
private String freq4; // 供水频率4
|
|
||||||
|
|
||||||
private String useWaterState; // 补水状态
|
|
||||||
|
|
||||||
private String backWaterState; // 回水状态
|
|
||||||
|
|
||||||
private int orderNum; |
|
||||||
|
|
||||||
} |
|
||||||
@ -1,145 +0,0 @@ |
|||||||
package com.mh.user.dto; |
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat; |
|
||||||
import lombok.Getter; |
|
||||||
import lombok.Setter; |
|
||||||
|
|
||||||
import java.math.BigDecimal; |
|
||||||
import java.util.Date; |
|
||||||
import java.util.StringJoiner; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author LJF |
|
||||||
* @version 1.0 |
|
||||||
* @project EEMCS |
|
||||||
* @description 生活热水系统控制界面VO |
|
||||||
* @date 2025-03-14 09:00:37 |
|
||||||
*/ |
|
||||||
@Setter |
|
||||||
@Getter |
|
||||||
public class HotWaterSystemControlVO { |
|
||||||
|
|
||||||
private String id; |
|
||||||
|
|
||||||
private String name; |
|
||||||
|
|
||||||
// 启用时间写入 1
|
|
||||||
private int timeSet; |
|
||||||
private String timeSetId; |
|
||||||
|
|
||||||
// 水箱温度 2
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal tankTemp; |
|
||||||
private String tankTempId; |
|
||||||
|
|
||||||
// 太阳能温度 3
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal solarTemp; |
|
||||||
private String solarTempId; |
|
||||||
|
|
||||||
// 回水温度 4
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal inTemp; |
|
||||||
private String inTempId; |
|
||||||
|
|
||||||
// 压力 4
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0") |
|
||||||
private BigDecimal pressure; |
|
||||||
private String pressureId; |
|
||||||
|
|
||||||
// PLC 时间
|
|
||||||
private String plcTime; |
|
||||||
// 秒_读 6
|
|
||||||
private int sTimeRead; |
|
||||||
private String sTimeReadId; |
|
||||||
|
|
||||||
// 分_读 8
|
|
||||||
private int minTimeRead; |
|
||||||
private String minTimeReadId; |
|
||||||
|
|
||||||
// 时_读 9
|
|
||||||
private int hourTimeRead; |
|
||||||
private String hourTimeReadId; |
|
||||||
|
|
||||||
// 日_读 9
|
|
||||||
private int dayTimeRead; |
|
||||||
private String dayTimeReadId; |
|
||||||
|
|
||||||
// 月_读 10
|
|
||||||
private int monthTimeRead; |
|
||||||
private String monthTimeReadId; |
|
||||||
|
|
||||||
// 年_读 11
|
|
||||||
private int yearTimeRead; |
|
||||||
private String yearTimeReadId; |
|
||||||
|
|
||||||
// 秒_写 6
|
|
||||||
private int sTimeSet; |
|
||||||
private String sTimeSetId; |
|
||||||
|
|
||||||
// 分_写 8
|
|
||||||
private int minTimeSet; |
|
||||||
private String minTimeSetId; |
|
||||||
|
|
||||||
// 时_写 9
|
|
||||||
private int hourTimeSet; |
|
||||||
private String hourTimeSetId; |
|
||||||
|
|
||||||
// 日_写 9
|
|
||||||
private int dayTimeSet; |
|
||||||
private String dayTimeSetId; |
|
||||||
|
|
||||||
// 月_写 10
|
|
||||||
private int monthTimeSet; |
|
||||||
private String monthTimeSetId; |
|
||||||
|
|
||||||
// 年_写 11
|
|
||||||
private int yearTimeSet; |
|
||||||
private String yearTimeSetId; |
|
||||||
|
|
||||||
private int orderNum; |
|
||||||
|
|
||||||
@Override |
|
||||||
public String toString() { |
|
||||||
return new StringJoiner(", ", HotWaterSystemControlVO.class.getSimpleName() + "[", "]") |
|
||||||
.add("id='" + id + "'") |
|
||||||
.add("name='" + name + "'") |
|
||||||
.add("timeSet=" + timeSet) |
|
||||||
.add("timeSetId='" + timeSetId + "'") |
|
||||||
.add("tankTemp=" + tankTemp) |
|
||||||
.add("tankTempId='" + tankTempId + "'") |
|
||||||
.add("solarTemp=" + solarTemp) |
|
||||||
.add("solarTempId='" + solarTempId + "'") |
|
||||||
.add("inTemp=" + inTemp) |
|
||||||
.add("inTempId='" + inTempId + "'") |
|
||||||
.add("pressure=" + pressure) |
|
||||||
.add("pressureId='" + pressureId + "'") |
|
||||||
.add("plcTime='" + plcTime + "'") |
|
||||||
.add("sTimeRead=" + sTimeRead) |
|
||||||
.add("sTimeReadId='" + sTimeReadId + "'") |
|
||||||
.add("minTimeRead=" + minTimeRead) |
|
||||||
.add("minTimeReadId='" + minTimeReadId + "'") |
|
||||||
.add("hourTimeRead=" + hourTimeRead) |
|
||||||
.add("hourTimeReadId='" + hourTimeReadId + "'") |
|
||||||
.add("dayTimeRead=" + dayTimeRead) |
|
||||||
.add("dayTimeReadId='" + dayTimeReadId + "'") |
|
||||||
.add("monthTimeRead=" + monthTimeRead) |
|
||||||
.add("monthTimeReadId='" + monthTimeReadId + "'") |
|
||||||
.add("yearTimeRead=" + yearTimeRead) |
|
||||||
.add("yearTimeReadId='" + yearTimeReadId + "'") |
|
||||||
.add("sTimeSet=" + sTimeSet) |
|
||||||
.add("sTimeSetId='" + sTimeSetId + "'") |
|
||||||
.add("minTimeSet=" + minTimeSet) |
|
||||||
.add("minTimeSetId='" + minTimeSetId + "'") |
|
||||||
.add("hourTimeSet=" + hourTimeSet) |
|
||||||
.add("hourTimeSetId='" + hourTimeSetId + "'") |
|
||||||
.add("dayTimeSet=" + dayTimeSet) |
|
||||||
.add("dayTimeSetId='" + dayTimeSetId + "'") |
|
||||||
.add("monthTimeSet=" + monthTimeSet) |
|
||||||
.add("monthTimeSetId='" + monthTimeSetId + "'") |
|
||||||
.add("yearTimeSet=" + yearTimeSet) |
|
||||||
.add("yearTimeSetId='" + yearTimeSetId + "'") |
|
||||||
.add("orderNum=" + orderNum) |
|
||||||
.toString(); |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,108 +0,0 @@ |
|||||||
package com.mh.user.entity; |
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat; |
|
||||||
import lombok.Getter; |
|
||||||
import lombok.Setter; |
|
||||||
import org.springframework.format.annotation.DateTimeFormat; |
|
||||||
|
|
||||||
import java.io.Serializable; |
|
||||||
import java.math.BigDecimal; |
|
||||||
import java.time.LocalDateTime; |
|
||||||
import java.util.Date; |
|
||||||
import java.util.StringJoiner; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author LJF |
|
||||||
* @version 1.0 |
|
||||||
* @project CHWS |
|
||||||
* @description 采集参数实体类 |
|
||||||
* @date 2025-12-10 10:53:33 |
|
||||||
*/ |
|
||||||
@Getter |
|
||||||
@Setter |
|
||||||
public class CollectionParamsManageEntity implements Serializable { |
|
||||||
|
|
||||||
static final long serialVersionUID = 42L; |
|
||||||
|
|
||||||
private Long id; |
|
||||||
|
|
||||||
/** 当前时间 */ |
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|
||||||
private Date createTime; |
|
||||||
|
|
||||||
/** 当前时间 */ |
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|
||||||
private Date updateTime; |
|
||||||
private Long buildingId; |
|
||||||
/** 设备id */ |
|
||||||
private Long deviceInstallId; |
|
||||||
/** 寄存器地址 */ |
|
||||||
private String registerAddr; |
|
||||||
/** 功能码 */ |
|
||||||
private String funcCode; |
|
||||||
/** 倍率 */ |
|
||||||
private Integer mtRatio; |
|
||||||
/** 初始值 */ |
|
||||||
private BigDecimal mtInitValue; |
|
||||||
/** 小数点 */ |
|
||||||
private Integer digits; |
|
||||||
/** 数据类型 */ |
|
||||||
private Integer dataType; |
|
||||||
/** 当前值 */ |
|
||||||
private BigDecimal curValue; |
|
||||||
/** 当前时间 */ |
|
||||||
/** 当前时间 */ |
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|
||||||
private Date curTime; |
|
||||||
/** 是否是总表 (0: 是, 1: 否) */ |
|
||||||
private Integer mtIsSum; |
|
||||||
/** 单位 */ |
|
||||||
private String unit; |
|
||||||
/** 排序 */ |
|
||||||
private Long orderNum; |
|
||||||
/** 备注 */ |
|
||||||
private String remark; |
|
||||||
/** 读取的寄存器大小 */ |
|
||||||
private Integer registerSize; |
|
||||||
/** 是否使用 */ |
|
||||||
private Integer isUse; |
|
||||||
/** 别名:mqtt上传名,唯一值 */ |
|
||||||
private String otherName; |
|
||||||
/** 40,累计值,140瞬时值 */ |
|
||||||
private Integer grade; |
|
||||||
/** 参数id */ |
|
||||||
private Integer paramTypeId; |
|
||||||
/** 遥测、遥信数据类型 */ |
|
||||||
private Integer collectionType; |
|
||||||
/** 上报质量 */ |
|
||||||
private String quality; |
|
||||||
|
|
||||||
@Override |
|
||||||
public String toString() { |
|
||||||
return new StringJoiner(", ", CollectionParamsManageEntity.class.getSimpleName() + "[", "]") |
|
||||||
.add("deviceInstallId=" + deviceInstallId) |
|
||||||
.add("registerAddr='" + registerAddr + "'") |
|
||||||
.add("funcCode='" + funcCode + "'") |
|
||||||
.add("mtRatio=" + mtRatio) |
|
||||||
.add("mtInitValue=" + mtInitValue) |
|
||||||
.add("digits=" + digits) |
|
||||||
.add("dataType=" + dataType) |
|
||||||
.add("curValue=" + curValue) |
|
||||||
.add("curTime=" + curTime) |
|
||||||
.add("mtIsSum=" + mtIsSum) |
|
||||||
.add("unit='" + unit + "'") |
|
||||||
.add("orderNum=" + orderNum) |
|
||||||
.add("remark='" + remark + "'") |
|
||||||
.add("registerSize=" + registerSize) |
|
||||||
.add("isUse=" + isUse) |
|
||||||
.add("otherName='" + otherName + "'") |
|
||||||
.add("grade=" + grade) |
|
||||||
.add("paramTypeId=" + paramTypeId) |
|
||||||
.add("collectionType=" + collectionType) |
|
||||||
.add("quality='" + quality + "'") |
|
||||||
.toString(); |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,193 +0,0 @@ |
|||||||
package com.mh.user.mapper; |
|
||||||
|
|
||||||
import com.mh.user.dto.HotWaterControlListVO; |
|
||||||
import com.mh.user.entity.CollectionParamsManageEntity; |
|
||||||
import com.mh.user.entity.DeviceInstallEntity; |
|
||||||
import org.apache.ibatis.annotations.*; |
|
||||||
import tk.mybatis.mapper.common.BaseMapper; |
|
||||||
|
|
||||||
import java.math.BigDecimal; |
|
||||||
import java.util.List; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author LJF |
|
||||||
* @version 1.0 |
|
||||||
* @project CHWS |
|
||||||
* @description 采集参数设备mapper类 |
|
||||||
* @date 2025-12-10 11:31:42 |
|
||||||
*/ |
|
||||||
@Mapper |
|
||||||
public interface CollectionParamsManageMapper extends BaseMapper<CollectionParamsManageEntity> { |
|
||||||
|
|
||||||
@Select("<script>" + |
|
||||||
"SELECT * FROM (" + |
|
||||||
"SELECT cpm.*, ROW_NUMBER() OVER (ORDER BY cpm.device_install_id) AS row_num " + |
|
||||||
"FROM collection_params_manage cpm join device_install di on cpm.device_install_id = di.id where 1=1" + |
|
||||||
"<if test='deviceInstallId != null and deviceInstallId != \"\"'>" + |
|
||||||
"AND cpm.device_install_id = #{deviceInstallId} " + |
|
||||||
"</if>" + |
|
||||||
"<if test='buildingId != null and buildingId != \"\"'>" + |
|
||||||
"AND di.building_id = #{buildingId} " + |
|
||||||
"</if>" + |
|
||||||
"<if test='otherName != null and otherName != \"\"'>" + |
|
||||||
"AND cpm.other_name LIKE CONCAT('%', #{otherName}, '%') " + |
|
||||||
"</if>" + |
|
||||||
") AS t WHERE t.row_num BETWEEN (#{pageNum}-1)*#{pageSize} AND #{pageNum}*#{pageSize}" + |
|
||||||
"</script>") |
|
||||||
@Results({ |
|
||||||
@Result(column = "id", property = "id"), |
|
||||||
@Result(column = "create_time", property = "createTime"), |
|
||||||
@Result(column = "update_time", property = "updateTime"), |
|
||||||
@Result(column = "device_install_id", property = "deviceInstallId"), |
|
||||||
@Result(column = "register_addr", property = "registerAddr"), |
|
||||||
@Result(column = "func_code", property = "funcCode"), |
|
||||||
@Result(column = "mt_ratio", property = "mtRatio"), |
|
||||||
@Result(column = "mt_init_value", property = "mtInitValue"), |
|
||||||
@Result(column = "digits", property = "digits"), |
|
||||||
@Result(column = "data_type", property = "dataType"), |
|
||||||
@Result(column = "cur_value", property = "curValue"), |
|
||||||
@Result(column = "cur_time", property = "curTime"), |
|
||||||
@Result(column = "mt_is_sum", property = "mtIsSum"), |
|
||||||
@Result(column = "unit", property = "unit"), |
|
||||||
@Result(column = "order_num", property = "orderNum"), |
|
||||||
@Result(column = "remark", property = "remark"), |
|
||||||
@Result(column = "register_size", property = "registerSize"), |
|
||||||
@Result(column = "is_use", property = "isUse"), |
|
||||||
@Result(column = "other_name", property = "otherName"), |
|
||||||
@Result(column = "grade", property = "grade"), |
|
||||||
@Result(column = "param_type_id", property = "paramTypeId"), |
|
||||||
@Result(column = "collection_type", property = "collectionType"), |
|
||||||
@Result(column = "quality", property = "quality") |
|
||||||
}) |
|
||||||
List<CollectionParamsManageEntity> selectCPMList(String buildingId,String deviceInstallId, String otherName, Integer pageNum, Integer pageSize); |
|
||||||
|
|
||||||
@Select("<script>" + |
|
||||||
"SELECT count(1) " + |
|
||||||
"FROM collection_params_manage cpm join device_install di on cpm.device_install_id = di.id where 1=1" + |
|
||||||
"<if test='deviceInstallId != null and deviceInstallId != \"\"'>" + |
|
||||||
"AND cpm.device_install_id = #{deviceInstallId} " + |
|
||||||
"</if>" + |
|
||||||
"<if test='buildingId != null and buildingId != \"\"'>" + |
|
||||||
"AND di.building_id = #{buildingId} " + |
|
||||||
"</if>" + |
|
||||||
"<if test='otherName != null and otherName != \"\"'>" + |
|
||||||
"AND cpm.other_name LIKE CONCAT('%', #{otherName}, '%') " + |
|
||||||
"</if>" + |
|
||||||
"</script>") |
|
||||||
int selectCPMListCount(String buildingId, String deviceInstallId, String otherName, Integer pageNum, Integer pageSize); |
|
||||||
|
|
||||||
@Select("select count(1) from collection_params_manage where other_name = #{otherName} ") |
|
||||||
int selectCountByOtherName(String otherName); |
|
||||||
|
|
||||||
@Update("update collection_params_manage set cur_value = #{value}, cur_time = #{time}, quality = #{quality} where other_name = #{name}") |
|
||||||
void updateCPMByOtherName(String name, BigDecimal value, String time, String quality); |
|
||||||
|
|
||||||
@Select("select top 1 * from collection_params_manage where other_name = #{name}") |
|
||||||
@Results({ |
|
||||||
@Result(column = "id", property = "id"), |
|
||||||
@Result(column = "create_time", property = "createTime"), |
|
||||||
@Result(column = "update_time", property = "updateTime"), |
|
||||||
@Result(column = "device_install_id", property = "deviceInstallId"), |
|
||||||
@Result(column = "register_addr", property = "registerAddr"), |
|
||||||
@Result(column = "func_code", property = "funcCode"), |
|
||||||
@Result(column = "mt_ratio", property = "mtRatio"), |
|
||||||
@Result(column = "mt_init_value", property = "mtInitValue"), |
|
||||||
@Result(column = "digits", property = "digits"), |
|
||||||
@Result(column = "data_type", property = "dataType"), |
|
||||||
@Result(column = "cur_value", property = "curValue"), |
|
||||||
@Result(column = "cur_time", property = "curTime"), |
|
||||||
@Result(column = "mt_is_sum", property = "mtIsSum"), |
|
||||||
@Result(column = "unit", property = "unit"), |
|
||||||
@Result(column = "order_num", property = "orderNum"), |
|
||||||
@Result(column = "remark", property = "remark"), |
|
||||||
@Result(column = "register_size", property = "registerSize"), |
|
||||||
@Result(column = "is_use", property = "isUse"), |
|
||||||
@Result(column = "other_name", property = "otherName"), |
|
||||||
@Result(column = "grade", property = "grade"), |
|
||||||
@Result(column = "param_type_id", property = "paramTypeId"), |
|
||||||
@Result(column = "collection_type", property = "collectionType"), |
|
||||||
@Result(column = "quality", property = "quality") |
|
||||||
}) |
|
||||||
CollectionParamsManageEntity selectDeviceInstallByOtherName(String name); |
|
||||||
|
|
||||||
@Insert("insert into collection_params_manage(" + |
|
||||||
"device_install_id, register_addr, func_code, mt_ratio, mt_init_value, digits, data_type, " + |
|
||||||
"mt_is_sum, unit, order_num, remark, register_size, is_use, " + |
|
||||||
"other_name, grade, param_type_id, collection_type, quality, create_time, building_id, cur_value, cur_time) " + |
|
||||||
"values(#{deviceInstallId}, #{registerAddr}, #{funcCode}, #{mtRatio}, #{mtInitValue}, " + |
|
||||||
"#{digits}, #{dataType}, #{mtIsSum}, #{unit}, #{orderNum}, " + |
|
||||||
"#{remark}, #{registerSize}, #{isUse}, #{otherName}, #{grade}, #{paramTypeId}, " + |
|
||||||
"#{collectionType}, #{quality}, getdate(), #{buildingId}, #{curValue}, #{curTime})") |
|
||||||
void insertCPM(CollectionParamsManageEntity cpmEntity); |
|
||||||
|
|
||||||
@Update("<script>" + |
|
||||||
"update collection_params_manage " + |
|
||||||
"<set>" + |
|
||||||
"<if test='deviceInstallId != null'>device_install_id = #{deviceInstallId},</if>" + |
|
||||||
"<if test='registerAddr != null'>register_addr = #{registerAddr},</if>" + |
|
||||||
"<if test='funcCode != null'>func_code = #{funcCode},</if>" + |
|
||||||
"<if test='mtRatio != null'>mt_ratio = #{mtRatio},</if>" + |
|
||||||
"<if test='mtInitValue != null'>mt_init_value = #{mtInitValue},</if>" + |
|
||||||
"<if test='digits != null'>digits = #{digits},</if>" + |
|
||||||
"<if test='dataType != null'>data_type = #{dataType},</if>" + |
|
||||||
"<if test='curValue != null'>cur_value = #{curValue},</if>" + |
|
||||||
"<if test='curTime != null'>cur_time = #{curTime},</if>" + |
|
||||||
"<if test='mtIsSum != null'>mt_is_sum = #{mtIsSum},</if>" + |
|
||||||
"<if test='unit != null'>unit = #{unit},</if>" + |
|
||||||
"<if test='orderNum != null'>order_num = #{orderNum},</if>" + |
|
||||||
"<if test='remark != null'>remark = #{remark},</if>" + |
|
||||||
"<if test='registerSize != null'>register_size = #{registerSize},</if>" + |
|
||||||
"<if test='isUse != null'>is_use = #{isUse},</if>" + |
|
||||||
"<if test='otherName != null'>other_name = #{otherName},</if>" + |
|
||||||
"<if test='grade != null'>grade = #{grade},</if>" + |
|
||||||
"<if test='paramTypeId != null'>param_type_id = #{paramTypeId},</if>" + |
|
||||||
"<if test='collectionType != null'>collection_type = #{collectionType},</if>" + |
|
||||||
"<if test='quality != null'>quality = #{quality},</if>" + |
|
||||||
"<if test='buildingId != null'>building_id = #{buildingId},</if>" + |
|
||||||
" update_time = getdate() " + |
|
||||||
"</set>" + |
|
||||||
"where id = #{id}" + |
|
||||||
"</script>") |
|
||||||
void updateById(CollectionParamsManageEntity cpmEntity); |
|
||||||
|
|
||||||
@Delete("delete from collection_params_manage where id = #{msId}") |
|
||||||
void deleteById(String msId); |
|
||||||
|
|
||||||
@Select("SELECT " + |
|
||||||
" cpm.id as cpm_id, " + |
|
||||||
" di.building_id, " + |
|
||||||
" di.building_name, " + |
|
||||||
" di.device_type, " + |
|
||||||
" di.id as device_id, " + |
|
||||||
" di.device_name, " + |
|
||||||
" cpm.other_name, " + |
|
||||||
" cpm.cur_value, " + |
|
||||||
" cpm.cur_time, " + |
|
||||||
" cpm.param_type_id, " + |
|
||||||
" ct.order_num AS ct_order_num, " + |
|
||||||
" di.order_num AS dl_order_num " + |
|
||||||
"FROM " + |
|
||||||
" device_install di " + |
|
||||||
" JOIN collection_params_manage cpm ON di.id = cpm.device_install_id " + |
|
||||||
" JOIN code_table ct ON ct.des = di.device_type " + |
|
||||||
" AND di.building_id = #{buildingId} " + |
|
||||||
" AND ct.name = 'deviceType' " + |
|
||||||
"ORDER BY " + |
|
||||||
" ct.order_num, " + |
|
||||||
" di.order_num ") |
|
||||||
@Results({ |
|
||||||
@Result(column = "cpm_id", property = "cpmId"), |
|
||||||
@Result(column = "building_id", property = "buildingId"), |
|
||||||
@Result(column = "building_name", property = "buildingName"), |
|
||||||
@Result(column = "device_type", property = "deviceType"), |
|
||||||
@Result(column = "device_id", property = "deviceId"), |
|
||||||
@Result(column = "device_name", property = "deviceName"), |
|
||||||
@Result(column = "other_name", property = "otherName"), |
|
||||||
@Result(column = "cur_value", property = "curValue"), |
|
||||||
@Result(column = "cur_time", property = "curTime"), |
|
||||||
@Result(column = "param_type_id", property = "paramTypeId"), |
|
||||||
@Result(column = "ct_order_num", property = "ctOrderNum"), |
|
||||||
@Result(column = "dl_order_num", property = "dlOrderNum") |
|
||||||
}) |
|
||||||
List<HotWaterControlListVO> selectHotWaterByBuildingId(String buildingId); |
|
||||||
} |
|
||||||
@ -1,39 +0,0 @@ |
|||||||
package com.mh.user.service; |
|
||||||
|
|
||||||
import com.mh.user.dto.HotWaterControlDTO; |
|
||||||
import com.mh.user.dto.HotWaterNowDataDTO; |
|
||||||
import com.mh.user.entity.CollectionParamsManageEntity; |
|
||||||
import com.mh.user.entity.DeviceInstallEntity; |
|
||||||
|
|
||||||
import java.math.BigDecimal; |
|
||||||
import java.util.List; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author LJF |
|
||||||
* @version 1.0 |
|
||||||
* @project EEMCS |
|
||||||
* @description 采集参数管理 |
|
||||||
* @date 2025-02-14 13:58:37 |
|
||||||
*/ |
|
||||||
public interface CollectionParamsManageService { |
|
||||||
|
|
||||||
List<CollectionParamsManageEntity> selectCPMList(String buildingId, String deviceInstallId, String otherName, Integer pageNum, Integer pageSize); |
|
||||||
|
|
||||||
int selectCPMListCount(String buildingId, String deviceInstallId, String otherName, Integer pageNum, Integer pageSize); |
|
||||||
|
|
||||||
CollectionParamsManageEntity selectById(String msId); |
|
||||||
|
|
||||||
String insertCPM(CollectionParamsManageEntity mqttSubscription); |
|
||||||
|
|
||||||
String updateCPM(CollectionParamsManageEntity mqttSubscription); |
|
||||||
|
|
||||||
int deleteByIds(String[] msIds); |
|
||||||
|
|
||||||
void updateCPMByOtherName(String name, BigDecimal value, String time); |
|
||||||
|
|
||||||
CollectionParamsManageEntity selectDeviceInstallByOtherName(String name); |
|
||||||
|
|
||||||
List<HotWaterNowDataDTO> monitorList(String buildingId); |
|
||||||
|
|
||||||
List<HotWaterControlDTO> operateList(String floorId); |
|
||||||
} |
|
||||||
@ -1,576 +0,0 @@ |
|||||||
package com.mh.user.service.impl; |
|
||||||
|
|
||||||
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.service.CollectionParamsManageService; |
|
||||||
import org.springframework.stereotype.Service; |
|
||||||
|
|
||||||
import java.math.BigDecimal; |
|
||||||
import java.util.Collections; |
|
||||||
import java.util.Comparator; |
|
||||||
import java.util.Date; |
|
||||||
import java.util.List; |
|
||||||
import java.util.stream.Collectors; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author LJF |
|
||||||
* @version 1.0 |
|
||||||
* @project CHWS |
|
||||||
* @description 采集参数设备实现类 |
|
||||||
* @date 2025-12-10 11:30:54 |
|
||||||
*/ |
|
||||||
@Service |
|
||||||
public class CollectionParamsManageServiceImpl implements CollectionParamsManageService { |
|
||||||
|
|
||||||
private final CollectionParamsManageMapper collectionParamsManageMapper; |
|
||||||
|
|
||||||
public CollectionParamsManageServiceImpl(CollectionParamsManageMapper collectionParamsManageMapper) { |
|
||||||
this.collectionParamsManageMapper = collectionParamsManageMapper; |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public List<HotWaterNowDataDTO> monitorList(String buildingId) { |
|
||||||
return Collections.emptyList(); |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public List<HotWaterControlDTO> operateList(String floorId) { |
|
||||||
List<HotWaterControlListVO> hotWaterControlListVOS = collectionParamsManageMapper.selectHotWaterByBuildingId(floorId); |
|
||||||
if (hotWaterControlListVOS.isEmpty()) { |
|
||||||
return Collections.emptyList(); |
|
||||||
} |
|
||||||
|
|
||||||
return hotWaterControlListVOS.stream() |
|
||||||
// .peek(vo -> System.out.println(vo.getHiOrderNum()))
|
|
||||||
.collect(Collectors.groupingBy(HotWaterControlListVO::getDeviceType)) |
|
||||||
.entrySet().stream() |
|
||||||
.map(houseEntry -> { |
|
||||||
HotWaterControlDTO dto = new HotWaterControlDTO(); |
|
||||||
dto.setId(houseEntry.getKey()); |
|
||||||
dto.setName(houseEntry.getValue().get(0).getDeviceType()); |
|
||||||
dto.setOrderNum(houseEntry.getValue().get(0).getCtOrderNum()); |
|
||||||
|
|
||||||
List<?> children = houseEntry.getValue().stream() |
|
||||||
.collect(Collectors.groupingBy(HotWaterControlListVO::getDeviceId)) |
|
||||||
.entrySet().stream() |
|
||||||
.map(dlEntry -> { |
|
||||||
List<HotWaterControlListVO> dlItems = dlEntry.getValue(); |
|
||||||
switch (dto.getName()) { |
|
||||||
case "系统": |
|
||||||
HotWaterSystemControlVO vo = new HotWaterSystemControlVO(); |
|
||||||
vo.setId(dlEntry.getKey()); |
|
||||||
if (StringUtils.isBlank(dlItems.get(0).getDeviceName())) { |
|
||||||
// 如果设备名称为空,则使用房间号
|
|
||||||
vo.setName(dto.getName()); |
|
||||||
} else { |
|
||||||
vo.setName(dlItems.get(0).getDeviceName()); |
|
||||||
} |
|
||||||
vo.setOrderNum(dlItems.get(0).getDlOrderNum()); |
|
||||||
// 单独对系统参数
|
|
||||||
dlItems.forEach(item -> { |
|
||||||
switch (item.getParamTypeId()) { |
|
||||||
case "1": |
|
||||||
// 启用写入时间
|
|
||||||
vo.setTimeSet(item.getCurValue().intValue()); |
|
||||||
vo.setTimeSetId(item.getCpmId()); |
|
||||||
break; |
|
||||||
case "5": |
|
||||||
// 压力
|
|
||||||
vo.setPressure(item.getCurValue()); |
|
||||||
vo.setPressureId(item.getCpmId()); |
|
||||||
break; |
|
||||||
case "6": |
|
||||||
// 回水温度
|
|
||||||
vo.setInTemp(item.getCurValue()); |
|
||||||
vo.setInTempId(item.getCpmId()); |
|
||||||
break; |
|
||||||
case "10": |
|
||||||
// 水箱温度
|
|
||||||
vo.setTankTemp(item.getCurValue()); |
|
||||||
vo.setTankTempId(item.getCpmId()); |
|
||||||
break; |
|
||||||
case "19": |
|
||||||
// 太阳能温度
|
|
||||||
vo.setSolarTemp(item.getCurValue()); |
|
||||||
vo.setSolarTempId(item.getCpmId()); |
|
||||||
break; |
|
||||||
case "15": |
|
||||||
// 时间
|
|
||||||
if ("年_读".equals(item.getOtherName())) { |
|
||||||
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; |
|
||||||
default: |
|
||||||
break; |
|
||||||
} |
|
||||||
}); |
|
||||||
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()); |
|
||||||
// 判断只有存在一个故障点,那么当前设备就是故障
|
|
||||||
if (dlItems.stream().anyMatch(item -> ("3".equals(item.getParamTypeId()) && "1".equals(item.getCurValue().toString())))) { |
|
||||||
hotPumpVo.setFault(1); // 去除pump前缀
|
|
||||||
} |
|
||||||
// 单独对系统参数
|
|
||||||
dlItems.forEach(item -> { |
|
||||||
switch (item.getParamTypeId()) { |
|
||||||
case "4": |
|
||||||
// 定时开关
|
|
||||||
if (item.getOtherName().contains("12定时_时开1")) { |
|
||||||
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; |
|
||||||
case "1": |
|
||||||
// 启停控制
|
|
||||||
hotPumpVo.setStartStopControl(item.getCurValue().intValue()); // 去除pump前缀
|
|
||||||
hotPumpVo.setStartStopControlId(item.getCpmId()); // 去除pump前缀
|
|
||||||
break; |
|
||||||
case "2": |
|
||||||
// 运行状态
|
|
||||||
hotPumpVo.setRunState(item.getCurValue().intValue()); // 去除pump前缀
|
|
||||||
hotPumpVo.setRunStateId(item.getCpmId()); // 去除pump前缀
|
|
||||||
break; |
|
||||||
case "10": |
|
||||||
// 水箱温度
|
|
||||||
hotPumpVo.setTankTemp(item.getCurValue()); // 去除pump前缀
|
|
||||||
hotPumpVo.setTankTempId(item.getCpmId()); // 去除pump前缀
|
|
||||||
break; |
|
||||||
case "11": |
|
||||||
// 出水温度
|
|
||||||
hotPumpVo.setOutWaterTemp(item.getCurValue()); // 去除pump前缀
|
|
||||||
hotPumpVo.setOutWaterTempId(item.getCpmId()); // 去除pump前缀
|
|
||||||
break; |
|
||||||
case "12": |
|
||||||
// 回水温度
|
|
||||||
hotPumpVo.setInWaterTemp(item.getCurValue()); // 去除pump前缀
|
|
||||||
hotPumpVo.setInWaterTempId(item.getCpmId()); // 去除pump前缀
|
|
||||||
break; |
|
||||||
case "16": |
|
||||||
// 累计运行时间
|
|
||||||
hotPumpVo.setRunTime(item.getCurValue()); // 去除pump前缀
|
|
||||||
hotPumpVo.setRunTimeId(item.getCpmId()); // 去除pump前缀
|
|
||||||
break; |
|
||||||
case "17": |
|
||||||
// 开机
|
|
||||||
hotPumpVo.setStart(item.getCurValue().toString()); // 去除pump前缀
|
|
||||||
hotPumpVo.setStartId(item.getCpmId()); // 去除pump前缀
|
|
||||||
break; |
|
||||||
case "18": |
|
||||||
// 关机
|
|
||||||
hotPumpVo.setStop(item.getCurValue().toString()); // 去除pump前缀
|
|
||||||
hotPumpVo.setStopId(item.getCpmId()); // 去除pump前缀
|
|
||||||
break; |
|
||||||
default: |
|
||||||
break; |
|
||||||
} |
|
||||||
}); |
|
||||||
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()); |
|
||||||
// 单独对系统参数
|
|
||||||
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": |
|
||||||
// 时控
|
|
||||||
if (item.getOtherName().contains("定时_时开1")) { |
|
||||||
circuitPumpVo.setOneHourTimeOpenSetOne(item.getCurValue().intValue()); |
|
||||||
circuitPumpVo.setOneHourTimeOpenSetOneId(item.getCpmId()); |
|
||||||
} else if (item.getOtherName().contains("定时_时关1")) { |
|
||||||
circuitPumpVo.setOneHourTimeCloseSetOne(item.getCurValue().intValue()); |
|
||||||
circuitPumpVo.setOneHourTimeCloseSetOneId(item.getCpmId()); |
|
||||||
} else if (item.getOtherName().contains("定时_分开1")) { |
|
||||||
circuitPumpVo.setOneMinTimeOpenSetOne(item.getCurValue().intValue()); |
|
||||||
circuitPumpVo.setOneMinTimeOpenSetOneId(item.getCpmId()); |
|
||||||
} else if (item.getOtherName().contains("定时_分关1")) { |
|
||||||
circuitPumpVo.setOneMinTimeCloseSetOne(item.getCurValue().intValue()); |
|
||||||
circuitPumpVo.setOneMinTimeCloseSetOneId(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; |
|
||||||
default: |
|
||||||
break; |
|
||||||
} |
|
||||||
}); |
|
||||||
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()); |
|
||||||
// 单独对系统参数
|
|
||||||
dlItems.forEach(item -> { |
|
||||||
switch (item.getParamTypeId()) { |
|
||||||
case "1": |
|
||||||
// 启停
|
|
||||||
backPumpVo.setStartStopControl(item.getCurValue().intValue()); |
|
||||||
backPumpVo.setStartStopControlId(item.getCpmId()); |
|
||||||
break; |
|
||||||
case "2": |
|
||||||
// 运行状态
|
|
||||||
backPumpVo.setRunState(item.getCurValue().intValue()); |
|
||||||
backPumpVo.setRunStateId(item.getCpmId()); |
|
||||||
break; |
|
||||||
case "3": |
|
||||||
// 故障
|
|
||||||
backPumpVo.setFault(item.getCurValue().intValue()); |
|
||||||
backPumpVo.setFaultId(item.getCpmId()); |
|
||||||
break; |
|
||||||
case "4": |
|
||||||
// 时控
|
|
||||||
if (item.getOtherName().contains("定时_时开1")) { |
|
||||||
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; |
|
||||||
case "7": |
|
||||||
// 回水温度设置
|
|
||||||
backPumpVo.setTempSet(item.getCurValue()); |
|
||||||
backPumpVo.setTempSetId(item.getCpmId()); |
|
||||||
break; |
|
||||||
case "15": |
|
||||||
// 开延时
|
|
||||||
backPumpVo.setOpenDelayTime(item.getCurValue().intValue()); |
|
||||||
backPumpVo.setOpenDelayTimeId(item.getCpmId()); |
|
||||||
break; |
|
||||||
case "16": |
|
||||||
if (item.getOtherName().contains("小时")) { |
|
||||||
// 累计运行时间
|
|
||||||
backPumpVo.setRunTime(item.getCurValue()); |
|
||||||
backPumpVo.setRunTimeId(item.getCpmId()); |
|
||||||
} |
|
||||||
break; |
|
||||||
default: |
|
||||||
break; |
|
||||||
} |
|
||||||
}); |
|
||||||
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()); |
|
||||||
// 单独对系统参数
|
|
||||||
dlItems.forEach(item -> { |
|
||||||
switch (item.getParamTypeId()) { |
|
||||||
case "0": |
|
||||||
if (item.getOtherName().contains("工程量上限")) { |
|
||||||
deviceCalibrationVo.setEngineeringMaxValue(item.getCurValue()); |
|
||||||
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; |
|
||||||
case "9": |
|
||||||
// 校准值
|
|
||||||
deviceCalibrationVo.setCalibrationValue(item.getCurValue()); |
|
||||||
deviceCalibrationVo.setCalibrationValueId(item.getCpmId()); |
|
||||||
break; |
|
||||||
default: |
|
||||||
break; |
|
||||||
} |
|
||||||
}); |
|
||||||
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()); |
|
||||||
// 单独对系统参数
|
|
||||||
dlItems.forEach(item -> { |
|
||||||
switch (item.getParamTypeId()) { |
|
||||||
case "13": |
|
||||||
meterVo.setTotalReading(item.getCurValue()); |
|
||||||
meterVo.setTotalReadingId(item.getCpmId()); |
|
||||||
break; |
|
||||||
case "14": |
|
||||||
meterVo.setTotalReading(item.getCurValue()); |
|
||||||
meterVo.setTotalReadingId(item.getCpmId()); |
|
||||||
break; |
|
||||||
default: |
|
||||||
break; |
|
||||||
} |
|
||||||
}); |
|
||||||
return meterVo; |
|
||||||
default: |
|
||||||
break; |
|
||||||
} |
|
||||||
return null; |
|
||||||
}) |
|
||||||
.collect(Collectors.toList()); |
|
||||||
dto.setChildren(children); |
|
||||||
return dto; |
|
||||||
}) |
|
||||||
// 添加排序操作
|
|
||||||
.sorted(Comparator.comparingInt(HotWaterControlDTO::getOrderNum)) |
|
||||||
.collect(Collectors.toList()); |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public CollectionParamsManageEntity selectDeviceInstallByOtherName(String name) { |
|
||||||
return collectionParamsManageMapper.selectDeviceInstallByOtherName(name); |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public void updateCPMByOtherName(String name, BigDecimal value, String time) { |
|
||||||
try { |
|
||||||
collectionParamsManageMapper.updateCPMByOtherName(name, value, time, "0"); |
|
||||||
} catch (Exception e) { |
|
||||||
collectionParamsManageMapper.updateCPMByOtherName(name, new BigDecimal(0), time, "-1"); |
|
||||||
; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public List<CollectionParamsManageEntity> selectCPMList(String buildingId, String deviceInstallId, String otherName, Integer pageNum, Integer pageSize) { |
|
||||||
return collectionParamsManageMapper.selectCPMList(buildingId, deviceInstallId, otherName, pageNum, pageSize); |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public int selectCPMListCount(String buildingId, String deviceInstallId, String otherName, Integer pageNum, Integer pageSize) { |
|
||||||
return collectionParamsManageMapper.selectCPMListCount(buildingId, deviceInstallId, otherName, pageNum, pageSize); |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public CollectionParamsManageEntity selectById(String msId) { |
|
||||||
return collectionParamsManageMapper.selectByPrimaryKey(msId); |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public String insertCPM(CollectionParamsManageEntity cpmEntity) { |
|
||||||
// 判断是否存在otherName
|
|
||||||
if (collectionParamsManageMapper.selectCountByOtherName(cpmEntity.getOtherName()) > 0) { |
|
||||||
return "存在相同参数名称"; |
|
||||||
} |
|
||||||
if (null == cpmEntity.getCurTime()) { |
|
||||||
cpmEntity.setCurTime(new Date()); |
|
||||||
} |
|
||||||
collectionParamsManageMapper.insertCPM(cpmEntity); |
|
||||||
return Constant.SUCCESS; |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public String updateCPM(CollectionParamsManageEntity cpmEntity) { |
|
||||||
// 判断是否存在otherName
|
|
||||||
// if (collectionParamsManageMapper.selectCountByOtherName(cpmEntity.getOtherName()) > 0) {
|
|
||||||
// return "存在相同参数名称";
|
|
||||||
// }
|
|
||||||
collectionParamsManageMapper.updateById(cpmEntity); |
|
||||||
return Constant.SUCCESS; |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public int deleteByIds(String[] msIds) { |
|
||||||
if (msIds != null && msIds.length > 0) { |
|
||||||
for (String msId : msIds) { |
|
||||||
collectionParamsManageMapper.deleteById(msId); |
|
||||||
} |
|
||||||
return msIds.length; |
|
||||||
} |
|
||||||
return 0; |
|
||||||
} |
|
||||||
} |
|
||||||
Loading…
Reference in new issue