From 9bef1331f2bcc3c08edd4e5b7ac227bc7063207c Mon Sep 17 00:00:00 2001 From: wr <1754607820@qq.com> Date: Mon, 10 Mar 2025 18:44:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=97=B4=E8=B0=90=E6=B3=A2?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=E8=84=9A=E6=9C=AC=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gather/detection/service/impl/DetectionServiceImpl.java | 6 +++--- .../gather/storage/service/impl/AdHarmonicServiceImpl.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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 ae120db8..7204cb5e 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 @@ -772,7 +772,7 @@ public class DetectionServiceImpl { dataMap.forEach((key, value) -> { try { // 设置 id 字段; - Field idField = AdHarmonicResult.class.getDeclaredField(phase + "Value" + (num == 1 ? (int) (key + 0.5) : key.intValue())); + Field idField = AdHarmonicResult.class.getDeclaredField(phase + "Value" + (num == 1 ? (int) (key + 1.5) : key.intValue())); idField.setAccessible(true); if (ObjectUtil.isNull(value.getIsData())) { idField.set(harmonicResult, value.getData()); @@ -1220,7 +1220,7 @@ public class DetectionServiceImpl { if (i.equals(1.0)) { integerListMap.get(1.0).add(multiply(fund, fund)); } else { - double v = num == 1 ? num : (i - num); + double v = (num == 1 ? num : (i - num)); if (type.equals("A")) { integerListMap.get(i).add(multiply(harm.getList().getA().get((int) v), fund)); } @@ -1241,7 +1241,7 @@ public class DetectionServiceImpl { integerList.add(multiply(fund, fund)); integerListMap.put(1.0, integerList); } else { - double v = num == 1 ? num : (i - num); + double v = (num == 1 ? num : (i - num)); if (type.equals("A")) { integerList.add(multiply(harm.getList().getA().get((int) v), fund)); } 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 56d59278..59515d2f 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 @@ -235,7 +235,7 @@ public class AdHarmonicServiceImpl extends ServiceImpl numbers) { - List isData = numbers.stream().filter(x -> ObjectUtil.isNotNull(x.getData())).filter(x -> 4 != x.getIsData()).map(RawResultDataVO.DetectionData::getIsData).distinct().collect(Collectors.toList()); + List isData = numbers.stream().filter(Objects::nonNull).filter(x -> ObjectUtil.isNotNull(x.getData())).filter(x -> 4 != x.getIsData()).map(RawResultDataVO.DetectionData::getIsData).distinct().collect(Collectors.toList()); return getInteger(isData); }