From 4f3f0833d54460b7ff3df4af5d8984fb8ade4c40 Mon Sep 17 00:00:00 2001 From: caozehui <2427765068@qq.com> Date: Fri, 8 May 2026 13:15:28 +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 --- .../detection/handler/SocketFreqConverterService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/detection/src/main/java/com/njcn/gather/detection/handler/SocketFreqConverterService.java b/detection/src/main/java/com/njcn/gather/detection/handler/SocketFreqConverterService.java index 9c8ef5bd..af5e57ac 100644 --- a/detection/src/main/java/com/njcn/gather/detection/handler/SocketFreqConverterService.java +++ b/detection/src/main/java/com/njcn/gather/detection/handler/SocketFreqConverterService.java @@ -347,7 +347,7 @@ public class SocketFreqConverterService { if (this.lastTolerancePoint.getTolerant() == 1) { TolerantPointVO featurePointVO = new TolerantPointVO(); - featurePointVO.setResidualVoltage((task.getPqDipData().getResidualVoltage() + this.lastTolerancePoint.getResidualVoltage()) / 2D); + featurePointVO.setResidualVoltage(Math.round((task.getPqDipData().getResidualVoltage() + this.lastTolerancePoint.getResidualVoltage()) / 2D * 100) / 100D); featurePointVO.setDurationMs(Integer.valueOf((task.getPqDipData().getDurationMs().intValue() + this.lastTolerancePoint.getDurationMs().intValue()) / 2)); featurePointVO.setTolerant(2); socketDataMsg.setData(JSON.toJSONString(featurePointVO)); @@ -368,7 +368,7 @@ public class SocketFreqConverterService { if (ObjectUtil.isNotNull(lastByDuration) && lastByDuration.getTolerant() == 1) { TolerantPointVO featurePointVO = new TolerantPointVO(); - featurePointVO.setResidualVoltage((task.getPqDipData().getResidualVoltage() + lastByDuration.getResidualVoltage()) / 2D); + featurePointVO.setResidualVoltage(Math.round((task.getPqDipData().getResidualVoltage() + lastByDuration.getResidualVoltage()) / 2D * 100) / 100D); featurePointVO.setDurationMs(Integer.valueOf((task.getPqDipData().getDurationMs().intValue() + lastByDuration.getDurationMs().intValue()) / 2)); featurePointVO.setTolerant(2); socketDataMsg.setData(JSON.toJSONString(featurePointVO)); @@ -389,7 +389,7 @@ public class SocketFreqConverterService { if (ObjectUtil.isNotNull(lastByResidualVoltage) && lastByResidualVoltage.getTolerant() == 1) { TolerantPointVO featurePointVO = new TolerantPointVO(); - featurePointVO.setResidualVoltage((task.getPqDipData().getResidualVoltage() + lastByResidualVoltage.getResidualVoltage()) / 2D); + featurePointVO.setResidualVoltage(Math.round((task.getPqDipData().getResidualVoltage() + lastByResidualVoltage.getResidualVoltage()) / 2D * 100) / 100D); featurePointVO.setDurationMs(Integer.valueOf((task.getPqDipData().getDurationMs().intValue() + lastByResidualVoltage.getDurationMs().intValue()) / 2)); featurePointVO.setTolerant(2); socketDataMsg.setData(JSON.toJSONString(featurePointVO));