From 173aa100bd61bd8e8a1ceac6b0efb87bf7d2d7b6 Mon Sep 17 00:00:00 2001 From: wr <1754607820@qq.com> Date: Mon, 13 Jan 2025 19:19:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../handler/SocketDevResponseService.java | 23 +++++++++++++++++-- .../service/impl/DetectionServiceImpl.java | 2 +- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/detection/src/main/java/com/njcn/gather/detection/handler/SocketDevResponseService.java b/detection/src/main/java/com/njcn/gather/detection/handler/SocketDevResponseService.java index b73a0074..865af837 100644 --- a/detection/src/main/java/com/njcn/gather/detection/handler/SocketDevResponseService.java +++ b/detection/src/main/java/com/njcn/gather/detection/handler/SocketDevResponseService.java @@ -1344,10 +1344,29 @@ public class SocketDevResponseService { } if (CollUtil.isNotEmpty(adNonHarmonicResultList)) { - detectionDataDealService.acceptAdNon(adNonHarmonicResultList, param.getCode()); + Map> map = adNonHarmonicResultList.stream().collect(Collectors.groupingBy(x -> x.getMonitorId() + x.getTimeId() + x.getScriptId() + x.getSort() + x.getAdType() + x.getDataType())); + List info=new ArrayList<>(); + map.forEach((key,value)->{ + if(value.size()>1){ + System.err.println("重复时间戳->"+key+value); + }else{ + info.addAll(value); + } + }); + + detectionDataDealService.acceptAdNon(info, param.getCode()); } if (CollUtil.isNotEmpty(adHarmonicResultList)) { - detectionDataDealService.acceptAd(adHarmonicResultList, param.getCode()); + Map> map = adHarmonicResultList.stream().collect(Collectors.groupingBy(x -> x.getMonitorId() + x.getTimeId() + x.getScriptId() + x.getSort() + x.getAdType() + x.getDataType())); + List info=new ArrayList<>(); + map.forEach((key,value)->{ + if(value.size()>1){ + System.err.println("重复时间戳->"+key+value); + }else{ + info.addAll(value); + } + }); + detectionDataDealService.acceptAd(info, param.getCode()); } System.out.println("原始数据插入数据库执行成功========================================="); // }; 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 ac5b1cd6..a11825f8 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 @@ -689,7 +689,7 @@ public class DetectionServiceImpl { nf.setMaximumFractionDigits(6); nf.setGroupingUsed(false); - data.setRadius(nf.format(-errSysDtl.getMaxErrorValue()) + "~" + nf.format(-errSysDtl.getMaxErrorValue())); + data.setRadius(nf.format(-errSys.getMaxErrorValue()) + "~" + nf.format(-errSys.getMaxErrorValue())); setDetection(dataRule, harmDataList, errSys, data, v); } info.add(data);