修改暂降严重度和暂降热力图接口
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,15 +8,16 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* 暂降严重度
|
||||
*
|
||||
* @author denghuajun
|
||||
* @version 1.0.0
|
||||
* @date 2022年05月07日 09:03
|
||||
*/
|
||||
@Data
|
||||
public class EventSeverityVO implements Serializable {
|
||||
@ApiModelProperty(name = "areaValue",value = "数值")
|
||||
@ApiModelProperty(name = "areaValue", value = "数值")
|
||||
private List<List<Object>> areaValue;
|
||||
|
||||
@ApiModelProperty(name = "eventSeverityValue",value = "暂降严重度数值")
|
||||
@ApiModelProperty(name = "eventSeverityValue", value = "暂降严重度数值")
|
||||
private List<EventSeverityValueVO> eventSeverityValue;
|
||||
}
|
||||
|
||||
@@ -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<>();
|
||||
// 获取暂降监测点
|
||||
@@ -172,37 +180,42 @@ public class AreaLineServiceImpl implements AreaLineService {
|
||||
//数据暂降查询
|
||||
List<RmpEventDetailPO> info = eventDetailService.list(new LambdaQueryWrapper<RmpEventDetailPO>()
|
||||
.in(RmpEventDetailPO::getMeasurementPointId, lineIndexs)
|
||||
.ge(StrUtil.isNotBlank(deviceInfoParam.getSearchBeginTime()), RmpEventDetailPO::getStartTime,DateUtil.beginOfDay(DateUtil.parse(deviceInfoParam.getSearchBeginTime())))
|
||||
.ge(StrUtil.isNotBlank(deviceInfoParam.getSearchBeginTime()), RmpEventDetailPO::getStartTime, DateUtil.beginOfDay(DateUtil.parse(deviceInfoParam.getSearchBeginTime())))
|
||||
.le(StrUtil.isNotBlank(deviceInfoParam.getSearchEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(deviceInfoParam.getSearchEndTime())))
|
||||
);
|
||||
List<EventHeatDeatilVO> eventdetailList= BeanUtil.copyToList(info,EventHeatDeatilVO.class);
|
||||
List<EventHeatDeatilVO> eventdetailList = BeanUtil.copyToList(info, EventHeatDeatilVO.class);
|
||||
if (eventdetailList.size() > 0) {
|
||||
List<String> lineIds = eventdetailList.stream().map(EventHeatDeatilVO::getLineId).collect(Collectors.toList());
|
||||
List<AreaLineInfoVO> areaAnalysisVOList = lineFeignClient.getBaseLineAreaInfo(lineIds).getData();
|
||||
|
||||
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);
|
||||
for (AreaLineInfoVO areaLineInfoVO : areaAnalysisVOList) {
|
||||
if (eventHeat.getLineId().equals(areaLineInfoVO.getLineId())) {
|
||||
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++;
|
||||
@@ -233,10 +246,10 @@ public class AreaLineServiceImpl implements AreaLineService {
|
||||
// List<EventHeatDeatilVO> eventdetailList = getContion(deviceInfoParam, lineIndexs);
|
||||
List<RmpEventDetailPO> info = eventDetailService.list(new LambdaQueryWrapper<RmpEventDetailPO>()
|
||||
.in(RmpEventDetailPO::getMeasurementPointId, lineIndexs)
|
||||
.ge(StrUtil.isNotBlank(deviceInfoParam.getSearchBeginTime()), RmpEventDetailPO::getStartTime,DateUtil.beginOfDay(DateUtil.parse(deviceInfoParam.getSearchBeginTime())))
|
||||
.ge(StrUtil.isNotBlank(deviceInfoParam.getSearchBeginTime()), RmpEventDetailPO::getStartTime, DateUtil.beginOfDay(DateUtil.parse(deviceInfoParam.getSearchBeginTime())))
|
||||
.le(StrUtil.isNotBlank(deviceInfoParam.getSearchEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(deviceInfoParam.getSearchEndTime())))
|
||||
);
|
||||
List<EventHeatDeatilVO> eventdetailList= BeanUtil.copyToList(info,EventHeatDeatilVO.class);
|
||||
List<EventHeatDeatilVO> eventdetailList = BeanUtil.copyToList(info, EventHeatDeatilVO.class);
|
||||
if (eventdetailList.size() > 0) {
|
||||
for (int eventNum = 0; eventNum < eventdetailList.size(); eventNum++) {
|
||||
tail += eventdetailList.get(eventNum).getCount();
|
||||
@@ -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;
|
||||
@@ -340,7 +340,7 @@ public class LargeScreenServiceImpl implements LargeScreenService {
|
||||
/*comAssessVO.setLevel(lv);*/
|
||||
}
|
||||
for (AllDataVO allDataVO : result) {
|
||||
if (Objects.isNull(allDataVO.getData())){
|
||||
if (Objects.isNull(allDataVO.getData())) {
|
||||
allDataVO.setData("-1");
|
||||
}
|
||||
}
|
||||
@@ -451,70 +451,73 @@ public class LargeScreenServiceImpl implements LargeScreenService {
|
||||
}
|
||||
|
||||
//设置保留四位小数
|
||||
private void setResults(List<PQSComAssesPO> pqsComAssesPOS, List<ComAssessDTO> comAssessDTOS) {
|
||||
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();
|
||||
comAssessDTO.setVuDev1(v1);
|
||||
float v2 = new BigDecimal(pqsComAssesPOS.get(i).getVuDev2()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setVuDev2(v2);
|
||||
float v3 = new BigDecimal(pqsComAssesPOS.get(i).getVuDev3()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setVuDev3(v3);
|
||||
float v4 = new BigDecimal(pqsComAssesPOS.get(i).getVuDev4()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setVuDev4(v4);
|
||||
float v5 = new BigDecimal(pqsComAssesPOS.get(i).getVuDev5()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setVuDev5(v5);
|
||||
float f1 = new BigDecimal(pqsComAssesPOS.get(i).getFreqDev1()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setFreqDev1(f1);
|
||||
float f2 = new BigDecimal(pqsComAssesPOS.get(i).getFreqDev2()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setFreqDev2(f2);
|
||||
float f3 = new BigDecimal(pqsComAssesPOS.get(i).getFreqDev3()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setFreqDev3(f3);
|
||||
float f4 = new BigDecimal(pqsComAssesPOS.get(i).getFreqDev4()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setFreqDev4(f4);
|
||||
float f5 = new BigDecimal(pqsComAssesPOS.get(i).getFreqDev5()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setFreqDev5(f5);
|
||||
float d1 = new BigDecimal(pqsComAssesPOS.get(i).getDataPlt1()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setDataPlT1(d1);
|
||||
float d2 = new BigDecimal(pqsComAssesPOS.get(i).getDataPlt2()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setDataPlT2(d2);
|
||||
float d3 = new BigDecimal(pqsComAssesPOS.get(i).getDataPlt3()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setDataPlT3(d3);
|
||||
float d4 = new BigDecimal(pqsComAssesPOS.get(i).getDataPlt4()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setDataPlT4(d4);
|
||||
float d5 = new BigDecimal(pqsComAssesPOS.get(i).getDataPlt5()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setDataPlT5(d5);
|
||||
float vu1 = new BigDecimal(pqsComAssesPOS.get(i).getVUnbalance1()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setVUnbalance1(vu1);
|
||||
float vu2 = new BigDecimal(pqsComAssesPOS.get(i).getVUnbalance2()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setVUnbalance2(vu2);
|
||||
float vu3 = new BigDecimal(pqsComAssesPOS.get(i).getVUnbalance3()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setVUnbalance3(vu3);
|
||||
float vu4 = new BigDecimal(pqsComAssesPOS.get(i).getVUnbalance4()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setVUnbalance4(vu4);
|
||||
float vu5 = new BigDecimal(pqsComAssesPOS.get(i).getVUnbalance5()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setVUnbalance5(vu5);
|
||||
float vt1 = new BigDecimal(pqsComAssesPOS.get(i).getVThd1()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setVTHD1(vt1);
|
||||
float vt2 = new BigDecimal(pqsComAssesPOS.get(i).getVThd2()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setVTHD2(vt2);
|
||||
float vt3 = new BigDecimal(pqsComAssesPOS.get(i).getVThd3()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setVTHD3(vt3);
|
||||
float vt4 = new BigDecimal(pqsComAssesPOS.get(i).getVThd4()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setVTHD4(vt4);
|
||||
float vt5 = new BigDecimal(pqsComAssesPOS.get(i).getVThd5()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setVTHD5(vt5);
|
||||
float e1 = new BigDecimal(pqsComAssesPOS.get(i).getEvent1()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setEvent1(e1);
|
||||
float e2 = new BigDecimal(pqsComAssesPOS.get(i).getEvent2()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setEvent2(e2);
|
||||
float e3 = new BigDecimal(pqsComAssesPOS.get(i).getEvent3()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setEvent3(e3);
|
||||
float e4 = new BigDecimal(pqsComAssesPOS.get(i).getEvent4()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setEvent4(e4);
|
||||
float e5 = new BigDecimal(pqsComAssesPOS.get(i).getEvent5()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setEvent5(e5);
|
||||
comAssessDTOS.add(comAssessDTO);
|
||||
@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();
|
||||
comAssessDTO.setVuDev1(v1);
|
||||
float v2 = new BigDecimal(pqsComAssesPOS.get(i).getVuDev2()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setVuDev2(v2);
|
||||
float v3 = new BigDecimal(pqsComAssesPOS.get(i).getVuDev3()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setVuDev3(v3);
|
||||
float v4 = new BigDecimal(pqsComAssesPOS.get(i).getVuDev4()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setVuDev4(v4);
|
||||
float v5 = new BigDecimal(pqsComAssesPOS.get(i).getVuDev5()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setVuDev5(v5);
|
||||
float f1 = new BigDecimal(pqsComAssesPOS.get(i).getFreqDev1()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setFreqDev1(f1);
|
||||
float f2 = new BigDecimal(pqsComAssesPOS.get(i).getFreqDev2()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setFreqDev2(f2);
|
||||
float f3 = new BigDecimal(pqsComAssesPOS.get(i).getFreqDev3()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setFreqDev3(f3);
|
||||
float f4 = new BigDecimal(pqsComAssesPOS.get(i).getFreqDev4()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setFreqDev4(f4);
|
||||
float f5 = new BigDecimal(pqsComAssesPOS.get(i).getFreqDev5()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setFreqDev5(f5);
|
||||
float d1 = new BigDecimal(pqsComAssesPOS.get(i).getDataPlt1()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setDataPlT1(d1);
|
||||
float d2 = new BigDecimal(pqsComAssesPOS.get(i).getDataPlt2()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setDataPlT2(d2);
|
||||
float d3 = new BigDecimal(pqsComAssesPOS.get(i).getDataPlt3()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setDataPlT3(d3);
|
||||
float d4 = new BigDecimal(pqsComAssesPOS.get(i).getDataPlt4()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setDataPlT4(d4);
|
||||
float d5 = new BigDecimal(pqsComAssesPOS.get(i).getDataPlt5()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setDataPlT5(d5);
|
||||
float vu1 = new BigDecimal(pqsComAssesPOS.get(i).getVUnbalance1()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setVUnbalance1(vu1);
|
||||
float vu2 = new BigDecimal(pqsComAssesPOS.get(i).getVUnbalance2()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setVUnbalance2(vu2);
|
||||
float vu3 = new BigDecimal(pqsComAssesPOS.get(i).getVUnbalance3()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setVUnbalance3(vu3);
|
||||
float vu4 = new BigDecimal(pqsComAssesPOS.get(i).getVUnbalance4()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setVUnbalance4(vu4);
|
||||
float vu5 = new BigDecimal(pqsComAssesPOS.get(i).getVUnbalance5()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setVUnbalance5(vu5);
|
||||
float vt1 = new BigDecimal(pqsComAssesPOS.get(i).getVThd1()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setVTHD1(vt1);
|
||||
float vt2 = new BigDecimal(pqsComAssesPOS.get(i).getVThd2()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setVTHD2(vt2);
|
||||
float vt3 = new BigDecimal(pqsComAssesPOS.get(i).getVThd3()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setVTHD3(vt3);
|
||||
float vt4 = new BigDecimal(pqsComAssesPOS.get(i).getVThd4()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setVTHD4(vt4);
|
||||
float vt5 = new BigDecimal(pqsComAssesPOS.get(i).getVThd5()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setVTHD5(vt5);
|
||||
float e1 = new BigDecimal(pqsComAssesPOS.get(i).getEvent1()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setEvent1(e1);
|
||||
float e2 = new BigDecimal(pqsComAssesPOS.get(i).getEvent2()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setEvent2(e2);
|
||||
float e3 = new BigDecimal(pqsComAssesPOS.get(i).getEvent3()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setEvent3(e3);
|
||||
float e4 = new BigDecimal(pqsComAssesPOS.get(i).getEvent4()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setEvent4(e4);
|
||||
float e5 = new BigDecimal(pqsComAssesPOS.get(i).getEvent5()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
comAssessDTO.setEvent5(e5);
|
||||
comAssessDTOS.add(comAssessDTO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -526,12 +529,15 @@ public class LargeScreenServiceImpl implements LargeScreenService {
|
||||
* @param searchBeginTime
|
||||
* @param searchEndTime
|
||||
*/
|
||||
private List<PQSComAssesPO> getComAccessData(List<String> lineIndexes, String searchBeginTime, String searchEndTime) {
|
||||
List<PQSComAssesPO> avgCount = largeScreenMapper.getAvgCount(lineIndexes,
|
||||
DateUtil.beginOfDay(DateUtil.parse(searchBeginTime)).toString(),
|
||||
DateUtil.beginOfDay(DateUtil.parse(searchEndTime)).toString());
|
||||
if (CollUtil.isNotEmpty(avgCount)) {
|
||||
return avgCount;
|
||||
@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;
|
||||
@@ -65,7 +66,7 @@ public class HarmonicComAssesUtil {
|
||||
// 综合评估程序,返回值为评估分
|
||||
public float GetComAsses(float in_data[][]) {
|
||||
float fResult = 0.0f;//返回最终评分
|
||||
try{
|
||||
try {
|
||||
//实例化所有参数
|
||||
Assess = new float[ST_QT_NUM][GRADE_NUM];
|
||||
Weight = new float[ST_QT_NUM][METHOD_NUM];
|
||||
@@ -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++) {
|
||||
@@ -105,34 +111,38 @@ public class HarmonicComAssesUtil {
|
||||
}
|
||||
}
|
||||
}
|
||||
fResult = FloatUtils.get2Float(fResult);
|
||||
}catch (Exception e){
|
||||
//Todo
|
||||
fResult = FloatUtils.get2Float(fResult);
|
||||
} catch (Exception e) {
|
||||
//Todo
|
||||
}
|
||||
return fResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 大批量的监测点的综合得分获取平均值
|
||||
*
|
||||
* @param comAssessDTOS 批量数据
|
||||
*/
|
||||
public float getAllComAss(List<ComAssessDTO> comAssessDTOS) {
|
||||
float allData=0f;
|
||||
for(int i=0;i<comAssessDTOS.size();i++){
|
||||
ComAssessDTO tempPqs = comAssessDTOS.get(i);
|
||||
//组合二维数组
|
||||
float f1[][]={{tempPqs.getFreqDev1(),tempPqs.getFreqDev2(),tempPqs.getFreqDev3(),tempPqs.getFreqDev4(),tempPqs.getFreqDev5()}
|
||||
,{tempPqs.getVTHD1(),tempPqs.getVTHD2(),tempPqs.getVTHD3(),tempPqs.getVTHD4(),tempPqs.getVTHD5(),}
|
||||
,{tempPqs.getDataPlT1(),tempPqs.getDataPlT2(),tempPqs.getDataPlT3(),tempPqs.getDataPlT4(),tempPqs.getDataPlT5()}
|
||||
,{tempPqs.getVuDev1(),tempPqs.getVuDev2(),tempPqs.getVuDev3(),tempPqs.getVuDev4(),tempPqs.getVuDev5(),}
|
||||
,{tempPqs.getVUnbalance1(),tempPqs.getVUnbalance2(),tempPqs.getVUnbalance3(),tempPqs.getVUnbalance4(),tempPqs.getVUnbalance5(),}
|
||||
,{tempPqs.getEvent1(),tempPqs.getEvent2(),tempPqs.getEvent3(),tempPqs.getEvent4(),tempPqs.getEvent5(),}};
|
||||
//获取该值返回的数据
|
||||
float temp=GetComAsses(f1);
|
||||
allData+=temp;
|
||||
float allData = 0f;
|
||||
if (CollectionUtil.isNotEmpty(comAssessDTOS)) {
|
||||
for (int i = 0; i < comAssessDTOS.size(); i++) {
|
||||
ComAssessDTO tempPqs = comAssessDTOS.get(i);
|
||||
//组合二维数组
|
||||
float f1[][] = {{tempPqs.getFreqDev1(), tempPqs.getFreqDev2(), tempPqs.getFreqDev3(), tempPqs.getFreqDev4(), tempPqs.getFreqDev5()}
|
||||
, {tempPqs.getVTHD1(), tempPqs.getVTHD2(), tempPqs.getVTHD3(), tempPqs.getVTHD4(), tempPqs.getVTHD5(),}
|
||||
, {tempPqs.getDataPlT1(), tempPqs.getDataPlT2(), tempPqs.getDataPlT3(), tempPqs.getDataPlT4(), tempPqs.getDataPlT5()}
|
||||
, {tempPqs.getVuDev1(), tempPqs.getVuDev2(), tempPqs.getVuDev3(), tempPqs.getVuDev4(), tempPqs.getVuDev5(),}
|
||||
, {tempPqs.getVUnbalance1(), tempPqs.getVUnbalance2(), tempPqs.getVUnbalance3(), tempPqs.getVUnbalance4(), tempPqs.getVUnbalance5(),}
|
||||
, {tempPqs.getEvent1(), tempPqs.getEvent2(), tempPqs.getEvent3(), tempPqs.getEvent4(), tempPqs.getEvent5(),}};
|
||||
//获取该值返回的数据
|
||||
float temp = GetComAsses(f1);
|
||||
allData += temp;
|
||||
}
|
||||
float aveData = allData / comAssessDTOS.size();
|
||||
return FloatUtils.get2Float(aveData);
|
||||
}
|
||||
float aveData=allData/comAssessDTOS.size();
|
||||
return FloatUtils.get2Float(aveData);
|
||||
return allData;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user