微调
This commit is contained in:
@@ -36,6 +36,12 @@ public class PqScriptDtls implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String scriptType;
|
private String scriptType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表明指标类型(例如:Freq频率下的影响、Base额定下的影响、VOL电压下的影响)
|
||||||
|
*/
|
||||||
|
@TableField("Script_SubType")
|
||||||
|
private String scriptSubType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表明指标类型(例如:VOL电压、CUR电流、Freq频率...)
|
* 表明指标类型(例如:VOL电压、CUR电流、Freq频率...)
|
||||||
*/
|
*/
|
||||||
@@ -60,7 +66,7 @@ public class PqScriptDtls implements Serializable {
|
|||||||
* (间)谐波次数
|
* (间)谐波次数
|
||||||
*/
|
*/
|
||||||
@TableField("HarmNum")
|
@TableField("HarmNum")
|
||||||
private Integer harmNum;
|
private Double harmNum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 暂态幅度(%)
|
* 暂态幅度(%)
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.njcn.gather.device.script.pojo.po;
|
package com.njcn.gather.device.script.pojo.po;
|
||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
@@ -22,6 +21,9 @@ public class SourceIssue {
|
|||||||
@JSONField(name = "sourceId", ordinal = 1)
|
@JSONField(name = "sourceId", ordinal = 1)
|
||||||
private String sourceId;
|
private String sourceId;
|
||||||
|
|
||||||
|
@JSONField(serialize = false)
|
||||||
|
private Integer index;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检测类型
|
* 检测类型
|
||||||
*/
|
*/
|
||||||
@@ -173,7 +175,7 @@ public class SourceIssue {
|
|||||||
* 间谐波次数
|
* 间谐波次数
|
||||||
*/
|
*/
|
||||||
@JSONField(name = "inharm", ordinal = 1)
|
@JSONField(name = "inharm", ordinal = 1)
|
||||||
private Integer inharm;
|
private Double inharm;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 间谐波含有率
|
* 间谐波含有率
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import com.njcn.gather.device.script.pojo.po.PqScript;
|
|||||||
import com.njcn.gather.device.script.pojo.po.PqScriptDtls;
|
import com.njcn.gather.device.script.pojo.po.PqScriptDtls;
|
||||||
import com.njcn.gather.device.script.pojo.po.SourceIssue;
|
import com.njcn.gather.device.script.pojo.po.SourceIssue;
|
||||||
import com.njcn.gather.device.script.service.IPqScriptDtlsService;
|
import com.njcn.gather.device.script.service.IPqScriptDtlsService;
|
||||||
|
import com.njcn.gather.system.dictionary.pojo.po.DictTree;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
@@ -115,7 +116,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
|||||||
if (voltSet.size() == 1 && currSet.size() == 1) {
|
if (voltSet.size() == 1 && currSet.size() == 1) {
|
||||||
Double volt = voltSet.stream().collect(Collectors.toList()).stream().findFirst().get();
|
Double volt = voltSet.stream().collect(Collectors.toList()).stream().findFirst().get();
|
||||||
Double curr = currSet.stream().collect(Collectors.toList()).stream().findFirst().get();
|
Double curr = currSet.stream().collect(Collectors.toList()).stream().findFirst().get();
|
||||||
List<PqScriptDtls> pqScriptDtls = this.pqScriptDtls(param.getScriptId(),param.getIsPhaseSequence(), volt, curr);
|
List<PqScriptDtls> pqScriptDtls = this.pqScriptDtls(param.getScriptId(), param.getIsPhaseSequence(), volt, curr);
|
||||||
if (CollUtil.isNotEmpty(pqScriptDtls)) {
|
if (CollUtil.isNotEmpty(pqScriptDtls)) {
|
||||||
/**
|
/**
|
||||||
* 1.获取全部检测点脚本
|
* 1.获取全部检测点脚本
|
||||||
@@ -136,11 +137,11 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
|||||||
List<PqScriptDtls> freq = value.stream().filter(x -> FREQ.equals(x.getValueType())).collect(Collectors.toList());
|
List<PqScriptDtls> freq = value.stream().filter(x -> FREQ.equals(x.getValueType())).collect(Collectors.toList());
|
||||||
if (CollUtil.isNotEmpty(freq)) {
|
if (CollUtil.isNotEmpty(freq)) {
|
||||||
PqScriptDtls freqDtls = freq.get(0);
|
PqScriptDtls freqDtls = freq.get(0);
|
||||||
String[] split = freqDtls.getScriptType().replace("Base", "NULL").split("-");
|
|
||||||
SourceIssue issue = new SourceIssue();
|
SourceIssue issue = new SourceIssue();
|
||||||
issue.setSourceId(param.getSourceId());
|
issue.setSourceId(param.getSourceId());
|
||||||
issue.setType(split[0]);
|
issue.setType(freqDtls.getScriptType());
|
||||||
issue.setSubType(split[1]);
|
issue.setIndex(freqDtls.getIndex());
|
||||||
|
issue.setSubType(freqDtls.getScriptSubType().replace("Base", "NULL"));
|
||||||
issue.setFUn(volt);
|
issue.setFUn(volt);
|
||||||
issue.setFIn(curr);
|
issue.setFIn(curr);
|
||||||
issue.setFFreq(freqDtls.getValue());
|
issue.setFFreq(freqDtls.getValue());
|
||||||
@@ -166,7 +167,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
//谐波电流,间谐波电流
|
//谐波电流,间谐波电流
|
||||||
List<PqScriptDtls> dtlsIList = value.stream().filter(x -> HARM_I.equals(x.getValueType()) ||
|
List<PqScriptDtls> dtlsIList = value.stream().filter(x -> HARM_I.equals(x.getValueType()) ||
|
||||||
INHARM_I.equals(x.getValueType())||
|
INHARM_I.equals(x.getValueType()) ||
|
||||||
DIP.equals(x.getValueType()) ||
|
DIP.equals(x.getValueType()) ||
|
||||||
FLICKER.equals(x.getValueType())
|
FLICKER.equals(x.getValueType())
|
||||||
)
|
)
|
||||||
@@ -185,17 +186,21 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
|||||||
return sourceIssues;
|
return sourceIssues;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<PqScriptDtls> pqScriptDtls(String scriptId,Boolean isPhaseSequence,Double volt, Double curr) {
|
private List<PqScriptDtls> pqScriptDtls(String scriptId, Boolean isPhaseSequence, Double volt, Double curr) {
|
||||||
List<PqScriptDtls> pqScriptDtls;
|
List<PqScriptDtls> pqScriptDtls;
|
||||||
if(isPhaseSequence){
|
MPJLambdaWrapper<PqScriptDtls> queryWrapper = new MPJLambdaWrapper<>();
|
||||||
pqScriptDtls = this.list(new MPJLambdaWrapper<PqScriptDtls>()
|
queryWrapper.selectAll(PqScriptDtls.class)
|
||||||
.eq(PqScriptDtls::getIndex, -1)
|
.selectAs(DictTree::getCode, PqScriptDtls::getScriptType)
|
||||||
.eq(PqScriptDtls::getEnable, 1)
|
.leftJoin(DictTree.class, DictTree::getId, PqScriptDtls::getScriptType);
|
||||||
);
|
if (isPhaseSequence) {
|
||||||
}else{
|
queryWrapper.eq(PqScriptDtls::getIndex, -1)
|
||||||
|
.eq(PqScriptDtls::getEnable, 1);
|
||||||
|
pqScriptDtls = this.list(queryWrapper);
|
||||||
|
} else {
|
||||||
//先获取检测脚本类型是否相对值 true相对值 false绝对值(相对值要乘额定值,绝对值不需要处理)
|
//先获取检测脚本类型是否相对值 true相对值 false绝对值(相对值要乘额定值,绝对值不需要处理)
|
||||||
Boolean isValueType = pqScriptMapper.selectScriptIsValueType(scriptId);
|
Boolean isValueType = pqScriptMapper.selectScriptIsValueType(scriptId);
|
||||||
pqScriptDtls = this.listPqScriptDtlByScriptId(scriptId);
|
queryWrapper.eq(PqScriptDtls::getScriptId, scriptId);
|
||||||
|
pqScriptDtls = this.getBaseMapper().selectJoinList(PqScriptDtls.class, queryWrapper);
|
||||||
if (isValueType) {
|
if (isValueType) {
|
||||||
for (PqScriptDtls pqScriptDtl : pqScriptDtls) {
|
for (PqScriptDtls pqScriptDtl : pqScriptDtls) {
|
||||||
if (VOL.equals(pqScriptDtl.getValueType())) {
|
if (VOL.equals(pqScriptDtl.getValueType())) {
|
||||||
@@ -216,7 +221,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
|||||||
* @param dtlsList 检测集合
|
* @param dtlsList 检测集合
|
||||||
* @param dtlsList 其他类型检测集合(谐波,间谐波等)
|
* @param dtlsList 其他类型检测集合(谐波,间谐波等)
|
||||||
* @param harm 谐波
|
* @param harm 谐波
|
||||||
* @param inHarm 间谐波
|
* @param inHarm 间谐波
|
||||||
* @param fFreq 频率
|
* @param fFreq 频率
|
||||||
* @param code U,I
|
* @param code U,I
|
||||||
* @param channelListDTOS 通道信息
|
* @param channelListDTOS 通道信息
|
||||||
@@ -327,7 +332,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
|||||||
SourceIssue.ChannelListDTO.HarmModel harmModel;
|
SourceIssue.ChannelListDTO.HarmModel harmModel;
|
||||||
for (PqScriptDtls pqScriptDtls : phaseHarmVList) {
|
for (PqScriptDtls pqScriptDtls : phaseHarmVList) {
|
||||||
harmModel = new SourceIssue.ChannelListDTO.HarmModel();
|
harmModel = new SourceIssue.ChannelListDTO.HarmModel();
|
||||||
harmModel.setHarm(pqScriptDtls.getHarmNum());
|
harmModel.setHarm(pqScriptDtls.getHarmNum().intValue());
|
||||||
harmModel.setFApm(pqScriptDtls.getValue());
|
harmModel.setFApm(pqScriptDtls.getValue());
|
||||||
harmModel.setFPhase(pqScriptDtls.getAngle());
|
harmModel.setFPhase(pqScriptDtls.getAngle());
|
||||||
info.add(harmModel);
|
info.add(harmModel);
|
||||||
@@ -348,7 +353,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
|||||||
inHarmModel = new SourceIssue.ChannelListDTO.InharmModel();
|
inHarmModel = new SourceIssue.ChannelListDTO.InharmModel();
|
||||||
inHarmModel.setInharm(pqScriptDtls.getHarmNum());
|
inHarmModel.setInharm(pqScriptDtls.getHarmNum());
|
||||||
inHarmModel.setFApm(pqScriptDtls.getValue());
|
inHarmModel.setFApm(pqScriptDtls.getValue());
|
||||||
inHarmModel.setFPhase(pqScriptDtls.getChagValue());
|
inHarmModel.setFPhase(pqScriptDtls.getAngle());
|
||||||
info.add(inHarmModel);
|
info.add(inHarmModel);
|
||||||
}
|
}
|
||||||
return info;
|
return info;
|
||||||
|
|||||||
Reference in New Issue
Block a user