This commit is contained in:
wr
2025-02-14 10:58:09 +08:00
parent 801e17e274
commit a006c0df33
2 changed files with 48 additions and 47 deletions

View File

@@ -129,16 +129,18 @@ public class ResultServiceImpl implements IResultService {
.ne(PqScriptDtls::getIndex, -1)
.eq(PqScriptDtls::getEnable, DataStateEnum.ENABLE.getCode())
);
List<AdBaseResult> allResultList = new ArrayList<>();
List<Integer> indexList = new ArrayList<>();
if (StrUtil.isNotBlank(param.getScriptType())) {
indexList = pqScriptDtlsService.getIndexList(param.getScriptType(), param.getScriptId());
}
allResultList.addAll(adNonHarmonicService.get(param.getScriptId(), indexList, param.getDevId(), param.getDevNum(), param.getCode()));
allResultList.addAll(adHarmonicService.get(param.getScriptId(), indexList, param.getDevId(), param.getDevNum(), param.getCode()));
Map<Integer, Set<Integer>> resultMap = new HashMap<>(5);
if (CollUtil.isNotEmpty(allResultList)) {
resultMap = allResultList.stream().collect(Collectors.groupingBy(AdBaseResult::getSort, Collectors.mapping(AdBaseResult::getResultFlag, Collectors.toSet())));
if(StrUtil.isNotBlank(param.getDevId())){
List<AdBaseResult> allResultList = new ArrayList<>();
List<Integer> indexList = new ArrayList<>();
if (StrUtil.isNotBlank(param.getScriptType())) {
indexList = pqScriptDtlsService.getIndexList(param.getScriptType(), param.getScriptId());
}
allResultList.addAll(adNonHarmonicService.get(param.getScriptId(), indexList, param.getDevId(), param.getDevNum(), param.getCode()));
allResultList.addAll(adHarmonicService.get(param.getScriptId(), indexList, param.getDevId(), param.getDevNum(), param.getCode()));
if (CollUtil.isNotEmpty(allResultList)) {
resultMap = allResultList.stream().collect(Collectors.groupingBy(AdBaseResult::getSort, Collectors.mapping(AdBaseResult::getResultFlag, Collectors.toSet())));
}
}
Map<String, List<PqScriptDtls>> dtlsSortMap = dtlsList.stream()
@@ -179,15 +181,15 @@ public class ResultServiceImpl implements IResultService {
.collect(Collectors.groupingBy(PqScriptDtls::getIndex, LinkedHashMap::new, Collectors.toList()));
List<TreeDataVO> subTypeList = new ArrayList<>();
indexMap.forEach((index, scriptDtlIndexList) -> {
TreeDataVO dtlType = new TreeDataVO();
dtlType.setIndex(index);
dtlType.setScriptType(scriptDtlIndexList.get(0).getScriptType());
ratedScriptTypeName(scriptDtlIndexList, isValueType, dtlType, dictTree);
dtlType.setSourceDesc(ScriptDtlsDesc.getStringBuffer(scriptDtlIndexList, isValueType).toString());
if (finalResultMap.containsKey(index)) {
TreeDataVO dtlType = new TreeDataVO();
dtlType.setIndex(index);
dtlType.setScriptType(scriptDtlIndexList.get(0).getScriptType());
ratedScriptTypeName(scriptDtlIndexList, isValueType, dtlType, dictTree);
dtlType.setSourceDesc(ScriptDtlsDesc.getStringBuffer(scriptDtlIndexList, isValueType).toString());
dtlType.setFly(conform(finalResultMap.get(index)));
subTypeList.add(dtlType);
}
subTypeList.add(dtlType);
});
if (CollUtil.isNotEmpty(subTypeList)) {
subType.setChildren(subTypeList);
@@ -221,23 +223,22 @@ public class ResultServiceImpl implements IResultService {
.sorted(Comparator.comparing(PqScriptDtls::getIndex))
.collect(Collectors.groupingBy(PqScriptDtls::getIndex, LinkedHashMap::new, Collectors.toList()));
indexMap.forEach((index, scriptDtlIndexList) -> {
if (finalResultMap.containsKey(index)) {
TreeDataVO dtlType = new TreeDataVO();
dtlType.setIndex(index);
if ("Harm".equals(subKey)) {
harmScriptTypeName(scriptDtlIndexList, dictTree, isValueType, dtlType);
}
if ("VOL".equals(subKey)) {
volScriptTypeName(scriptDtlIndexList, dictTree, isValueType, dtlType);
}
if ("Freq".equals(subKey)) {
freqScriptTypeName(scriptDtlIndexList, dictTree, isValueType, dtlType);
}
dtlType.setSourceDesc(ScriptDtlsDesc.getStringBuffer(scriptDtlIndexList, isValueType).toString());
dtlType.setFly(conform(finalResultMap.get(index)));
subTypeList.add(dtlType);
TreeDataVO dtlType = new TreeDataVO();
dtlType.setIndex(index);
if ("Harm".equals(subKey)) {
harmScriptTypeName(scriptDtlIndexList, dictTree, isValueType, dtlType);
}
if ("VOL".equals(subKey)) {
volScriptTypeName(scriptDtlIndexList, dictTree, isValueType, dtlType);
}
if ("Freq".equals(subKey)) {
freqScriptTypeName(scriptDtlIndexList, dictTree, isValueType, dtlType);
}
dtlType.setSourceDesc(ScriptDtlsDesc.getStringBuffer(scriptDtlIndexList, isValueType).toString());
if (finalResultMap.containsKey(index)) {
dtlType.setFly(conform(finalResultMap.get(index)));
}
subTypeList.add(dtlType);
});
if (CollUtil.isNotEmpty(subTypeList)) {
treeDataVO.setChildren(subTypeList);
@@ -269,17 +270,17 @@ public class ResultServiceImpl implements IResultService {
vo.setScriptTypeName(name);
TreeDataVO dlt;
for (PqScriptDtls dtls : dip) {
dlt = new TreeDataVO();
List<PqScriptDtls> scriptDtlIndexList = subValue.stream().filter(x -> dtls.getIndex().equals(x.getIndex())).collect(Collectors.toList());
//特征幅值=20%Un持续时间=1周波
dlt.setScriptTypeName("特征幅值=" + dtls.getTransValue() + "%Un持续时间=" + dtls.getRetainTime().intValue() + "周波");
dlt.setIndex(dtls.getIndex());
dlt.setScriptType(scriptDtlIndexList.get(0).getScriptType());
dlt.setSourceDesc(ScriptDtlsDesc.getStringBuffer(scriptDtlIndexList, isValueType).toString());
if (finalResultMap.containsKey(dtls.getIndex())) {
dlt = new TreeDataVO();
List<PqScriptDtls> scriptDtlIndexList = subValue.stream().filter(x -> dtls.getIndex().equals(x.getIndex())).collect(Collectors.toList());
//特征幅值=20%Un持续时间=1周波
dlt.setScriptTypeName("特征幅值=" + dtls.getTransValue() + "%Un持续时间=" + dtls.getRetainTime().intValue() + "周波");
dlt.setIndex(dtls.getIndex());
dlt.setScriptType(scriptDtlIndexList.get(0).getScriptType());
dlt.setSourceDesc(ScriptDtlsDesc.getStringBuffer(scriptDtlIndexList, isValueType).toString());
dlt.setFly(conform(finalResultMap.get(dtls.getIndex())));
info.add(dlt);
}
info.add(dlt);
}
if (CollUtil.isNotEmpty(info)) {