From 74808dbd05a3374e27ad623af5f87fe4b9bab45e Mon Sep 17 00:00:00 2001 From: hzj <826100833@qq.com> Date: Wed, 16 Jul 2025 20:00:23 +0800 Subject: [PATCH] =?UTF-8?q?pmsbug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../distribution/mapping/PwMonitorMapper.xml | 45 ++---- .../mapping/DistributionMonitorMapper.xml | 41 ++--- .../pq/controller/DeviceController.java | 3 +- .../pq/controller/TerminalBaseController.java | 16 +- .../service/impl/TerminalBaseServiceImpl.java | 10 +- .../pojo/vo/EventDipShortDistributionVO.java | 144 +++++++++--------- .../pojo/vo/EventRiseDistributionTableVO.java | 6 +- .../PwEventDistributionStatisticsMapper.java | 3 + .../distribution/PwRmpEventDetailMapper.java | 7 +- .../PwEventDistributionStatisticsMapper.xml | 35 +++++ .../mapping/PwRmpEventDetailMapper.xml | 22 +-- .../Impl/PwEventMonitorReportServiceImpl.java | 139 +++++++++++++++-- .../impl/PwRMpBenchmarkLevelMServiceImpl.java | 27 +++- 13 files changed, 327 insertions(+), 171 deletions(-) diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/distribution/mapping/PwMonitorMapper.xml b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/distribution/mapping/PwMonitorMapper.xml index 995846ace..0f44ace60 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/distribution/mapping/PwMonitorMapper.xml +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/distribution/mapping/PwMonitorMapper.xml @@ -88,17 +88,17 @@ AND monitor.`Name` LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%') - + SELECT t.org_id orgId, + t.orgName orgName, t.id monitorId, t.NAME monitorName, b.Terminal_Id terminalId, @@ -401,6 +402,7 @@ a.id, a.NAME, a.org_id, + dept.name orgName, 3 AS lineType, a.Power_Station_Id AS powerrId, a.Line_Id, @@ -408,7 +410,7 @@ b.Power_Name powerName FROM pms_power_client a - LEFT JOIN pms_statation_stat b ON a.Power_Station_Id = b.Power_Id + LEFT JOIN pms_statation_stat b ON a.Power_Station_Id = b.Power_Id LEFT JOIN sys_dept dept on a.org_id =dept.code WHERE a.STATUS = 1 ) UNION ALL @@ -417,6 +419,7 @@ a.id, a.NAME, a.org_id, + dept.name orgName, 3 AS lineType, a.Power_Station_Id AS powerrId, a.Line_Id, @@ -424,37 +427,39 @@ b.Power_Name powerName FROM pms_power_generation_user a - LEFT JOIN pms_statation_stat b ON a.Power_Station_Id = b.Power_Id + LEFT JOIN pms_statation_stat b ON a.Power_Station_Id = b.Power_Id LEFT JOIN sys_dept dept on a.org_id =dept.code WHERE a.STATUS = 1 ) UNION ALL ( SELECT - id, - NAME, - org_id, + a.id, + a.NAME, + a.org_id, + dept.name orgName, 2 AS lineType, - Power_Station_Id AS powerrId, - Line_Id, - Voltage_Level, - Powerr_Name powerName + a.Power_Station_Id AS powerrId, + a.Line_Id, + a.Voltage_Level, + a.Powerr_Name powerName FROM - pms_power_distributionarea + pms_power_distributionarea a LEFT JOIN sys_dept dept on a.org_id =dept.code WHERE STATUS = 1 ) UNION ALL ( SELECT - id, - NAME, - org_id, + a.id, + a.NAME, + a.org_id, + dept.name orgName, 1 AS lineType, - Powerr_Id AS powerrId, - Line_Id, - Voltage_Level, - Powerr_Name powerName + a.Powerr_Id AS powerrId, + a.Line_Id, + a.Voltage_Level, + a.Powerr_Name powerName FROM - pms_monitor + pms_monitor a LEFT JOIN sys_dept dept on a.org_id =dept.code WHERE STATUS = 1 ) diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/DeviceController.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/DeviceController.java index 2a4ee0307..b1000b95e 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/DeviceController.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/DeviceController.java @@ -26,6 +26,7 @@ import org.springframework.web.bind.annotation.*; import java.nio.charset.StandardCharsets; import java.util.List; +import java.util.Objects; /** @@ -183,7 +184,7 @@ public class DeviceController extends BaseController { @ApiOperation("修改装置通讯状态") public HttpResult updateDevComFlag(@RequestBody DevComFlagDTO devComFlagDTO) { String methodDescribe = getMethodDescribe("updateDevComFlag"); - boolean update = iDeviceService.lambdaUpdate().set(Device::getComFlag, devComFlagDTO.getStatus()).set(Device::getUpdateTime, devComFlagDTO.getDate()).eq(Device::getId, devComFlagDTO.getId()).update(); + boolean update = iDeviceService.lambdaUpdate().set(Objects.nonNull(devComFlagDTO.getStatus()), Device::getComFlag,devComFlagDTO.getStatus()).set(Device::getUpdateTime, devComFlagDTO.getDate()).eq(Device::getId, devComFlagDTO.getId()).update(); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, update, methodDescribe); } diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/TerminalBaseController.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/TerminalBaseController.java index e4a846ca7..d78128d13 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/TerminalBaseController.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/TerminalBaseController.java @@ -121,13 +121,13 @@ public class TerminalBaseController extends BaseController { } terminalBaseService.addTerminal(addTerminalParam); //新增终端后发送消息给前置重启设备 - if (Objects.nonNull(addTerminalParam.getDeviceParam())) { - addTerminalParam.getDeviceParam().forEach(temp->{ - Line line = terminalBaseService.queryTerminalByName(temp.getName()); - terminalBaseService.askRestartDevice(line.getId(), DeviceRebootType.ADD_TERMINAL); - }); - - } +// if (Objects.nonNull(addTerminalParam.getDeviceParam())) { +// addTerminalParam.getDeviceParam().forEach(temp->{ +// Line line = terminalBaseService.queryTerminalByName(temp.getName()); +// terminalBaseService.askRestartDevice(line.getId(), DeviceRebootType.ADD_TERMINAL); +// }); +// +// } return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); } @@ -163,7 +163,7 @@ public class TerminalBaseController extends BaseController { Boolean b = terminalBaseService.terminalSyncDeleteFly(lineId); //删除监测点即修改终端通知前置重启 - terminalBaseService.askRestartDevice(devId,DeviceRebootType.LEDGER_MODIFY); +// terminalBaseService.askRestartDevice(devId,DeviceRebootType.LEDGER_MODIFY); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe); } diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/TerminalBaseServiceImpl.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/TerminalBaseServiceImpl.java index 895f52ced..56be1afc9 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/TerminalBaseServiceImpl.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/TerminalBaseServiceImpl.java @@ -1513,7 +1513,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl imple lineLambdaQueryWrapper.in(DeptLine::getLineId, lineIndexList); deptLineMapper.delete(lineLambdaQueryWrapper); // 删除终端通知前置重启 - this.askRestartDevice(id,DeviceRebootType.DELETE_TERMINAL); +// this.askRestartDevice(id,DeviceRebootType.DELETE_TERMINAL); } @@ -1535,8 +1535,8 @@ public class TerminalBaseServiceImpl extends ServiceImpl imple lineLambdaQueryWrapper.in(DeptLine::getLineId, lineIndexList); deptLineMapper.delete(lineLambdaQueryWrapper); //通知前置删除监测点 - String[] split = obj.getPids().split(","); - this.askRestartDevice(split[4],DeviceRebootType.LEDGER_MODIFY); +// String[] split = obj.getPids().split(","); +// this.askRestartDevice(split[4],DeviceRebootType.LEDGER_MODIFY); } @@ -1547,8 +1547,8 @@ public class TerminalBaseServiceImpl extends ServiceImpl imple overlimitMapper.deleteById(obj.getId()); deptLineMapper.deleteById(obj.getId()); //通知前置删除监测点 - String[] split = obj.getPids().split(","); - this.askRestartDevice(split[4],DeviceRebootType.LEDGER_MODIFY); +// String[] split = obj.getPids().split(","); +// this.askRestartDevice(split[4],DeviceRebootType.LEDGER_MODIFY); } else { throw new BusinessException(CommonResponseEnum.FAIL); diff --git a/pqs-event/event-api/src/main/java/com/njcn/event/pojo/vo/EventDipShortDistributionVO.java b/pqs-event/event-api/src/main/java/com/njcn/event/pojo/vo/EventDipShortDistributionVO.java index 6f76b5acf..ed86a01ef 100644 --- a/pqs-event/event-api/src/main/java/com/njcn/event/pojo/vo/EventDipShortDistributionVO.java +++ b/pqs-event/event-api/src/main/java/com/njcn/event/pojo/vo/EventDipShortDistributionVO.java @@ -17,84 +17,84 @@ public class EventDipShortDistributionVO implements Serializable { private static final long serialVersionUID = 1L; - private int featureAmp90with100ms; - private int featureAmp90with250ms; - private int featureAmp90with500ms; - private int featureAmp90with1000ms; - private int featureAmp90with3000ms; - private int featureAmp90with10000ms; - private int featureAmp90with20000ms; - private int featureAmp90with60000ms; + private int featureAmp90with100ms=0; + private int featureAmp90with250ms=0; + private int featureAmp90with500ms=0; + private int featureAmp90with1000ms=0; + private int featureAmp90with3000ms=0; + private int featureAmp90with10000ms=0; + private int featureAmp90with20000ms=0; + private int featureAmp90with60000ms=0; - private int featureAmp80with100ms; - private int featureAmp80with250ms; - private int featureAmp80with500ms; - private int featureAmp80with1000ms; - private int featureAmp80with3000ms; - private int featureAmp80with10000ms; - private int featureAmp80with20000ms; - private int featureAmp80with60000ms; + private int featureAmp80with100ms=0; + private int featureAmp80with250ms=0; + private int featureAmp80with500ms=0; + private int featureAmp80with1000ms=0; + private int featureAmp80with3000ms=0; + private int featureAmp80with10000ms=0; + private int featureAmp80with20000ms=0; + private int featureAmp80with60000ms=0; - private int featureAmp70with100ms; - private int featureAmp70with250ms; - private int featureAmp70with500ms; - private int featureAmp70with1000ms; - private int featureAmp70with3000ms; - private int featureAmp70with10000ms; - private int featureAmp70with20000ms; - private int featureAmp70with60000ms; + private int featureAmp70with100ms=0; + private int featureAmp70with250ms=0; + private int featureAmp70with500ms=0; + private int featureAmp70with1000ms=0; + private int featureAmp70with3000ms=0; + private int featureAmp70with10000ms=0; + private int featureAmp70with20000ms=0; + private int featureAmp70with60000ms=0; - private int featureAmp60with100ms; - private int featureAmp60with250ms; - private int featureAmp60with500ms; - private int featureAmp60with1000ms; - private int featureAmp60with3000ms; - private int featureAmp60with10000ms; - private int featureAmp60with20000ms; - private int featureAmp60with60000ms; + private int featureAmp60with100ms=0; + private int featureAmp60with250ms=0; + private int featureAmp60with500ms=0; + private int featureAmp60with1000ms=0; + private int featureAmp60with3000ms=0; + private int featureAmp60with10000ms=0; + private int featureAmp60with20000ms=0; + private int featureAmp60with60000ms=0; - private int featureAmp50with100ms; - private int featureAmp50with250ms; - private int featureAmp50with500ms; - private int featureAmp50with1000ms; - private int featureAmp50with3000ms; - private int featureAmp50with10000ms; - private int featureAmp50with20000ms; - private int featureAmp50with60000ms; + private int featureAmp50with100ms=0; + private int featureAmp50with250ms=0; + private int featureAmp50with500ms=0; + private int featureAmp50with1000ms=0; + private int featureAmp50with3000ms=0; + private int featureAmp50with10000ms=0; + private int featureAmp50with20000ms=0; + private int featureAmp50with60000ms=0; - private int featureAmp40with100ms; - private int featureAmp40with250ms; - private int featureAmp40with500ms; - private int featureAmp40with1000ms; - private int featureAmp40with3000ms; - private int featureAmp40with10000ms; - private int featureAmp40with20000ms; - private int featureAmp40with60000ms; + private int featureAmp40with100ms=0; + private int featureAmp40with250ms=0; + private int featureAmp40with500ms=0; + private int featureAmp40with1000ms=0; + private int featureAmp40with3000ms=0; + private int featureAmp40with10000ms=0; + private int featureAmp40with20000ms=0; + private int featureAmp40with60000ms=0; - private int featureAmp30with100ms; - private int featureAmp30with250ms; - private int featureAmp30with500ms; - private int featureAmp30with1000ms; - private int featureAmp30with3000ms; - private int featureAmp30with10000ms; - private int featureAmp30with20000ms; - private int featureAmp30with60000ms; + private int featureAmp30with100ms=0; + private int featureAmp30with250ms=0; + private int featureAmp30with500ms=0; + private int featureAmp30with1000ms=0; + private int featureAmp30with3000ms=0; + private int featureAmp30with10000ms=0; + private int featureAmp30with20000ms=0; + private int featureAmp30with60000ms=0; - private int featureAmp20with100ms; - private int featureAmp20with250ms; - private int featureAmp20with500ms; - private int featureAmp20with1000ms; - private int featureAmp20with3000ms; - private int featureAmp20with10000ms; - private int featureAmp20with20000ms; - private int featureAmp20with60000ms; + private int featureAmp20with100ms=0; + private int featureAmp20with250ms=0; + private int featureAmp20with500ms=0; + private int featureAmp20with1000ms=0; + private int featureAmp20with3000ms=0; + private int featureAmp20with10000ms=0; + private int featureAmp20with20000ms=0; + private int featureAmp20with60000ms=0; - private int featureAmp10with100ms; - private int featureAmp10with250ms; - private int featureAmp10with500ms; - private int featureAmp10with1000ms; - private int featureAmp10with3000ms; - private int featureAmp10with10000ms; - private int featureAmp10with20000ms; - private int featureAmp10with60000ms; + private int featureAmp10with100ms=0; + private int featureAmp10with250ms=0; + private int featureAmp10with500ms=0; + private int featureAmp10with1000ms=0; + private int featureAmp10with3000ms=0; + private int featureAmp10with10000ms=0; + private int featureAmp10with20000ms=0; + private int featureAmp10with60000ms=0; } diff --git a/pqs-event/event-api/src/main/java/com/njcn/event/pojo/vo/EventRiseDistributionTableVO.java b/pqs-event/event-api/src/main/java/com/njcn/event/pojo/vo/EventRiseDistributionTableVO.java index 68b9d5f36..1502c6fa5 100644 --- a/pqs-event/event-api/src/main/java/com/njcn/event/pojo/vo/EventRiseDistributionTableVO.java +++ b/pqs-event/event-api/src/main/java/com/njcn/event/pojo/vo/EventRiseDistributionTableVO.java @@ -26,18 +26,18 @@ public class EventRiseDistributionTableVO implements Serializable { * 持续时间100ms-500ms */ @ApiModelProperty(name = "duration500",value = "持续时间100ms-500ms") - private Integer duration500; + private Integer duration500=0; /** * 持续时间500ms-5000ms */ @ApiModelProperty(name = "duration5000",value = "持续时间500ms-5000ms") - private Integer duration5000; + private Integer duration5000=0; /** * 持续时间5000ms-60000ms */ @ApiModelProperty(name = "duration60000",value = "持续时间5000ms-60000ms") - private Integer duration60000; + private Integer duration60000=0; } diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/mapper/distribution/PwEventDistributionStatisticsMapper.java b/pqs-event/event-boot/src/main/java/com/njcn/event/mapper/distribution/PwEventDistributionStatisticsMapper.java index 9c0008f26..6d504ab36 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/mapper/distribution/PwEventDistributionStatisticsMapper.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/mapper/distribution/PwEventDistributionStatisticsMapper.java @@ -53,4 +53,7 @@ public interface PwEventDistributionStatisticsMapper { * @return com.njcn.event.pojo.vo.EventRiseDistributionVO */ EventRiseDistributionVO getEventRiseDistributionByCond(Map map); + + List getEventDipShortDistributionByCondition(Map condMap); + } diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/mapper/distribution/PwRmpEventDetailMapper.java b/pqs-event/event-boot/src/main/java/com/njcn/event/mapper/distribution/PwRmpEventDetailMapper.java index 82add6dbf..023b329df 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/mapper/distribution/PwRmpEventDetailMapper.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/mapper/distribution/PwRmpEventDetailMapper.java @@ -34,13 +34,13 @@ public interface PwRmpEventDetailMapper extends BaseMapper { /** * 获取暂态事件明细 * - * @param monitorIds 监测点id * @param eventType 暂态指标类型 * @param startTime 开始时间 * @param endTime 结束时间 * @return 暂态事件明细 */ - List getDetailsOfTransientEvents(@Param("monitorIds") List monitorIds, + List getDetailsOfTransientEvents( +// @Param("monitorIds") List monitorIds, @Param("eventType") List eventType, @Param("startTime") String startTime, @Param("endTime") String endTime); @@ -55,7 +55,8 @@ public interface PwRmpEventDetailMapper extends BaseMapper { * @param endTime * @return java.util.List */ - List getDetailsOfTransientEventsByMonth(@Param("monitorIds") List monitorIds, + List getDetailsOfTransientEventsByMonth( +// @Param("monitorIds") List monitorIds, @Param("eventType") List eventType, @Param("startTime") String startTime, @Param("endTime") String endTime); diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/mapper/distribution/mapping/PwEventDistributionStatisticsMapper.xml b/pqs-event/event-boot/src/main/java/com/njcn/event/mapper/distribution/mapping/PwEventDistributionStatisticsMapper.xml index 1948aa431..568cda7e4 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/mapper/distribution/mapping/PwEventDistributionStatisticsMapper.xml +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/mapper/distribution/mapping/PwEventDistributionStatisticsMapper.xml @@ -262,4 +262,39 @@ ) r + + \ No newline at end of file diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/mapper/distribution/mapping/PwRmpEventDetailMapper.xml b/pqs-event/event-boot/src/main/java/com/njcn/event/mapper/distribution/mapping/PwRmpEventDetailMapper.xml index cfd2d6f72..ec51f8a9a 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/mapper/distribution/mapping/PwRmpEventDetailMapper.xml +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/mapper/distribution/mapping/PwRmpEventDetailMapper.xml @@ -36,11 +36,11 @@ Event_Type as eventType FROM r_mp_event_detail - WHERE - measurement_point_id IN - - #{item} - + WHERE 1=1 + + + + AND Event_Type IN @@ -71,12 +71,12 @@ AND DATE_FORMAT(start_time, '%Y-%m') <= #{endTime} - - and measurement_point_id IN - - #{item} - - + + + + + + AND Event_Type IN diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/service/distribution/Impl/PwEventMonitorReportServiceImpl.java b/pqs-event/event-boot/src/main/java/com/njcn/event/service/distribution/Impl/PwEventMonitorReportServiceImpl.java index 9dcca4222..d25f69be1 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/service/distribution/Impl/PwEventMonitorReportServiceImpl.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/service/distribution/Impl/PwEventMonitorReportServiceImpl.java @@ -17,6 +17,7 @@ import com.njcn.system.enums.DicDataEnum; import com.njcn.system.enums.DicDataTypeEnum; import com.njcn.system.pojo.po.DictData; import lombok.RequiredArgsConstructor; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.ListUtils; import org.springframework.stereotype.Service; @@ -80,14 +81,20 @@ public class PwEventMonitorReportServiceImpl implements PwEventMonitorReportServ //查询暂态事件明细 List detailList = new ArrayList<>(); - List> partition = ListUtils.partition(monitorIdList, 20000); - for (List list : partition) { - if (BizParamConstant.STAT_BIZ_MONTH.equals(type + "")) { //按月查 - detailList.addAll(rmpEventDetailMapper.getDetailsOfTransientEventsByMonth(list, null, startTime, endTime)); +// List> partition = ListUtils.partition(monitorIdList, 20000); +// for (List list : partition) { +// if (BizParamConstant.STAT_BIZ_MONTH.equals(type + "")) { //按月查 +// detailList.addAll(rmpEventDetailMapper.getDetailsOfTransientEventsByMonth(list, null, startTime, endTime)); +// } else { //按日查 +// detailList.addAll( rmpEventDetailMapper.getDetailsOfTransientEvents(list, null, startTime, endTime)); +// } +// } + if (BizParamConstant.STAT_BIZ_MONTH.equals(type + "")) { //按月查 + detailList.addAll(rmpEventDetailMapper.getDetailsOfTransientEventsByMonth( null, startTime, endTime)); } else { //按日查 - detailList.addAll( rmpEventDetailMapper.getDetailsOfTransientEvents(list, null, startTime, endTime)); + detailList.addAll( rmpEventDetailMapper.getDetailsOfTransientEvents(null, startTime, endTime)); } - } + detailList = detailList.stream().filter(temp->monitorIdList.contains(temp.getLineId())).collect(Collectors.toList()); if (CollUtil.isNotEmpty(detailList)) { //todo 获取监测点信息接口 pwPmsMonitorParam.setMonitorName(eventMonitorReportParam.getMonitorName()); @@ -173,8 +180,10 @@ public class PwEventMonitorReportServiceImpl implements PwEventMonitorReportServ condMap.put("endTime", endTime); condMap.put("eventTypeList", Arrays.asList(eventStatisMapByCode.get(DicDataEnum.VOLTAGE_DIP.getCode()).getId(), eventStatisMapByCode.get(DicDataEnum.SHORT_INTERRUPTIONS.getCode()).getId())); condMap.put("dateType", type); - EventDipShortDistributionVO eventDipShortDistribution = eventDistributionStatisticsMapper.getEventDipShortDistributionByCond(condMap); - +// EventDipShortDistributionVO eventDipShortDistribution = eventDistributionStatisticsMapper.getEventDipShortDistributionByCond(condMap); + List eventDipShortDistributionByCondition = eventDistributionStatisticsMapper.getEventDipShortDistributionByCondition(condMap); + eventDipShortDistributionByCondition = eventDipShortDistributionByCondition.stream().filter(temp->monitorIds.contains(temp.getMeasurementPointId())).collect(Collectors.toList()); + EventDipShortDistributionVO eventDipShortDistribution = change(eventDipShortDistributionByCondition); //设置返回数据 List list = new ArrayList<>(); //特征幅值[80,90] @@ -296,12 +305,100 @@ public class PwEventMonitorReportServiceImpl implements PwEventMonitorReportServ return list; } - /*** + private EventDipShortDistributionVO change(List list) { + EventDipShortDistributionVO eventDipShortDistributionVO = new EventDipShortDistributionVO(); + if(!CollectionUtils.isEmpty(list)) { + eventDipShortDistributionVO.setFeatureAmp90with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 10 && temp.getDuration() <= 100).count()); + eventDipShortDistributionVO.setFeatureAmp90with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 100 && temp.getDuration() <= 250).count()); + eventDipShortDistributionVO.setFeatureAmp90with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 250 && temp.getDuration() <= 500).count()); + eventDipShortDistributionVO.setFeatureAmp90with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count()); + eventDipShortDistributionVO.setFeatureAmp90with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count()); + eventDipShortDistributionVO.setFeatureAmp90with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count()); + eventDipShortDistributionVO.setFeatureAmp90with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count()); + eventDipShortDistributionVO.setFeatureAmp90with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count()); + + eventDipShortDistributionVO.setFeatureAmp80with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 10 && temp.getDuration() <= 100).count()); + eventDipShortDistributionVO.setFeatureAmp80with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 100 && temp.getDuration() <= 250).count()); + eventDipShortDistributionVO.setFeatureAmp80with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 250 && temp.getDuration() <= 500).count()); + eventDipShortDistributionVO.setFeatureAmp80with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count()); + eventDipShortDistributionVO.setFeatureAmp80with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count()); + eventDipShortDistributionVO.setFeatureAmp80with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count()); + eventDipShortDistributionVO.setFeatureAmp80with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count()); + eventDipShortDistributionVO.setFeatureAmp80with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count()); + + eventDipShortDistributionVO.setFeatureAmp70with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 10 && temp.getDuration() <= 100).count()); + eventDipShortDistributionVO.setFeatureAmp70with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 100 && temp.getDuration() <= 250).count()); + eventDipShortDistributionVO.setFeatureAmp70with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 250 && temp.getDuration() <= 500).count()); + eventDipShortDistributionVO.setFeatureAmp70with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count()); + eventDipShortDistributionVO.setFeatureAmp70with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count()); + eventDipShortDistributionVO.setFeatureAmp70with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count()); + eventDipShortDistributionVO.setFeatureAmp70with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count()); + eventDipShortDistributionVO.setFeatureAmp70with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count()); + + eventDipShortDistributionVO.setFeatureAmp60with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 10 && temp.getDuration() <= 100).count()); + eventDipShortDistributionVO.setFeatureAmp60with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 100 && temp.getDuration() <= 250).count()); + eventDipShortDistributionVO.setFeatureAmp60with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 250 && temp.getDuration() <= 500).count()); + eventDipShortDistributionVO.setFeatureAmp60with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count()); + eventDipShortDistributionVO.setFeatureAmp60with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count()); + eventDipShortDistributionVO.setFeatureAmp60with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count()); + eventDipShortDistributionVO.setFeatureAmp60with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count()); + eventDipShortDistributionVO.setFeatureAmp60with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count()); + + eventDipShortDistributionVO.setFeatureAmp50with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 10 && temp.getDuration() <= 100).count()); + eventDipShortDistributionVO.setFeatureAmp50with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 100 && temp.getDuration() <= 250).count()); + eventDipShortDistributionVO.setFeatureAmp50with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 250 && temp.getDuration() <= 500).count()); + eventDipShortDistributionVO.setFeatureAmp50with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count()); + eventDipShortDistributionVO.setFeatureAmp50with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count()); + eventDipShortDistributionVO.setFeatureAmp50with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count()); + eventDipShortDistributionVO.setFeatureAmp50with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count()); + eventDipShortDistributionVO.setFeatureAmp50with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count()); + + eventDipShortDistributionVO.setFeatureAmp40with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 10 && temp.getDuration() <= 100).count()); + eventDipShortDistributionVO.setFeatureAmp40with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 100 && temp.getDuration() <= 250).count()); + eventDipShortDistributionVO.setFeatureAmp40with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 250 && temp.getDuration() <= 500).count()); + eventDipShortDistributionVO.setFeatureAmp40with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count()); + eventDipShortDistributionVO.setFeatureAmp40with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count()); + eventDipShortDistributionVO.setFeatureAmp40with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count()); + eventDipShortDistributionVO.setFeatureAmp40with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count()); + eventDipShortDistributionVO.setFeatureAmp40with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count()); + + eventDipShortDistributionVO.setFeatureAmp30with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 10 && temp.getDuration() <= 100).count()); + eventDipShortDistributionVO.setFeatureAmp30with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 100 && temp.getDuration() <= 250).count()); + eventDipShortDistributionVO.setFeatureAmp30with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 250 && temp.getDuration() <= 500).count()); + eventDipShortDistributionVO.setFeatureAmp30with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count()); + eventDipShortDistributionVO.setFeatureAmp30with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count()); + eventDipShortDistributionVO.setFeatureAmp30with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count()); + eventDipShortDistributionVO.setFeatureAmp30with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count()); + eventDipShortDistributionVO.setFeatureAmp30with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count()); + + eventDipShortDistributionVO.setFeatureAmp20with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 10 && temp.getDuration() <= 100).count()); + eventDipShortDistributionVO.setFeatureAmp20with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 100 && temp.getDuration() <= 250).count()); + eventDipShortDistributionVO.setFeatureAmp20with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 250 && temp.getDuration() <= 500).count()); + eventDipShortDistributionVO.setFeatureAmp20with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count()); + eventDipShortDistributionVO.setFeatureAmp20with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count()); + eventDipShortDistributionVO.setFeatureAmp20with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count()); + eventDipShortDistributionVO.setFeatureAmp20with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count()); + eventDipShortDistributionVO.setFeatureAmp20with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count()); + + eventDipShortDistributionVO.setFeatureAmp10with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 10 && temp.getDuration() <= 100).count()); + eventDipShortDistributionVO.setFeatureAmp10with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 100 && temp.getDuration() <= 250).count()); + eventDipShortDistributionVO.setFeatureAmp10with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 250 && temp.getDuration() <= 500).count()); + eventDipShortDistributionVO.setFeatureAmp10with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count()); + eventDipShortDistributionVO.setFeatureAmp10with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count()); + eventDipShortDistributionVO.setFeatureAmp10with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count()); + eventDipShortDistributionVO.setFeatureAmp10with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count()); + eventDipShortDistributionVO.setFeatureAmp10with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count()); + + } + + return eventDipShortDistributionVO; + } + /** * 暂态指标监测点电压暂升分布情况 * @author jianghaifei - * @date 2022-10-29 14:08 + * @date 2022-10-29 14:03 * @param eventMonitorReportParam - * @return com.njcn.event.pojo.vo.EventRiseDistributionVO + * @retu4n com.njcn.event4pojo.vo.EventRiseDistributionVO */ @Override public List getEventRiseDistributionByCond(EventMonitorReportParam eventMonitorReportParam) { @@ -325,7 +422,10 @@ public class PwEventMonitorReportServiceImpl implements PwEventMonitorReportServ riseCondMap.put("endTime", endTime); riseCondMap.put("eventTypeList", Collections.singletonList(eventStatisMapByCode.get(DicDataEnum.VOLTAGE_RISE.getCode()).getId())); riseCondMap.put("dateType", type); - EventRiseDistributionVO eventRiseDistribution = eventDistributionStatisticsMapper.getEventRiseDistributionByCond(riseCondMap); +// EventRiseDistributionVO eventRiseDistribution = eventDistributionStatisticsMapper.getEventRiseDistributionByCond(riseCondMap); + List rmpEventDetailPOS = eventDistributionStatisticsMapper.getEventDipShortDistributionByCondition(riseCondMap); + rmpEventDetailPOS = rmpEventDetailPOS.stream().filter(temp->monitorIds.contains(temp.getMeasurementPointId())).collect(Collectors.toList()); + EventRiseDistributionVO eventRiseDistribution = changeEventRise(rmpEventDetailPOS); //设置返回数据 List list = new ArrayList<>(); //特征幅值U1≥120 @@ -345,4 +445,19 @@ public class PwEventMonitorReportServiceImpl implements PwEventMonitorReportServ list.add(entity110); return list; } + + private EventRiseDistributionVO changeEventRise(List list) { + EventRiseDistributionVO eventRiseDistributionVO = new EventRiseDistributionVO(); + if(!CollectionUtils.isEmpty(list)){ + eventRiseDistributionVO.setFeatureAmp120with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 120 && temp.getDuration() > 10 && temp.getDuration() <= 500).count()); + eventRiseDistributionVO.setFeatureAmp120with5000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 120 && temp.getDuration() > 500 && temp.getDuration() <= 5000).count()); + eventRiseDistributionVO.setFeatureAmp120with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 120 && temp.getDuration() > 5000 && temp.getDuration() <= 60000).count()); + eventRiseDistributionVO.setFeatureAmp110with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= -120 && temp.getFeatureAmplitude() <= 110 && temp.getDuration() > 500 && temp.getDuration() <= 60000).count()); + eventRiseDistributionVO.setFeatureAmp110with5000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= -120 && temp.getFeatureAmplitude() <= 110 && temp.getDuration() > 5000 && temp.getDuration() <= 60000).count()); + eventRiseDistributionVO.setFeatureAmp110with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= -120 && temp.getFeatureAmplitude() <= 110 && temp.getDuration() > 60000 && temp.getDuration() <= 60000).count()); + + + } + return eventRiseDistributionVO; + } } diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/distribution/impl/PwRMpBenchmarkLevelMServiceImpl.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/distribution/impl/PwRMpBenchmarkLevelMServiceImpl.java index 90574a0c2..f9ae6dce5 100644 --- a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/distribution/impl/PwRMpBenchmarkLevelMServiceImpl.java +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/distribution/impl/PwRMpBenchmarkLevelMServiceImpl.java @@ -107,17 +107,28 @@ public class PwRMpBenchmarkLevelMServiceImpl extends ServiceImpl monitorMap = pwMonitorList.stream().collect(Collectors.toMap(PwPmsMonitorDTO::getMonitorId, Function.identity(), (key1, key2) -> key1)); - List resultList = temList.stream().map(item -> { + List resultList = temList.stream().filter(temp->monitorMap.containsKey(temp.getMeasurementPointId())).map(item -> { //封装前端需要的对象 PwRMpBenchmarkLevelVO rMpBenchmarkLevelVO = new PwRMpBenchmarkLevelVO(); BeanUtils.copyProperties(item, rMpBenchmarkLevelVO); - //单位信息 - rMpBenchmarkLevelVO.setOrgNo(monitorMap.get(item.getMeasurementPointId()).getOrgId()); //单位id - rMpBenchmarkLevelVO.setOrgName(monitorMap.get(item.getMeasurementPointId()).getOrgName()); //单位名称 - //监测点信息 - rMpBenchmarkLevelVO.setMeasurementPointName(monitorMap.get(item.getMeasurementPointId()).getMonitorName()); //监测点名称 - //电压等级 - rMpBenchmarkLevelVO.setVoltageLevel(monitorMap.get(item.getMeasurementPointId()).getVoltageLevel()); + if(monitorMap.containsKey(item.getMeasurementPointId())){ + //单位信息 + rMpBenchmarkLevelVO.setOrgNo(monitorMap.get(item.getMeasurementPointId()).getOrgId()); //单位id + rMpBenchmarkLevelVO.setOrgName(monitorMap.get(item.getMeasurementPointId()).getOrgName()); //单位名称 + //监测点信息 + rMpBenchmarkLevelVO.setMeasurementPointName(monitorMap.get(item.getMeasurementPointId()).getMonitorName()); //监测点名称 + //电压等级 + rMpBenchmarkLevelVO.setVoltageLevel(monitorMap.get(item.getMeasurementPointId()).getVoltageLevel()); + }else { + //单位信息 + rMpBenchmarkLevelVO.setOrgNo("/"); //单位id + rMpBenchmarkLevelVO.setOrgName("/"); //单位名称 + //监测点信息 + rMpBenchmarkLevelVO.setMeasurementPointName("/"); //监测点名称 + //电压等级 + rMpBenchmarkLevelVO.setVoltageLevel("/"); + } + return rMpBenchmarkLevelVO; }).collect(Collectors.toList());