修改暂降严重度和暂降热力图接口
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.njcn.device.pq.pojo.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -28,6 +29,7 @@ public class GeneralDeviceDTO implements Serializable {
|
||||
/**
|
||||
* name对应统计名称:如 区域:南京市、苏州市;电压等级:10kV、220kV...
|
||||
*/
|
||||
@ApiModelProperty(name = "name", value = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
@@ -59,5 +61,7 @@ public class GeneralDeviceDTO implements Serializable {
|
||||
* lineIndexes:监测点索引集合
|
||||
*/
|
||||
private List<String> lineIndexes = new ArrayList<>();
|
||||
@ApiModelProperty(name = "tail", value = "总数")
|
||||
private Integer tail;
|
||||
|
||||
}
|
||||
|
||||
@@ -82,4 +82,7 @@ public class AreaLineInfoVO implements Serializable {
|
||||
|
||||
@ApiModelProperty(name = "loadType",value = "干扰源类型")
|
||||
private String loadType;
|
||||
|
||||
@ApiModelProperty(name = "tail",value = "总数")
|
||||
private Integer tail;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.event.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -16,4 +17,9 @@ public class BaseVO {
|
||||
private String name;
|
||||
|
||||
private BigDecimal value;
|
||||
/**
|
||||
* 综合评估
|
||||
*/
|
||||
@ApiModelProperty("综合评估")
|
||||
private String data;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.event.pojo.vo;
|
||||
|
||||
import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -18,5 +19,5 @@ public class EventHeatMapVO implements Serializable {
|
||||
private List<BaseVO> areaValue;
|
||||
|
||||
@ApiModelProperty(name = "eventHeatMapValue",value = "热力图数值")
|
||||
private List<List<Object>> eventHeatMapValue;
|
||||
private List<List<AreaLineInfoVO>> eventHeatMapValue;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* 暂降严重度
|
||||
*
|
||||
* @author denghuajun
|
||||
* @version 1.0.0
|
||||
* @date 2022年05月07日 09:03
|
||||
|
||||
@@ -23,6 +23,10 @@ import com.njcn.event.pojo.vo.TerminalRunningStatisticsVO.TerminalRunningInfoVO;
|
||||
import com.njcn.event.pojo.vo.TerminalRunningStatisticsVO.TerminalRunningVO;
|
||||
import com.njcn.event.service.majornetwork.AreaLineService;
|
||||
import com.njcn.event.service.majornetwork.EventDetailService;
|
||||
import com.njcn.event.service.majornetwork.LargeScreenService;
|
||||
import com.njcn.harmonic.pojo.dto.ComAssessDTO;
|
||||
import com.njcn.harmonic.pojo.po.PQSComAssesPO;
|
||||
import com.njcn.harmonic.utils.HarmonicComAssesUtil;
|
||||
import com.njcn.influxdb.param.InfluxDBPublicParam;
|
||||
import com.njcn.influxdb.utils.InfluxDbUtils;
|
||||
import com.njcn.system.pojo.enums.StatisticsEnum;
|
||||
@@ -30,6 +34,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.influxdb.dto.QueryResult;
|
||||
import org.influxdb.impl.InfluxDBResultMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -62,7 +67,10 @@ public class AreaLineServiceImpl implements AreaLineService {
|
||||
|
||||
private final PqDeviceMapper pqDeviceMapper;
|
||||
private final EventDetailService eventDetailService;
|
||||
|
||||
@Autowired
|
||||
private LargeScreenService largeScreenService;
|
||||
@Autowired
|
||||
private HarmonicComAssesUtil comAssesUtil;
|
||||
|
||||
@Override
|
||||
public AreaLineVO getAreaLineVO(DeviceInfoParam deviceInfoParam) {
|
||||
@@ -155,7 +163,7 @@ public class AreaLineServiceImpl implements AreaLineService {
|
||||
@Override
|
||||
public EventHeatMapVO getEventHeatMap(DeviceInfoParam.BusinessParam deviceInfoParam) {
|
||||
EventHeatMapVO eventHeatMapVO = new EventHeatMapVO();
|
||||
List<List<Object>> eventHeatMapDetailList = new ArrayList<>();
|
||||
List<List<AreaLineInfoVO>> eventHeatMapDetailList = new ArrayList<>();
|
||||
deviceInfoParam.setServerName(ServerEnum.EVENT.getName());
|
||||
List<BaseVO> listObject = new ArrayList<>();
|
||||
// 获取暂降监测点
|
||||
@@ -183,26 +191,31 @@ public class AreaLineServiceImpl implements AreaLineService {
|
||||
for (EventHeatDeatilVO eventHeat : eventdetailList) {
|
||||
for (AreaLineInfoVO areaLineInfoVO : areaAnalysisVOList) {
|
||||
if (eventHeat.getLineId().equals(areaLineInfoVO.getLineId())) {
|
||||
List<Object> ev = new ArrayList<>();
|
||||
tail += eventHeat.getCount();
|
||||
ev.add(areaLineInfoVO.getLng());
|
||||
ev.add(areaLineInfoVO.getLat());
|
||||
ev.add(tail);
|
||||
List<AreaLineInfoVO> ev = new ArrayList<>();
|
||||
tail += eventHeat.getCount() == null ? 0 : eventHeat.getCount();
|
||||
areaLineInfoVO.setTail(tail);
|
||||
ev.add(areaLineInfoVO);
|
||||
eventHeatMapDetailList.add(ev);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//获取综合评估
|
||||
List<PQSComAssesPO> comAccessData = largeScreenService.getComAccessData(lineIndexs, deviceInfoParam.getSearchBeginTime(), deviceInfoParam.getSearchEndTime());
|
||||
List<ComAssessDTO> comAssessDTOS = new ArrayList<>();
|
||||
largeScreenService.setResults(comAccessData, comAssessDTOS);
|
||||
float allComAss = comAssesUtil.getAllComAss(comAssessDTOS);
|
||||
BaseVO baseVO = new BaseVO();
|
||||
baseVO.setName(generalDeviceDTO.getName());
|
||||
baseVO.setValue(BigDecimal.valueOf(lineIndexs.size()));
|
||||
baseVO.setData(String.valueOf(allComAss));
|
||||
listObject.add(baseVO);
|
||||
}
|
||||
} else {
|
||||
BaseVO baseVO = new BaseVO();
|
||||
baseVO.setName(generalDeviceDTO.getName());
|
||||
baseVO.setValue(BigDecimal.valueOf(3.141592));
|
||||
baseVO.setData("-1");
|
||||
listObject.add(baseVO);
|
||||
}
|
||||
i++;
|
||||
@@ -245,7 +258,7 @@ public class AreaLineServiceImpl implements AreaLineService {
|
||||
eventSeverityValueVO.setLineNum(lineIndexs.size());
|
||||
eventSeverityValueVO.setEventNum(tail);
|
||||
eventSeverityValueList.add(eventSeverityValueVO);
|
||||
objectList.add(generalDeviceDTO.getName() + "\n(" + lineIndexs.size() + ")");
|
||||
objectList.add(generalDeviceDTO.getName());
|
||||
objectList.add(tail);
|
||||
listObject.add(objectList);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.njcn.event.service.majornetwork.Impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.LargeScreenParam;
|
||||
@@ -17,9 +19,7 @@ import com.njcn.system.pojo.enums.StatisticsEnum;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.map.HashedMap;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -451,7 +451,9 @@ public class LargeScreenServiceImpl implements LargeScreenService {
|
||||
}
|
||||
|
||||
//设置保留四位小数
|
||||
private void setResults(List<PQSComAssesPO> pqsComAssesPOS, List<ComAssessDTO> comAssessDTOS) {
|
||||
@Override
|
||||
public void setResults(List<PQSComAssesPO> pqsComAssesPOS, List<ComAssessDTO> comAssessDTOS) {
|
||||
if (CollectionUtil.isNotEmpty(pqsComAssesPOS)) {
|
||||
for (int i = 0; i < pqsComAssesPOS.size(); i++) {
|
||||
float v1 = new BigDecimal(pqsComAssesPOS.get(i).getVuDev1()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
ComAssessDTO comAssessDTO = new ComAssessDTO();
|
||||
@@ -517,6 +519,7 @@ public class LargeScreenServiceImpl implements LargeScreenService {
|
||||
comAssessDTOS.add(comAssessDTO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* influxDB查询综合评估相关信息
|
||||
@@ -526,13 +529,16 @@ public class LargeScreenServiceImpl implements LargeScreenService {
|
||||
* @param searchBeginTime
|
||||
* @param searchEndTime
|
||||
*/
|
||||
private List<PQSComAssesPO> getComAccessData(List<String> lineIndexes, String searchBeginTime, String searchEndTime) {
|
||||
@Override
|
||||
public List<PQSComAssesPO> getComAccessData(List<String> lineIndexes, String searchBeginTime, String searchEndTime) {
|
||||
if (CollectionUtil.isNotEmpty(lineIndexes)) {
|
||||
List<PQSComAssesPO> avgCount = largeScreenMapper.getAvgCount(lineIndexes,
|
||||
DateUtil.beginOfDay(DateUtil.parse(searchBeginTime)).toString(),
|
||||
DateUtil.beginOfDay(DateUtil.parse(searchEndTime)).toString());
|
||||
if (CollUtil.isNotEmpty(avgCount)) {
|
||||
return avgCount;
|
||||
}
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,8 @@ package com.njcn.event.service.majornetwork;
|
||||
|
||||
import com.njcn.device.pq.pojo.param.LargeScreenParam;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import com.njcn.harmonic.pojo.dto.ComAssessDTO;
|
||||
import com.njcn.harmonic.pojo.po.PQSComAssesPO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -28,4 +30,8 @@ public interface LargeScreenService {
|
||||
List<MiddleTerminalVO> getMiddleTerminal(LargeScreenParam largeScreenParam);
|
||||
|
||||
List<MiddleLimitRateVO> getMiddleLimitRate(LargeScreenParam largeScreenParam);
|
||||
|
||||
List<PQSComAssesPO> getComAccessData(List<String> lineIndexes, String searchBeginTime, String searchEndTime);
|
||||
|
||||
void setResults(List<PQSComAssesPO> pqsComAssesPOS, List<ComAssessDTO> comAssessDTOS);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn.harmonic.utils;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.njcn.harmonic.pojo.dto.ComAssessDTO;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -88,7 +89,12 @@ public class HarmonicComAssesUtil {
|
||||
if (getBysxf()) {
|
||||
//G和F得出综合权重A
|
||||
if (getZhqzf()) {
|
||||
A[0] = 0.28f;A[1] = 0.23f;A[2] = 0.13f;A[3] = 0.16f;A[4] = 0.08f;A[5] = 0.12f;
|
||||
A[0] = 0.28f;
|
||||
A[1] = 0.23f;
|
||||
A[2] = 0.13f;
|
||||
A[3] = 0.16f;
|
||||
A[4] = 0.08f;
|
||||
A[5] = 0.12f;
|
||||
for (i = 0; i < GRADE_NUM; i++) {
|
||||
B[i] = 0;
|
||||
for (j = 0; j < ST_QT_NUM; j++) {
|
||||
@@ -114,10 +120,12 @@ public class HarmonicComAssesUtil {
|
||||
|
||||
/**
|
||||
* 大批量的监测点的综合得分获取平均值
|
||||
*
|
||||
* @param comAssessDTOS 批量数据
|
||||
*/
|
||||
public float getAllComAss(List<ComAssessDTO> comAssessDTOS) {
|
||||
float allData = 0f;
|
||||
if (CollectionUtil.isNotEmpty(comAssessDTOS)) {
|
||||
for (int i = 0; i < comAssessDTOS.size(); i++) {
|
||||
ComAssessDTO tempPqs = comAssessDTOS.get(i);
|
||||
//组合二维数组
|
||||
@@ -134,6 +142,8 @@ public class HarmonicComAssesUtil {
|
||||
float aveData = allData / comAssessDTOS.size();
|
||||
return FloatUtils.get2Float(aveData);
|
||||
}
|
||||
return allData;
|
||||
}
|
||||
|
||||
|
||||
//熵权法求权重
|
||||
|
||||
Reference in New Issue
Block a user