合并代码
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
package com.njcn.harmonic.controller.specialanalysis;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.harmonic.pojo.param.PowerQualityParam;
|
||||
import com.njcn.harmonic.pojo.vo.RMpPvPowerDetailVO;
|
||||
import com.njcn.harmonic.service.specialanalysis.DistributedPvVolOverService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
@@ -19,7 +20,6 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 专项分析-分布式光伏-电压越限分析
|
||||
@@ -48,9 +48,9 @@ public class DistributedPvVolOverController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("获取分布式光伏电压越限分析")
|
||||
@ApiImplicitParam(name = "param", value = "条件参数", required = true)
|
||||
public HttpResult<List<RMpPvPowerDetailVO>> getVoltageOutOfLimitAnalysis(@RequestBody StatisticsBizBaseParam param) {
|
||||
public HttpResult<Page<RMpPvPowerDetailVO>> getVoltageOutOfLimitAnalysis(@RequestBody PowerQualityParam param) {
|
||||
String methodDescribe = getMethodDescribe("getVoltageOutOfLimitAnalysis");
|
||||
List<RMpPvPowerDetailVO> list = distributedPvVolOverService.getVoltageOutOfLimitAnalysis(param);
|
||||
Page<RMpPvPowerDetailVO> list = distributedPvVolOverService.getVoltageOutOfLimitAnalysis(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
if (excelRpts.size() > 0){
|
||||
content = minIoUtils.getObjectUrl(minIoProperties.getBucket(), excelRpts.get(0).getContent(), 7 * 24 * 60 * 60);
|
||||
}else{
|
||||
content = analyzeReport(reportSearchParam,excelRptTemp);
|
||||
content = minIoUtils.getObjectUrl(minIoProperties.getBucket(), analyzeReport(reportSearchParam,excelRptTemp), 7 * 24 * 60 * 60);
|
||||
}
|
||||
|
||||
//拼接数据
|
||||
|
||||
@@ -10,7 +10,6 @@ import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.param.RStatHarmonicMParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicOrgM;
|
||||
import com.njcn.harmonic.mapper.StatHarmonicOrgMMapper;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicOrgQ;
|
||||
import com.njcn.harmonic.pojo.vo.RArrayVO;
|
||||
import com.njcn.harmonic.pojo.vo.RIconVO;
|
||||
import com.njcn.harmonic.pojo.vo.RStatHarmonicMVO;
|
||||
|
||||
@@ -7,14 +7,9 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.event.pojo.po.RStatEventOrgY;
|
||||
import com.njcn.harmonic.pojo.param.RStatHarmonicMParam;
|
||||
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicOrgM;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicOrgQ;
|
||||
import com.njcn.harmonic.mapper.StatHarmonicOrgQMapper;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicOrgY;
|
||||
import com.njcn.harmonic.pojo.vo.DeptLevelVO;
|
||||
import com.njcn.harmonic.pojo.vo.RArrayVO;
|
||||
import com.njcn.harmonic.pojo.vo.RIconVO;
|
||||
import com.njcn.harmonic.pojo.vo.RStatHarmonicMVO;
|
||||
|
||||
@@ -1,22 +1,17 @@
|
||||
package com.njcn.harmonic.service.majornetwork.impl;
|
||||
import java.util.Date;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.njcn.common.pojo.constant.BizParamConstant;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.event.pojo.po.RStatEventOrgY;
|
||||
import com.njcn.harmonic.mapper.StatHarmonicOrgMMapper;
|
||||
import com.njcn.harmonic.mapper.StatHarmonicOrgQMapper;
|
||||
import com.njcn.harmonic.pojo.param.RStatHarmonicMParam;
|
||||
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicOrgQ;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicOrgY;
|
||||
import com.njcn.harmonic.mapper.StatHarmonicOrgYMapper;
|
||||
import com.njcn.harmonic.pojo.vo.*;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.njcn.harmonic.service.specialanalysis;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.param.PowerQualityParam;
|
||||
import com.njcn.harmonic.pojo.vo.RMpPvPowerDetailVO;
|
||||
|
||||
import java.util.List;
|
||||
@@ -20,5 +22,5 @@ public interface DistributedPvVolOverService {
|
||||
* @author yzh
|
||||
* @date 2022/11/22
|
||||
*/
|
||||
List<RMpPvPowerDetailVO> getVoltageOutOfLimitAnalysis(StatisticsBizBaseParam param);
|
||||
Page<RMpPvPowerDetailVO> getVoltageOutOfLimitAnalysis(PowerQualityParam param);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn.harmonic.service.specialanalysis.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.device.pms.api.PwMonitorClient;
|
||||
@@ -25,6 +26,7 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -63,11 +65,15 @@ public class DistributedPvOverviewServiceImpl implements DistributedPvOverviewSe
|
||||
}
|
||||
// 取出单位
|
||||
List<String> deptIds = monitorDtoList.stream().map(PwPmsMonitorDTO::getOrgId).collect(Collectors.toList());
|
||||
Map<String, String> deptMap =
|
||||
monitorDtoList.stream()
|
||||
.collect(Collectors.toMap(PwPmsMonitorDTO::getOrgId, PwPmsMonitorDTO::getOrgName,(key1,key2)->key2));
|
||||
|
||||
// 按电压等级获取分布式光伏总览
|
||||
LambdaQueryWrapper<RStatOrgPvAreaPO> lqw = new LambdaQueryWrapper<>();
|
||||
lqw.in(RStatOrgPvAreaPO::getOrgNo, deptIds);
|
||||
lqw.ge(param.getStartTime() != null, RStatOrgPvAreaPO::getDataDate, param.getStartTime());
|
||||
lqw.le(param.getEndTime() != null, RStatOrgPvAreaPO::getDataDate, param.getEndTime());
|
||||
lqw.ge(StrUtil.isNotBlank(param.getStartTime()), RStatOrgPvAreaPO::getDataDate, param.getStartTime());
|
||||
lqw.le(StrUtil.isNotBlank(param.getEndTime()), RStatOrgPvAreaPO::getDataDate, param.getEndTime());
|
||||
List<RStatOrgPvAreaPO> poList = rStatOrgPvAreaService.list(lqw);
|
||||
if (CollUtil.isEmpty(poList)) {
|
||||
new RStatOrgPvVO();
|
||||
@@ -86,38 +92,41 @@ public class DistributedPvOverviewServiceImpl implements DistributedPvOverviewSe
|
||||
List<RStatOrgPvVO.PvPermeability> pvPermeabilityList = new ArrayList<>();
|
||||
List<RStatOrgPvVO.LowPowerFactor> lowPowerFactorList = new ArrayList<>();
|
||||
poMap.forEach((key, value) -> {
|
||||
for (RStatOrgPvAreaPO po : value) {
|
||||
// 潮流倒送
|
||||
if (areaPqEventTypeMap.get(po.getAreaPqEventType()).equals(DicDataEnum.EVENT_TYPE_U.getCode())){
|
||||
RStatOrgPvVO.FlowReversal flowReversal = new RStatOrgPvVO.FlowReversal();
|
||||
Integer monitorPointNum = po.getMonitorPointNum();
|
||||
flowReversal.setMonitor(monitorPointNum.toString());
|
||||
flowReversal.setType(key);
|
||||
flowReversalList.add(flowReversal);
|
||||
}
|
||||
// 电压越限
|
||||
if (areaPqEventTypeMap.get(po.getAreaPqEventType()).equals(DicDataEnum.EVENT_TYPE_W.getCode())){
|
||||
RStatOrgPvVO.VoltageOutOfLimit voltageOutOfLimit = new RStatOrgPvVO.VoltageOutOfLimit();
|
||||
Integer monitorPointNum = po.getMonitorPointNum();
|
||||
voltageOutOfLimit.setMonitor(monitorPointNum.toString());
|
||||
voltageOutOfLimit.setType(key);
|
||||
voltageOutOfLimitList.add(voltageOutOfLimit);
|
||||
}
|
||||
// 渗透率超上限
|
||||
if (areaPqEventTypeMap.get(po.getAreaPqEventType()).equals(DicDataEnum.PENET_LIMIT.getCode())){
|
||||
RStatOrgPvVO.PvPermeability pvPermeability = new RStatOrgPvVO.PvPermeability();
|
||||
Integer monitorPointNum = po.getMonitorPointNum();
|
||||
pvPermeability.setMonitor(monitorPointNum.toString());
|
||||
pvPermeability.setType(key);
|
||||
pvPermeabilityList.add(pvPermeability);
|
||||
}
|
||||
// 低功率因数
|
||||
if (areaPqEventTypeMap.get(po.getAreaPqEventType()).equals(DicDataEnum.EVENT_TYPE_I.getCode())){
|
||||
RStatOrgPvVO.LowPowerFactor lowPowerFactor = new RStatOrgPvVO.LowPowerFactor();
|
||||
Integer monitorPointNum = po.getMonitorPointNum();
|
||||
lowPowerFactor.setMonitor(monitorPointNum.toString());
|
||||
lowPowerFactor.setType(key);
|
||||
lowPowerFactorList.add(lowPowerFactor);
|
||||
if(deptMap.containsKey(key)){
|
||||
key=deptMap.get(key);
|
||||
for (RStatOrgPvAreaPO po : value) {
|
||||
// 潮流倒送
|
||||
if (areaPqEventTypeMap.get(po.getAreaPqEventType()).equals(DicDataEnum.EVENT_TYPE_U.getCode())){
|
||||
RStatOrgPvVO.FlowReversal flowReversal = new RStatOrgPvVO.FlowReversal();
|
||||
Integer monitorPointNum = po.getMonitorPointNum();
|
||||
flowReversal.setMonitor(monitorPointNum.toString());
|
||||
flowReversal.setType(key);
|
||||
flowReversalList.add(flowReversal);
|
||||
}
|
||||
// 电压越限
|
||||
if (areaPqEventTypeMap.get(po.getAreaPqEventType()).equals(DicDataEnum.EVENT_TYPE_W.getCode())){
|
||||
RStatOrgPvVO.VoltageOutOfLimit voltageOutOfLimit = new RStatOrgPvVO.VoltageOutOfLimit();
|
||||
Integer monitorPointNum = po.getMonitorPointNum();
|
||||
voltageOutOfLimit.setMonitor(monitorPointNum.toString());
|
||||
voltageOutOfLimit.setType(key);
|
||||
voltageOutOfLimitList.add(voltageOutOfLimit);
|
||||
}
|
||||
// 渗透率超上限
|
||||
if (areaPqEventTypeMap.get(po.getAreaPqEventType()).equals(DicDataEnum.PENET_LIMIT.getCode())){
|
||||
RStatOrgPvVO.PvPermeability pvPermeability = new RStatOrgPvVO.PvPermeability();
|
||||
Integer monitorPointNum = po.getMonitorPointNum();
|
||||
pvPermeability.setMonitor(monitorPointNum.toString());
|
||||
pvPermeability.setType(key);
|
||||
pvPermeabilityList.add(pvPermeability);
|
||||
}
|
||||
// 低功率因数
|
||||
if (areaPqEventTypeMap.get(po.getAreaPqEventType()).equals(DicDataEnum.EVENT_TYPE_I.getCode())){
|
||||
RStatOrgPvVO.LowPowerFactor lowPowerFactor = new RStatOrgPvVO.LowPowerFactor();
|
||||
Integer monitorPointNum = po.getMonitorPointNum();
|
||||
lowPowerFactor.setMonitor(monitorPointNum.toString());
|
||||
lowPowerFactor.setType(key);
|
||||
lowPowerFactorList.add(lowPowerFactor);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -149,8 +158,8 @@ public class DistributedPvOverviewServiceImpl implements DistributedPvOverviewSe
|
||||
// 按电压等级获取分布式光伏总览
|
||||
LambdaQueryWrapper<RStatOrgPvVoltagePO> lqw = new LambdaQueryWrapper<>();
|
||||
lqw.in(RStatOrgPvVoltagePO::getOrgNo, deptIds);
|
||||
lqw.ge(param.getStartTime() != null, RStatOrgPvVoltagePO::getDataDate, param.getStartTime());
|
||||
lqw.le(param.getEndTime() != null, RStatOrgPvVoltagePO::getDataDate, param.getEndTime());
|
||||
lqw.ge(StrUtil.isNotBlank(param.getStartTime()), RStatOrgPvVoltagePO::getDataDate, param.getStartTime());
|
||||
lqw.le(StrUtil.isNotBlank(param.getEndTime()), RStatOrgPvVoltagePO::getDataDate, param.getEndTime());
|
||||
List<RStatOrgPvVoltagePO> poList = rStatOrgPvVoltageService.list(lqw);
|
||||
if (CollUtil.isEmpty(poList)) {
|
||||
new RStatOrgPvVO();
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
package com.njcn.harmonic.service.specialanalysis.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.device.pms.api.PwMonitorClient;
|
||||
import com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO;
|
||||
import com.njcn.device.pms.pojo.param.PwPmsMonitorParam;
|
||||
import com.njcn.harmonic.pojo.param.PowerQualityParam;
|
||||
import com.njcn.harmonic.pojo.po.RMpPvPowerDetailMPO;
|
||||
import com.njcn.harmonic.pojo.vo.RMpPvPowerDetailVO;
|
||||
import com.njcn.harmonic.pojo.vo.RMpWpPowerDetailVO;
|
||||
import com.njcn.harmonic.service.specialanalysis.DistributedPvVolOverService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -42,37 +46,40 @@ public class DistributedPvVolOverServiceImpl implements DistributedPvVolOverServ
|
||||
* @date 2022/11/22
|
||||
*/
|
||||
@Override
|
||||
public List<RMpPvPowerDetailVO> getVoltageOutOfLimitAnalysis(StatisticsBizBaseParam param) {
|
||||
public Page<RMpPvPowerDetailVO> getVoltageOutOfLimitAnalysis(PowerQualityParam param) {
|
||||
|
||||
// 获取当前单位下的监测点信息
|
||||
PwPmsMonitorParam pwPmsMonitorParam = new PwPmsMonitorParam();
|
||||
pwPmsMonitorParam.setOrgId(param.getId());
|
||||
List<PwPmsMonitorDTO> pwMonitorList = monitorClient.getPwMonitorList(pwPmsMonitorParam).getData();
|
||||
if (CollUtil.isEmpty(pwMonitorList)) {
|
||||
return Collections.emptyList();
|
||||
return new Page<>();
|
||||
}
|
||||
// 取出监测点id
|
||||
List<String> monitorIds = pwMonitorList
|
||||
.stream().map(PwPmsMonitorDTO::getMonitorId).collect(Collectors.toList());
|
||||
if (CollUtil.isEmpty(monitorIds)) {
|
||||
return Collections.emptyList();
|
||||
return new Page<>();
|
||||
}
|
||||
// 获取电压越限分析
|
||||
LambdaQueryWrapper<RMpPvPowerDetailMPO> lqw = new LambdaQueryWrapper<>();
|
||||
lqw.in(RMpPvPowerDetailMPO::getMeasurementPointId, monitorIds);
|
||||
lqw.ge(param.getStartTime() != null, RMpPvPowerDetailMPO::getDataDate, param.getStartTime());
|
||||
lqw.le(param.getEndTime() != null, RMpPvPowerDetailMPO::getDataDate, param.getEndTime());
|
||||
List<RMpPvPowerDetailMPO> pos = rMpPvPowerDetailMService.list(lqw);
|
||||
Page<RMpPvPowerDetailMPO> pos = rMpPvPowerDetailMService.page(new Page<>(param.getPageNum(), param.getPageSize()),lqw);
|
||||
// 将监测点信息转换成map集合
|
||||
Map<String, PwPmsMonitorDTO> monitorMap = pwMonitorList.stream()
|
||||
.collect(Collectors.toMap(PwPmsMonitorDTO::getMonitorId, PwPmsMonitorDTO -> PwPmsMonitorDTO));
|
||||
// 数据赋值
|
||||
return pos.stream().map(po -> {
|
||||
List<RMpPvPowerDetailVO> infoList = pos.getRecords().stream().map(po -> {
|
||||
RMpPvPowerDetailVO vo = new RMpPvPowerDetailVO();
|
||||
BeanUtils.copyProperties(po,vo);
|
||||
BeanUtils.copyProperties(po, vo);
|
||||
vo.setMonitorSort(monitorMap.get(po.getMeasurementPointId()).getMonitorSort());
|
||||
vo.setOrgName(monitorMap.get(po.getMeasurementPointId()).getOrgName());
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
Page<RMpPvPowerDetailVO> page=BeanUtil.copyProperties(pos,Page.class);
|
||||
page.setRecords(infoList);
|
||||
return page;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user