From 24d05203a287d0090c74d762d5ec704748bf8445 Mon Sep 17 00:00:00 2001 From: xy <748613696@qq.com> Date: Wed, 30 Jul 2025 09:07:59 +0800 Subject: [PATCH] =?UTF-8?q?bug=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Impl/EventAnalysisServiceImpl.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/EventAnalysisServiceImpl.java b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/EventAnalysisServiceImpl.java index ef9147505..10890aaf7 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/EventAnalysisServiceImpl.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/EventAnalysisServiceImpl.java @@ -54,9 +54,11 @@ import java.util.zip.ZipOutputStream; public class EventAnalysisServiceImpl implements EventAnalysisService { // 定义阈值常量(单位:百分比) - final double[] EVENT_VALUE_THRESHOLDS = {90, 85, 70, 40, 10}; + final double[] EVENT_VALUE_THRESHOLDS = {85, 70, 40, 10, 0}; // 定义持续时间阈值(单位:毫秒) final double[] DURATION_THRESHOLDS = {0.02, 0.1, 0.5, 1, 3, 20, 60, 180}; + // 定义持续时间阈值(单位:毫秒) + final double[] DURATION_THRESHOLDS_411 = {0.02, 0.1, 0.2, 0.5, 1, 180}; String[] labels = {"90%", "85%", "70%", "40%", "10%"}; @@ -320,6 +322,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService { List events = eventDetailService.list( new LambdaQueryWrapper() .eq(RmpEventDetailPO::getMeasurementPointId, statisticsParam.getLineIndex()) + .le(RmpEventDetailPO::getFeatureAmplitude,0.9) .ge(StringUtils.isNotBlank(statisticsParam.getStartTime()), RmpEventDetailPO::getStartTime, DateUtil.beginOfDay(DateUtil.parse(statisticsParam.getStartTime()))) .le(StringUtils.isNotBlank(statisticsParam.getEndTime()), @@ -384,6 +387,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService { //查询监测点未处理暂态事件 List events = eventDetailService.list(new LambdaQueryWrapper() .eq(RmpEventDetailPO::getMeasurementPointId, statisticsParam.getLineIndex()) + .le(RmpEventDetailPO::getFeatureAmplitude,0.9) .ge(StringUtils.isNotBlank(statisticsParam.getStartTime()), RmpEventDetailPO::getStartTime, DateUtil.beginOfDay(DateUtil.parse(statisticsParam.getStartTime()))) .le(StringUtils.isNotBlank(statisticsParam.getEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(statisticsParam.getEndTime()))) ); @@ -401,7 +405,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService { // 确定事件等级(0=90%, 1=85%, ..., 4=10%) int level = getIEC411_EventLevel(eventValue); // 确定持续时间区间索引 - int durationIndex = getDurationIndex(duration, DURATION_THRESHOLDS); + int durationIndex = getDurationIndex(duration, DURATION_THRESHOLDS_411); if (level != -1 && durationIndex != -1) { arr[level][durationIndex]++; @@ -418,11 +422,15 @@ public class EventAnalysisServiceImpl implements EventAnalysisService { * 根据事件值获取等级索引(从高到低匹配) */ private int getIEC411_EventLevel(double eventValue) { - if (eventValue >= 0.1 && eventValue < 0.4) { + if (eventValue >= 0.01 && eventValue < 0.4) { return 1; } else if (eventValue >= 0.4 && eventValue < 0.7) { return 0; - } else if (eventValue >= 0.7 && eventValue < 1) { + } +// else if (eventValue >= 0.7 && eventValue < 1) { +// return 2; +// } + else if (eventValue < 0.01) { return 2; } return -1;