diff --git a/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/vo/GridDiagramVO.java b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/vo/GridDiagramVO.java index 7300f3e62..eb0dcf4c9 100644 --- a/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/vo/GridDiagramVO.java +++ b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/vo/GridDiagramVO.java @@ -42,6 +42,8 @@ public class GridDiagramVO { @Data public static class LineStatisticsData { + @ApiModelProperty(name = "columnName", value = "列名") + private String columnName; @ApiModelProperty(name = "num", value = "监测点个数") private Integer num; @@ -64,6 +66,8 @@ public class GridDiagramVO { @Data public static class StatisticsData { + @ApiModelProperty(name = "columnName", value = "列名") + private String columnName; @ApiModelProperty(name = "numOne", value = "数据") private Long numOne; @@ -71,6 +75,9 @@ public class GridDiagramVO { @ApiModelProperty(name = "numOneList", value = "数据集合") private List numOneList; + /** + * 上送国网 + */ @ApiModelProperty(name = "numTwo", value = "数据") private Long numTwo; diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/DeviceRunEvaluateController.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/DeviceRunEvaluateController.java new file mode 100644 index 000000000..b5a3822f9 --- /dev/null +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/DeviceRunEvaluateController.java @@ -0,0 +1,24 @@ +package com.njcn.device.pq.controller; + +import com.njcn.device.pq.service.DeviceRunEvaluateService; +import io.swagger.annotations.Api; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author 终端运行评价 + * @description + * @date 2025/5/8 13:57 + */ +@Slf4j +@Api(tags = "终端运行评价") +@RestController +@RequestMapping("/deviceRunEvaluate") +@RequiredArgsConstructor +public class DeviceRunEvaluateController { + + private final DeviceRunEvaluateService deviceRunEvaluateService; + +} diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/DeviceRunEvaluateService.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/DeviceRunEvaluateService.java new file mode 100644 index 000000000..e017cd06c --- /dev/null +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/DeviceRunEvaluateService.java @@ -0,0 +1,9 @@ +package com.njcn.device.pq.service; + +/** + * @author wr + * @description + * @date 2025/5/8 13:45 + */ +public interface DeviceRunEvaluateService { +} diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/DeviceRunEvaluateServiceImpl.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/DeviceRunEvaluateServiceImpl.java new file mode 100644 index 000000000..1dfeab7fb --- /dev/null +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/DeviceRunEvaluateServiceImpl.java @@ -0,0 +1,18 @@ +package com.njcn.device.pq.service.impl; + +import com.njcn.device.pq.service.DeviceRunEvaluateService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +/** + * @author wr + * @description + * @date 2025/5/8 13:45 + */ +@Service +@RequiredArgsConstructor +public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService { + + + +} diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/GeneralDeviceService.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/GeneralDeviceService.java index 3826f6e3c..19ab41440 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/GeneralDeviceService.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/GeneralDeviceService.java @@ -429,7 +429,7 @@ public class GeneralDeviceService { //3.筛选出变电站id,理论上监测点的pids中第四个id为变电站id 联查: pq_line t1 ,pq_substation t2 List subIds=devices.stream().map(Line::getPid).collect(Collectors.toList()); - List sub = terminalBaseService.getSubByCondition(subIds, deviceInfoParam.getScale()); + List sub = terminalBaseService.getSubByCondition(subIds, new ArrayList<>()); //筛选最终的数据 dealDeviceData(generalDeviceDTO, lines, devices, voltages, sub); diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/GridDiagramServiceImpl.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/GridDiagramServiceImpl.java index 6ec87be36..c05517fef 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/GridDiagramServiceImpl.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/GridDiagramServiceImpl.java @@ -169,7 +169,7 @@ public class GridDiagramServiceImpl implements GridDiagramService { //终端id集合 List devIds = lineBaseList.stream().filter(x -> value.equals(x.getVoltageLevel())).map(LineDevGetDTO::getDevId).distinct().collect(Collectors.toList()); - gridDiagramAdd(statisticsData, onlineRateByDevIds, onIntegrityByIds, devIds, lineIds, onLineNumIds); + gridDiagramAdd(statisticsData, onlineRateByDevIds,value, onIntegrityByIds, devIds, lineIds, onLineNumIds); } @@ -180,11 +180,12 @@ public class GridDiagramServiceImpl implements GridDiagramService { List lineIdsAll = lineBaseList.stream().map(LineDevGetDTO::getPointId).distinct().collect(Collectors.toList()); List onLineNumAll = lineBaseList.stream().filter(x -> 1 == x.getComFlag()).map(LineDevGetDTO::getPointId).distinct().collect(Collectors.toList()); - gridDiagramAdd(statisticsData, onlineRateByDevIds, onIntegrityByIds, devIdsAll, lineIdsAll, onLineNumAll); + gridDiagramAdd(statisticsData, onlineRateByDevIds,null, onIntegrityByIds, devIdsAll, lineIdsAll, onLineNumAll); } - private void gridDiagramAdd(List statisticsData, List onlineRateByDevIds, List onIntegrityByIds, List devIdsAll, List lineIdsAll, List onLineNumAll) { + private void gridDiagramAdd(List statisticsData, List onlineRateByDevIds,String value, List onIntegrityByIds, List devIdsAll, List lineIdsAll, List onLineNumAll) { GridDiagramVO.LineStatisticsData lineStatisticsData = new GridDiagramVO.LineStatisticsData(); + lineStatisticsData.setColumnName(value); lineStatisticsData.setNum(lineIdsAll.size()); lineStatisticsData.setNumList(lineIdsAll); lineStatisticsData.setOnLineNum(onLineNumAll.size()); @@ -203,7 +204,7 @@ public class GridDiagramServiceImpl implements GridDiagramService { //终端id集合 List devIds = lineBaseList.stream().filter(x -> value.equals(x.getVoltageLevel())).filter(x -> 1 == x.getIsUpToGrid()).map(LineDevGetDTO::getDevId).distinct().collect(Collectors.toList()); - gridDiagramAdd(statisticsData, onlineRateByDevIds, onIntegrityByIds, devIds, lineIds, onLineNumIds); + gridDiagramAdd(statisticsData, onlineRateByDevIds, value, onIntegrityByIds, devIds, lineIds, onLineNumIds); } private void gwStatisticsDataOtherList(List statisticsData, List lineBaseList, List onlineRateByDevIds, List onIntegrityByIds) { @@ -213,7 +214,7 @@ public class GridDiagramServiceImpl implements GridDiagramService { List lineIdsAll = lineBaseList.stream().filter(x -> 1 == x.getIsUpToGrid()).map(LineDevGetDTO::getPointId).distinct().collect(Collectors.toList()); List onLineNumAll = lineBaseList.stream().filter(x -> 1 == x.getComFlag() && 1 == x.getIsUpToGrid()).map(LineDevGetDTO::getPointId).distinct().collect(Collectors.toList()); - gridDiagramAdd(statisticsData, onlineRateByDevIds, onIntegrityByIds, devIdsAll, lineIdsAll, onLineNumAll); + gridDiagramAdd(statisticsData, onlineRateByDevIds,null, onIntegrityByIds, devIdsAll, lineIdsAll, onLineNumAll); } private void onLineAndIntegrity(List lineIds, List onIntegrityByIds, List devIds, List onlineRateByDevIds, GridDiagramVO.LineStatisticsData lineStatisticsData) { @@ -555,6 +556,7 @@ public class GridDiagramServiceImpl implements GridDiagramService { for (String voltageId : voltageIds) { for (int i = 0; i < 2; i++) { data = new GridDiagramVO.StatisticsData(); + data.setColumnName(voltageId); int finalI = i; //todo 1国网信息 long count = lineBaseList.stream().filter(x -> getIsUpToGrid(finalI, x, voltageId)).map(LineDevGetDTO::getDevId).distinct().count(); diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/TransientServiceImpl.java b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/TransientServiceImpl.java index 111068d59..e114391df 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/TransientServiceImpl.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/TransientServiceImpl.java @@ -97,7 +97,6 @@ public class TransientServiceImpl implements TransientService { private final DeviceTreeClient deviceTreeClient; - @Override public Page getTransientData(TransientParam transientParam) { Page page = new Page<>(); @@ -196,11 +195,11 @@ public class TransientServiceImpl implements TransientService { ip = monitorVO.getIp(); } String waveName = eventDetail.getWavePath(); - String cfgPath, datPath,cfgPath2,datPath2; + String cfgPath, datPath, cfgPath2, datPath2; if (generalInfo.getBusinessWaveFileStorage() == GeneralConstant.LOCAL_DISK) { cfgPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG; datPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.DAT; - log.info("本地磁盘波形文件路径----"+cfgPath); + log.info("本地磁盘波形文件路径----" + cfgPath); InputStream cfgStream = waveFileComponent.getFileInputStreamByFilePath(cfgPath); InputStream datStream = waveFileComponent.getFileInputStreamByFilePath(datPath); if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) { @@ -213,7 +212,7 @@ public class TransientServiceImpl implements TransientService { //适配文件后缀小写 cfgPath2 = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG.toLowerCase(); datPath2 = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.DAT.toLowerCase(); - log.info("文件服务器波形文件路径----"+cfgPath); + log.info("文件服务器波形文件路径----" + cfgPath); try ( InputStream cfgStream = fileStorageUtil.getFileStream(cfgPath); InputStream datStream = fileStorageUtil.getFileStream(datPath) @@ -230,7 +229,7 @@ public class TransientServiceImpl implements TransientService { throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND); } waveDataDTO = waveFileComponent.getComtrade(cfgStream, datStream, 1); - }catch (Exception e1){ + } catch (Exception e1) { throw new BusinessException(WaveFileResponseEnum.WAVE_DATA_INVALID); } @@ -292,11 +291,11 @@ public class TransientServiceImpl implements TransientService { page.setSize(transientParam.getPageSize()); page.setCurrent(transientParam.getPageNum()); // 按部门分类的实际运行终端综合信息 - List generalDeviceDTOList =new ArrayList<>(); - if(transientParam.getIsType()==0){ + List generalDeviceDTOList; + if (transientParam.getIsType() == 0) { generalDeviceDTOList = generalDeviceInfoClient.getPracticalRunDeviceInfo(transientParam).getData(); - }else{ - generalDeviceDTOList = generalDeviceInfoClient.getOfflineRunDeviceInfo(transientParam).getData(); + } else { + generalDeviceDTOList = generalDeviceInfoClient.getOfflineRunDeviceInfo(transientParam).getData(); } if (!CollectionUtils.isEmpty(generalDeviceDTOList)) { if (Objects.nonNull(transientParam.getEventValueMin())) { @@ -308,12 +307,12 @@ public class TransientServiceImpl implements TransientService { // 获取按终端分类的监测点索引集合 List lineList = generalDeviceDTOList.stream().flatMap(dto -> dto.getLineIndexes().stream()).collect(Collectors.toList()); List data = deviceTreeClient.getTerminalTree().getData(); - if(!CollectionUtils.isEmpty(transientParam.getSubstationIds())){ + if (!CollectionUtils.isEmpty(transientParam.getSubstationIds())) { List collect = data.stream().map(TerminalTree::getChildren).flatMap(Collection::stream) .map(TerminalTree::getChildren).flatMap(Collection::stream) .map(TerminalTree::getChildren).flatMap(Collection::stream) .map(TerminalTree::getChildren).flatMap(Collection::stream) - .filter(temp->transientParam.getSubstationIds().contains(temp.getId())) + .filter(temp -> transientParam.getSubstationIds().contains(temp.getId())) .map(TerminalTree::getChildren).flatMap(Collection::stream) .map(TerminalTree::getChildren).flatMap(Collection::stream) .map(TerminalTree::getChildren).flatMap(Collection::stream) @@ -321,7 +320,7 @@ public class TransientServiceImpl implements TransientService { lineList.retainAll(collect); } - if(!CollectionUtils.isEmpty(transientParam.getLineIds())){ + if (!CollectionUtils.isEmpty(transientParam.getLineIds())) { List collect1 = data.stream().map(TerminalTree::getChildren).flatMap(Collection::stream) .map(TerminalTree::getChildren).flatMap(Collection::stream) .map(TerminalTree::getChildren).flatMap(Collection::stream) @@ -329,11 +328,11 @@ public class TransientServiceImpl implements TransientService { .map(TerminalTree::getChildren).flatMap(Collection::stream) .map(TerminalTree::getChildren).flatMap(Collection::stream) .map(TerminalTree::getChildren).flatMap(Collection::stream) - .filter(temp->transientParam.getLineIds().contains(temp.getId())) + .filter(temp -> transientParam.getLineIds().contains(temp.getId())) .map(TerminalTree::getId).collect(Collectors.toList()); lineList.retainAll(collect1); } - if(CollUtil.isEmpty(lineList)){ + if (CollUtil.isEmpty(lineList)) { return new Page<>(); } List lineInfoVOList = lineFeignClient.getBaseLineAreaInfo(lineList).getData(); @@ -351,17 +350,17 @@ public class TransientServiceImpl implements TransientService { .in(CollUtil.isNotEmpty(transientParam.getEventType()), RmpEventDetailPO::getAdvanceType, transientParam.getEventType()); - if(StrUtil.isNotBlank(transientParam.getOrderBy())){ - if(transientParam.getSortBy().equals("start_time")){ - wrapper.orderBy(true,transientParam.getOrderBy().equals("asc"),RmpEventDetailPO::getStartTime); - }else if(transientParam.getSortBy().equals("feature_amplitude")){ - wrapper.orderBy(true,transientParam.getOrderBy().equals("asc"),RmpEventDetailPO::getFeatureAmplitude); - }else if(transientParam.getSortBy().equals("firstMs")){ - wrapper.orderBy(true,transientParam.getOrderBy().equals("asc"),RmpEventDetailPO::getFirstMs); - }else if(transientParam.getSortBy().equals("duration")){ - wrapper.orderBy(true,transientParam.getOrderBy().equals("asc"),RmpEventDetailPO::getDuration); + if (StrUtil.isNotBlank(transientParam.getOrderBy())) { + if (transientParam.getSortBy().equals("start_time")) { + wrapper.orderBy(true, transientParam.getOrderBy().equals("asc"), RmpEventDetailPO::getStartTime); + } else if (transientParam.getSortBy().equals("feature_amplitude")) { + wrapper.orderBy(true, transientParam.getOrderBy().equals("asc"), RmpEventDetailPO::getFeatureAmplitude); + } else if (transientParam.getSortBy().equals("firstMs")) { + wrapper.orderBy(true, transientParam.getOrderBy().equals("asc"), RmpEventDetailPO::getFirstMs); + } else if (transientParam.getSortBy().equals("duration")) { + wrapper.orderBy(true, transientParam.getOrderBy().equals("asc"), RmpEventDetailPO::getDuration); } - }else { + } else { wrapper.orderByDesc(RmpEventDetailPO::getStartTime); } @@ -383,7 +382,7 @@ public class TransientServiceImpl implements TransientService { if (Objects.nonNull(transientParam.getFileFlag())) { wrapper.eq(Objects.nonNull(transientParam.getFileFlag()), RmpEventDetailPO::getFileFlag, transientParam.getFileFlag()); } - wrapper.in(!CollectionUtils.isEmpty(transientParam.getVerifyReason()),RmpEventDetailPO::getVerifyReason,transientParam.getVerifyReason()); + wrapper.in(!CollectionUtils.isEmpty(transientParam.getVerifyReason()), RmpEventDetailPO::getVerifyReason, transientParam.getVerifyReason()); // Page pageInfo = eventDetailService.page(new Page<>(transientParam.getPageNum(), transientParam.getPageSize()),wrapper); Page pageInfo = pwRmpEventDetailMapper.selectPage(new Page<>(transientParam.getPageNum(), transientParam.getPageSize()), wrapper); List eventDetailData = BeanUtil.copyToList(pageInfo.getRecords(), EventDetailNew.class); @@ -395,7 +394,7 @@ public class TransientServiceImpl implements TransientService { List typeList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_TYPE.getName()).getData(); for (EventDetailNew eventDetail : eventDetailData) { DecimalFormat df = new DecimalFormat("#0.000"); - eventDetail.setSeverity(Double.parseDouble(df.format(Objects.isNull(eventDetail.getSeverity())?0.00:eventDetail.getSeverity()))); + eventDetail.setSeverity(Double.parseDouble(df.format(Objects.isNull(eventDetail.getSeverity()) ? 0.00 : eventDetail.getSeverity()))); for (AreaLineInfoVO areaLineInfoVO : r) { if (eventDetail.getLineId().equals(areaLineInfoVO.getLineId())) { eventDetail.setLineId(areaLineInfoVO.getLineId()); @@ -440,9 +439,9 @@ public class TransientServiceImpl implements TransientService { @Override public void updateEventReason(EventVerifyReasonParam eventVerifyReasonParam) { eventDetailService.lambdaUpdate() - .eq(RmpEventDetailPO::getEventId,eventVerifyReasonParam.getEventId()) - .set(RmpEventDetailPO::getVerifyReason,eventVerifyReasonParam.getVerifyReason()) - .set(RmpEventDetailPO::getVerifyReasonDetail,eventVerifyReasonParam.getVerifyReasonDetail()) + .eq(RmpEventDetailPO::getEventId, eventVerifyReasonParam.getEventId()) + .set(RmpEventDetailPO::getVerifyReason, eventVerifyReasonParam.getVerifyReason()) + .set(RmpEventDetailPO::getVerifyReasonDetail, eventVerifyReasonParam.getVerifyReasonDetail()) .update(); } @@ -467,10 +466,10 @@ public class TransientServiceImpl implements TransientService { */ public void copyTempData(List eventIds) { List rmpEventDetailPOList = eventDetailService.listByIds(eventIds); - List nullWave = rmpEventDetailPOList.stream().filter(item->Objects.isNull(item.getWavePath())).collect(Collectors.toList()); - if(nullWave.size()!=0){ - throw new BusinessException("请选择存在波形的事件导出!"); - } + List nullWave = rmpEventDetailPOList.stream().filter(item -> Objects.isNull(item.getWavePath())).collect(Collectors.toList()); + if (nullWave.size() != 0) { + throw new BusinessException("请选择存在波形的事件导出!"); + } if (CollUtil.isNotEmpty(rmpEventDetailPOList)) { for (int i = 0; i < rmpEventDetailPOList.size(); i++) { //根据监测点id获取监测点详情 diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/impl/RMpTargetWarnDServiceImpl.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/impl/RMpTargetWarnDServiceImpl.java index 5d00ba9ea..415dfc133 100644 --- a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/impl/RMpTargetWarnDServiceImpl.java +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/impl/RMpTargetWarnDServiceImpl.java @@ -61,7 +61,6 @@ public class RMpTargetWarnDServiceImpl extends ServiceImpl vName.contains(item.getName())).sorted(Comparator.comparing(DictData::getSort).reversed()).map(DictData::getId).collect(Collectors.toList()); }else{ voltageIds = dictDataList.stream().filter(item -> Objects.equals(DicDataEnum.DY_500KV.getCode(), item.getCode()) || Objects.equals(DicDataEnum.DY_220KV.getCode(), item.getCode()) || Objects.equals(DicDataEnum.DY_110KV.getCode(), item.getCode()) || Objects.equals(DicDataEnum.DY_35KV.getCode(), item.getCode())).sorted(Comparator.comparing(DictData::getSort).reversed()).map(DictData::getId).collect(Collectors.toList()); - } @@ -136,6 +135,7 @@ public class RMpTargetWarnDServiceImpl extends ServiceImpl getIsUpToGrid(finalI, x, voltageId))