1.代码提交
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package com.njcn.event.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 通用树
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/30 9:41
|
||||
*/
|
||||
@Data
|
||||
public class NodeVO {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("父级id")
|
||||
private String pid;
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("次数")
|
||||
private Integer data = 0;
|
||||
|
||||
@ApiModelProperty("子级")
|
||||
private List<NodeVO> children;
|
||||
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.event.pojo.vo.AreaStatisticalVO;
|
||||
import com.njcn.event.service.majornetwork.AreaStatisticalService;
|
||||
import com.njcn.harmonic.pojo.vo.NodeVO;
|
||||
import com.njcn.event.pojo.vo.NodeVO;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.njcn.event.service.majornetwork;
|
||||
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.event.pojo.vo.AreaStatisticalVO;
|
||||
import com.njcn.harmonic.pojo.vo.NodeVO;
|
||||
import com.njcn.event.pojo.vo.NodeVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -26,7 +26,7 @@ public interface AreaStatisticalService {
|
||||
/**
|
||||
* @Description: 节点图
|
||||
* @param deviceInfoParam
|
||||
* @return: java.util.List<com.njcn.harmonic.pojo.vo.NodeVO>
|
||||
* @return: java.util.List<com.njcn.event.pojo.vo.NodeVO>
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/30 9:43
|
||||
*/
|
||||
|
||||
@@ -23,7 +23,7 @@ import com.njcn.event.pojo.vo.MonthCalculationVO;
|
||||
import com.njcn.event.pojo.vo.VoltageLevelCalculationVO;
|
||||
import com.njcn.event.service.majornetwork.AreaStatisticalService;
|
||||
import com.njcn.event.service.majornetwork.EventDetailService;
|
||||
import com.njcn.harmonic.pojo.vo.NodeVO;
|
||||
import com.njcn.event.pojo.vo.NodeVO;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.pojo.enums.StatisticsEnum;
|
||||
|
||||
@@ -86,7 +86,6 @@ import org.apache.poi.ss.usermodel.VerticalAlignment;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.util.Units;
|
||||
import org.apache.poi.xwpf.usermodel.*;
|
||||
import org.influxdb.impl.InfluxDBResultMapper;
|
||||
import org.openxmlformats.schemas.wordprocessingml.x2006.main.*;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -2103,14 +2102,16 @@ public class ReportServiceImpl implements ReportService {
|
||||
public void getAreaReport(AreaReportParam areaReportParam, HttpServletResponse response) throws Exception {
|
||||
|
||||
//暂态事件
|
||||
String typeName;
|
||||
if (areaReportParam.getWaveType().equals(0)) {
|
||||
//设置类型变量名为暂态
|
||||
String typeName = "暂态";
|
||||
|
||||
typeName = "暂态";
|
||||
} else {
|
||||
typeName = "暂降";
|
||||
}
|
||||
//事件统计表格(部门查询)
|
||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceInfoClient.getPracticalAllDeviceInfo(areaReportParam).getData();
|
||||
//测试id
|
||||
// generalDeviceDTOList.get(9).getLineIndexes().add("97ec50b62c84d39d1e15d83e61e06844");
|
||||
|
||||
//这是总的监测点id
|
||||
List<String> lineIds = generalDeviceDTOList.stream().flatMap(dto -> dto.getLineIndexes().stream()).collect(Collectors.toList());
|
||||
|
||||
@@ -2134,12 +2135,11 @@ public class ReportServiceImpl implements ReportService {
|
||||
areaParam.setSearchEndTime(areaReportParam.getSearchEndTime());
|
||||
|
||||
|
||||
InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper();
|
||||
//提前创建,不然获取不到(初始化数据)
|
||||
if (CollUtil.isEmpty(lineIds)) {
|
||||
throw new BusinessException(EventResponseEnum.NOT_FOUND);
|
||||
}
|
||||
List<EventDetailNew> eventDetailList = getEventDetailListInfo(areaReportParam, lineIds);
|
||||
List<EventDetailNew> eventDetailList = getEventDetailListInfo(areaReportParam, lineIds,areaReportParam.getWaveType());
|
||||
List<GeneralDeviceDTO> voltageParamList = generalDeviceInfoClient.getPracticalAllDeviceInfo(areaParam).getData();
|
||||
|
||||
|
||||
@@ -4964,7 +4964,6 @@ public class ReportServiceImpl implements ReportService {
|
||||
//11.暂降热力图
|
||||
if (areaReportParam.isThermodynamicChart()) {
|
||||
//暂降热力图
|
||||
|
||||
createTitle(doc, "4." + oneCount + " " + typeName + "热力图", "标题 2", 200, 11);
|
||||
|
||||
p = doc.createParagraph();// 新建一个段落
|
||||
@@ -4983,7 +4982,6 @@ public class ReportServiceImpl implements ReportService {
|
||||
//当前子部门下所有id
|
||||
List<String> lineIndexes = generalDeviceDTO.getLineIndexes();
|
||||
|
||||
|
||||
//如果集合中有id将id进行拼接
|
||||
if (CollectionUtil.isNotEmpty(lineIndexes)) {
|
||||
//数据统计
|
||||
@@ -5017,40 +5015,33 @@ public class ReportServiceImpl implements ReportService {
|
||||
response.setContentType("application/octet-stream;charset=UTF-8");
|
||||
doc.write(outputStream);
|
||||
outputStream.close();
|
||||
//暂降事件
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getPmsAreaReport(AreaReportParam areaReportParam, HttpServletResponse response) throws Exception {
|
||||
//暂态事件
|
||||
String typeName;
|
||||
if (areaReportParam.getWaveType().equals(0)) {
|
||||
//设置类型变量名为暂态
|
||||
String typeName = "暂态";
|
||||
|
||||
typeName = "暂态";
|
||||
} else {
|
||||
typeName = "暂降";
|
||||
}
|
||||
PmsDeviceInfoParam pmsDeviceInfoParam = new PmsDeviceInfoParam();
|
||||
pmsDeviceInfoParam.setDeptIndex(areaReportParam.getDeptIndex());
|
||||
//获取统计类型
|
||||
pmsDeviceInfoParam.setStatisticalType(areaReportParam.getStatisticalType());
|
||||
//获取主网台账信息
|
||||
List<PmsGeneralDeviceDTO> generalDeviceDTOList = pmsGeneralDeviceInfoClient.getPmsDeviceInfoWithInOrg(pmsDeviceInfoParam).getData();
|
||||
// if(areaReportParam.getDeptIndex().equals("0d52f9f6e43ec0ee83013cd32da93f66")){
|
||||
// //测试id
|
||||
// generalDeviceDTOList.get(0).getMonitorIdList().add("97ec50b62c84d39d1e15d83e61e06844");
|
||||
// }
|
||||
//这是总的监测点id
|
||||
List<String> lineIds = generalDeviceDTOList.stream().flatMap(dto -> dto.getMonitorIdList().stream()).distinct().collect(Collectors.toList());
|
||||
|
||||
|
||||
InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper();
|
||||
//提前创建,不然获取不到(初始化数据)
|
||||
if (CollUtil.isEmpty(lineIds)) {
|
||||
throw new BusinessException(EventResponseEnum.NOT_LINEID);
|
||||
}
|
||||
List<EventDetailNew> eventDetailList = getEventDetailListInfo(areaReportParam, lineIds);
|
||||
List<EventDetailNew> eventDetailList = getEventDetailListInfo(areaReportParam, lineIds,areaReportParam.getWaveType());
|
||||
if (CollectionUtil.isEmpty(eventDetailList)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA);
|
||||
}
|
||||
@@ -7980,9 +7971,7 @@ public class ReportServiceImpl implements ReportService {
|
||||
doc.write(outputStream);
|
||||
outputStream.close();
|
||||
//暂降事件
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -8957,18 +8946,22 @@ public class ReportServiceImpl implements ReportService {
|
||||
* @param lineIds 监测点集合
|
||||
* @return
|
||||
*/
|
||||
private List<EventDetailNew> getEventDetailListInfo(AreaReportParam areaReportParam, List<String> lineIds) {
|
||||
|
||||
private List<EventDetailNew> getEventDetailListInfo(AreaReportParam areaReportParam, List<String> lineIds,Integer type) {
|
||||
//获取事件类型(短时中断 电压暂降 电压暂升 扰动 其他)
|
||||
List<DictData> dictType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVENT_STATIS.getCode()).getData();
|
||||
List<String> typeIds = dictType.stream().filter(x -> DicDataEnum.VOLTAGE_DIP.getCode().equals(x.getCode())
|
||||
|| DicDataEnum.SHORT_INTERRUPTIONS.getCode().equals(x.getCode())
|
||||
|| DicDataEnum.DISTURBANCE.getCode().equals(x.getCode())
|
||||
|| DicDataEnum.OTHER.getCode().equals(x.getCode())
|
||||
|| DicDataEnum.VOLTAGE_RISE.getCode().equals(x.getCode())
|
||||
)
|
||||
.map(DictData::getId).collect(Collectors.toList());
|
||||
|
||||
List<String> typeIds;
|
||||
if(type==0){
|
||||
typeIds = dictType.stream().filter(x -> DicDataEnum.VOLTAGE_DIP.getCode().equals(x.getCode())
|
||||
|| DicDataEnum.SHORT_INTERRUPTIONS.getCode().equals(x.getCode())
|
||||
|| DicDataEnum.DISTURBANCE.getCode().equals(x.getCode())
|
||||
|| DicDataEnum.OTHER.getCode().equals(x.getCode())
|
||||
|| DicDataEnum.VOLTAGE_RISE.getCode().equals(x.getCode())
|
||||
)
|
||||
.map(DictData::getId).collect(Collectors.toList());
|
||||
}else{
|
||||
typeIds = dictType.stream().filter(x -> DicDataEnum.VOLTAGE_DIP.getCode().equals(x.getCode()))
|
||||
.map(DictData::getId).collect(Collectors.toList());
|
||||
}
|
||||
//数据暂降查询
|
||||
List<RmpEventDetailPO> info = eventDetailService.list(new LambdaQueryWrapper<RmpEventDetailPO>()
|
||||
.in(RmpEventDetailPO::getMeasurementPointId, lineIds)
|
||||
|
||||
Reference in New Issue
Block a user