|
|
|
|
@@ -1,7 +1,9 @@
|
|
|
|
|
package com.njcn.event.service.majornetwork.Impl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import com.njcn.common.config.GeneralInfo;
|
|
|
|
|
import com.njcn.common.pojo.exception.BusinessException;
|
|
|
|
|
@@ -16,14 +18,17 @@ import com.njcn.event.pojo.dto.wave.WaveDataDTO;
|
|
|
|
|
import com.njcn.event.pojo.param.*;
|
|
|
|
|
import com.njcn.event.pojo.po.EventDetail;
|
|
|
|
|
import com.njcn.event.pojo.po.EventDetailNew;
|
|
|
|
|
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
|
|
|
|
import com.njcn.event.pojo.vo.*;
|
|
|
|
|
import com.njcn.event.service.majornetwork.EventAnalysisService;
|
|
|
|
|
import com.njcn.event.service.majornetwork.EventDetailService;
|
|
|
|
|
import com.njcn.influxdb.utils.InfluxDbUtils;
|
|
|
|
|
import com.njcn.system.api.DicDataFeignClient;
|
|
|
|
|
import com.njcn.system.enums.DicDataEnum;
|
|
|
|
|
import com.njcn.system.enums.DicDataTypeEnum;
|
|
|
|
|
import com.njcn.system.pojo.po.DictData;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
|
import org.influxdb.dto.QueryResult;
|
|
|
|
|
import org.influxdb.impl.InfluxDBResultMapper;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -35,6 +40,7 @@ import java.text.ParseException;
|
|
|
|
|
import java.time.LocalDate;
|
|
|
|
|
import java.time.temporal.ChronoUnit;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.function.Function;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
import java.util.zip.ZipEntry;
|
|
|
|
|
import java.util.zip.ZipOutputStream;
|
|
|
|
|
@@ -59,6 +65,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
|
|
|
|
|
|
|
|
|
private final DicDataFeignClient dicDataFeignClient;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Page<EventDetail> getEventAnalyse(EventBaseParam eventBaseParam) {
|
|
|
|
|
|
|
|
|
|
@@ -138,10 +145,17 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public List<CoordsVO> getCoords(StatisticsParam statisticsParam) {
|
|
|
|
|
QueryResult query = MonitorQuery(statisticsParam);
|
|
|
|
|
InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper();
|
|
|
|
|
List<CoordsVO> result = new ArrayList<>();
|
|
|
|
|
List<EventDetail> info = influxDBResultMapper.toPOJO(query, EventDetail.class);
|
|
|
|
|
// QueryResult query = MonitorQuery(statisticsParam);
|
|
|
|
|
// InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper();
|
|
|
|
|
// List<EventDetail> info = influxDBResultMapper.toPOJO(query, EventDetail.class);
|
|
|
|
|
|
|
|
|
|
//查询监测点未处理暂态事件
|
|
|
|
|
List<RmpEventDetailPO> info = eventDetailService.list(new LambdaQueryWrapper<RmpEventDetailPO>()
|
|
|
|
|
.in(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())))
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 10; i++) {
|
|
|
|
|
for (int j = 0; j < 9; j++) {
|
|
|
|
|
@@ -151,204 +165,204 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
|
|
|
|
for (int i = 0; i < info.size(); i++) {
|
|
|
|
|
Integer index = null;
|
|
|
|
|
CoordsVO dto = new CoordsVO();
|
|
|
|
|
if (info.get(i).getEventValue() >= 0 && info.get(i).getEventValue() <= 0.1) {
|
|
|
|
|
if (info.get(i).getPersistTime()/1000 > 0 && info.get(i).getPersistTime()/1000 <= 0.020) {
|
|
|
|
|
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) {
|
|
|
|
|
index = 0;
|
|
|
|
|
} else if (info.get(i).getPersistTime()/1000 <= 0.040 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.060 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.080 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.120 && info.get(i).getPersistTime()/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).getPersistTime()/1000 > 0.120 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.200 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.400 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.600 && info.get(i).getPersistTime()/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).getEventValue() > 0.1 && info.get(i).getEventValue() <= 0.2) {
|
|
|
|
|
if (info.get(i).getPersistTime()/1000 > 0 && info.get(i).getPersistTime()/1000 <= 0.020) {
|
|
|
|
|
} 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) {
|
|
|
|
|
index = 9;
|
|
|
|
|
} else if (info.get(i).getPersistTime()/1000 <= 0.040 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.060 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.080 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.120 && info.get(i).getPersistTime()/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).getPersistTime()/1000 > 0.120 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.200 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.400 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.600 && info.get(i).getPersistTime()/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).getEventValue() > 0.2 && info.get(i).getEventValue() <= 0.3) {
|
|
|
|
|
if (info.get(i).getPersistTime()/1000 > 0 && info.get(i).getPersistTime()/1000 <= 0.020) {
|
|
|
|
|
} 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) {
|
|
|
|
|
index = 18;
|
|
|
|
|
} else if (info.get(i).getPersistTime()/1000 <= 0.040 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.060 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.080 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.120 && info.get(i).getPersistTime()/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).getPersistTime()/1000 > 0.120 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.200 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.400 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.600 && info.get(i).getPersistTime()/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).getEventValue() > 0.3 && info.get(i).getEventValue() <= 0.4) {
|
|
|
|
|
if (info.get(i).getPersistTime()/1000 > 0 && info.get(i).getPersistTime()/1000 <= 0.020) {
|
|
|
|
|
} 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) {
|
|
|
|
|
index = 27;
|
|
|
|
|
} else if (info.get(i).getPersistTime()/1000 <= 0.040 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.060 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.080 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.120 && info.get(i).getPersistTime()/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).getPersistTime()/1000 > 0.120 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.200 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.400 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.600 && info.get(i).getPersistTime()/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).getEventValue() > 0.4 && info.get(i).getEventValue() <= 0.5) {
|
|
|
|
|
if (info.get(i).getPersistTime()/1000 > 0 && info.get(i).getPersistTime()/1000 <= 0.020) {
|
|
|
|
|
} 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) {
|
|
|
|
|
index = 36;
|
|
|
|
|
} else if (info.get(i).getPersistTime()/1000 <= 0.040 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.060 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.080 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.120 && info.get(i).getPersistTime()/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).getPersistTime()/1000 > 0.120 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.200 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.400 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.600 && info.get(i).getPersistTime()/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).getEventValue() > 0.5 && info.get(i).getEventValue() <= 0.6) {
|
|
|
|
|
if (info.get(i).getPersistTime()/1000 > 0 && info.get(i).getPersistTime()/1000 <= 0.020) {
|
|
|
|
|
} 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) {
|
|
|
|
|
index = 45;
|
|
|
|
|
} else if (info.get(i).getPersistTime()/1000 <= 0.040 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.060 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.080 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.120 && info.get(i).getPersistTime()/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).getPersistTime()/1000 > 0.120 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.200 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.400 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.600 && info.get(i).getPersistTime()/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).getEventValue() > 0.6 && info.get(i).getEventValue() <= 0.7) {
|
|
|
|
|
if (info.get(i).getPersistTime()/1000 > 0 && info.get(i).getPersistTime()/1000 <= 0.020) {
|
|
|
|
|
} 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) {
|
|
|
|
|
index = 54;
|
|
|
|
|
} else if (info.get(i).getPersistTime()/1000 <= 0.040 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.060 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.080 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.120 && info.get(i).getPersistTime()/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).getPersistTime()/1000 > 0.120 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.200 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.400 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.600 && info.get(i).getPersistTime()/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).getEventValue() > 0.7 && info.get(i).getEventValue() <= 0.8) {
|
|
|
|
|
if (info.get(i).getPersistTime()/1000 > 0 && info.get(i).getPersistTime()/1000 <= 0.020) {
|
|
|
|
|
} 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) {
|
|
|
|
|
index = 63;
|
|
|
|
|
} else if (info.get(i).getPersistTime()/1000 <= 0.040 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.060 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.080 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.120 && info.get(i).getPersistTime()/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).getPersistTime()/1000 > 0.120 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.200 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.400 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.600 && info.get(i).getPersistTime()/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).getEventValue() > 0.8 && info.get(i).getEventValue() <= 0.9) {
|
|
|
|
|
if (info.get(i).getPersistTime()/1000 > 0 && info.get(i).getPersistTime()/1000 <= 0.020) {
|
|
|
|
|
} 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) {
|
|
|
|
|
index = 72;
|
|
|
|
|
} else if (info.get(i).getPersistTime()/1000 <= 0.040 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.060 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.080 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.120 && info.get(i).getPersistTime()/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).getPersistTime()/1000 > 0.120 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.200 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.400 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.600 && info.get(i).getPersistTime()/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).getPersistTime()/1000 > 0 && info.get(i).getPersistTime()/1000 <= 0.020) {
|
|
|
|
|
if (info.get(i).getDuration()/1000 > 0 && info.get(i).getDuration()/1000 <= 0.020) {
|
|
|
|
|
index = 81;
|
|
|
|
|
} else if (info.get(i).getPersistTime()/1000 <= 0.040 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.060 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.080 && info.get(i).getPersistTime()/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).getPersistTime()/1000 <= 0.120 && info.get(i).getPersistTime()/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).getPersistTime()/1000 > 0.120 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.200 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.400 && info.get(i).getPersistTime()/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).getPersistTime()/1000 >= 0.600 && info.get(i).getPersistTime()/1000 <= 1.200) {
|
|
|
|
|
} else if (info.get(i).getDuration()/1000 >= 0.600 && info.get(i).getDuration()/1000 <= 1.200) {
|
|
|
|
|
index = 89;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -479,10 +493,17 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
|
|
|
|
@Override
|
|
|
|
|
public List<IEC411VO> IEC411(StatisticsParam statisticsParam) {
|
|
|
|
|
List<IEC411VO> result = new ArrayList<>();
|
|
|
|
|
List<EventDetail> info = new ArrayList<>();
|
|
|
|
|
QueryResult query = MonitorQuery(statisticsParam);
|
|
|
|
|
InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper();
|
|
|
|
|
info = influxDBResultMapper.toPOJO(query, EventDetail.class);
|
|
|
|
|
// List<EventDetail> info = new ArrayList<>();
|
|
|
|
|
// QueryResult query = MonitorQuery(statisticsParam);
|
|
|
|
|
// InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper();
|
|
|
|
|
// info = influxDBResultMapper.toPOJO(query, EventDetail.class);
|
|
|
|
|
|
|
|
|
|
//查询监测点未处理暂态事件
|
|
|
|
|
List<RmpEventDetailPO> info = eventDetailService.list(new LambdaQueryWrapper<RmpEventDetailPO>()
|
|
|
|
|
.in(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[3][6];
|
|
|
|
|
for (int i = 0; i < 3; i++) {
|
|
|
|
|
for (int j = 0; j < 6; j++) {
|
|
|
|
|
@@ -490,8 +511,8 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for (int i = 0; i < info.size(); i++) {
|
|
|
|
|
Double eventvalue = info.get(i).getEventValue();
|
|
|
|
|
double persisttime = info.get(i).getPersistTime();
|
|
|
|
|
Double eventvalue = info.get(i).getFeatureAmplitude();
|
|
|
|
|
double persisttime = info.get(i).getDuration();
|
|
|
|
|
if (eventvalue * 100 < 1) {
|
|
|
|
|
if (persisttime < 20 && persisttime >= 10) {
|
|
|
|
|
arr[2][0]++;
|
|
|
|
|
@@ -894,6 +915,8 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public List<TimeVO> getReasonTypeTime(StatisticsParam statisticsParam) throws ParseException {
|
|
|
|
|
//获取暂降字典信息
|
|
|
|
|
DictData data = dicDataFeignClient.getDicDataByCode(DicDataEnum.VOLTAGE_DIP.getCode()).getData();
|
|
|
|
|
List<TimeVO> list = new ArrayList<>();
|
|
|
|
|
//参数
|
|
|
|
|
StringBuilder builder1 = new StringBuilder();
|
|
|
|
|
@@ -918,10 +941,16 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
|
|
|
|
} else {
|
|
|
|
|
builder2.append(startYear).append("-").append(startMonth + 1).append("-").append(startDays);
|
|
|
|
|
}
|
|
|
|
|
query = MonitorQuery(new StatisticsParam(statisticsParam.getLineIndex(),builder1.toString(), builder2.toString(), statisticsParam.getFlag()));
|
|
|
|
|
InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper();
|
|
|
|
|
List<EventDetail> eventDetailList = influxDBResultMapper.toPOJO(query, EventDetail.class);
|
|
|
|
|
long count = eventDetailList.stream().filter(x -> x.getWaveType() == 1).count();
|
|
|
|
|
// query = MonitorQuery(new StatisticsParam(statisticsParam.getLineIndex(),builder1.toString(), builder2.toString(), statisticsParam.getFlag()));
|
|
|
|
|
// InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper();
|
|
|
|
|
// List<EventDetail> eventDetailList = influxDBResultMapper.toPOJO(query, EventDetail.class);
|
|
|
|
|
// long count = eventDetailList.stream().filter(x -> x.getWaveType() == 1).count();
|
|
|
|
|
List<RmpEventDetailPO> eventDetailList = eventDetailService.list(new LambdaQueryWrapper<RmpEventDetailPO>()
|
|
|
|
|
.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())))
|
|
|
|
|
);
|
|
|
|
|
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()));
|
|
|
|
|
} else {
|
|
|
|
|
@@ -937,10 +966,16 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
|
|
|
|
builder2.delete(0, builder2.length());
|
|
|
|
|
builder1.append(startYear).append("-").append(startMonth).append("-").append(startDays);
|
|
|
|
|
builder2.append(startYear).append("-").append(startMonth).append("-").append(endDays);
|
|
|
|
|
query = MonitorQuery(new StatisticsParam(statisticsParam.getLineIndex(),builder1.toString(), builder2.toString(), statisticsParam.getFlag()));
|
|
|
|
|
InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper();
|
|
|
|
|
List<EventDetail> eventDetailList = influxDBResultMapper.toPOJO(query, EventDetail.class);
|
|
|
|
|
long count1 = eventDetailList.stream().filter(x -> x.getWaveType() == 1).count();
|
|
|
|
|
// query = MonitorQuery(new StatisticsParam(statisticsParam.getLineIndex(),builder1.toString(), builder2.toString(), statisticsParam.getFlag()));
|
|
|
|
|
// InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper();
|
|
|
|
|
// List<EventDetail> eventDetailList = influxDBResultMapper.toPOJO(query, EventDetail.class);
|
|
|
|
|
// long count1 = eventDetailList.stream().filter(x -> x.getWaveType() == 1).count();
|
|
|
|
|
List<RmpEventDetailPO> eventDetailList = eventDetailService.list(new LambdaQueryWrapper<RmpEventDetailPO>()
|
|
|
|
|
.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())))
|
|
|
|
|
);
|
|
|
|
|
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()));
|
|
|
|
|
} else {
|
|
|
|
|
@@ -949,18 +984,27 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
QueryResult monitorQuery = MonitorQuery(statisticsParam);
|
|
|
|
|
InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper();
|
|
|
|
|
List<EventDetailNew> eventDetailList = influxDBResultMapper.toPOJO(monitorQuery, EventDetailNew.class);
|
|
|
|
|
// QueryResult monitorQuery = MonitorQuery(statisticsParam);
|
|
|
|
|
// InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper();
|
|
|
|
|
// List<EventDetailNew> eventDetailList = influxDBResultMapper.toPOJO(monitorQuery, EventDetailNew.class);
|
|
|
|
|
// Map<String, List<EventDetailNew>> map = eventDetailList.stream().filter(x -> data.getId().equals(x.getEventType())).collect(Collectors.groupingBy(s -> s.getTimeId().substring(0, 10)));
|
|
|
|
|
|
|
|
|
|
Map<String, List<EventDetailNew>> map = eventDetailList.stream().filter(x -> x.getWaveType()==1).collect(Collectors.groupingBy(s -> s.getTimeId().substring(0, 10)));
|
|
|
|
|
List<RmpEventDetailPO> eventDetailList = eventDetailService.list(new LambdaQueryWrapper<RmpEventDetailPO>()
|
|
|
|
|
.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())))
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
Map<String, List<RmpEventDetailPO>> map = eventDetailList.stream().filter(x -> data.getId().equals(x.getEventType()))
|
|
|
|
|
.collect(Collectors.groupingBy(s -> DateUtil.format(s.getStartTime(), "yyyy-MM-dd")));
|
|
|
|
|
Set<String> keySet = map.keySet();
|
|
|
|
|
|
|
|
|
|
LocalDate parse1 = LocalDate.parse(startTime);
|
|
|
|
|
LocalDate parse2 = LocalDate.parse(endTime);
|
|
|
|
|
while (!parse1.equals(parse2.plus(1, ChronoUnit.DAYS))){
|
|
|
|
|
if (keySet.contains(parse1.toString())){
|
|
|
|
|
List<EventDetailNew> eventDetailNews = map.get(parse1.toString());
|
|
|
|
|
// List<EventDetailNew> eventDetailNews = map.get(parse1.toString());
|
|
|
|
|
List<RmpEventDetailPO> eventDetailNews = map.get(parse1.toString());
|
|
|
|
|
TimeVO timeVO = new TimeVO();
|
|
|
|
|
timeVO.setTimes(eventDetailNews.size()+"");
|
|
|
|
|
if (parse1.getDayOfMonth()<10){
|
|
|
|
|
@@ -1351,28 +1395,65 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
|
|
|
|
@Override
|
|
|
|
|
public List<EventDetail> getPlot(StatisticsParam statisticsParam) {
|
|
|
|
|
List<EventDetail> result = new ArrayList<>();
|
|
|
|
|
QueryResult query = MonitorQuery(statisticsParam);
|
|
|
|
|
InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper();
|
|
|
|
|
result = influxDBResultMapper.toPOJO(query, EventDetail.class);
|
|
|
|
|
HttpResult<List<DictData>> reason = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_REASON.getName());
|
|
|
|
|
HttpResult<List<DictData>> type = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_TYPE.getName());
|
|
|
|
|
List<DictData> reasonData = reason.getData();
|
|
|
|
|
List<DictData> typeData = type.getData();
|
|
|
|
|
//添加detail
|
|
|
|
|
for (EventDetail detail : result) {
|
|
|
|
|
if (detail.getWaveType() == 1) {
|
|
|
|
|
for (DictData data : reasonData) {
|
|
|
|
|
if (detail.getEventReason().equals(data.getId())) {
|
|
|
|
|
detail.setEventReason(data.getName());
|
|
|
|
|
}
|
|
|
|
|
// QueryResult query = MonitorQuery(statisticsParam);
|
|
|
|
|
// InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper();
|
|
|
|
|
// result = influxDBResultMapper.toPOJO(query, EventDetail.class);
|
|
|
|
|
// //添加detail
|
|
|
|
|
// for (EventDetail detail : result) {
|
|
|
|
|
// if (detail.getWaveType() == 1) {
|
|
|
|
|
// for (DictData data : reasonData) {
|
|
|
|
|
// if (detail.getEventReason().equals(data.getId())) {
|
|
|
|
|
// detail.setEventReason(data.getName());
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// for (DictData data : typeData) {
|
|
|
|
|
// if (detail.getEventType().equals(data.getId())) {
|
|
|
|
|
// detail.setEventType(data.getName());
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//查询监测点未处理暂态事件
|
|
|
|
|
List<RmpEventDetailPO> eventDetails = eventDetailService.list(new LambdaQueryWrapper<RmpEventDetailPO>()
|
|
|
|
|
.in(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())))
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
//获取字典属性
|
|
|
|
|
List<DictData> reasonData = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVENT_REASON.getCode()).getData();
|
|
|
|
|
Map<String, DictData> reasonMap = reasonData.stream().collect(Collectors.toMap(DictData::getId, Function.identity(), (kye1, key2) -> kye1));
|
|
|
|
|
List<DictData> typeData = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVENT_TYPE.getCode()).getData();
|
|
|
|
|
Map<String, DictData> typeMap = typeData.stream().collect(Collectors.toMap(DictData::getId, Function.identity(), (kye1, key2) -> kye1));
|
|
|
|
|
//获取电压暂降信息
|
|
|
|
|
DictData data = dicDataFeignClient.getDicDataByCode(DicDataEnum.VOLTAGE_DIP.getCode()).getData();
|
|
|
|
|
EventDetail eventDetailNew;
|
|
|
|
|
for (RmpEventDetailPO eventDetail : eventDetails) {
|
|
|
|
|
eventDetailNew= BeanUtil.copyProperties(eventDetail,EventDetail.class);
|
|
|
|
|
//监测点id
|
|
|
|
|
eventDetailNew.setLineId(eventDetail.getMeasurementPointId());
|
|
|
|
|
//持续时间
|
|
|
|
|
eventDetailNew.setPersistTime(eventDetail.getDuration());
|
|
|
|
|
//特征幅值
|
|
|
|
|
eventDetailNew.setEventValue(eventDetail.getFeatureAmplitude());
|
|
|
|
|
//波形路径
|
|
|
|
|
eventDetailNew.setWaveName(eventDetail.getWavePath());
|
|
|
|
|
if(data.getId().equals(eventDetail.getEventType())){
|
|
|
|
|
if (reasonMap.containsKey(eventDetail.getEventReason())) {
|
|
|
|
|
//暂降原因
|
|
|
|
|
DictData dictData = reasonMap.get(eventDetail.getEventReason());
|
|
|
|
|
eventDetailNew.setEventReason(dictData.getName());
|
|
|
|
|
}
|
|
|
|
|
for (DictData data : typeData) {
|
|
|
|
|
if (detail.getEventType().equals(data.getId())) {
|
|
|
|
|
detail.setEventType(data.getName());
|
|
|
|
|
}
|
|
|
|
|
if (typeMap.containsKey(eventDetail.getEventType())) {
|
|
|
|
|
//事件类型
|
|
|
|
|
DictData dictData = typeMap.get(eventDetail.getEventType());
|
|
|
|
|
eventDetailNew.setEventType(dictData.getName());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result.add(eventDetailNew);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|