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);