1.解决【区域统计】:数据不对应bug
2.在线监测点bug
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
package com.njcn.event.pojo.vo;
|
package com.njcn.event.pojo.vo;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateTime;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import cn.hutool.core.date.DateUtil;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -71,6 +70,7 @@ public class VoltageToleranceCurveVO implements Serializable {
|
|||||||
private String gdName;
|
private String gdName;
|
||||||
|
|
||||||
@ApiModelProperty(name = "time", value = "发生时刻")
|
@ApiModelProperty(name = "time", value = "发生时刻")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS",timezone = "GMT+8")
|
||||||
private LocalDateTime time;
|
private LocalDateTime time;
|
||||||
|
|
||||||
public static Comparator<VoltageToleranceCurveDataList> sortAscTime() {
|
public static Comparator<VoltageToleranceCurveDataList> sortAscTime() {
|
||||||
|
|||||||
@@ -3,10 +3,9 @@ package com.njcn.event.service.majornetwork.Impl;
|
|||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.C;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.njcn.db.bo.BaseEntity;
|
|
||||||
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
||||||
import com.njcn.device.pq.api.LineFeignClient;
|
import com.njcn.device.pq.api.LineFeignClient;
|
||||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||||
@@ -20,15 +19,12 @@ import com.njcn.event.pojo.vo.VoltageToleranceCurveVO.VoltageToleranceCurveDataL
|
|||||||
import com.njcn.event.service.majornetwork.AreaAnalysisService;
|
import com.njcn.event.service.majornetwork.AreaAnalysisService;
|
||||||
import com.njcn.event.service.majornetwork.EventDetailService;
|
import com.njcn.event.service.majornetwork.EventDetailService;
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
|
import com.njcn.system.enums.DicDataEnum;
|
||||||
import com.njcn.system.enums.DicDataTypeEnum;
|
import com.njcn.system.enums.DicDataTypeEnum;
|
||||||
import com.njcn.system.pojo.po.DictData;
|
import com.njcn.system.pojo.po.DictData;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.Value;
|
|
||||||
import org.influxdb.querybuilder.clauses.Clause;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.ZoneId;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -75,12 +71,29 @@ public class AreaAnalysisServiceImpl implements AreaAnalysisService {
|
|||||||
|
|
||||||
//暂降类型特殊处理
|
//暂降类型特殊处理
|
||||||
DictData dictData = dicReasonList.stream().filter(item->"短路故障".equals(item.getName())).findFirst().get();
|
DictData dictData = dicReasonList.stream().filter(item->"短路故障".equals(item.getName())).findFirst().get();
|
||||||
|
//相间
|
||||||
|
List<String> dicIdsXi = dicTypeList.stream().filter(item->
|
||||||
|
ObjectUtil.equals(DicDataEnum.INTERPHASE_AB.getCode(),item.getCode())||
|
||||||
|
ObjectUtil.equals(DicDataEnum.INTERPHASE_BC.getCode(),item.getCode())||
|
||||||
|
ObjectUtil.equals(DicDataEnum.INTERPHASE_AC.getCode(),item.getCode())
|
||||||
|
).map(DictData::getId).collect(Collectors.toList());
|
||||||
|
//接地
|
||||||
|
List<String> dicIdsOne = dicTypeList.stream().filter(item->
|
||||||
|
ObjectUtil.equals(DicDataEnum.PHASE_A.getCode(),item.getCode())||
|
||||||
|
ObjectUtil.equals(DicDataEnum.PHASE_B.getCode(),item.getCode())||
|
||||||
|
ObjectUtil.equals(DicDataEnum.PHASE_C.getCode(),item.getCode())
|
||||||
|
).map(DictData::getId).collect(Collectors.toList());
|
||||||
|
//三相接地
|
||||||
|
List<String> dicIdsThree = dicTypeList.stream().filter(item->ObjectUtil.equals(DicDataEnum.GROUND_ABC.getCode(),item.getCode())).map(DictData::getId).collect(Collectors.toList());
|
||||||
|
//其他
|
||||||
|
List<String> dicIdsOther = dicTypeList.stream().filter(item->ObjectUtil.equals(DicDataEnum.TYPE_REST.getCode(),item.getCode())).map(DictData::getId).collect(Collectors.toList());
|
||||||
|
//两相接地
|
||||||
|
List<String> dicIdsDouble = dicTypeList.stream().filter(item->
|
||||||
|
ObjectUtil.equals(DicDataEnum.GROUND_AB.getCode(),item.getCode())||
|
||||||
|
ObjectUtil.equals(DicDataEnum.GROUND_BC.getCode(),item.getCode())||
|
||||||
|
ObjectUtil.equals(DicDataEnum.GROUND_AC.getCode(),item.getCode())
|
||||||
|
).map(DictData::getId).collect(Collectors.toList());
|
||||||
|
|
||||||
List<String> dicIdsXi = dicTypeList.stream().filter(item->item.getName().contains("相间")).map(DictData::getId).collect(Collectors.toList());
|
|
||||||
List<String> dicIdsOne = dicTypeList.stream().filter(item->"A相".equals(item.getName())||"B相".equals(item.getName())||"C相".equals(item.getName())).map(DictData::getId).collect(Collectors.toList());
|
|
||||||
List<String> dicIdsThree = dicTypeList.stream().filter(item->item.getName().contains("三相接地")).map(DictData::getId).collect(Collectors.toList());
|
|
||||||
List<String> dicIdsOther = dicTypeList.stream().filter(item->item.getName().contains("其他")).map(DictData::getId).collect(Collectors.toList());
|
|
||||||
List<String> dicIdsDouble = dicTypeList.stream().filter(item->item.getName().contains("双相接地")).map(DictData::getId).collect(Collectors.toList());
|
|
||||||
Map<String, List<String>> stringListMap = new HashMap<>();
|
Map<String, List<String>> stringListMap = new HashMap<>();
|
||||||
stringListMap.put("单相接地",dicIdsOne);
|
stringListMap.put("单相接地",dicIdsOne);
|
||||||
stringListMap.put("两相接地",dicIdsDouble);
|
stringListMap.put("两相接地",dicIdsDouble);
|
||||||
|
|||||||
@@ -4,22 +4,19 @@ import cn.hutool.core.bean.BeanUtil;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.common.config.GeneralInfo;
|
import com.njcn.common.config.GeneralInfo;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.PubUtils;
|
|
||||||
import com.njcn.device.pq.api.LineFeignClient;
|
import com.njcn.device.pq.api.LineFeignClient;
|
||||||
import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
|
import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
|
||||||
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
||||||
import com.njcn.event.enums.EventResponseEnum;
|
import com.njcn.event.enums.EventResponseEnum;
|
||||||
import com.njcn.event.pojo.constant.Param;
|
import com.njcn.event.pojo.constant.Param;
|
||||||
import com.njcn.event.pojo.dto.wave.WaveDataDTO;
|
|
||||||
import com.njcn.event.pojo.param.*;
|
import com.njcn.event.pojo.param.*;
|
||||||
import com.njcn.event.pojo.po.EventDetail;
|
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.po.RmpEventDetailPO;
|
||||||
import com.njcn.event.pojo.vo.*;
|
import com.njcn.event.pojo.vo.*;
|
||||||
import com.njcn.event.service.majornetwork.EventAnalysisService;
|
import com.njcn.event.service.majornetwork.EventAnalysisService;
|
||||||
@@ -35,7 +32,6 @@ import org.influxdb.dto.QueryResult;
|
|||||||
import org.influxdb.impl.InfluxDBResultMapper;
|
import org.influxdb.impl.InfluxDBResultMapper;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
@@ -1076,9 +1072,12 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
|||||||
// QueryResult query = MonitorQuery(statisticsParam);
|
// QueryResult query = MonitorQuery(statisticsParam);
|
||||||
// InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper();
|
// InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper();
|
||||||
// info = influxDBResultMapper.toPOJO(query, EventDetail.class);
|
// info = influxDBResultMapper.toPOJO(query, EventDetail.class);
|
||||||
|
//获取暂降字典信息
|
||||||
|
DictData dataDto = dicDataFeignClient.getDicDataByCode(DicDataEnum.VOLTAGE_DIP.getCode()).getData();
|
||||||
//数据暂降查询
|
//数据暂降查询
|
||||||
List<RmpEventDetailPO> info = eventDetailService.list(new LambdaQueryWrapper<RmpEventDetailPO>()
|
List<RmpEventDetailPO> info = eventDetailService.list(new LambdaQueryWrapper<RmpEventDetailPO>()
|
||||||
.eq(RmpEventDetailPO::getMeasurementPointId, statisticsParam.getLineIndex())
|
.eq(RmpEventDetailPO::getMeasurementPointId, statisticsParam.getLineIndex())
|
||||||
|
.eq(StringUtils.isNotBlank(dataDto.getId()),RmpEventDetailPO::getMeasurementPointId, dataDto.getId())
|
||||||
.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())))
|
.le(StringUtils.isNotBlank(statisticsParam.getEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(statisticsParam.getEndTime())))
|
||||||
);
|
);
|
||||||
@@ -1087,8 +1086,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
|||||||
HttpResult<List<DictData>> type = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_TYPE.getName());
|
HttpResult<List<DictData>> type = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_TYPE.getName());
|
||||||
List<DictData> reasonData = reason.getData();
|
List<DictData> reasonData = reason.getData();
|
||||||
List<DictData> typeData = type.getData();
|
List<DictData> typeData = type.getData();
|
||||||
//获取暂降字典信息
|
|
||||||
DictData dataDto = dicDataFeignClient.getDicDataByCode(DicDataEnum.VOLTAGE_DIP.getCode()).getData();
|
|
||||||
HashMap<String, Integer> reasonMap = new HashMap<>();
|
HashMap<String, Integer> reasonMap = new HashMap<>();
|
||||||
HashMap<String, Integer> typeMap = new HashMap<>();
|
HashMap<String, Integer> typeMap = new HashMap<>();
|
||||||
|
|
||||||
@@ -1150,6 +1148,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ProbabilityVO getProbabilityDistribution(StatisticsParam statisticsParam) {
|
public ProbabilityVO getProbabilityDistribution(StatisticsParam statisticsParam) {
|
||||||
|
|
||||||
ProbabilityVO result = new ProbabilityVO();
|
ProbabilityVO result = new ProbabilityVO();
|
||||||
List<EventDetail> info = new ArrayList<>();
|
List<EventDetail> info = new ArrayList<>();
|
||||||
// QueryResult query = MonitorQuery(statisticsParam);
|
// QueryResult query = MonitorQuery(statisticsParam);
|
||||||
@@ -1456,9 +1455,12 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
//获取电压暂降信息
|
||||||
|
DictData data = dicDataFeignClient.getDicDataByCode(DicDataEnum.VOLTAGE_DIP.getCode()).getData();
|
||||||
//查询监测点未处理暂态事件
|
//查询监测点未处理暂态事件
|
||||||
List<RmpEventDetailPO> eventDetails = eventDetailService.list(new LambdaQueryWrapper<RmpEventDetailPO>()
|
List<RmpEventDetailPO> eventDetails = eventDetailService.list(new LambdaQueryWrapper<RmpEventDetailPO>()
|
||||||
.eq(RmpEventDetailPO::getMeasurementPointId, statisticsParam.getLineIndex())
|
.eq(RmpEventDetailPO::getMeasurementPointId, statisticsParam.getLineIndex())
|
||||||
|
.eq(StrUtil.isNotBlank(data.getId()),RmpEventDetailPO::getEventType, data.getId())
|
||||||
.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())))
|
.le(StringUtils.isNotBlank(statisticsParam.getEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(statisticsParam.getEndTime())))
|
||||||
);
|
);
|
||||||
@@ -1467,8 +1469,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
|||||||
Map<String, DictData> reasonMap = reasonData.stream().collect(Collectors.toMap(DictData::getId, Function.identity(), (kye1, key2) -> kye1));
|
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();
|
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));
|
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;
|
EventDetail eventDetailNew;
|
||||||
for (RmpEventDetailPO eventDetail : eventDetails) {
|
for (RmpEventDetailPO eventDetail : eventDetails) {
|
||||||
eventDetailNew = BeanUtil.copyProperties(eventDetail, EventDetail.class);
|
eventDetailNew = BeanUtil.copyProperties(eventDetail, EventDetail.class);
|
||||||
@@ -1516,7 +1517,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
|||||||
VoltageToleranceCurveVO.VoltageToleranceCurveDataList voltageToleranceCurve = new VoltageToleranceCurveVO.VoltageToleranceCurveDataList();
|
VoltageToleranceCurveVO.VoltageToleranceCurveDataList voltageToleranceCurve = new VoltageToleranceCurveVO.VoltageToleranceCurveDataList();
|
||||||
voltageToleranceCurve.setLineId(dto.getLineId());
|
voltageToleranceCurve.setLineId(dto.getLineId());
|
||||||
voltageToleranceCurve.setPersistTime(dto.getDuration());
|
voltageToleranceCurve.setPersistTime(dto.getDuration());
|
||||||
voltageToleranceCurve.setEventValue(dto.getFeatureAmplitude());
|
voltageToleranceCurve.setEventValue(dto.getFeatureAmplitude()*100);
|
||||||
voltageToleranceCurve.setTime(dto.getStartTime());
|
voltageToleranceCurve.setTime(dto.getStartTime());
|
||||||
voltageToleranceCurve.setGdName(info.getGdName());
|
voltageToleranceCurve.setGdName(info.getGdName());
|
||||||
voltageToleranceCurve.setSubName(info.getSubName());
|
voltageToleranceCurve.setSubName(info.getSubName());
|
||||||
|
|||||||
@@ -174,10 +174,10 @@ public enum DicDataEnum {
|
|||||||
DY_110KV("交流110kV", "110kV"),
|
DY_110KV("交流110kV", "110kV"),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电压等级
|
* 电压等级
|
||||||
* 此电压用于计算,真实code请使用上面枚举
|
* 此电压用于计算,真实code请使用上面枚举
|
||||||
|
*
|
||||||
* @author cdf
|
* @author cdf
|
||||||
* @date 2023/3/24
|
* @date 2023/3/24
|
||||||
*/
|
*/
|
||||||
@@ -325,6 +325,21 @@ public enum DicDataEnum {
|
|||||||
*/
|
*/
|
||||||
GATEWAY_DEV("网关", "Gateway_Dev"),
|
GATEWAY_DEV("网关", "Gateway_Dev"),
|
||||||
CONNECT_DEV("直连设备", "Connect_Dev"),
|
CONNECT_DEV("直连设备", "Connect_Dev"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂降类型
|
||||||
|
*/
|
||||||
|
PHASE_A("A相接地", "Phase_A"),
|
||||||
|
PHASE_B("B相接地", "Phase_B"),
|
||||||
|
PHASE_C("C相接地", "Phase_C"),
|
||||||
|
INTERPHASE_AB("AB相间", "Interphase_AB"),
|
||||||
|
INTERPHASE_BC("BC相间", "Interphase_BC"),
|
||||||
|
INTERPHASE_AC("AC相间", "Interphase_AC"),
|
||||||
|
GROUND_AB("AB两相接地", "Ground_AB"),
|
||||||
|
GROUND_BC("BC两相接地", "Ground_BC"),
|
||||||
|
GROUND_AC("AC两相接地", "Ground_AC"),
|
||||||
|
GROUND_ABC("三相接地", "Ground_ABC"),
|
||||||
|
TYPE_REST("其他", "Type_Rest"),
|
||||||
;
|
;
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|||||||
Reference in New Issue
Block a user