增加暂态信息搜索,调整全景区域污染值逻辑

This commit is contained in:
wr
2025-12-14 14:24:15 +08:00
parent d09f1472a9
commit cebda9323e
3 changed files with 98 additions and 71 deletions

View File

@@ -1,6 +1,6 @@
package com.njcn.event.pojo.param; package com.njcn.event.pojo.param;
import com.njcn.web.pojo.annotation.DateTimeStrValid; import com.njcn.device.pq.pojo.param.DeviceInfoParam;
import com.njcn.web.pojo.param.BaseParam; import com.njcn.web.pojo.param.BaseParam;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@@ -29,7 +29,13 @@ public class EventBaseParam extends BaseParam implements Serializable {
@Data @Data
public static class Info extends EventBaseParam { public static class Info extends DeviceInfoParam.BusinessParam {
@ApiModelProperty("页码")
private Integer pageNum;
@ApiModelProperty("页面尺寸")
private Integer pageSize;
@ApiModelProperty(name = "dicData", value = "字典id") @ApiModelProperty(name = "dicData", value = "字典id")
private String dicData; private String dicData;

View File

@@ -488,13 +488,21 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
@Override @Override
public Page<AdvanceEventDetailVO> getEventByLineIdsCount(EventBaseParam.Info param) { public Page<AdvanceEventDetailVO> getEventByLineIdsCount(EventBaseParam.Info param) {
Page<RmpEventDetailPO> poPage = this.page(new Page<>(PageFactory.getPageNum(param), PageFactory.getPageSize(param)), new LambdaQueryWrapper<RmpEventDetailPO>() Page<AdvanceEventDetailVO> pageResult = new Page<>();
.eq(StrUtil.isNotBlank(param.getLineId()), RmpEventDetailPO::getLineId, param.getLineId()) param.setLineOrDevice(0);
param.setDeptIndex("0d52f9f6e43ec0ee83013cd32da93f66");
param.setStatisticalType(new SimpleDTO());
//获取终端台账类信息
List<GeneralDeviceDTO> deviceInfo = generalDeviceInfoClient.getPracticalRunDeviceInfo(param).getData();
List<String> ids = deviceInfo.stream().flatMap(x -> x.getLineIndexes().stream()).distinct().collect(Collectors.toList());
Page<RmpEventDetailPO> poPage = this.page(new Page<>(param.getPageNum(), param.getPageSize()), new LambdaQueryWrapper<RmpEventDetailPO>()
.in(CollUtil.isNotEmpty(ids), RmpEventDetailPO::getLineId, ids)
.eq(StrUtil.isNotBlank(param.getDicData()), RmpEventDetailPO::getEventType, param.getDicData()) .eq(StrUtil.isNotBlank(param.getDicData()), RmpEventDetailPO::getEventType, param.getDicData())
.ge(StrUtil.isNotBlank(param.getSearchBeginTime()), RmpEventDetailPO::getStartTime, DateUtil.beginOfDay(DateUtil.parse(param.getSearchBeginTime()))) .ge(StrUtil.isNotBlank(param.getSearchBeginTime()), RmpEventDetailPO::getStartTime, DateUtil.beginOfDay(DateUtil.parse(param.getSearchBeginTime())))
.le(StrUtil.isNotBlank(param.getSearchEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(param.getSearchEndTime()))) .le(StrUtil.isNotBlank(param.getSearchEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(param.getSearchEndTime())))
); );
List<String> tempLineIds = poPage.getRecords().stream().map(RmpEventDetailPO::getLineId).distinct().collect(Collectors.toList()); List<String> tempLineIds = poPage.getRecords().stream().map(RmpEventDetailPO::getLineId).distinct().collect(Collectors.toList());
if(CollUtil.isNotEmpty(tempLineIds)){
List<AreaLineInfoVO> temLine = lineFeignClient.getBaseLineAreaInfo(tempLineIds).getData(); List<AreaLineInfoVO> temLine = lineFeignClient.getBaseLineAreaInfo(tempLineIds).getData();
Map<String, AreaLineInfoVO> map = temLine.stream().collect(Collectors.toMap(AreaLineInfoVO::getLineId, Function.identity())); Map<String, AreaLineInfoVO> map = temLine.stream().collect(Collectors.toMap(AreaLineInfoVO::getLineId, Function.identity()));
List<AdvanceEventDetailVO> advanceEventDetailVOList = BeanUtil.copyToList(poPage.getRecords(), AdvanceEventDetailVO.class); List<AdvanceEventDetailVO> advanceEventDetailVOList = BeanUtil.copyToList(poPage.getRecords(), AdvanceEventDetailVO.class);
@@ -530,8 +538,8 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
} }
}).collect(Collectors.toList()); }).collect(Collectors.toList());
Page<AdvanceEventDetailVO> pageResult = new Page<>();
pageResult.setRecords(advanceEventDetailVOList); pageResult.setRecords(advanceEventDetailVOList);
}
pageResult.setTotal(poPage.getTotal()); pageResult.setTotal(poPage.getTotal());
pageResult.setPages(poPage.getPages()); pageResult.setPages(poPage.getPages());
pageResult.setSize(poPage.getSize()); pageResult.setSize(poPage.getSize());

View File

