This commit is contained in:
wr
2025-02-27 14:51:50 +08:00
parent a2ac240150
commit 06b13fdfe1

View File

@@ -233,7 +233,7 @@ public class DetectionServiceImpl {
List<DetectionData> resultFlag = new ArrayList<>();
map.forEach((key, value) -> {
List<ErrDtlsCheckDataVO> checkData = dtlsCheckData.stream().filter(x -> key.equals(x.getPhase())).collect(Collectors.toList());
if(CollUtil.isNotEmpty(checkData)){
if (CollUtil.isNotEmpty(checkData)) {
DetectionData detectionData;
if (DUR.equals(devIndex)) {
detectionData = rangeDURComparisonList(value, new ArrayList<>(), sourceIssue.getFFreq(), checkData.get(0).getValue(), dataRule);
@@ -278,11 +278,12 @@ public class DetectionServiceImpl {
}
}
if (devIndex.contains("I")) {
fundCode = DetectionCodeEnum.I1.getCode();;
fundCode = DetectionCodeEnum.I1.getCode();
;
type = I;
fData = sourceIssue.getFIn();
if (devIndex.contains("50")) {
harmCode =DetectionCodeEnum.I2_50.getCode();
harmCode = DetectionCodeEnum.I2_50.getCode();
}
if (devIndex.contains("49")) {
harmCode = DetectionCodeEnum.SI_1_49.getCode();
@@ -294,7 +295,7 @@ public class DetectionServiceImpl {
fData = sourceIssue.getFIn() * sourceIssue.getFUn() * 0.01;
}
Map<String, Map<Double, List<Double>>> devHarmMap = devHarmListMap(dev, sourceIssue, dataRule, fundCode, harmCode, num);
if(CollUtil.isNotEmpty(devHarmMap)){
if (CollUtil.isNotEmpty(devHarmMap)) {
AdHarmonicResult harmonicResult = new AdHarmonicResult();
String[] split = dev.get(0).getId().split("_");
String devID = devIdMapComm.get(split[0]);
@@ -454,11 +455,12 @@ public class DetectionServiceImpl {
}
if (I.equals(type)) {
fData = sourceIssue.getFIn();
fundCode = DetectionCodeEnum.I1.getCode();;
fundCode = DetectionCodeEnum.I1.getCode();
;
if (num == 1) {
harmCode = DetectionCodeEnum.SI_1_49.getCode();
} else {
harmCode =DetectionCodeEnum.I2_50.getCode();
harmCode = DetectionCodeEnum.I2_50.getCode();
}
}
if (P.equals(type)) {
@@ -466,7 +468,7 @@ public class DetectionServiceImpl {
harmCode = DetectionCodeEnum.P2_50.getCode();
}
Map<String, Map<Double, List<Double>>> devMap = devHarmListMap(dev, sourceIssue, dataRule, fundCode, harmCode, num);
if(CollUtil.isNotEmpty(devMap)){
if (CollUtil.isNotEmpty(devMap)) {
AdHarmonicResult harmonicResult = new AdHarmonicResult();
String[] split = dev.get(0).getId().split("_");
String devID = devIdMapComm.get(split[0]);
@@ -520,7 +522,7 @@ public class DetectionServiceImpl {
.eq(PqScriptCheckData::getScriptId, sourceIssue.getScriptId())
);
Map<String, List<Double>> map = devListMap(dev, dataRule, code);
if(CollUtil.isNotEmpty(map)){
if (CollUtil.isNotEmpty(map)) {
Double fData = 1.0;
if (U.equals(type)) {
fData = sourceIssue.getFUn();
@@ -878,7 +880,10 @@ public class DetectionServiceImpl {
*/
private void setDetection(DictDataEnum dataRule, List<Double> harmDataList, PqErrSysDtls errSysDtl, DetectionData data, Double v) {
List<Double> qualifiedList = harmDataList.stream()
.filter(x -> x > 0 && NumberUtil.isIn(devSubtractChannelData(x, v, errSysDtl.getErrorValueType()),
.filter(x -> v == 0 ? NumberUtil.isIn(devSubtractChannelData(x, v, errSysDtl.getErrorValueType()),
BigDecimal.valueOf(-errSysDtl.getMaxErrorValue()),
BigDecimal.valueOf(errSysDtl.getMaxErrorValue())) :
x > 0 && NumberUtil.isIn(devSubtractChannelData(x, v, errSysDtl.getErrorValueType()),
BigDecimal.valueOf(-errSysDtl.getMaxErrorValue()),
BigDecimal.valueOf(errSysDtl.getMaxErrorValue()))).collect(Collectors.toList());
isData(dataRule, harmDataList, data, qualifiedList);