代码调整

This commit is contained in:
2025-01-09 20:02:02 +08:00
parent d91960700b
commit f2cfc383fd
8 changed files with 63 additions and 13 deletions

View File

@@ -28,4 +28,6 @@ public class PqScriptIssueParam {
@ApiModelProperty("源id")
private String sourceId;
private List<Integer> indexList;
}

View File

@@ -124,7 +124,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
if (voltSet.size() == 1 && currSet.size() == 1) {
Double volt = voltSet.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,param.getIndexList());
if (CollUtil.isNotEmpty(pqScriptDtls)) {
/**
* 1.获取全部检测点脚本
@@ -200,6 +200,9 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
return sourceIssues;
}
@Override
public List<Integer> getIndexList(String scriptType, String scriptId) {
MPJLambdaWrapper<PqScriptDtls> wrapper = new MPJLambdaWrapper<>();
@@ -210,7 +213,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
return this.getBaseMapper().selectJoinList(PqScriptDtls.class, wrapper).stream().map(PqScriptDtls::getIndex).collect(Collectors.toList());
}
private List<PqScriptDtls> pqScriptDtls(String scriptId, String isPhaseSequence, Double volt, Double curr) {
public List<PqScriptDtls> pqScriptDtls(String scriptId, String isPhaseSequence, Double volt, Double curr,List<Integer> indexList) {
List<PqScriptDtls> pqScriptDtls;
MPJLambdaWrapper<PqScriptDtls> queryWrapper = new MPJLambdaWrapper<>();
queryWrapper.selectAll(PqScriptDtls.class)
@@ -228,7 +231,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
pqScriptDtls = this.list(queryWrapper);
}else if(isPhaseSequence.equals(CommonEnum.COEFFICIENT_TEST.getValue())){
//系数
queryWrapper.in(PqScriptDtls::getIndex, Stream.of(-2,-3).collect(Collectors.toList()))
queryWrapper.in(PqScriptDtls::getIndex, indexList)
.eq(PqScriptDtls::getEnable, 1);
pqScriptDtls = this.list(queryWrapper);
} else {