@@ -1199,24 +1199,38 @@ public class PollutionSubstationServiceImpl extends ServiceImpl<RStatPollutionSu
deviceInfoParam.setLineRunFlag(0); deviceInfoParam.setLineRunFlag(0);
deviceInfoParam.setDeptIndex(param.getId()); deviceInfoParam.setDeptIndex(param.getId());
deviceInfoParam.setStatisticalType(new SimpleDTO()); deviceInfoParam.setStatisticalType(new SimpleDTO());
deviceInfoParam.setMonitorFlag(param.getIsUpToGrid());
List<GeneralDeviceDTO> deptData = generalDeviceInfoClient.getPracticalRunDeviceInfo(deviceInfoParam).getData(); List<GeneralDeviceDTO> deptData = generalDeviceInfoClient.getPracticalRunDeviceInfo(deviceInfoParam).getData();
List<String> lineIdList = deptData.stream().flatMap(x -> x.getLineIndexes().stream()).distinct().collect(Collectors.toList()); List<String> lineIdList = deptData.stream().flatMap(x -> x.getLineIndexes().stream()).distinct().collect(Collectors.toList());
if (CollUtil.isNotEmpty(lineIdList)) { if (CollUtil.isNotEmpty(lineIdList)) {
List<DeptDTO> deptList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData();
Map<String, String> deptId = deptList.stream().filter(x ->!x.getId().equals("46364ea96a55095ebc250be698d5262c") &&
!x.getId().equals("a3069759b0b6072c99cf9a7af6c162e9")).collect(Collectors.toMap(DeptDTO::getArea, DeptDTO::getId));
List<RMpPollutionDPO> pollutionList = rMpPollutionDPOMapper.selectSumList(lineIdList, param.getIds(), param.getStartTime(), param.getEndTime()); List<RMpPollutionDPO> pollutionList = rMpPollutionDPOMapper.selectSumList(lineIdList, param.getIds(), param.getStartTime(), param.getEndTime());
Map<String, Double> pollutionMap = pollutionList.stream().collect(Collectors.toMap(RMpPollutionDPO::getLineId, RMpPollutionDPO::getValue)); Map<String, Double> pollutionMap = pollutionList.stream().collect(Collectors.toMap(RMpPollutionDPO::getLineId, RMpPollutionDPO::getValue));
List<PollutionLineInfoDTO> lineDetailList = commLineClient.getPollutionLineInfo(lineIdList).getData(); List<PollutionLineInfoDTO> lineDetailList = commLineClient.getPollutionLineInfo(lineIdList).getData();
Map<String, List<PollutionLineInfoDTO>> lineDetailMap = lineDetailList.stream().collect(Collectors.groupingBy(PollutionLineInfoDTO::getActualArea)); List<String> ids = deptData.stream()
//获取部门 .filter(x -> x.getIndex().equals("46364ea96a55095ebc250be698d5262c") ||
List<DeptDTO> deptList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData(); x.getIndex().equals("a3069759b0b6072c99cf9a7af6c162e9"))
deptList.forEach(item -> { .flatMap(x -> x.getLineIndexes().stream()).collect(Collectors.toList());
if (lineDetailMap.containsKey(item.getArea())) { //获取到了部门风光储和超高压的其他部门信息
Map<String, List<String>> fgIds = lineDetailList
.stream().filter(x -> ids.contains(x.getLineId()))
.collect(Collectors.groupingBy(x -> deptId.get(x.getActualArea()), Collectors.mapping(PollutionLineInfoDTO::getLineId, Collectors.toList())));
for (GeneralDeviceDTO dto : deptData) {
if (dto.getIndex().equals("46364ea96a55095ebc250be698d5262c") ||
dto.getIndex().equals("a3069759b0b6072c99cf9a7af6c162e9")) {
break;
}
if (fgIds.containsKey(dto.getIndex())) {
dto.getLineIndexes().addAll(fgIds.get(dto.getIndex()));
}
List<PowerFlagPollution> linePollutionList = new ArrayList<>(); List<PowerFlagPollution> linePollutionList = new ArrayList<>();
AreaPollution pollution = new AreaPollution(); AreaPollution pollution = new AreaPollution();
pollution.setDeptName(item.getName()); pollution.setDeptName(dto.getName());
pollution.setDeptId(item.getId()); pollution.setDeptId(dto.getIndex());
List<PollutionLineInfoDTO> lineDetails = lineDetailMap.get(item.getArea()).stream().collect(Collectors.toList()); List<PollutionLineInfoDTO> lineDetails = lineDetailList.stream().filter(x -> dto.getLineIndexes().contains(x.getLineId())).collect(Collectors.toList());
PowerFlagPollution pollution1; PowerFlagPollution pollution1;
for (PollutionLineInfoDTO lineDetail : lineDetails) { for (PollutionLineInfoDTO lineDetail : lineDetails) {
pollution1 = new PowerFlagPollution(); pollution1 = new PowerFlagPollution();
@@ -1237,7 +1251,6 @@ public class PollutionSubstationServiceImpl extends ServiceImpl<RStatPollutionSu
pollution.setScore(NumberUtil.round(linePollutionList.stream().mapToDouble(PowerFlagPollution::getVHarmonicValue).sum(), 2).doubleValue()); pollution.setScore(NumberUtil.round(linePollutionList.stream().mapToDouble(PowerFlagPollution::getVHarmonicValue).sum(), 2).doubleValue());
info.add(pollution); info.add(pollution);
} }
});
} }
return info; return info;
} }