From b93006bc3ad1ac6214901a7fe4f05e360d729c96 Mon Sep 17 00:00:00 2001 From: zhangbaojian <1065122561@qq.com> Date: Fri, 5 May 2023 09:33:13 +0800 Subject: [PATCH] =?UTF-8?q?zbj//1.=E8=8E=B7=E5=8F=96=E7=94=B5=E5=8E=8B?= =?UTF-8?q?=E6=9A=82=E6=80=81=E8=A1=A8=E5=8F=8A=E5=AF=86=E5=BA=A6=E5=9D=90?= =?UTF-8?q?=E6=A0=87=E5=9B=BE=E4=B8=8E=E8=A1=A8=E6=95=B0=E6=8D=AE=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E4=B8=8D=E4=B8=8A=20bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Impl/EventAnalysisServiceImpl.java | 305 +++++++++--------- 1 file changed, 161 insertions(+), 144 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 69e641e8a..dce6a2d2c 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 @@ -157,7 +157,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService { //查询监测点未处理暂态事件 List info = eventDetailService.list(new LambdaQueryWrapper() .eq(RmpEventDetailPO::getMeasurementPointId, statisticsParam.getLineIndex()) - .ge(StringUtils.isNotBlank(statisticsParam.getStartTime()), RmpEventDetailPO::getStartTime,DateUtil.beginOfDay(DateUtil.parse(statisticsParam.getStartTime()))) + .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()))) ); @@ -170,203 +170,203 @@ public class EventAnalysisServiceImpl implements EventAnalysisService { Integer index = null; CoordsVO dto = new CoordsVO(); if (info.get(i).getFeatureAmplitude() >= 0 && info.get(i).getFeatureAmplitude() <= 0.1) { - if (info.get(i).getDuration()/1000 > 0 && info.get(i).getDuration()/1000 <= 0.020) { + if (info.get(i).getDuration() / 1000 > 0 && info.get(i).getDuration() / 1000 <= 0.020) { index = 0; - } else if (info.get(i).getDuration()/1000 <= 0.040 && info.get(i).getDuration()/1000 > 0.020) { + } else if (info.get(i).getDuration() / 1000 <= 0.040 && info.get(i).getDuration() / 1000 > 0.020) { index = 1; - } else if (info.get(i).getDuration()/1000 <= 0.060 && info.get(i).getDuration()/1000 > 0.040) { + } else if (info.get(i).getDuration() / 1000 <= 0.060 && info.get(i).getDuration() / 1000 > 0.040) { index = 2; - } else if (info.get(i).getDuration()/1000 <= 0.080 && info.get(i).getDuration()/1000 > 0.060) { + } else if (info.get(i).getDuration() / 1000 <= 0.080 && info.get(i).getDuration() / 1000 > 0.060) { index = 3; - } else if (info.get(i).getDuration()/1000 <= 0.120 && info.get(i).getDuration()/1000 > 0.080) { + } else if (info.get(i).getDuration() / 1000 <= 0.120 && info.get(i).getDuration() / 1000 > 0.080) { index = 4; - } else if (info.get(i).getDuration()/1000 > 0.120 && info.get(i).getDuration()/1000 < 0.200) { + } else if (info.get(i).getDuration() / 1000 > 0.120 && info.get(i).getDuration() / 1000 < 0.200) { index = 5; - } else if (info.get(i).getDuration()/1000 >= 0.200 && info.get(i).getDuration()/1000 < 0.400) { + } else if (info.get(i).getDuration() / 1000 >= 0.200 && info.get(i).getDuration() / 1000 < 0.400) { index = 6; - } else if (info.get(i).getDuration()/1000 >= 0.400 && info.get(i).getDuration()/1000 < 0.600) { + } else if (info.get(i).getDuration() / 1000 >= 0.400 && info.get(i).getDuration() / 1000 < 0.600) { index = 7; - } else if (info.get(i).getDuration()/1000 >= 0.600 && info.get(i).getDuration()/1000 <= 1.200) { + } else if (info.get(i).getDuration() / 1000 >= 0.600 && info.get(i).getDuration() / 1000 <= 1.200) { index = 8; } } else if (info.get(i).getFeatureAmplitude() > 0.1 && info.get(i).getFeatureAmplitude() <= 0.2) { - if (info.get(i).getDuration()/1000 > 0 && info.get(i).getDuration()/1000 <= 0.020) { + if (info.get(i).getDuration() / 1000 > 0 && info.get(i).getDuration() / 1000 <= 0.020) { index = 9; - } else if (info.get(i).getDuration()/1000 <= 0.040 && info.get(i).getDuration()/1000 > 0.020) { + } else if (info.get(i).getDuration() / 1000 <= 0.040 && info.get(i).getDuration() / 1000 > 0.020) { index = 10; - } else if (info.get(i).getDuration()/1000 <= 0.060 && info.get(i).getDuration()/1000 > 0.040) { + } else if (info.get(i).getDuration() / 1000 <= 0.060 && info.get(i).getDuration() / 1000 > 0.040) { index = 11; - } else if (info.get(i).getDuration()/1000 <= 0.080 && info.get(i).getDuration()/1000 > 0.060) { + } else if (info.get(i).getDuration() / 1000 <= 0.080 && info.get(i).getDuration() / 1000 > 0.060) { index = 12; - } else if (info.get(i).getDuration()/1000 <= 0.120 && info.get(i).getDuration()/1000 > 0.080) { + } else if (info.get(i).getDuration() / 1000 <= 0.120 && info.get(i).getDuration() / 1000 > 0.080) { index = 13; - } else if (info.get(i).getDuration()/1000 > 0.120 && info.get(i).getDuration()/1000 < 0.200) { + } else if (info.get(i).getDuration() / 1000 > 0.120 && info.get(i).getDuration() / 1000 < 0.200) { index = 14; - } else if (info.get(i).getDuration()/1000 >= 0.200 && info.get(i).getDuration()/1000 < 0.400) { + } else if (info.get(i).getDuration() / 1000 >= 0.200 && info.get(i).getDuration() / 1000 < 0.400) { index = 15; - } else if (info.get(i).getDuration()/1000 >= 0.400 && info.get(i).getDuration()/1000 < 0.600) { + } else if (info.get(i).getDuration() / 1000 >= 0.400 && info.get(i).getDuration() / 1000 < 0.600) { index = 16; - } else if (info.get(i).getDuration()/1000 >= 0.600 && info.get(i).getDuration()/1000 <= 1.200) { + } else if (info.get(i).getDuration() / 1000 >= 0.600 && info.get(i).getDuration() / 1000 <= 1.200) { index = 17; } } else if (info.get(i).getFeatureAmplitude() > 0.2 && info.get(i).getFeatureAmplitude() <= 0.3) { - if (info.get(i).getDuration()/1000 > 0 && info.get(i).getDuration()/1000 <= 0.020) { + if (info.get(i).getDuration() / 1000 > 0 && info.get(i).getDuration() / 1000 <= 0.020) { index = 18; - } else if (info.get(i).getDuration()/1000 <= 0.040 && info.get(i).getDuration()/1000 > 0.020) { + } else if (info.get(i).getDuration() / 1000 <= 0.040 && info.get(i).getDuration() / 1000 > 0.020) { index = 19; - } else if (info.get(i).getDuration()/1000 <= 0.060 && info.get(i).getDuration()/1000 > 0.040) { + } else if (info.get(i).getDuration() / 1000 <= 0.060 && info.get(i).getDuration() / 1000 > 0.040) { index = 20; - } else if (info.get(i).getDuration()/1000 <= 0.080 && info.get(i).getDuration()/1000 > 0.060) { + } else if (info.get(i).getDuration() / 1000 <= 0.080 && info.get(i).getDuration() / 1000 > 0.060) { index = 21; - } else if (info.get(i).getDuration()/1000 <= 0.120 && info.get(i).getDuration()/1000 > 0.080) { + } else if (info.get(i).getDuration() / 1000 <= 0.120 && info.get(i).getDuration() / 1000 > 0.080) { index = 22; - } else if (info.get(i).getDuration()/1000 > 0.120 && info.get(i).getDuration()/1000 < 0.200) { + } else if (info.get(i).getDuration() / 1000 > 0.120 && info.get(i).getDuration() / 1000 < 0.200) { index = 23; - } else if (info.get(i).getDuration()/1000 >= 0.200 && info.get(i).getDuration()/1000 < 0.400) { + } else if (info.get(i).getDuration() / 1000 >= 0.200 && info.get(i).getDuration() / 1000 < 0.400) { index = 24; - } else if (info.get(i).getDuration()/1000 >= 0.400 && info.get(i).getDuration()/1000 < 0.600) { + } else if (info.get(i).getDuration() / 1000 >= 0.400 && info.get(i).getDuration() / 1000 < 0.600) { index = 25; - } else if (info.get(i).getDuration()/1000 >= 0.600 && info.get(i).getDuration()/1000 <= 1.200) { + } else if (info.get(i).getDuration() / 1000 >= 0.600 && info.get(i).getDuration() / 1000 <= 1.200) { index = 26; } } else if (info.get(i).getFeatureAmplitude() > 0.3 && info.get(i).getFeatureAmplitude() <= 0.4) { - if (info.get(i).getDuration()/1000 > 0 && info.get(i).getDuration()/1000 <= 0.020) { + if (info.get(i).getDuration() / 1000 > 0 && info.get(i).getDuration() / 1000 <= 0.020) { index = 27; - } else if (info.get(i).getDuration()/1000 <= 0.040 && info.get(i).getDuration()/1000 > 0.020) { + } else if (info.get(i).getDuration() / 1000 <= 0.040 && info.get(i).getDuration() / 1000 > 0.020) { index = 28; - } else if (info.get(i).getDuration()/1000 <= 0.060 && info.get(i).getDuration()/1000 > 0.040) { + } else if (info.get(i).getDuration() / 1000 <= 0.060 && info.get(i).getDuration() / 1000 > 0.040) { index = 29; - } else if (info.get(i).getDuration()/1000 <= 0.080 && info.get(i).getDuration()/1000 > 0.060) { + } else if (info.get(i).getDuration() / 1000 <= 0.080 && info.get(i).getDuration() / 1000 > 0.060) { index = 30; - } else if (info.get(i).getDuration()/1000 <= 0.120 && info.get(i).getDuration()/1000 > 0.080) { + } else if (info.get(i).getDuration() / 1000 <= 0.120 && info.get(i).getDuration() / 1000 > 0.080) { index = 31; - } else if (info.get(i).getDuration()/1000 > 0.120 && info.get(i).getDuration()/1000 < 0.200) { + } else if (info.get(i).getDuration() / 1000 > 0.120 && info.get(i).getDuration() / 1000 < 0.200) { index = 32; - } else if (info.get(i).getDuration()/1000 >= 0.200 && info.get(i).getDuration()/1000 < 0.400) { + } else if (info.get(i).getDuration() / 1000 >= 0.200 && info.get(i).getDuration() / 1000 < 0.400) { index = 33; - } else if (info.get(i).getDuration()/1000 >= 0.400 && info.get(i).getDuration()/1000 < 0.600) { + } else if (info.get(i).getDuration() / 1000 >= 0.400 && info.get(i).getDuration() / 1000 < 0.600) { index = 34; - } else if (info.get(i).getDuration()/1000 >= 0.600 && info.get(i).getDuration()/1000 <= 1.200) { + } else if (info.get(i).getDuration() / 1000 >= 0.600 && info.get(i).getDuration() / 1000 <= 1.200) { index = 35; } } else if (info.get(i).getFeatureAmplitude() > 0.4 && info.get(i).getFeatureAmplitude() <= 0.5) { - if (info.get(i).getDuration()/1000 > 0 && info.get(i).getDuration()/1000 <= 0.020) { + if (info.get(i).getDuration() / 1000 > 0 && info.get(i).getDuration() / 1000 <= 0.020) { index = 36; - } else if (info.get(i).getDuration()/1000 <= 0.040 && info.get(i).getDuration()/1000 > 0.020) { + } else if (info.get(i).getDuration() / 1000 <= 0.040 && info.get(i).getDuration() / 1000 > 0.020) { index = 37; - } else if (info.get(i).getDuration()/1000 <= 0.060 && info.get(i).getDuration()/1000 > 0.040) { + } else if (info.get(i).getDuration() / 1000 <= 0.060 && info.get(i).getDuration() / 1000 > 0.040) { index = 38; - } else if (info.get(i).getDuration()/1000 <= 0.080 && info.get(i).getDuration()/1000 > 0.060) { + } else if (info.get(i).getDuration() / 1000 <= 0.080 && info.get(i).getDuration() / 1000 > 0.060) { index = 39; - } else if (info.get(i).getDuration()/1000 <= 0.120 && info.get(i).getDuration()/1000 > 0.080) { + } else if (info.get(i).getDuration() / 1000 <= 0.120 && info.get(i).getDuration() / 1000 > 0.080) { index = 40; - } else if (info.get(i).getDuration()/1000 > 0.120 && info.get(i).getDuration()/1000 < 0.200) { + } else if (info.get(i).getDuration() / 1000 > 0.120 && info.get(i).getDuration() / 1000 < 0.200) { index = 41; - } else if (info.get(i).getDuration()/1000 >= 0.200 && info.get(i).getDuration()/1000 < 0.400) { + } else if (info.get(i).getDuration() / 1000 >= 0.200 && info.get(i).getDuration() / 1000 < 0.400) { index = 42; - } else if (info.get(i).getDuration()/1000 >= 0.400 && info.get(i).getDuration()/1000 < 0.600) { + } else if (info.get(i).getDuration() / 1000 >= 0.400 && info.get(i).getDuration() / 1000 < 0.600) { index = 43; - } else if (info.get(i).getDuration()/1000 >= 0.600 && info.get(i).getDuration()/1000 <= 1.200) { + } else if (info.get(i).getDuration() / 1000 >= 0.600 && info.get(i).getDuration() / 1000 <= 1.200) { index = 44; } } else if (info.get(i).getFeatureAmplitude() > 0.5 && info.get(i).getFeatureAmplitude() <= 0.6) { - if (info.get(i).getDuration()/1000 > 0 && info.get(i).getDuration()/1000 <= 0.020) { + if (info.get(i).getDuration() / 1000 > 0 && info.get(i).getDuration() / 1000 <= 0.020) { index = 45; - } else if (info.get(i).getDuration()/1000 <= 0.040 && info.get(i).getDuration()/1000 > 0.020) { + } else if (info.get(i).getDuration() / 1000 <= 0.040 && info.get(i).getDuration() / 1000 > 0.020) { index = 46; - } else if (info.get(i).getDuration()/1000 <= 0.060 && info.get(i).getDuration()/1000 > 0.040) { + } else if (info.get(i).getDuration() / 1000 <= 0.060 && info.get(i).getDuration() / 1000 > 0.040) { index = 47; - } else if (info.get(i).getDuration()/1000 <= 0.080 && info.get(i).getDuration()/1000 > 0.060) { + } else if (info.get(i).getDuration() / 1000 <= 0.080 && info.get(i).getDuration() / 1000 > 0.060) { index = 48; - } else if (info.get(i).getDuration()/1000 <= 0.120 && info.get(i).getDuration()/1000 > 0.080) { + } else if (info.get(i).getDuration() / 1000 <= 0.120 && info.get(i).getDuration() / 1000 > 0.080) { index = 49; - } else if (info.get(i).getDuration()/1000 > 0.120 && info.get(i).getDuration()/1000 < 0.200) { + } else if (info.get(i).getDuration() / 1000 > 0.120 && info.get(i).getDuration() / 1000 < 0.200) { index = 50; - } else if (info.get(i).getDuration()/1000 >= 0.200 && info.get(i).getDuration()/1000 < 0.400) { + } else if (info.get(i).getDuration() / 1000 >= 0.200 && info.get(i).getDuration() / 1000 < 0.400) { index = 51; - } else if (info.get(i).getDuration()/1000 >= 0.400 && info.get(i).getDuration()/1000 < 0.600) { + } else if (info.get(i).getDuration() / 1000 >= 0.400 && info.get(i).getDuration() / 1000 < 0.600) { index = 52; - } else if (info.get(i).getDuration()/1000 >= 0.600 && info.get(i).getDuration()/1000 <= 1.200) { + } else if (info.get(i).getDuration() / 1000 >= 0.600 && info.get(i).getDuration() / 1000 <= 1.200) { index = 53; } } else if (info.get(i).getFeatureAmplitude() > 0.6 && info.get(i).getFeatureAmplitude() <= 0.7) { - if (info.get(i).getDuration()/1000 > 0 && info.get(i).getDuration()/1000 <= 0.020) { + if (info.get(i).getDuration() / 1000 > 0 && info.get(i).getDuration() / 1000 <= 0.020) { index = 54; - } else if (info.get(i).getDuration()/1000 <= 0.040 && info.get(i).getDuration()/1000 > 0.020) { + } else if (info.get(i).getDuration() / 1000 <= 0.040 && info.get(i).getDuration() / 1000 > 0.020) { index = 55; - } else if (info.get(i).getDuration()/1000 <= 0.060 && info.get(i).getDuration()/1000 > 0.040) { + } else if (info.get(i).getDuration() / 1000 <= 0.060 && info.get(i).getDuration() / 1000 > 0.040) { index = 56; - } else if (info.get(i).getDuration()/1000 <= 0.080 && info.get(i).getDuration()/1000 > 0.060) { + } else if (info.get(i).getDuration() / 1000 <= 0.080 && info.get(i).getDuration() / 1000 > 0.060) { index = 57; - } else if (info.get(i).getDuration()/1000 <= 0.120 && info.get(i).getDuration()/1000 > 0.080) { + } else if (info.get(i).getDuration() / 1000 <= 0.120 && info.get(i).getDuration() / 1000 > 0.080) { index = 58; - } else if (info.get(i).getDuration()/1000 > 0.120 && info.get(i).getDuration()/1000 < 0.200) { + } else if (info.get(i).getDuration() / 1000 > 0.120 && info.get(i).getDuration() / 1000 < 0.200) { index = 59; - } else if (info.get(i).getDuration()/1000 >= 0.200 && info.get(i).getDuration()/1000 < 0.400) { + } else if (info.get(i).getDuration() / 1000 >= 0.200 && info.get(i).getDuration() / 1000 < 0.400) { index = 60; - } else if (info.get(i).getDuration()/1000 >= 0.400 && info.get(i).getDuration()/1000 < 0.600) { + } else if (info.get(i).getDuration() / 1000 >= 0.400 && info.get(i).getDuration() / 1000 < 0.600) { index = 61; - } else if (info.get(i).getDuration()/1000 >= 0.600 && info.get(i).getDuration()/1000 <= 1.200) { + } else if (info.get(i).getDuration() / 1000 >= 0.600 && info.get(i).getDuration() / 1000 <= 1.200) { index = 62; } } else if (info.get(i).getFeatureAmplitude() > 0.7 && info.get(i).getFeatureAmplitude() <= 0.8) { - if (info.get(i).getDuration()/1000 > 0 && info.get(i).getDuration()/1000 <= 0.020) { + if (info.get(i).getDuration() / 1000 > 0 && info.get(i).getDuration() / 1000 <= 0.020) { index = 63; - } else if (info.get(i).getDuration()/1000 <= 0.040 && info.get(i).getDuration()/1000 > 0.020) { + } else if (info.get(i).getDuration() / 1000 <= 0.040 && info.get(i).getDuration() / 1000 > 0.020) { index = 64; - } else if (info.get(i).getDuration()/1000 <= 0.060 && info.get(i).getDuration()/1000 > 0.040) { + } else if (info.get(i).getDuration() / 1000 <= 0.060 && info.get(i).getDuration() / 1000 > 0.040) { index = 65; - } else if (info.get(i).getDuration()/1000 <= 0.080 && info.get(i).getDuration()/1000 > 0.060) { + } else if (info.get(i).getDuration() / 1000 <= 0.080 && info.get(i).getDuration() / 1000 > 0.060) { index = 66; - } else if (info.get(i).getDuration()/1000 <= 0.120 && info.get(i).getDuration()/1000 > 0.080) { + } else if (info.get(i).getDuration() / 1000 <= 0.120 && info.get(i).getDuration() / 1000 > 0.080) { index = 67; - } else if (info.get(i).getDuration()/1000 > 0.120 && info.get(i).getDuration()/1000 < 0.200) { + } else if (info.get(i).getDuration() / 1000 > 0.120 && info.get(i).getDuration() / 1000 < 0.200) { index = 68; - } else if (info.get(i).getDuration()/1000 >= 0.200 && info.get(i).getDuration()/1000 < 0.400) { + } else if (info.get(i).getDuration() / 1000 >= 0.200 && info.get(i).getDuration() / 1000 < 0.400) { index = 69; - } else if (info.get(i).getDuration()/1000 >= 0.400 && info.get(i).getDuration()/1000 < 0.600) { + } else if (info.get(i).getDuration() / 1000 >= 0.400 && info.get(i).getDuration() / 1000 < 0.600) { index = 70; - } else if (info.get(i).getDuration()/1000 >= 0.600 && info.get(i).getDuration()/1000 <= 1.200) { + } else if (info.get(i).getDuration() / 1000 >= 0.600 && info.get(i).getDuration() / 1000 <= 1.200) { index = 71; } } else if (info.get(i).getFeatureAmplitude() > 0.8 && info.get(i).getFeatureAmplitude() <= 0.9) { - if (info.get(i).getDuration()/1000 > 0 && info.get(i).getDuration()/1000 <= 0.020) { + if (info.get(i).getDuration() / 1000 > 0 && info.get(i).getDuration() / 1000 <= 0.020) { index = 72; - } else if (info.get(i).getDuration()/1000 <= 0.040 && info.get(i).getDuration()/1000 > 0.020) { + } else if (info.get(i).getDuration() / 1000 <= 0.040 && info.get(i).getDuration() / 1000 > 0.020) { index = 73; - } else if (info.get(i).getDuration()/1000 <= 0.060 && info.get(i).getDuration()/1000 > 0.040) { + } else if (info.get(i).getDuration() / 1000 <= 0.060 && info.get(i).getDuration() / 1000 > 0.040) { index = 74; - } else if (info.get(i).getDuration()/1000 <= 0.080 && info.get(i).getDuration()/1000 > 0.060) { + } else if (info.get(i).getDuration() / 1000 <= 0.080 && info.get(i).getDuration() / 1000 > 0.060) { index = 75; - } else if (info.get(i).getDuration()/1000 <= 0.120 && info.get(i).getDuration()/1000 > 0.080) { + } else if (info.get(i).getDuration() / 1000 <= 0.120 && info.get(i).getDuration() / 1000 > 0.080) { index = 76; - } else if (info.get(i).getDuration()/1000 > 0.120 && info.get(i).getDuration()/1000 < 0.200) { + } else if (info.get(i).getDuration() / 1000 > 0.120 && info.get(i).getDuration() / 1000 < 0.200) { index = 77; - } else if (info.get(i).getDuration()/1000 >= 0.200 && info.get(i).getDuration()/1000 < 0.400) { + } else if (info.get(i).getDuration() / 1000 >= 0.200 && info.get(i).getDuration() / 1000 < 0.400) { index = 78; - } else if (info.get(i).getDuration()/1000 >= 0.400 && info.get(i).getDuration()/1000 < 0.600) { + } else if (info.get(i).getDuration() / 1000 >= 0.400 && info.get(i).getDuration() / 1000 < 0.600) { index = 79; - } else if (info.get(i).getDuration()/1000 >= 0.600 && info.get(i).getDuration()/1000 <= 1.200) { + } else if (info.get(i).getDuration() / 1000 >= 0.600 && info.get(i).getDuration() / 1000 <= 1.200) { index = 80; } } else { - if (info.get(i).getDuration()/1000 > 0 && info.get(i).getDuration()/1000 <= 0.020) { + if (info.get(i).getDuration() / 1000 > 0 && info.get(i).getDuration() / 1000 <= 0.020) { index = 81; - } else if (info.get(i).getDuration()/1000 <= 0.040 && info.get(i).getDuration()/1000 > 0.020) { + } else if (info.get(i).getDuration() / 1000 <= 0.040 && info.get(i).getDuration() / 1000 > 0.020) { index = 82; - } else if (info.get(i).getDuration()/1000 <= 0.060 && info.get(i).getDuration()/1000 > 0.040) { + } else if (info.get(i).getDuration() / 1000 <= 0.060 && info.get(i).getDuration() / 1000 > 0.040) { index = 83; - } else if (info.get(i).getDuration()/1000 <= 0.080 && info.get(i).getDuration()/1000 > 0.060) { + } else if (info.get(i).getDuration() / 1000 <= 0.080 && info.get(i).getDuration() / 1000 > 0.060) { index = 84; - } else if (info.get(i).getDuration()/1000 <= 0.120 && info.get(i).getDuration()/1000 > 0.080) { + } else if (info.get(i).getDuration() / 1000 <= 0.120 && info.get(i).getDuration() / 1000 > 0.080) { index = 85; - } else if (info.get(i).getDuration()/1000 > 0.120 && info.get(i).getDuration()/1000 < 0.200) { + } else if (info.get(i).getDuration() / 1000 > 0.120 && info.get(i).getDuration() / 1000 < 0.200) { index = 86; - } else if (info.get(i).getDuration()/1000 >= 0.200 && info.get(i).getDuration()/1000 < 0.400) { + } else if (info.get(i).getDuration() / 1000 >= 0.200 && info.get(i).getDuration() / 1000 < 0.400) { index = 87; - } else if (info.get(i).getDuration()/1000 >= 0.400 && info.get(i).getDuration()/1000 < 0.600) { + } else if (info.get(i).getDuration() / 1000 >= 0.400 && info.get(i).getDuration() / 1000 < 0.600) { index = 88; - } else if (info.get(i).getDuration()/1000 >= 0.600 && info.get(i).getDuration()/1000 <= 1.200) { + } else if (info.get(i).getDuration() / 1000 >= 0.600 && info.get(i).getDuration() / 1000 <= 1.200) { index = 89; } } @@ -381,10 +381,19 @@ public class EventAnalysisServiceImpl implements EventAnalysisService { @Override public List eventDisdip(StatisticsParam statisticsParam) { List result = new ArrayList<>(); - List info = new ArrayList<>(); + + /*List info = new ArrayList<>(); QueryResult query = MonitorQuery(statisticsParam); InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper(); - info = influxDBResultMapper.toPOJO(query, EventDetail.class); + info = influxDBResultMapper.toPOJO(query, EventDetail.class);*/ + + //查询监测点未处理暂态事件 + List info = eventDetailService.list(new LambdaQueryWrapper() + .eq(RmpEventDetailPO::getMeasurementPointId, statisticsParam.getLineIndex()) + .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()))) + ); + int[][] arr = new int[5][8]; for (int i = 0; i < 5; i++) { for (int j = 0; j < 8; j++) { @@ -505,7 +514,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService { //查询监测点未处理暂态事件 List info = eventDetailService.list(new LambdaQueryWrapper() .eq(RmpEventDetailPO::getMeasurementPointId, statisticsParam.getLineIndex()) - .ge(StringUtils.isNotBlank(statisticsParam.getStartTime()), RmpEventDetailPO::getStartTime,DateUtil.beginOfDay(DateUtil.parse(statisticsParam.getStartTime()))) + .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()))) ); int[][] arr = new int[3][6]; @@ -569,10 +578,20 @@ public class EventAnalysisServiceImpl implements EventAnalysisService { @Override public List IEC28(StatisticsParam statisticsParam) { + List result = new ArrayList<>(); - QueryResult query = MonitorQuery(statisticsParam); + + /*QueryResult query = MonitorQuery(statisticsParam); InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper(); - List info = influxDBResultMapper.toPOJO(query, EventDetail.class); + List info = influxDBResultMapper.toPOJO(query, EventDetail.class);*/ + + //查询监测点未处理暂态事件 + List info = eventDetailService.list(new LambdaQueryWrapper() + .eq(RmpEventDetailPO::getMeasurementPointId, statisticsParam.getLineIndex()) + .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()))) + ); + int[][] arr = new int[17][8]; for (int i = 0; i < 17; i++) { for (int j = 0; j < 8; j++) { @@ -935,7 +954,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService { Integer endMonth = Integer.parseInt(endTime.substring(5, 7)); Integer startYear = Integer.parseInt(startTime.substring(0, 4)); Integer endYear = Integer.parseInt(endTime.substring(0, 4)); - if (statisticsParam.getFlag()==0){ + if (statisticsParam.getFlag() == 0) { while (startYear != endYear && startMonth != endMonth) { builder1.delete(0, builder1.length()); builder2.delete(0, builder2.length()); @@ -952,14 +971,14 @@ public class EventAnalysisServiceImpl implements EventAnalysisService { // long count = eventDetailList.stream().filter(x -> x.getWaveType() == 1).count(); List eventDetailList = eventDetailService.list(new LambdaQueryWrapper() .eq(RmpEventDetailPO::getMeasurementPointId, statisticsParam.getLineIndex()) - .ge(StringUtils.isNotBlank(statisticsParam.getStartTime()), RmpEventDetailPO::getStartTime,DateUtil.beginOfDay(DateUtil.parse(statisticsParam.getStartTime()))) + .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()))) ); long count = eventDetailList.stream().filter(x -> data.getId().equals(x.getEventType())).count(); if (startMonth < 10) { - list.add(new TimeVO(null, null,"", "0" + startMonth.toString(), count+"", startYear.toString(), startYear.toString()+"-"+"0"+startMonth.toString())); + list.add(new TimeVO(null, null, "", "0" + startMonth.toString(), count + "", startYear.toString(), startYear.toString() + "-" + "0" + startMonth.toString())); } else { - list.add(new TimeVO(null, null,"", startMonth.toString(), count+"", startYear.toString(),startYear.toString()+"-"+startMonth.toString())); + list.add(new TimeVO(null, null, "", startMonth.toString(), count + "", startYear.toString(), startYear.toString() + "-" + startMonth.toString())); } startMonth++; if (startMonth == 13) { @@ -977,18 +996,17 @@ public class EventAnalysisServiceImpl implements EventAnalysisService { // long count1 = eventDetailList.stream().filter(x -> x.getWaveType() == 1).count(); List eventDetailList = eventDetailService.list(new LambdaQueryWrapper() .eq(RmpEventDetailPO::getMeasurementPointId, statisticsParam.getLineIndex()) - .ge(StringUtils.isNotBlank(statisticsParam.getStartTime()), RmpEventDetailPO::getStartTime,DateUtil.beginOfDay(DateUtil.parse(statisticsParam.getStartTime()))) + .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()))) ); long count1 = eventDetailList.stream().filter(x -> data.getId().equals(x.getEventType())).count(); if (startMonth < 10) { - list.add(new TimeVO(null, null,"", "0" + startMonth.toString(), count1+"", startYear.toString(), startYear.toString()+"-"+"0"+startMonth.toString())); + list.add(new TimeVO(null, null, "", "0" + startMonth.toString(), count1 + "", startYear.toString(), startYear.toString() + "-" + "0" + startMonth.toString())); } else { - list.add(new TimeVO(null, null,"", startMonth.toString(), count1+"", startYear.toString(),startYear.toString()+"-"+startMonth.toString())); + list.add(new TimeVO(null, null, "", startMonth.toString(), count1 + "", startYear.toString(), startYear.toString() + "-" + startMonth.toString())); } return list; - } - else { + } else { // QueryResult monitorQuery = MonitorQuery(statisticsParam); // InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper(); // List eventDetailList = influxDBResultMapper.toPOJO(monitorQuery, EventDetailNew.class); @@ -996,7 +1014,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService { List eventDetailList = eventDetailService.list(new LambdaQueryWrapper() .eq(RmpEventDetailPO::getMeasurementPointId, statisticsParam.getLineIndex()) - .ge(StringUtils.isNotBlank(statisticsParam.getStartTime()), RmpEventDetailPO::getStartTime,DateUtil.beginOfDay(DateUtil.parse(statisticsParam.getStartTime()))) + .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()))) ); @@ -1006,43 +1024,43 @@ public class EventAnalysisServiceImpl implements EventAnalysisService { LocalDate parse1 = LocalDate.parse(startTime); LocalDate parse2 = LocalDate.parse(endTime); - while (!parse1.equals(parse2.plus(1, ChronoUnit.DAYS))){ - if (keySet.contains(parse1.toString())){ + while (!parse1.equals(parse2.plus(1, ChronoUnit.DAYS))) { + if (keySet.contains(parse1.toString())) { // List eventDetailNews = map.get(parse1.toString()); List eventDetailNews = map.get(parse1.toString()); TimeVO timeVO = new TimeVO(); - timeVO.setTimes(eventDetailNews.size()+""); - if (parse1.getDayOfMonth()<10){ - timeVO.setDay("0"+parse1.getDayOfMonth()+""); - }else { - timeVO.setDay(parse1.getDayOfMonth()+""); + timeVO.setTimes(eventDetailNews.size() + ""); + if (parse1.getDayOfMonth() < 10) { + timeVO.setDay("0" + parse1.getDayOfMonth() + ""); + } else { + timeVO.setDay(parse1.getDayOfMonth() + ""); } - timeVO.setYear(parse1.getYear()+""); - if (parse1.getMonthValue()<10){ - timeVO.setMonth("0"+parse1.getMonthValue()+""); - }else { - timeVO.setMonth(parse1.getMonthValue()+""); + timeVO.setYear(parse1.getYear() + ""); + if (parse1.getMonthValue() < 10) { + timeVO.setMonth("0" + parse1.getMonthValue() + ""); + } else { + timeVO.setMonth(parse1.getMonthValue() + ""); } timeVO.setFulltime(parse1.toString()); list.add(timeVO); - }else { + } else { TimeVO timeVO = new TimeVO(); timeVO.setTimes("0"); - if (parse1.getDayOfMonth()<10){ - timeVO.setDay("0"+parse1.getDayOfMonth()+""); - }else { - timeVO.setDay(parse1.getDayOfMonth()+""); + if (parse1.getDayOfMonth() < 10) { + timeVO.setDay("0" + parse1.getDayOfMonth() + ""); + } else { + timeVO.setDay(parse1.getDayOfMonth() + ""); } - timeVO.setYear(parse1.getYear()+""); - if (parse1.getMonthValue()<10){ - timeVO.setMonth("0"+parse1.getMonthValue()+""); - }else { - timeVO.setMonth(parse1.getMonthValue()+""); + timeVO.setYear(parse1.getYear() + ""); + if (parse1.getMonthValue() < 10) { + timeVO.setMonth("0" + parse1.getMonthValue() + ""); + } else { + timeVO.setMonth(parse1.getMonthValue() + ""); } timeVO.setFulltime(parse1.toString()); list.add(timeVO); } - parse1=parse1.plus(1, ChronoUnit.DAYS); + parse1 = parse1.plus(1, ChronoUnit.DAYS); } return list; } @@ -1061,7 +1079,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService { //数据暂降查询 List info = eventDetailService.list(new LambdaQueryWrapper() .eq(RmpEventDetailPO::getMeasurementPointId, statisticsParam.getLineIndex()) - .ge(StringUtils.isNotBlank(statisticsParam.getStartTime()), RmpEventDetailPO::getStartTime,DateUtil.beginOfDay(DateUtil.parse(statisticsParam.getStartTime()))) + .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()))) ); @@ -1078,18 +1096,18 @@ public class EventAnalysisServiceImpl implements EventAnalysisService { //添加detail for (RmpEventDetailPO detail : info) { EventDetail details = null; - if (dataDto.getId() .equals(detail.getEventType())) { + if (dataDto.getId().equals(detail.getEventType())) { for (DictData data : reasonData) { - reasonMap.put(data.getName(),0); + reasonMap.put(data.getName(), 0); if (detail.getAdvanceReason().equals(data.getId())) { - details=BeanUtil.copyProperties(detail,EventDetail.class); + details = BeanUtil.copyProperties(detail, EventDetail.class); details.setAdvanceReason(data.getName()); } } for (DictData data : typeData) { - typeMap.put(data.getName(),0); + typeMap.put(data.getName(), 0); if (detail.getAdvanceType().equals(data.getId())) { - details=BeanUtil.copyProperties(detail,EventDetail.class); + details = BeanUtil.copyProperties(detail, EventDetail.class); detail.setAdvanceType(data.getName()); } } @@ -1140,7 +1158,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService { //数据暂降查询 List infos = eventDetailService.list(new LambdaQueryWrapper() .eq(RmpEventDetailPO::getMeasurementPointId, statisticsParam.getLineIndex()) - .ge(StringUtils.isNotBlank(statisticsParam.getStartTime()), RmpEventDetailPO::getStartTime,DateUtil.beginOfDay(DateUtil.parse(statisticsParam.getStartTime()))) + .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()))) ); List info2 = BeanUtil.copyToList(infos, EventDetail.class); @@ -1441,7 +1459,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService { //查询监测点未处理暂态事件 List eventDetails = eventDetailService.list(new LambdaQueryWrapper() .eq(RmpEventDetailPO::getMeasurementPointId, statisticsParam.getLineIndex()) - .ge(StringUtils.isNotBlank(statisticsParam.getStartTime()), RmpEventDetailPO::getStartTime,DateUtil.beginOfDay(DateUtil.parse(statisticsParam.getStartTime()))) + .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()))) ); //获取字典属性 @@ -1453,7 +1471,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService { DictData data = dicDataFeignClient.getDicDataByCode(DicDataEnum.VOLTAGE_DIP.getCode()).getData(); EventDetail eventDetailNew; for (RmpEventDetailPO eventDetail : eventDetails) { - eventDetailNew= BeanUtil.copyProperties(eventDetail,EventDetail.class); + eventDetailNew = BeanUtil.copyProperties(eventDetail, EventDetail.class); //监测点id eventDetailNew.setLineId(eventDetail.getMeasurementPointId()); //持续时间 @@ -1462,7 +1480,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService { eventDetailNew.setFeatureAmplitude(eventDetail.getFeatureAmplitude()); //波形路径 eventDetailNew.setWavePath(eventDetail.getWavePath()); - if(data.getId().equals(eventDetail.getEventType())) { + if (data.getId().equals(eventDetail.getEventType())) { if (reasonMap.containsKey(eventDetail.getAdvanceReason())) { //暂降原因 DictData dictData = reasonMap.get(eventDetail.getAdvanceReason()); @@ -1523,13 +1541,13 @@ public class EventAnalysisServiceImpl implements EventAnalysisService { //数据暂降查询 Page pageInfo = eventDetailService.page(new Page<>(eventBaseParam.getPageNum(), eventBaseParam.getPageSize()), new LambdaQueryWrapper() .eq(RmpEventDetailPO::getMeasurementPointId, eventBaseParam.getLineId()) - .ge(StringUtils.isNotBlank(eventBaseParam.getSearchBeginTime()), RmpEventDetailPO::getStartTime,DateUtil.beginOfDay(DateUtil.parse(eventBaseParam.getSearchBeginTime()))) + .ge(StringUtils.isNotBlank(eventBaseParam.getSearchBeginTime()), RmpEventDetailPO::getStartTime, DateUtil.beginOfDay(DateUtil.parse(eventBaseParam.getSearchBeginTime()))) .le(StringUtils.isNotBlank(eventBaseParam.getSearchEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(eventBaseParam.getSearchEndTime()))) ); //获取关于监测点发电站相关信息 List areaLineList = lineFeignClient.getBaseLineAreaInfo(Arrays.asList(eventBaseParam.getLineId())).getData(); - if(CollectionUtil.isEmpty(areaLineList)) { + if (CollectionUtil.isEmpty(areaLineList)) { throw new BusinessException(EventResponseEnum.NOT_FOUND); } List waveTypeVOS = new ArrayList<>(); @@ -1537,7 +1555,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService { WaveTypeVO waveTypeVO; //将监测点发电机相关信息copy到准备好的VO对象中 for (RmpEventDetailPO record : records) { - waveTypeVO=BeanUtil.copyProperties(record,WaveTypeVO.class); + waveTypeVO = BeanUtil.copyProperties(record, WaveTypeVO.class); if (waveTypeVO.getLineId() != null) { for (AreaLineInfoVO lineInfoVO : areaLineList) { if (waveTypeVO.getLineId().equals(lineInfoVO.getLineId())) { @@ -1592,7 +1610,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService { throw new BusinessException(EventResponseEnum.EVENT_NOT_FOUND); } } - Page page=BeanUtil.copyProperties(pageInfo,Page.class); + Page page = BeanUtil.copyProperties(pageInfo, Page.class); page.setRecords(waveTypeVOS); return page; // //提前创建结果集合 @@ -1837,7 +1855,6 @@ public class EventAnalysisServiceImpl implements EventAnalysisService { } - /** * 监测点事件波形下载 *