This commit is contained in:
wr
2024-12-18 11:40:36 +08:00
parent e9a294acdb
commit e36652f930
4 changed files with 49 additions and 16 deletions

View File

@@ -4,6 +4,8 @@
<!-- 通用查询映射结果 -->
<resultMap id="DevResultMap" type="com.njcn.gather.device.device.pojo.vo.PreDetection">
<id column="Id" property="devId" />
<id column="Name" property="devName" />
<id column="IP" property="devIP" />
<result column="Port" property="port" />
<result column="Dev_Type" property="devType" />
@@ -20,6 +22,7 @@
<select id="selectDevInfo" resultMap="DevResultMap">
SELECT
d.Id,
d.Name,
d.IP,
( select name from sys_dict_data sd where d.Dev_Type= sd.id) as Dev_Type,
d.Port,

View File

@@ -1,6 +1,7 @@
package com.njcn.gather.device.device.pojo.vo;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.njcn.gather.device.device.util.DeviceUtil;
import lombok.Data;
@@ -20,44 +21,58 @@ public class PreDetection {
/**
* 装置ip
*/
@JsonProperty("devIP")
@JSONField(serialize = false)
private String devId;
/**
* 装置ip
*/
@JSONField(serialize = false)
private String devName;
/**
* 装置ip
*/
@JSONField(name = "devIP", serialize = false)
private String devIP;
/**
* 装置端口
*/
@JsonProperty("port")
@JSONField(name = "port")
private Integer port;
/**
* 设备类型,字典表
*/
@JsonProperty("devType")
@JSONField(name = "devType")
private String devType;
/**
* icd设备类型
*/
@JsonProperty("icdType")
@JSONField(name = "icdType")
private String icdType;
/**
* 装置识别码3ds加密
*/
@JsonProperty("devCode")
@JSONField(name = "devCode")
private String devCode;
/**
* 装置秘钥3ds加密
*/
@JsonProperty("devKey")
@JSONField(name = "devKey")
private String devKey;
@JSONField(serialize = false)
private Integer devChns;
/**
* 监测点信息
*/
@JsonProperty("monitorList")
@JSONField(name = "monitorList")
private List<MonitorListDTO> monitorList;
@@ -67,13 +82,13 @@ public class PreDetection {
/**
* 监测点id
*/
@JsonProperty("lineId")
@JSONField(name = "lineId")
private String lineId;
/**
* 监测点线路号
*/
@JsonProperty("line")
@JSONField(name = "line")
private Integer line;
}

View File

@@ -1,6 +1,7 @@
package com.njcn.gather.device.device.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
@@ -403,7 +404,21 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
@Override
public List<PreDetection> getDevInfo(List<String> devIds) {
return this.baseMapper.selectDevInfo(devIds);
List<PreDetection> preDetections = this.baseMapper.selectDevInfo(devIds);
for (PreDetection preDetection : preDetections) {
List<PreDetection.MonitorListDTO> monitorList = preDetection.getMonitorList();
if(CollUtil.isEmpty(monitorList)){
PreDetection.MonitorListDTO monitorListDTO;
for (int i = 1; i <= preDetection.getDevChns(); i++) {
monitorListDTO=new PreDetection.MonitorListDTO();
monitorListDTO.setLineId(preDetection.getDevIP()+"_"+i);
monitorListDTO.setLine(i);
monitorList.add(monitorListDTO);
}
preDetection.setMonitorList(monitorList);
}
}
return preDetections;
}
@Override

View File

@@ -27,5 +27,5 @@ public class PqScriptIssueParam {
private Boolean isPhaseSequence;
@ApiModelProperty("源id")
private String sourceId ="111";
private String sourceId;
}