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<>(); List<DetectionData> resultFlag = new ArrayList<>();
map.forEach((key, value) -> { map.forEach((key, value) -> {
List<ErrDtlsCheckDataVO> checkData = dtlsCheckData.stream().filter(x -> key.equals(x.getPhase())).collect(Collectors.toList()); List<ErrDtlsCheckDataVO> checkData = dtlsCheckData.stream().filter(x -> key.equals(x.getPhase())).collect(Collectors.toList());
if(CollUtil.isNotEmpty(checkData)){ if (CollUtil.isNotEmpty(checkData)) {
DetectionData detectionData; DetectionData detectionData;
if (DUR.equals(devIndex)) { if (DUR.equals(devIndex)) {
detectionData = rangeDURComparisonList(value, new ArrayList<>(), sourceIssue.getFFreq(), checkData.get(0).getValue(), dataRule); detectionData = rangeDURComparisonList(value, new ArrayList<>(), sourceIssue.getFFreq(), checkData.get(0).getValue(), dataRule);
@@ -278,11 +278,12 @@ public class DetectionServiceImpl {
} }
} }
if (devIndex.contains("I")) { if (devIndex.contains("I")) {
fundCode = DetectionCodeEnum.I1.getCode();; fundCode = DetectionCodeEnum.I1.getCode();
;
type = I; type = I;
fData = sourceIssue.getFIn(); fData = sourceIssue.getFIn();
if (devIndex.contains("50")) { if (devIndex.contains("50")) {
harmCode =DetectionCodeEnum.I2_50.getCode(); harmCode = DetectionCodeEnum.I2_50.getCode();
} }
if (devIndex.contains("49")) { if (devIndex.contains("49")) {
harmCode = DetectionCodeEnum.SI_1_49.getCode(); harmCode = DetectionCodeEnum.SI_1_49.getCode();
@@ -294,7 +295,7 @@ public class DetectionServiceImpl {
fData = sourceIssue.getFIn() * sourceIssue.getFUn() * 0.01; fData = sourceIssue.getFIn() * sourceIssue.getFUn() * 0.01;
} }
Map<String, Map<Double, List<Double>>> devHarmMap = devHarmListMap(dev, sourceIssue, dataRule, fundCode, harmCode, num); 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(); AdHarmonicResult harmonicResult = new AdHarmonicResult();
String[] split = dev.get(0).getId().split("_"); String[] split = dev.get(0).getId().split("_");
String devID = devIdMapComm.get(split[0]); String devID = devIdMapComm.get(split[0]);
@@ -307,8 +308,8 @@ public class DetectionServiceImpl {
} }
//电压下百分比给百分比直接算 电流是是下百分比给的是幅值要转换算 //电压下百分比给百分比直接算 电流是是下百分比给的是幅值要转换算
List<DetectionData> integerBooleanA = harmRangeComparison(new ArrayList<>(), type, TYPE_A, sourceIssue, dataRule, devHarmMap.get(TYPE_A), fData, num); List<DetectionData> integerBooleanA = harmRangeComparison(new ArrayList<>(), type, TYPE_A, sourceIssue, dataRule, devHarmMap.get(TYPE_A), fData, num);
List<DetectionData> integerBooleanB = harmRangeComparison(new ArrayList<>(), type, TYPE_B, sourceIssue, dataRule, devHarmMap.get(TYPE_B), fData, num); List<DetectionData> integerBooleanB = harmRangeComparison(new ArrayList<>(), type, TYPE_B, sourceIssue, dataRule, devHarmMap.get(TYPE_B), fData, num);
List<DetectionData> integerBooleanC = harmRangeComparison(new ArrayList<>(), type, TYPE_C, sourceIssue, dataRule, devHarmMap.get(TYPE_C), fData, num); List<DetectionData> integerBooleanC = harmRangeComparison(new ArrayList<>(), type, TYPE_C, sourceIssue, dataRule, devHarmMap.get(TYPE_C), fData, num);
harmonicResult.setDataType("avg"); harmonicResult.setDataType("avg");
reflectHarmonic("a", integerBooleanA, harmonicResult, num); reflectHarmonic("a", integerBooleanA, harmonicResult, num);
reflectHarmonic("b", integerBooleanB, harmonicResult, num); reflectHarmonic("b", integerBooleanB, harmonicResult, num);
@@ -454,11 +455,12 @@ public class DetectionServiceImpl {
} }
if (I.equals(type)) { if (I.equals(type)) {
fData = sourceIssue.getFIn(); fData = sourceIssue.getFIn();
fundCode = DetectionCodeEnum.I1.getCode();; fundCode = DetectionCodeEnum.I1.getCode();
;
if (num == 1) { if (num == 1) {
harmCode = DetectionCodeEnum.SI_1_49.getCode(); harmCode = DetectionCodeEnum.SI_1_49.getCode();
} else { } else {
harmCode =DetectionCodeEnum.I2_50.getCode(); harmCode = DetectionCodeEnum.I2_50.getCode();
} }
} }
if (P.equals(type)) { if (P.equals(type)) {
@@ -466,7 +468,7 @@ public class DetectionServiceImpl {
harmCode = DetectionCodeEnum.P2_50.getCode(); harmCode = DetectionCodeEnum.P2_50.getCode();
} }
Map<String, Map<Double, List<Double>>> devMap = devHarmListMap(dev, sourceIssue, dataRule, fundCode, harmCode, num); 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(); AdHarmonicResult harmonicResult = new AdHarmonicResult();
String[] split = dev.get(0).getId().split("_"); String[] split = dev.get(0).getId().split("_");
String devID = devIdMapComm.get(split[0]); String devID = devIdMapComm.get(split[0]);
@@ -520,7 +522,7 @@ public class DetectionServiceImpl {
.eq(PqScriptCheckData::getScriptId, sourceIssue.getScriptId()) .eq(PqScriptCheckData::getScriptId, sourceIssue.getScriptId())
); );
Map<String, List<Double>> map = devListMap(dev, dataRule, code); Map<String, List<Double>> map = devListMap(dev, dataRule, code);
if(CollUtil.isNotEmpty(map)){ if (CollUtil.isNotEmpty(map)) {
Double fData = 1.0; Double fData = 1.0;
if (U.equals(type)) { if (U.equals(type)) {
fData = sourceIssue.getFUn(); fData = sourceIssue.getFUn();
@@ -878,7 +880,10 @@ public class DetectionServiceImpl {
*/ */
private void setDetection(DictDataEnum dataRule, List<Double> harmDataList, PqErrSysDtls errSysDtl, DetectionData data, Double v) { private void setDetection(DictDataEnum dataRule, List<Double> harmDataList, PqErrSysDtls errSysDtl, DetectionData data, Double v) {
List<Double> qualifiedList = harmDataList.stream() 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()),
BigDecimal.valueOf(errSysDtl.getMaxErrorValue()))).collect(Collectors.toList()); BigDecimal.valueOf(errSysDtl.getMaxErrorValue()))).collect(Collectors.toList());
isData(dataRule, harmDataList, data, qualifiedList); isData(dataRule, harmDataList, data, qualifiedList);