diff --git a/detection/src/main/java/com/njcn/gather/detection/service/impl/DetectionServiceImpl.java b/detection/src/main/java/com/njcn/gather/detection/service/impl/DetectionServiceImpl.java index 1562d339..ae120db8 100644 --- a/detection/src/main/java/com/njcn/gather/detection/service/impl/DetectionServiceImpl.java +++ b/detection/src/main/java/com/njcn/gather/detection/service/impl/DetectionServiceImpl.java @@ -676,9 +676,9 @@ public class DetectionServiceImpl { DetectionData c; if (DUR.equals(dur)) { c = rangeDURComparisonList(mag.get(typeC), magErrList, fData, channelTypeCList.get(0).getDipData().getRetainTime(), dataRule); - }else { + } else { List ampData = mag.get(typeC).stream() - .filter(x->ObjectUtil.isNotNull(x)) + .filter(x -> ObjectUtil.isNotNull(x)) .map(x -> x * channelTypeCList.get(0).getFAmp() * 0.01) .collect(Collectors.toList()); c = rangeComparisonList(ampData, magErrList, fData, channelTypeCList.get(0).getDipData().getFTransValue(), dataRule); @@ -885,11 +885,11 @@ public class DetectionServiceImpl { private void setDetection(DictDataEnum dataRule, List harmDataList, PqErrSysDtls errSysDtl, DetectionData data, Double v) { List qualifiedList = harmDataList.stream() .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()); + 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); } @@ -1003,6 +1003,7 @@ public class DetectionServiceImpl { }); return map; } + /** * 处理数据是否合格 * @@ -1219,14 +1220,15 @@ public class DetectionServiceImpl { if (i.equals(1.0)) { integerListMap.get(1.0).add(multiply(fund, fund)); } else { + double v = num == 1 ? num : (i - num); if (type.equals("A")) { - integerListMap.get(i).add(multiply(harm.getList().getA().get((int) (i - num)), fund)); + integerListMap.get(i).add(multiply(harm.getList().getA().get((int) v), fund)); } if (type.equals("B")) { - integerListMap.get(i).add(multiply(harm.getList().getB().get((int) (i - num)), fund)); + integerListMap.get(i).add(multiply(harm.getList().getB().get((int) v), fund)); } if (type.equals("C")) { - integerListMap.get(i).add(multiply(harm.getList().getC().get((int) (i - num)), fund)); + integerListMap.get(i).add(multiply(harm.getList().getC().get((int) v), fund)); } } } @@ -1239,14 +1241,15 @@ public class DetectionServiceImpl { integerList.add(multiply(fund, fund)); integerListMap.put(1.0, integerList); } else { + double v = num == 1 ? num : (i - num); if (type.equals("A")) { - integerList.add(multiply(harm.getList().getA().get((int) (i - num)), fund)); + integerList.add(multiply(harm.getList().getA().get((int) v), fund)); } if (type.equals("B")) { - integerList.add(multiply(harm.getList().getB().get((int) (i - num)), fund)); + integerList.add(multiply(harm.getList().getB().get((int) v), fund)); } if (type.equals("C")) { - integerList.add(multiply(harm.getList().getC().get((int) (i - num)), fund)); + integerList.add(multiply(harm.getList().getC().get((int) v), fund)); } integerListMap.put(i, integerList); } diff --git a/storage/src/main/java/com/njcn/gather/storage/service/impl/AdHarmonicServiceImpl.java b/storage/src/main/java/com/njcn/gather/storage/service/impl/AdHarmonicServiceImpl.java index 10ef106e..bd22c540 100644 --- a/storage/src/main/java/com/njcn/gather/storage/service/impl/AdHarmonicServiceImpl.java +++ b/storage/src/main/java/com/njcn/gather/storage/service/impl/AdHarmonicServiceImpl.java @@ -99,18 +99,15 @@ public class AdHarmonicServiceImpl extends ServiceImpl