1.微调
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,20 +82,20 @@ public class PreDetection {
|
||||
/**
|
||||
* 监测点id
|
||||
*/
|
||||
@JsonProperty("lineId")
|
||||
@JSONField(name = "lineId")
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* 监测点线路号
|
||||
*/
|
||||
@JsonProperty("line")
|
||||
@JSONField(name = "line")
|
||||
private Integer line;
|
||||
}
|
||||
|
||||
public String getDevKey() {
|
||||
if(StrUtil.isNotBlank(devKey)){
|
||||
if (StrUtil.isNotBlank(devKey)) {
|
||||
String key = DeviceUtil.decoderString(1, devKey);
|
||||
if(StrUtil.isNotBlank(key)){
|
||||
if (StrUtil.isNotBlank(key)) {
|
||||
return key;
|
||||
}
|
||||
}
|
||||
@@ -88,9 +103,9 @@ public class PreDetection {
|
||||
}
|
||||
|
||||
public String getDevCode() {
|
||||
if(StrUtil.isNotBlank(devCode)){
|
||||
String code= DeviceUtil.decoderString(1,devCode);
|
||||
if(StrUtil.isNotBlank(code)){
|
||||
if (StrUtil.isNotBlank(devCode)) {
|
||||
String code = DeviceUtil.decoderString(1, devCode);
|
||||
if (StrUtil.isNotBlank(code)) {
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -27,5 +27,5 @@ public class PqScriptIssueParam {
|
||||
private Boolean isPhaseSequence;
|
||||
|
||||
@ApiModelProperty("源id")
|
||||
private String sourceId ="111";
|
||||
private String sourceId;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user