微调
This commit is contained in:
@@ -113,7 +113,7 @@ public class DetectionServiceImpl {
|
|||||||
*/
|
*/
|
||||||
case HV:
|
case HV:
|
||||||
AdHarmonicResult harmV = isHarmQualified(dev, devIdMapComm, errDtlsCheckData, U, sourceIssue, dataRule, 2);
|
AdHarmonicResult harmV = isHarmQualified(dev, devIdMapComm, errDtlsCheckData, U, sourceIssue, dataRule, 2);
|
||||||
if (ObjectUtil.isNull(harmV)) {
|
if (ObjectUtil.isNotNull(harmV)) {
|
||||||
detectionDataDealService.acceptAdResult(Arrays.asList(harmV), code);
|
detectionDataDealService.acceptAdResult(Arrays.asList(harmV), code);
|
||||||
return harmV.getResultFlag();
|
return harmV.getResultFlag();
|
||||||
}
|
}
|
||||||
@@ -123,7 +123,7 @@ public class DetectionServiceImpl {
|
|||||||
*/
|
*/
|
||||||
case HI:
|
case HI:
|
||||||
AdHarmonicResult harmI = isHarmQualified(dev, devIdMapComm, errDtlsCheckData, I, sourceIssue, dataRule, 2);
|
AdHarmonicResult harmI = isHarmQualified(dev, devIdMapComm, errDtlsCheckData, I, sourceIssue, dataRule, 2);
|
||||||
if (ObjectUtil.isNull(harmI)) {
|
if (ObjectUtil.isNotNull(harmI)) {
|
||||||
detectionDataDealService.acceptAdResult(Arrays.asList(harmI), code);
|
detectionDataDealService.acceptAdResult(Arrays.asList(harmI), code);
|
||||||
return harmI.getResultFlag();
|
return harmI.getResultFlag();
|
||||||
}
|
}
|
||||||
@@ -133,7 +133,7 @@ public class DetectionServiceImpl {
|
|||||||
*/
|
*/
|
||||||
case HSV:
|
case HSV:
|
||||||
AdHarmonicResult harmInV = isHarmQualified(dev, devIdMapComm, errDtlsCheckData, U, sourceIssue, dataRule, 1);
|
AdHarmonicResult harmInV = isHarmQualified(dev, devIdMapComm, errDtlsCheckData, U, sourceIssue, dataRule, 1);
|
||||||
if (ObjectUtil.isNull(harmInV)) {
|
if (ObjectUtil.isNotNull(harmInV)) {
|
||||||
detectionDataDealService.acceptAdResult(Arrays.asList(harmInV), code);
|
detectionDataDealService.acceptAdResult(Arrays.asList(harmInV), code);
|
||||||
return harmInV.getResultFlag();
|
return harmInV.getResultFlag();
|
||||||
}
|
}
|
||||||
@@ -143,7 +143,7 @@ public class DetectionServiceImpl {
|
|||||||
*/
|
*/
|
||||||
case HSI:
|
case HSI:
|
||||||
AdHarmonicResult harmInI = isHarmQualified(dev, devIdMapComm, errDtlsCheckData, I, sourceIssue, dataRule, 1);
|
AdHarmonicResult harmInI = isHarmQualified(dev, devIdMapComm, errDtlsCheckData, I, sourceIssue, dataRule, 1);
|
||||||
if (ObjectUtil.isNull(harmInI)) {
|
if (ObjectUtil.isNotNull(harmInI)) {
|
||||||
detectionDataDealService.acceptAdResult(Arrays.asList(harmInI), code);
|
detectionDataDealService.acceptAdResult(Arrays.asList(harmInI), code);
|
||||||
return harmInI.getResultFlag();
|
return harmInI.getResultFlag();
|
||||||
}
|
}
|
||||||
@@ -153,7 +153,7 @@ public class DetectionServiceImpl {
|
|||||||
*/
|
*/
|
||||||
case IMBV:
|
case IMBV:
|
||||||
AdNonHarmonicResult vUnban = isUnBalanceOrFlickerQualified(dev, devIdMapComm, errDtlsCheckData, U, sourceIssue, dataRule, "V_UNBAN");
|
AdNonHarmonicResult vUnban = isUnBalanceOrFlickerQualified(dev, devIdMapComm, errDtlsCheckData, U, sourceIssue, dataRule, "V_UNBAN");
|
||||||
if (ObjectUtil.isNull(vUnban)) {
|
if (ObjectUtil.isNotNull(vUnban)) {
|
||||||
detectionDataDealService.acceptAdNonResult(Arrays.asList(vUnban), code);
|
detectionDataDealService.acceptAdNonResult(Arrays.asList(vUnban), code);
|
||||||
return vUnban.getResultFlag();
|
return vUnban.getResultFlag();
|
||||||
}
|
}
|
||||||
@@ -163,7 +163,7 @@ public class DetectionServiceImpl {
|
|||||||
*/
|
*/
|
||||||
case IMBA:
|
case IMBA:
|
||||||
AdNonHarmonicResult iUnban = isUnBalanceOrFlickerQualified(dev, devIdMapComm, errDtlsCheckData, I, sourceIssue, dataRule, "I_UNBAN");
|
AdNonHarmonicResult iUnban = isUnBalanceOrFlickerQualified(dev, devIdMapComm, errDtlsCheckData, I, sourceIssue, dataRule, "I_UNBAN");
|
||||||
if (ObjectUtil.isNull(iUnban)) {
|
if (ObjectUtil.isNotNull(iUnban)) {
|
||||||
detectionDataDealService.acceptAdNonResult(Arrays.asList(iUnban), code);
|
detectionDataDealService.acceptAdNonResult(Arrays.asList(iUnban), code);
|
||||||
return iUnban.getResultFlag();
|
return iUnban.getResultFlag();
|
||||||
}
|
}
|
||||||
@@ -173,7 +173,7 @@ public class DetectionServiceImpl {
|
|||||||
*/
|
*/
|
||||||
case HP:
|
case HP:
|
||||||
AdHarmonicResult harmP = isHarmQualified(dev, devIdMapComm, errDtlsCheckData, P, sourceIssue, dataRule, 2);
|
AdHarmonicResult harmP = isHarmQualified(dev, devIdMapComm, errDtlsCheckData, P, sourceIssue, dataRule, 2);
|
||||||
if (ObjectUtil.isNull(harmP)) {
|
if (ObjectUtil.isNotNull(harmP)) {
|
||||||
detectionDataDealService.acceptAdResult(Arrays.asList(harmP), code);
|
detectionDataDealService.acceptAdResult(Arrays.asList(harmP), code);
|
||||||
return harmP.getResultFlag();
|
return harmP.getResultFlag();
|
||||||
}
|
}
|
||||||
@@ -183,7 +183,7 @@ public class DetectionServiceImpl {
|
|||||||
*/
|
*/
|
||||||
case F:
|
case F:
|
||||||
AdNonHarmonicResult pst = isUnBalanceOrFlickerQualified(dev, devIdMapComm, errDtlsCheckData, null, sourceIssue, dataRule, "PST");
|
AdNonHarmonicResult pst = isUnBalanceOrFlickerQualified(dev, devIdMapComm, errDtlsCheckData, null, sourceIssue, dataRule, "PST");
|
||||||
if (ObjectUtil.isNull(pst)) {
|
if (ObjectUtil.isNotNull(pst)) {
|
||||||
detectionDataDealService.acceptAdNonResult(Arrays.asList(pst), code);
|
detectionDataDealService.acceptAdNonResult(Arrays.asList(pst), code);
|
||||||
return pst.getResultFlag();
|
return pst.getResultFlag();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,16 +129,18 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
.ne(PqScriptDtls::getIndex, -1)
|
.ne(PqScriptDtls::getIndex, -1)
|
||||||
.eq(PqScriptDtls::getEnable, DataStateEnum.ENABLE.getCode())
|
.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);
|
Map<Integer, Set<Integer>> resultMap = new HashMap<>(5);
|
||||||
if (CollUtil.isNotEmpty(allResultList)) {
|
if(StrUtil.isNotBlank(param.getDevId())){
|
||||||
resultMap = allResultList.stream().collect(Collectors.groupingBy(AdBaseResult::getSort, Collectors.mapping(AdBaseResult::getResultFlag, Collectors.toSet())));
|
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()
|
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()));
|
.collect(Collectors.groupingBy(PqScriptDtls::getIndex, LinkedHashMap::new, Collectors.toList()));
|
||||||
List<TreeDataVO> subTypeList = new ArrayList<>();
|
List<TreeDataVO> subTypeList = new ArrayList<>();
|
||||||
indexMap.forEach((index, scriptDtlIndexList) -> {
|
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)) {
|
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)));
|
dtlType.setFly(conform(finalResultMap.get(index)));
|
||||||
subTypeList.add(dtlType);
|
|
||||||
}
|
}
|
||||||
|
subTypeList.add(dtlType);
|
||||||
});
|
});
|
||||||
if (CollUtil.isNotEmpty(subTypeList)) {
|
if (CollUtil.isNotEmpty(subTypeList)) {
|
||||||
subType.setChildren(subTypeList);
|
subType.setChildren(subTypeList);
|
||||||
@@ -221,23 +223,22 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
.sorted(Comparator.comparing(PqScriptDtls::getIndex))
|
.sorted(Comparator.comparing(PqScriptDtls::getIndex))
|
||||||
.collect(Collectors.groupingBy(PqScriptDtls::getIndex, LinkedHashMap::new, Collectors.toList()));
|
.collect(Collectors.groupingBy(PqScriptDtls::getIndex, LinkedHashMap::new, Collectors.toList()));
|
||||||
indexMap.forEach((index, scriptDtlIndexList) -> {
|
indexMap.forEach((index, scriptDtlIndexList) -> {
|
||||||
if (finalResultMap.containsKey(index)) {
|
TreeDataVO dtlType = new TreeDataVO();
|
||||||
TreeDataVO dtlType = new TreeDataVO();
|
dtlType.setIndex(index);
|
||||||
dtlType.setIndex(index);
|
if ("Harm".equals(subKey)) {
|
||||||
if ("Harm".equals(subKey)) {
|
harmScriptTypeName(scriptDtlIndexList, dictTree, isValueType, dtlType);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
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)) {
|
if (CollUtil.isNotEmpty(subTypeList)) {
|
||||||
treeDataVO.setChildren(subTypeList);
|
treeDataVO.setChildren(subTypeList);
|
||||||
@@ -269,17 +270,17 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
vo.setScriptTypeName(name);
|
vo.setScriptTypeName(name);
|
||||||
TreeDataVO dlt;
|
TreeDataVO dlt;
|
||||||
for (PqScriptDtls dtls : dip) {
|
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())) {
|
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())));
|
dlt.setFly(conform(finalResultMap.get(dtls.getIndex())));
|
||||||
info.add(dlt);
|
|
||||||
}
|
}
|
||||||
|
info.add(dlt);
|
||||||
|
|
||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(info)) {
|
if (CollUtil.isNotEmpty(info)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user