1.微调
This commit is contained in:
@@ -77,6 +77,11 @@ public class PqScriptDtlsParam {
|
||||
*/
|
||||
private String valueType;
|
||||
|
||||
/**
|
||||
* 检测指标类型父id
|
||||
*/
|
||||
private String pid;
|
||||
|
||||
/**
|
||||
* 数据类型,来源于字典表,包括实时数据(3s)、分钟统计数据(1min/3min/5min/10min)等
|
||||
*/
|
||||
|
||||
@@ -381,12 +381,13 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
if (CollUtil.isNotEmpty(checkDataList)) {
|
||||
List<String> ids = checkDataList.stream().map(PqScriptDtlsParam.CheckData::getValueType).collect(Collectors.toList());
|
||||
List<DictTree> dictTreeById = dictTreeService.getDictTreeById(ids);
|
||||
Map<String, String> dicTreeMap = dictTreeById.stream().collect(Collectors.toMap(DictTree::getId, DictTree::getCode));
|
||||
Map<String, DictTree> dicTreeMap = dictTreeById.stream().collect(Collectors.toMap(DictTree::getId,Function.identity()));
|
||||
PqScriptDtlsParam.CheckData checkData;
|
||||
for (PqScriptDtlsParam.CheckData channelListDTO : checkDataList) {
|
||||
if (dicTreeMap.containsKey(channelListDTO.getValueType())) {
|
||||
String code = dicTreeMap.get(channelListDTO.getValueType());
|
||||
DetectionCodeEnum codeEnum = DetectionCodeEnum.getDetectionCodeByCode(code);
|
||||
DictTree dictTree = dicTreeMap.get(channelListDTO.getValueType());
|
||||
channelListDTO.setPid(dictTree.getPid());
|
||||
DetectionCodeEnum codeEnum = DetectionCodeEnum.getDetectionCodeByCode(dictTree.getCode());
|
||||
List<PqScriptDtlsParam.ChannelListDTO> channelList = sourceIssue.getChannelList();
|
||||
List<PqScriptDtlsParam.ChannelListDTO> list;
|
||||
switch (codeEnum) {
|
||||
@@ -398,6 +399,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
checkData.setPhase("T");
|
||||
checkData.setDataType(channelListDTO.getDataType());
|
||||
checkData.setValueType(channelListDTO.getValueType());
|
||||
checkData.setPid(channelListDTO.getPid());
|
||||
info.add(checkData);
|
||||
break;
|
||||
case U1:
|
||||
@@ -418,6 +420,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
checkData.setPhase(listDTO.getChannelType().substring(1, 2));
|
||||
checkData.setDataType(channelListDTO.getDataType());
|
||||
checkData.setValueType(channelListDTO.getValueType());
|
||||
checkData.setPid(channelListDTO.getPid());
|
||||
info.add(checkData);
|
||||
}
|
||||
}
|
||||
@@ -433,6 +436,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
checkData.setPhase(listDTO.getChannelType().substring(1, 2));
|
||||
checkData.setDataType(channelListDTO.getDataType());
|
||||
checkData.setValueType(channelListDTO.getValueType());
|
||||
checkData.setPid(channelListDTO.getPid());
|
||||
info.add(checkData);
|
||||
}
|
||||
}
|
||||
@@ -476,6 +480,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
checkData.setPhase(listDTO.getChannelType().substring(1, 2));
|
||||
checkData.setDataType(channelListDTO.getDataType());
|
||||
checkData.setValueType(channelListDTO.getValueType());
|
||||
checkData.setPid(channelListDTO.getPid());
|
||||
info.add(checkData);
|
||||
|
||||
}
|
||||
@@ -506,6 +511,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
checkData.setPhase(listDTO.getChannelType().substring(1, 2));
|
||||
checkData.setDataType(channelListDTO.getDataType());
|
||||
checkData.setValueType(channelListDTO.getValueType());
|
||||
checkData.setPid(channelListDTO.getPid());
|
||||
info.add(checkData);
|
||||
}
|
||||
break;
|
||||
@@ -519,6 +525,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
checkData.setPhase(listDTO.getChannelType().substring(1, 2));
|
||||
checkData.setDataType(channelListDTO.getDataType());
|
||||
checkData.setValueType(channelListDTO.getValueType());
|
||||
checkData.setPid(channelListDTO.getPid());
|
||||
info.add(checkData);
|
||||
}
|
||||
break;
|
||||
@@ -539,7 +546,6 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
break;
|
||||
case PST:
|
||||
break;
|
||||
|
||||
case I1:
|
||||
break;
|
||||
case UNKNOWN_ERROR:
|
||||
@@ -606,6 +612,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
checkData.setPhase("T");
|
||||
checkData.setDataType(channelListDTO.getDataType());
|
||||
checkData.setValueType(channelListDTO.getValueType());
|
||||
checkData.setPid(channelListDTO.getPid());
|
||||
info.add(checkData);
|
||||
}
|
||||
}
|
||||
@@ -620,6 +627,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
checkData.setPhase(listDTO.getChannelType().substring(1, 2));
|
||||
checkData.setDataType(channelListDTO.getDataType());
|
||||
checkData.setValueType(channelListDTO.getValueType());
|
||||
checkData.setPid(channelListDTO.getPid());
|
||||
info.add(checkData);
|
||||
}
|
||||
}
|
||||
@@ -638,6 +646,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
checkData.setHarmNum(inharmModel.getInharm());
|
||||
checkData.setDataType(channelListDTO.getDataType());
|
||||
checkData.setValueType(channelListDTO.getValueType());
|
||||
checkData.setPid(channelListDTO.getPid());
|
||||
info.add(checkData);
|
||||
}
|
||||
}
|
||||
@@ -658,6 +667,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
checkData.setHarmNum(harmModel.getHarm());
|
||||
checkData.setDataType(channelListDTO.getDataType());
|
||||
checkData.setValueType(channelListDTO.getValueType());
|
||||
checkData.setPid(channelListDTO.getPid());
|
||||
info.add(checkData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="generator.mapper.PqScriptCheckdataMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.njcn.gather.script.pojo.po.PqScriptCheckData">
|
||||
<id property="id" column="Id" jdbcType="CHAR"/>
|
||||
<result property="scriptId" column="Script_Id" jdbcType="CHAR"/>
|
||||
<result property="index" column="Index" jdbcType="INTEGER"/>
|
||||
<result property="valueType" column="Value_Type" jdbcType="CHAR"/>
|
||||
<result property="dataType" column="Data_Type" jdbcType="CHAR"/>
|
||||
<result property="phase" column="Phase" jdbcType="CHAR"/>
|
||||
<result property="value" column="Value" jdbcType="FLOAT"/>
|
||||
<result property="harmnum" column="HarmNum" jdbcType="FLOAT"/>
|
||||
<result property="enable" column="Enable" jdbcType="TINYINT"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
Id,Script_Id,Index,
|
||||
Value_Type,Data_Type,Phase,
|
||||
Value,HarmNum,Enable
|
||||
</sql>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user