diff --git a/pqs-harmonic/harmonic-api/src/main/java/com/njcn/harmonic/pojo/vo/NodeVO.java b/pqs-event/event-api/src/main/java/com/njcn/event/pojo/vo/NodeVO.java similarity index 94% rename from pqs-harmonic/harmonic-api/src/main/java/com/njcn/harmonic/pojo/vo/NodeVO.java rename to pqs-event/event-api/src/main/java/com/njcn/event/pojo/vo/NodeVO.java index bd2b8d33a..f7be72ced 100644 --- a/pqs-harmonic/harmonic-api/src/main/java/com/njcn/harmonic/pojo/vo/NodeVO.java +++ b/pqs-event/event-api/src/main/java/com/njcn/event/pojo/vo/NodeVO.java @@ -1,4 +1,4 @@ -package com.njcn.harmonic.pojo.vo; +package com.njcn.event.pojo.vo; import io.swagger.annotations.ApiModelProperty; import lombok.Data; diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/controller/majornetwork/AreaStatisticalController.java b/pqs-event/event-boot/src/main/java/com/njcn/event/controller/majornetwork/AreaStatisticalController.java index cb609aa9f..1dd2615b0 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/controller/majornetwork/AreaStatisticalController.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/controller/majornetwork/AreaStatisticalController.java @@ -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; diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/AreaStatisticalService.java b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/AreaStatisticalService.java index af58bc152..c55626641 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/AreaStatisticalService.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/AreaStatisticalService.java @@ -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 + * @return: java.util.List * @Author: wr * @Date: 2023/8/30 9:43 */ diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/AreaStatisticalServiceImpl.java b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/AreaStatisticalServiceImpl.java index ec440e2af..2d6b7335c 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/AreaStatisticalServiceImpl.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/AreaStatisticalServiceImpl.java @@ -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; diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/ReportServiceImpl.java b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/ReportServiceImpl.java index f63bf75f1..2e851e4e6 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/ReportServiceImpl.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/ReportServiceImpl.java @@ -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 generalDeviceDTOList = generalDeviceInfoClient.getPracticalAllDeviceInfo(areaReportParam).getData(); - //测试id -// generalDeviceDTOList.get(9).getLineIndexes().add("97ec50b62c84d39d1e15d83e61e06844"); + //这是总的监测点id List 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 eventDetailList = getEventDetailListInfo(areaReportParam, lineIds); + List eventDetailList = getEventDetailListInfo(areaReportParam, lineIds,areaReportParam.getWaveType()); List 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 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 generalDeviceDTOList = pmsGeneralDeviceInfoClient.getPmsDeviceInfoWithInOrg(pmsDeviceInfoParam).getData(); -// if(areaReportParam.getDeptIndex().equals("0d52f9f6e43ec0ee83013cd32da93f66")){ -// //测试id -// generalDeviceDTOList.get(0).getMonitorIdList().add("97ec50b62c84d39d1e15d83e61e06844"); -// } //这是总的监测点id List 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 eventDetailList = getEventDetailListInfo(areaReportParam, lineIds); + List 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 getEventDetailListInfo(AreaReportParam areaReportParam, List lineIds) { - + private List getEventDetailListInfo(AreaReportParam areaReportParam, List lineIds,Integer type) { //获取事件类型(短时中断 电压暂降 电压暂升 扰动 其他) List dictType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVENT_STATIS.getCode()).getData(); - List 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 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 info = eventDetailService.list(new LambdaQueryWrapper() .in(RmpEventDetailPO::getMeasurementPointId, lineIds)