1.数据质量统计算法->台账质量统计算法
This commit is contained in:
@@ -21,4 +21,7 @@ public class DeptGetBusBarDTO extends DeptGetBase {
|
||||
|
||||
@ApiModelProperty(name = "pwBusBarIds",value = "配网母线/线路信息")
|
||||
private List<String> pwBusBarIds;
|
||||
|
||||
@ApiModelProperty(name = "busBarIds",value = "线路/监测点id信息")
|
||||
private List<String> busBarAndMonitorIDs;
|
||||
}
|
||||
|
||||
@@ -21,4 +21,7 @@ public class DeptGetSubStationDTO extends DeptGetBase {
|
||||
|
||||
@ApiModelProperty(name = "pwStationIds",value = "配网电站信息")
|
||||
private List<String> pwStationIds;
|
||||
|
||||
@ApiModelProperty(name = "stationIds",value = "变电站/监测点信息")
|
||||
private List<String> stationAndMonitorIDs;
|
||||
}
|
||||
|
||||
@@ -20,4 +20,6 @@ public class TerminalGetBase {
|
||||
* 台账(监测点,母线,装置,电站,供电公司)id
|
||||
*/
|
||||
private String ledgerId;
|
||||
|
||||
private String lineId;
|
||||
}
|
||||
|
||||
@@ -44,17 +44,17 @@ public class RQualityParameterPO implements Serializable {
|
||||
* 监测点-母线-变电站匹配个数
|
||||
*/
|
||||
@ApiModelProperty(name = "matchingCount",value = "监测点-母线-变电站匹配个数")
|
||||
private String matchingCount;
|
||||
private Integer matchingCount;
|
||||
/**
|
||||
* 监测点-母线-变电站匹配个率
|
||||
*/
|
||||
@ApiModelProperty(name = "matchingRate",value = "监测点-母线-变电站匹配个率")
|
||||
private String matchingRate;
|
||||
private Float matchingRate;
|
||||
/**
|
||||
* 监测点台账完整率
|
||||
*/
|
||||
@ApiModelProperty(name = "monitoringIntegrityRate",value = "监测点台账完整率")
|
||||
private String monitoringIntegrityRate;
|
||||
private Float monitoringIntegrityRate;
|
||||
/**
|
||||
* 数据类型,字典表(01:主网测点 02:配网测点)
|
||||
*/
|
||||
|
||||
@@ -40,25 +40,25 @@ public class RQualityParameterVO implements Serializable {
|
||||
* 监测点数量
|
||||
*/
|
||||
@ApiModelProperty(name = "measurementCount",value = "监测点数量")
|
||||
private String measurementCount;
|
||||
private Integer measurementCount;
|
||||
|
||||
/**
|
||||
* 监测点-母线-变电站匹配个数
|
||||
*/
|
||||
@ApiModelProperty(name = "matchingCount",value = "监测点-母线-变电站匹配个数")
|
||||
private String matchingCount;
|
||||
private Integer matchingCount;
|
||||
|
||||
/**
|
||||
* 监测点-母线-变电站匹配个率
|
||||
*/
|
||||
@ApiModelProperty(name = "matchingRate",value = "监测点-母线-变电站匹配个率")
|
||||
private String matchingRate;
|
||||
private Float matchingRate;
|
||||
|
||||
/**
|
||||
* 监测点台账完整率
|
||||
*/
|
||||
@ApiModelProperty(name = "monitoringIntegrityRate",value = "监测点台账完整率")
|
||||
private String monitoringIntegrityRate;
|
||||
private Float monitoringIntegrityRate;
|
||||
|
||||
/**
|
||||
* 数据类型,字典表(01:主网测点 02:配网测点)
|
||||
|
||||
@@ -55,4 +55,13 @@ public interface PmsGeneratrixWireMapper extends MppBaseMapper<GeneratrixWire> {
|
||||
* @date 2023/5/11
|
||||
*/
|
||||
List<GeneratrixWire> getGeneratrixWireList();
|
||||
|
||||
/**
|
||||
* @Description: 监测点和线路关系
|
||||
* @param
|
||||
* @return: java.util.List<com.njcn.device.pms.pojo.po.GeneratrixWire>
|
||||
* @Author: wr
|
||||
* @Date: 2023/10/11 13:57
|
||||
*/
|
||||
List<GeneratrixWire> getWireAndMonitor();
|
||||
}
|
||||
|
||||
@@ -125,7 +125,17 @@
|
||||
on pms_generatrix_wire.Station_Id = pms_statation_stat.Power_Id
|
||||
where pms_generatrix_wire.status = 1
|
||||
</select>
|
||||
|
||||
<select id="getWireAndMonitor" resultType="com.njcn.device.pms.pojo.po.GeneratrixWire">
|
||||
SELECT
|
||||
monitor.id as id,
|
||||
monitor.Org_Id as orgId
|
||||
FROM
|
||||
pms_generatrix_wire wire
|
||||
INNER JOIN pms_statation_stat stat ON wire.Station_Id = stat.Power_Id
|
||||
INNER JOIN pms_monitor monitor ON monitor.Line_Id = wire.id
|
||||
WHERE
|
||||
wire.STATUS = 1
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -92,7 +92,7 @@ public class PwDataQualityStatServiceImpl implements PwDataQualityStatService {
|
||||
BeanUtils.copyProperties(po, vo);
|
||||
vo.setOrgName(deptDTOMap.get(vo.getOrgNo()).getName());
|
||||
vo.setMeasurementCompleteQuantity(Double.toString(
|
||||
Integer.parseInt(po.getMeasurementCount()) * Double.parseDouble(po.getMonitoringIntegrityRate())
|
||||
Integer.parseInt(po.getMeasurementCount()) * po.getMonitoringIntegrityRate()
|
||||
));
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
@@ -17,6 +17,8 @@ import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.biz.utils.COverlimitUtil;
|
||||
import com.njcn.device.pms.mapper.majornetwork.*;
|
||||
import com.njcn.device.pms.pojo.dto.PmsMonitorBaseDTO;
|
||||
import com.njcn.device.pms.pojo.dto.PmsStatationStatInfoDTO;
|
||||
import com.njcn.device.pms.pojo.param.PmsStatationStatInfoParam;
|
||||
import com.njcn.device.pms.pojo.po.*;
|
||||
import com.njcn.device.pms.service.ledgerManger.DeptLineService;
|
||||
import com.njcn.device.pms.service.ledgerManger.CommTerminalService;
|
||||
@@ -174,6 +176,10 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
List<StatationStat> statationStatList = statationStatMapper.selectList(new LambdaQueryWrapper<StatationStat>().eq(StatationStat::getStatus, 1));
|
||||
Map<String, List<StatationStat>> map = statationStatList.stream().collect(Collectors.groupingBy(StatationStat::getOrgId));
|
||||
|
||||
//获取监测点信息
|
||||
List<PmsStatationStatInfoDTO> statationStatInfo = statationStatMapper.getStatationStatInfo(new PmsStatationStatInfoParam());
|
||||
Map<String, List<PmsStatationStatInfoDTO>> statationAndMonitorMap = statationStatInfo.stream().collect(Collectors.groupingBy(PmsStatationStatInfoDTO::getOrgId));
|
||||
|
||||
//List<PmsMonitorBaseDTO> pmsMonitorBaseDTOList = distributionMonitorMapper.getDisMonitorAllList(null, 0);
|
||||
//Map<String, List<PmsMonitorBaseDTO>> mapPms = pmsMonitorBaseDTOList.stream().collect(Collectors.groupingBy(PmsMonitorBaseDTO::getOrgId));
|
||||
|
||||
@@ -187,15 +193,21 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
if (CollectionUtil.isNotEmpty(deptIds)) {
|
||||
List<String> lineList = new ArrayList<>();
|
||||
List<String> lineListPw = new ArrayList<>();
|
||||
List<String> statationList = new ArrayList<>();
|
||||
deptIds.forEach(i -> {
|
||||
if (map.containsKey(i)) {
|
||||
lineList.addAll(map.get(i).stream().map(StatationStat::getPowerId).distinct().collect(Collectors.toList()));
|
||||
|
||||
}
|
||||
if(statationAndMonitorMap.containsKey(i)){
|
||||
statationList.addAll(statationAndMonitorMap.get(i).stream().filter(x->x.getPowerId()!=null).map(PmsStatationStatInfoDTO::getMonitorId).collect(Collectors.toList()));
|
||||
}
|
||||
/*if (mapPms.containsKey(i)) {
|
||||
lineListPw.addAll(mapPms.get(i).stream().map(PmsMonitorBaseDTO::getPowerrId).distinct().collect(Collectors.toList()));
|
||||
}*/
|
||||
});
|
||||
deptGetSubStationDTO.setStationIds(lineList.stream().distinct().collect(Collectors.toList()));
|
||||
deptGetSubStationDTO.setStationAndMonitorIDs(statationList.stream().distinct().collect(Collectors.toList()));
|
||||
deptGetSubStationDTO.setPwStationIds(lineListPw.stream().distinct().collect(Collectors.toList()));
|
||||
|
||||
}
|
||||
@@ -212,6 +224,10 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
List<GeneratrixWire> generatrixWireList = pmsGeneratrixWireMapper.getGeneratrixWireList();
|
||||
Map<String, List<GeneratrixWire>> map = generatrixWireList.stream().collect(Collectors.groupingBy(GeneratrixWire::getOrgId));
|
||||
|
||||
//获取主网,线路和监测点关系个数
|
||||
List<GeneratrixWire> wireAndMonitor = pmsGeneratrixWireMapper.getWireAndMonitor();
|
||||
Map<String, List<GeneratrixWire>> wireAndMonitorMap = wireAndMonitor.stream().collect(Collectors.groupingBy(GeneratrixWire::getOrgId));
|
||||
|
||||
/*List<PmsMonitorBaseDTO> pmsMonitorBaseDTOList = distributionMonitorMapper.getDisMonitorAllList(null, 0);
|
||||
Map<String, List<PmsMonitorBaseDTO>> mapPms = pmsMonitorBaseDTOList.stream().collect(Collectors.groupingBy(PmsMonitorBaseDTO::getOrgId));
|
||||
*/
|
||||
@@ -225,15 +241,20 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
if (CollectionUtil.isNotEmpty(deptIds)) {
|
||||
List<String> lineList = new ArrayList<>();
|
||||
List<String> lineListPw = new ArrayList<>();
|
||||
List<String> wireAndMonitorList = new ArrayList<>();
|
||||
deptIds.forEach(i -> {
|
||||
if (map.containsKey(i)) {
|
||||
lineList.addAll(map.get(i).stream().map(GeneratrixWire::getId).collect(Collectors.toList()));
|
||||
}
|
||||
if(wireAndMonitorMap.containsKey(i)){
|
||||
wireAndMonitorList.addAll(wireAndMonitorMap.get(i).stream().map(GeneratrixWire::getId).collect(Collectors.toList()));
|
||||
}
|
||||
/* if (mapPms.containsKey(i)) {
|
||||
lineListPw.addAll(mapPms.get(i).stream().map(PmsMonitorBaseDTO::getLineId).collect(Collectors.toList()));
|
||||
}*/
|
||||
});
|
||||
deptGetBusBarDTO.setBusBarIds(lineList);
|
||||
deptGetBusBarDTO.setBusBarAndMonitorIDs(wireAndMonitorList);
|
||||
deptGetBusBarDTO.setPwBusBarIds(lineListPw);
|
||||
}
|
||||
result.add(deptGetBusBarDTO);
|
||||
|
||||
@@ -72,9 +72,12 @@ public class ROperatingIndexMServiceImpl extends ServiceImpl<ROperatingIndexMMap
|
||||
//在线监测率
|
||||
Integer measurementRunPoints = item.getMeasurementRunPoints(); //监测点数
|
||||
Integer transitMeasurementPoints = item.getTransitMeasurementPoints(); //在线监测点数
|
||||
Double transitMeasurementRate = Double.parseDouble(df.format(transitMeasurementPoints / (measurementRunPoints * 1.0) * 100));
|
||||
rOperatingIndexCommonVO.setTransitMeasurementRate(transitMeasurementRate); //在线监测率
|
||||
|
||||
if(transitMeasurementPoints!=null&&transitMeasurementPoints!=0){
|
||||
Double transitMeasurementRate = Double.parseDouble(df.format(transitMeasurementPoints / (measurementRunPoints * 1.0) * 100));
|
||||
rOperatingIndexCommonVO.setTransitMeasurementRate(transitMeasurementRate); //在线监测率
|
||||
}else{
|
||||
rOperatingIndexCommonVO.setTransitMeasurementRate(0.0);
|
||||
}
|
||||
return rOperatingIndexCommonVO;
|
||||
}).collect(Collectors.toList());
|
||||
return resultList;
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
DISTINCT
|
||||
pq_dept_line.id unitId,
|
||||
dic.value voltageLevel,
|
||||
voltage.id pointId
|
||||
|
||||
voltage.id pointId,
|
||||
point.id devId
|
||||
</if>
|
||||
<!--装置-->
|
||||
<if test="type == 3">
|
||||
@@ -73,7 +73,8 @@
|
||||
select
|
||||
DISTINCT
|
||||
pq_dept_line.id unitId,
|
||||
substation.id ledgerId
|
||||
substation.id ledgerId,
|
||||
point.id lineId
|
||||
from pq_dept_line pq_dept_line
|
||||
inner join pq_line point on pq_dept_line.line_id = point.id
|
||||
inner join pq_line_detail lineDetail on point.id = lineDetail.id
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.device.pq.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||
import com.njcn.device.biz.pojo.dto.TerminalGetBase;
|
||||
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
import com.njcn.web.pojo.param.DeptLineParam;
|
||||
|
||||
@@ -89,7 +90,7 @@ public interface DeptLineService extends IService<DeptLine> {
|
||||
* @author cdf
|
||||
* @date 2023/5/10
|
||||
*/
|
||||
Map<String, List<String>> orgSubStationGet(List<Integer> devType);
|
||||
Map<String, List<TerminalGetBase>> orgSubStationGet(List<Integer> devType);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -115,7 +115,7 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
public List<DeptGetSubStationDTO> deptSubStation(DeptGetLineParam deptGetLineParam) {
|
||||
List<DeptGetSubStationDTO> result = new ArrayList<>();
|
||||
List<DeptGetBase> temDept = getDeptChildrenByParent(deptGetLineParam);
|
||||
Map<String, List<String>> map = deptLineService.orgSubStationGet(filterDataTypeNew(deptGetLineParam.getServerName()));
|
||||
Map<String, List<TerminalGetBase>> map = deptLineService.orgSubStationGet(filterDataTypeNew(deptGetLineParam.getServerName()));
|
||||
temDept.forEach(item -> {
|
||||
DeptGetSubStationDTO deptGetSubStationDTO = new DeptGetSubStationDTO();
|
||||
deptGetSubStationDTO.setUnitId(item.getUnitId());
|
||||
@@ -123,13 +123,16 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
deptGetSubStationDTO.setUnitChildrenList(item.getUnitChildrenList());
|
||||
List<String> deptIds = item.getUnitChildrenList();
|
||||
if (CollectionUtil.isNotEmpty(deptIds)) {
|
||||
List<String> subList = new ArrayList<>();
|
||||
List<String> lineList = new ArrayList<>();
|
||||
deptIds.forEach(i -> {
|
||||
if (map.containsKey(i)) {
|
||||
lineList.addAll(map.get(i));
|
||||
subList.addAll(map.get(i).stream().map(TerminalGetBase::getLedgerId).collect(Collectors.toList()));
|
||||
lineList.addAll(map.get(i).stream().map(TerminalGetBase::getLineId).collect(Collectors.toList()));
|
||||
}
|
||||
});
|
||||
deptGetSubStationDTO.setStationIds(lineList);
|
||||
deptGetSubStationDTO.setStationIds(subList);
|
||||
deptGetSubStationDTO.setStationAndMonitorIDs(lineList);
|
||||
}
|
||||
result.add(deptGetSubStationDTO);
|
||||
});
|
||||
@@ -148,13 +151,16 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
deptGetBusBarDTO.setUnitChildrenList(item.getUnitChildrenList());
|
||||
List<String> deptIds = item.getUnitChildrenList();
|
||||
if (CollectionUtil.isNotEmpty(deptIds)) {
|
||||
List<String> busBarList = new ArrayList<>();
|
||||
List<String> lineList = new ArrayList<>();
|
||||
deptIds.forEach(i -> {
|
||||
if (map.containsKey(i)) {
|
||||
lineList.addAll(map.get(i).stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList()));
|
||||
busBarList.addAll(map.get(i).stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList()));
|
||||
lineList.addAll(map.get(i).stream().map(LineDevGetDTO::getDevId).collect(Collectors.toList()));
|
||||
}
|
||||
});
|
||||
deptGetBusBarDTO.setBusBarIds(lineList);
|
||||
deptGetBusBarDTO.setBusBarIds(busBarList);
|
||||
deptGetBusBarDTO.setBusBarAndMonitorIDs(lineList);
|
||||
}
|
||||
result.add(deptGetBusBarDTO);
|
||||
});
|
||||
|
||||
@@ -99,9 +99,9 @@ public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> i
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<String>> orgSubStationGet(List<Integer> devDataType) {
|
||||
public Map<String, List<TerminalGetBase>> orgSubStationGet(List<Integer> devDataType) {
|
||||
List<TerminalGetBase> deptLines = deptLineMapper.orgSubStationGet(devDataType);
|
||||
return deptLines.stream ().collect (Collectors.groupingBy (TerminalGetBase::getUnitId, Collectors.mapping (TerminalGetBase::getLedgerId,Collectors.toList ())));
|
||||
return deptLines.stream ().collect (Collectors.groupingBy (TerminalGetBase::getUnitId));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user