|
|
|
|
@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
import com.njcn.device.biz.pojo.dto.DeptGetChildrenMoreDTO;
|
|
|
|
|
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
|
|
|
|
import com.njcn.device.pms.api.MonitorClient;
|
|
|
|
|
import com.njcn.device.pms.pojo.po.Monitor;
|
|
|
|
|
import com.njcn.harmonic.pojo.po.RMpPartHarmonicDetailD;
|
|
|
|
|
import com.njcn.harmonic.pojo.po.RMpSurplusHarmonicDetailD;
|
|
|
|
|
import com.njcn.harmonic.pojo.po.send.PqTypicalSourceCreatePO;
|
|
|
|
|
@@ -18,9 +20,11 @@ import com.njcn.prepare.harmonic.pojo.mysql.ROperatingMonitorDPO;
|
|
|
|
|
import com.njcn.prepare.harmonic.service.mysql.line.ROperatingMonitorService;
|
|
|
|
|
import com.njcn.prepare.harmonic.service.mysql.send.PqTypicalSourceCreatePOService;
|
|
|
|
|
import com.njcn.system.api.DicDataFeignClient;
|
|
|
|
|
import com.njcn.system.api.DictTreeFeignClient;
|
|
|
|
|
import com.njcn.system.enums.DicDataEnum;
|
|
|
|
|
import com.njcn.system.enums.DicDataTypeEnum;
|
|
|
|
|
import com.njcn.system.pojo.po.DictData;
|
|
|
|
|
import com.njcn.system.pojo.po.SysDicTreePO;
|
|
|
|
|
import com.njcn.user.api.DeptFeignClient;
|
|
|
|
|
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
@@ -36,6 +40,7 @@ import java.util.Map;
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
import java.util.function.Function;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
import java.util.stream.Stream;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
@@ -51,6 +56,8 @@ public class PqTypicalSourceCreatePOServiceImpl extends ServiceImpl<PqTypicalSou
|
|
|
|
|
|
|
|
|
|
private final DeptFeignClient deptFeignClient;
|
|
|
|
|
private final DicDataFeignClient dicDataFeignClient;
|
|
|
|
|
private final MonitorClient monitorClient;
|
|
|
|
|
private final DictTreeFeignClient dictTreeFeignClient;
|
|
|
|
|
|
|
|
|
|
private final RMpPartHarmonicDetailDMapper rMpPartHarmonicDetailDMapper;
|
|
|
|
|
private final RMpSurplusHarmonicDetailDMapper rMpSurplusHarmonicDetailDMapper;
|
|
|
|
|
@@ -73,114 +80,168 @@ public class PqTypicalSourceCreatePOServiceImpl extends ServiceImpl<PqTypicalSou
|
|
|
|
|
|
|
|
|
|
QueryWrapper<RMpPartHarmonicDetailD> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
QueryWrapper<RMpSurplusHarmonicDetailD> rMpSurplusHarmonicDetailDQueryWrapper = new QueryWrapper<>();
|
|
|
|
|
List<SysDicTreePO> sysdictreepo = dictTreeFeignClient.queryAll().getData();
|
|
|
|
|
List<String> other_interferencesource_users = Stream.of(DicDataEnum.SEMICONDUCTOR_MANUFACTURING.getCode(),
|
|
|
|
|
DicDataEnum.PRECISION_MACHINING.getCode(),
|
|
|
|
|
DicDataEnum.PARTY_GOVERNMENT.getCode(),
|
|
|
|
|
DicDataEnum.NOSOCOMIUM.getCode(),
|
|
|
|
|
DicDataEnum.TRANSPORTATION_HUB.getCode(),
|
|
|
|
|
DicDataEnum.AERODROME.getCode(),
|
|
|
|
|
DicDataEnum.FINANCE.getCode(),
|
|
|
|
|
DicDataEnum.DATA_CENTER.getCode(),
|
|
|
|
|
DicDataEnum.HAZARDOUS_CHEMICALS.getCode(),
|
|
|
|
|
DicDataEnum.EXPLOSIVE_PRODUCTS.getCode(),
|
|
|
|
|
DicDataEnum.LARGEVENUE.getCode()
|
|
|
|
|
).collect(Collectors.toList());
|
|
|
|
|
List<String> windfarm_user = Stream.of(
|
|
|
|
|
DicDataEnum.WINDPOWER_STATION.getCode()).collect(Collectors.toList());
|
|
|
|
|
List<String> photovoltaicsit_eusers = Stream.of(
|
|
|
|
|
DicDataEnum.PHOTOVOLTAIC_POWER_STATION.getCode()).collect(Collectors.toList());
|
|
|
|
|
List<String> tractionstation = Stream.of(
|
|
|
|
|
DicDataEnum.ELECTRIFIED_RAILWAY.getCode()).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
/*3.45 典型源荷用户类型*/
|
|
|
|
|
List<String> collect = Stream.of(DicDataEnum.TRACTIONSTATION.getCode(),
|
|
|
|
|
DicDataEnum.WINDFARM_USER.getCode(),
|
|
|
|
|
DicDataEnum.PHOTOVOLTAICSIT_EUSERS.getCode(),
|
|
|
|
|
DicDataEnum.OTHER_INTERFERENCESOURCE_USERS.getCode()).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
List<SysDicTreePO> other_interferencesource_users_dict = sysdictreepo.stream().filter(temp -> other_interferencesource_users.contains(temp.getCode())).collect(Collectors.toList());
|
|
|
|
|
List<SysDicTreePO> windfarm_user_dict = sysdictreepo.stream().filter(temp -> windfarm_user.contains(temp.getCode())).collect(Collectors.toList());
|
|
|
|
|
List<SysDicTreePO> photovoltaicsit_eusers_dict = sysdictreepo.stream().filter(temp -> photovoltaicsit_eusers.contains(temp.getCode())).collect(Collectors.toList());
|
|
|
|
|
List<SysDicTreePO> tractionstation_dict = sysdictreepo.stream().filter(temp -> tractionstation.contains(temp.getCode())).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<PvTerminalTreeVO> deptList = deptFeignClient.allDeptList().getData();
|
|
|
|
|
Map<String, PvTerminalTreeVO> mapCode = deptList.stream().collect(Collectors.toMap(PvTerminalTreeVO::getCode, Function.identity()));
|
|
|
|
|
Map<String, PvTerminalTreeVO> mapList = deptList.stream().collect(Collectors.toMap(PvTerminalTreeVO::getId, Function.identity()));
|
|
|
|
|
List<DictData> indicatorTypeDate = dicDataFeignClient.getDicDataByTypeCode(
|
|
|
|
|
DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
|
|
|
|
|
// List<DictData> indicatorTypeDate = dicDataFeignClient.getDicDataByTypeCode(
|
|
|
|
|
// DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
|
|
|
|
|
|
|
|
|
|
List<DictData> supvVoltageDicList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData();
|
|
|
|
|
Map<String, DictData> mapVoltage = supvVoltageDicList.stream().collect(Collectors.toMap(DictData::getId, Function.identity()));
|
|
|
|
|
for (DeptGetChildrenMoreDTO deptGetChildrenMoreDTO : calculatedParam.getIdList()) {
|
|
|
|
|
List<String> collect1 = deptGetChildrenMoreDTO.getLineBaseList().stream().filter(temp->Objects.equals(temp.getIsUpToGrid(),1)).map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//站内有效监测点数量
|
|
|
|
|
Integer effectiveMonitorNum;
|
|
|
|
|
|
|
|
|
|
List<RMpPartHarmonicDetailD> rMpPartHarmonicDetailDS;
|
|
|
|
|
List<RMpSurplusHarmonicDetailD> rMpSurplusHarmonicDetailDS;
|
|
|
|
|
List<Monitor> monitorList;
|
|
|
|
|
if (!CollectionUtils.isEmpty(collect1)) {
|
|
|
|
|
List<ROperatingMonitorDPO> list = rOperatingMonitorService.lambdaQuery().
|
|
|
|
|
in(ROperatingMonitorDPO::getMeasurementPointId, collect1).
|
|
|
|
|
eq(ROperatingMonitorDPO::getDataDate, calculatedParam.getDataDate()).
|
|
|
|
|
ge(ROperatingMonitorDPO::getDataIntegrityRate, 0.95).
|
|
|
|
|
eq(ROperatingMonitorDPO::getIsUnusual, 1).list();
|
|
|
|
|
effectiveMonitorNum = list.size();
|
|
|
|
|
|
|
|
|
|
queryWrapper.clear();
|
|
|
|
|
queryWrapper.
|
|
|
|
|
in("measurement_point_id",collect1).
|
|
|
|
|
eq("data_date",localDate);
|
|
|
|
|
rMpPartHarmonicDetailDS = rMpPartHarmonicDetailDMapper.selectList(queryWrapper);
|
|
|
|
|
|
|
|
|
|
rMpSurplusHarmonicDetailDQueryWrapper.clear();
|
|
|
|
|
rMpSurplusHarmonicDetailDQueryWrapper.
|
|
|
|
|
in("measurement_point_id",collect1).
|
|
|
|
|
eq("data_date",localDate);
|
|
|
|
|
rMpSurplusHarmonicDetailDS = rMpSurplusHarmonicDetailDMapper.selectList(rMpSurplusHarmonicDetailDQueryWrapper);
|
|
|
|
|
|
|
|
|
|
monitorList = monitorClient.getMonitorList(collect1).getData();
|
|
|
|
|
} else {
|
|
|
|
|
rMpSurplusHarmonicDetailDS = new ArrayList<>();
|
|
|
|
|
rMpPartHarmonicDetailDS = new ArrayList<>();
|
|
|
|
|
effectiveMonitorNum = 0;
|
|
|
|
|
monitorList = new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// rStatOrgDPOQueryWrapper.clear();
|
|
|
|
|
// rStatOrgDPOQueryWrapper.select("effective_measurement").
|
|
|
|
|
// eq("org_no",deptGetChildrenMoreDTO.getUnitId()).
|
|
|
|
|
// eq("data_type",dataTypeMap.get(DicDataEnum.MAINNET_POINT.getCode()).getId()).
|
|
|
|
|
// eq("data_date",localDate);
|
|
|
|
|
// RStatOrgDPO rStatOrgDPO = rStatOrgDMapper.selectOne(rStatOrgDPOQueryWrapper);
|
|
|
|
|
collect.stream().forEach(temp->{
|
|
|
|
|
PqTypicalSourceCreatePO pqTypicalSourceCreatePO = new PqTypicalSourceCreatePO();
|
|
|
|
|
|
|
|
|
|
indicatorTypeDate.forEach(dictData -> {
|
|
|
|
|
if(Objects.equals(dictData.getCode(), DicDataEnum.HARMONIC_VOLTAGE.getCode())||
|
|
|
|
|
Objects.equals(dictData.getCode(), DicDataEnum.FLICKER.getCode())||
|
|
|
|
|
Objects.equals(dictData.getCode(), DicDataEnum.phase_Voltage.getCode())||
|
|
|
|
|
// Objects.equals(dictData.getCode(), DicDataEnum.HARMONIC_CURRENT.getCode())||
|
|
|
|
|
Objects.equals(dictData.getCode(), DicDataEnum.NEG_CURRENT.getCode()
|
|
|
|
|
)){
|
|
|
|
|
PqTypicalSourceCreatePO pqTypicalSourceCreatePO = new PqTypicalSourceCreatePO();
|
|
|
|
|
pqTypicalSourceCreatePO = initPqTypicalSourceCreatePO(pqTypicalSourceCreatePO,dictData.getCode(),rMpPartHarmonicDetailDS,rMpSurplusHarmonicDetailDS,collect1.size());
|
|
|
|
|
pqTypicalSourceCreatePO.setStatisticalDate(calculatedParam.getDataDate());
|
|
|
|
|
pqTypicalSourceCreatePO.setStatisticalType("03");
|
|
|
|
|
List<Monitor> tempList = new ArrayList<>();
|
|
|
|
|
if (temp.equals(DicDataEnum.TRACTIONSTATION.getCode())){
|
|
|
|
|
List<String> idList = tractionstation_dict.stream().map(SysDicTreePO::getId).collect(Collectors.toList());
|
|
|
|
|
tempList = monitorList.stream().filter(tempmonitor -> idList.contains(tempmonitor.getObjType())).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
pqTypicalSourceCreatePO.setMonitorNum(effectiveMonitorNum);
|
|
|
|
|
pqTypicalSourceCreatePO.setMonitoringRate(divideAndRound(effectiveMonitorNum,collect1.size()));
|
|
|
|
|
} else if (temp.equals(DicDataEnum.WINDFARM_USER.getCode())) {
|
|
|
|
|
List<String> idList = windfarm_user_dict.stream().map(SysDicTreePO::getId).collect(Collectors.toList());
|
|
|
|
|
tempList = monitorList.stream().filter(tempmonitor -> idList.contains(tempmonitor.getObjType())).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
}else if(temp.equals(DicDataEnum.PHOTOVOLTAICSIT_EUSERS.getCode())) {
|
|
|
|
|
List<String> idList = photovoltaicsit_eusers_dict.stream().map(SysDicTreePO::getId).collect(Collectors.toList());
|
|
|
|
|
tempList = monitorList.stream().filter(tempmonitor -> idList.contains(tempmonitor.getObjType())).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
if (mapCode.containsKey(deptGetChildrenMoreDTO.getUnitId())) {
|
|
|
|
|
PvTerminalTreeVO pvTerminalTreeVO = mapCode.get(deptGetChildrenMoreDTO.getUnitId());
|
|
|
|
|
String[] split = (pvTerminalTreeVO.getPids() + StrUtil.COMMA + pvTerminalTreeVO.getId())
|
|
|
|
|
.split(StrUtil.COMMA);
|
|
|
|
|
if (split.length <3) {
|
|
|
|
|
return;
|
|
|
|
|
}else if(temp.equals(DicDataEnum.OTHER_INTERFERENCESOURCE_USERS.getCode())) {
|
|
|
|
|
List<String> idList = other_interferencesource_users_dict.stream().map(SysDicTreePO::getId).collect(Collectors.toList());
|
|
|
|
|
tempList = monitorList.stream().filter(tempmonitor -> idList.contains(tempmonitor.getObjType())).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(CollectionUtils.isEmpty(tempList)){
|
|
|
|
|
return;
|
|
|
|
|
}else {
|
|
|
|
|
//电站等级
|
|
|
|
|
if (mapVoltage.containsKey(tempList.get(0).getVoltageLevel())) {
|
|
|
|
|
pqTypicalSourceCreatePO.setVoltageLevel(String.format("%02d", mapVoltage.get(tempList.get(0).getVoltageLevel()).getAlgoDescribe()));
|
|
|
|
|
pqTypicalSourceCreatePO.setIndustryType("01");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
List<String> monitorIds = tempList.stream().map(Monitor::getId).collect(Collectors.toList());
|
|
|
|
|
//站内有效监测点数量
|
|
|
|
|
Integer effectiveMonitorNum;
|
|
|
|
|
|
|
|
|
|
List<RMpPartHarmonicDetailD> rMpPartHarmonicDetailDS;
|
|
|
|
|
List<RMpSurplusHarmonicDetailD> rMpSurplusHarmonicDetailDS;
|
|
|
|
|
if (!CollectionUtils.isEmpty(monitorIds)) {
|
|
|
|
|
List<ROperatingMonitorDPO> list = rOperatingMonitorService.lambdaQuery().
|
|
|
|
|
in(ROperatingMonitorDPO::getMeasurementPointId, monitorIds).
|
|
|
|
|
eq(ROperatingMonitorDPO::getDataDate, calculatedParam.getDataDate()).
|
|
|
|
|
ge(ROperatingMonitorDPO::getDataIntegrityRate, 0.95).
|
|
|
|
|
eq(ROperatingMonitorDPO::getIsUnusual, 1).list();
|
|
|
|
|
effectiveMonitorNum = list.size();
|
|
|
|
|
|
|
|
|
|
queryWrapper.clear();
|
|
|
|
|
queryWrapper.
|
|
|
|
|
in("measurement_point_id",monitorIds).
|
|
|
|
|
eq("data_date",localDate);
|
|
|
|
|
rMpPartHarmonicDetailDS = rMpPartHarmonicDetailDMapper.selectList(queryWrapper);
|
|
|
|
|
|
|
|
|
|
rMpSurplusHarmonicDetailDQueryWrapper.clear();
|
|
|
|
|
rMpSurplusHarmonicDetailDQueryWrapper.
|
|
|
|
|
in("measurement_point_id",monitorIds).
|
|
|
|
|
eq("data_date",localDate);
|
|
|
|
|
rMpSurplusHarmonicDetailDS = rMpSurplusHarmonicDetailDMapper.selectList(rMpSurplusHarmonicDetailDQueryWrapper);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
rMpSurplusHarmonicDetailDS = new ArrayList<>();
|
|
|
|
|
rMpPartHarmonicDetailDS = new ArrayList<>();
|
|
|
|
|
effectiveMonitorNum = 0;
|
|
|
|
|
}
|
|
|
|
|
pqTypicalSourceCreatePO = initPqTypicalSourceCreatePO(pqTypicalSourceCreatePO,rMpPartHarmonicDetailDS,rMpSurplusHarmonicDetailDS,collect1.size());
|
|
|
|
|
pqTypicalSourceCreatePO.setIndexType(temp);
|
|
|
|
|
pqTypicalSourceCreatePO.setStatisticalDate(calculatedParam.getDataDate());
|
|
|
|
|
pqTypicalSourceCreatePO.setStatisticalType("03");
|
|
|
|
|
pqTypicalSourceCreatePO.setMonitorNum(effectiveMonitorNum);
|
|
|
|
|
pqTypicalSourceCreatePO.setMonitorCount(effectiveMonitorNum);
|
|
|
|
|
pqTypicalSourceCreatePO.setMonitoringRate(divideAndRound(effectiveMonitorNum,collect1.size()));
|
|
|
|
|
if (mapCode.containsKey(deptGetChildrenMoreDTO.getUnitId())) {
|
|
|
|
|
PvTerminalTreeVO pvTerminalTreeVO = mapCode.get(deptGetChildrenMoreDTO.getUnitId());
|
|
|
|
|
String[] split = (pvTerminalTreeVO.getPids() + StrUtil.COMMA + pvTerminalTreeVO.getId())
|
|
|
|
|
.split(StrUtil.COMMA);
|
|
|
|
|
if (split.length <3) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (int i = 2; i < split.length; i++) {
|
|
|
|
|
//省
|
|
|
|
|
if (i == 2) {
|
|
|
|
|
if (mapList.containsKey(split[i])) {
|
|
|
|
|
pvTerminalTreeVO = mapList.get(split[i]);
|
|
|
|
|
pqTypicalSourceCreatePO.setProvinceName(pvTerminalTreeVO.getName());
|
|
|
|
|
pqTypicalSourceCreatePO.setProvinceId(pvTerminalTreeVO.getCode());
|
|
|
|
|
pqTypicalSourceCreatePO.setStatisticalLevel("3");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//市
|
|
|
|
|
if (i == 3) {
|
|
|
|
|
if (mapList.containsKey(split[i])) {
|
|
|
|
|
pvTerminalTreeVO = mapList.get(split[i]);
|
|
|
|
|
pqTypicalSourceCreatePO.setCityName(pvTerminalTreeVO.getName());
|
|
|
|
|
pqTypicalSourceCreatePO.setCityId(pvTerminalTreeVO.getCode());
|
|
|
|
|
pqTypicalSourceCreatePO.setStatisticalLevel("4");
|
|
|
|
|
|
|
|
|
|
for (int i = 2; i < split.length; i++) {
|
|
|
|
|
//省
|
|
|
|
|
if (i == 2) {
|
|
|
|
|
if (mapList.containsKey(split[i])) {
|
|
|
|
|
pvTerminalTreeVO = mapList.get(split[i]);
|
|
|
|
|
pqTypicalSourceCreatePO.setProvinceName(pvTerminalTreeVO.getName());
|
|
|
|
|
pqTypicalSourceCreatePO.setProvinceId(pvTerminalTreeVO.getCode());
|
|
|
|
|
pqTypicalSourceCreatePO.setStatisticalLevel("3");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//市
|
|
|
|
|
if (i == 3) {
|
|
|
|
|
if (mapList.containsKey(split[i])) {
|
|
|
|
|
pvTerminalTreeVO = mapList.get(split[i]);
|
|
|
|
|
pqTypicalSourceCreatePO.setCityName(pvTerminalTreeVO.getName());
|
|
|
|
|
pqTypicalSourceCreatePO.setCityId(pvTerminalTreeVO.getCode());
|
|
|
|
|
pqTypicalSourceCreatePO.setStatisticalLevel("4");
|
|
|
|
|
}
|
|
|
|
|
//县
|
|
|
|
|
if (i == 4) {
|
|
|
|
|
if (mapList.containsKey(split[i])) {
|
|
|
|
|
pvTerminalTreeVO = mapList.get(split[i]);
|
|
|
|
|
pqTypicalSourceCreatePO.setCountyName(pvTerminalTreeVO.getName());
|
|
|
|
|
pqTypicalSourceCreatePO.setCountyId(pvTerminalTreeVO.getCode());
|
|
|
|
|
pqTypicalSourceCreatePO.setStatisticalLevel("5");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//县
|
|
|
|
|
if (i == 4) {
|
|
|
|
|
if (mapList.containsKey(split[i])) {
|
|
|
|
|
pvTerminalTreeVO = mapList.get(split[i]);
|
|
|
|
|
pqTypicalSourceCreatePO.setCountyName(pvTerminalTreeVO.getName());
|
|
|
|
|
pqTypicalSourceCreatePO.setCountyId(pvTerminalTreeVO.getCode());
|
|
|
|
|
pqTypicalSourceCreatePO.setStatisticalLevel("5");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
pqTypicalSourceCreatePO.setId(deptGetChildrenMoreDTO.getUnitId()+"-"+pqTypicalSourceCreatePO.getIndexType()+"-"+calculatedParam.getDataDate());
|
|
|
|
|
pqTypicalSourceCreatePOList.add(pqTypicalSourceCreatePO);
|
|
|
|
|
}
|
|
|
|
|
pqTypicalSourceCreatePO.setId(deptGetChildrenMoreDTO.getUnitId()+"-"+pqTypicalSourceCreatePO.getIndexType()+"-"+calculatedParam.getDataDate());
|
|
|
|
|
pqTypicalSourceCreatePOList.add(pqTypicalSourceCreatePO);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -190,8 +251,9 @@ public class PqTypicalSourceCreatePOServiceImpl extends ServiceImpl<PqTypicalSou
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private PqTypicalSourceCreatePO initPqTypicalSourceCreatePO(PqTypicalSourceCreatePO pqTypicalSourceCreatePO,
|
|
|
|
|
String code,
|
|
|
|
|
// String code,
|
|
|
|
|
List<RMpPartHarmonicDetailD> rMpPartHarmonicDetailDS,
|
|
|
|
|
List<RMpSurplusHarmonicDetailD> rMpSurplusHarmonicDetailDS,
|
|
|
|
|
int count) {
|
|
|
|
|
@@ -231,44 +293,45 @@ public class PqTypicalSourceCreatePOServiceImpl extends ServiceImpl<PqTypicalSou
|
|
|
|
|
pqTypicalSourceCreatePO.setAverageOvDays(initialvalue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Objects.equals(code,DicDataEnum.FLICKER.getCode())) {
|
|
|
|
|
pqTypicalSourceCreatePO.setIndexType("02");
|
|
|
|
|
int value = Integer.valueOf(rMpSurplusHarmonicDetailDS.stream().filter(temp ->temp.getIsFlicker()==1).count()+"");
|
|
|
|
|
pqTypicalSourceCreatePO.setFlickerOvNum(value);
|
|
|
|
|
pqTypicalSourceCreatePO.setFlickerOvRate(divideAndRound(value,count));
|
|
|
|
|
pqTypicalSourceCreatePO.setFlickerAvgOvRate(divideAndRound(value,count));
|
|
|
|
|
int flickervalue = Integer.valueOf(rMpSurplusHarmonicDetailDS.stream().filter(temp ->temp.getIsFlicker()==1).count()+"");
|
|
|
|
|
pqTypicalSourceCreatePO.setFlickerOvNum(flickervalue);
|
|
|
|
|
pqTypicalSourceCreatePO.setFlickerOvRate(divideAndRound(flickervalue,count));
|
|
|
|
|
pqTypicalSourceCreatePO.setFlickerAvgOvRate(divideAndRound(flickervalue,count));
|
|
|
|
|
|
|
|
|
|
} else if (Objects.equals(code,DicDataEnum.NEG_CURRENT.getCode())) {
|
|
|
|
|
pqTypicalSourceCreatePO.setIndexType("06");
|
|
|
|
|
int value = Integer.valueOf(rMpPartHarmonicDetailDS.stream().filter(temp ->temp.getIsINeg()==1).count()+"");
|
|
|
|
|
|
|
|
|
|
pqTypicalSourceCreatePO.setInseqOvNum(value);
|
|
|
|
|
pqTypicalSourceCreatePO.setInseqOvRate(divideAndRound(value,count));
|
|
|
|
|
pqTypicalSourceCreatePO.setInseqAvgOvRate(divideAndRound(value,count));
|
|
|
|
|
int neg_currentvalue = Integer.valueOf(rMpPartHarmonicDetailDS.stream().filter(temp ->temp.getIsINeg()==1).count()+"");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// else if (Objects.equals(code,DicDataEnum.HARMONIC_CURRENT.getCode())) {
|
|
|
|
|
// pqTypicalSourceCreatePO.setIndexType("02");
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
else if (Objects.equals(code,DicDataEnum.phase_Voltage.getCode())) {
|
|
|
|
|
int value = Integer.valueOf(rMpPartHarmonicDetailDS.stream().filter(temp ->temp.getIsUnbalance()==1).count()+"");
|
|
|
|
|
pqTypicalSourceCreatePO.setInseqOvNum(neg_currentvalue);
|
|
|
|
|
pqTypicalSourceCreatePO.setInseqOvRate(divideAndRound(neg_currentvalue,count));
|
|
|
|
|
pqTypicalSourceCreatePO.setInseqAvgOvRate(divideAndRound(neg_currentvalue,count));
|
|
|
|
|
|
|
|
|
|
pqTypicalSourceCreatePO.setIndexType("03");
|
|
|
|
|
|
|
|
|
|
pqTypicalSourceCreatePO.setUnbanOvNum(value);
|
|
|
|
|
pqTypicalSourceCreatePO.setUnbanOvRate(divideAndRound(value,count));
|
|
|
|
|
pqTypicalSourceCreatePO.setUnbanAvgOvRate(divideAndRound(value,count));
|
|
|
|
|
int phase_voltagevalue = Integer.valueOf(rMpPartHarmonicDetailDS.stream().filter(temp ->temp.getIsUnbalance()==1).count()+"");
|
|
|
|
|
|
|
|
|
|
} else if (Objects.equals(code,DicDataEnum.HARMONIC_VOLTAGE.getCode())) {
|
|
|
|
|
int value = Integer.valueOf(rMpPartHarmonicDetailDS.stream().filter(temp ->temp.getIsV()==1).count()+"");
|
|
|
|
|
|
|
|
|
|
pqTypicalSourceCreatePO.setIndexType("01");
|
|
|
|
|
pqTypicalSourceCreatePO.setVOvNum(value);
|
|
|
|
|
pqTypicalSourceCreatePO.setVOvRate(divideAndRound(value,count));
|
|
|
|
|
pqTypicalSourceCreatePO.setVAvgOvRate(divideAndRound(value,count));
|
|
|
|
|
pqTypicalSourceCreatePO.setUnbanOvNum(phase_voltagevalue);
|
|
|
|
|
pqTypicalSourceCreatePO.setUnbanOvRate(divideAndRound(phase_voltagevalue,count));
|
|
|
|
|
pqTypicalSourceCreatePO.setUnbanAvgOvRate(divideAndRound(phase_voltagevalue,count));
|
|
|
|
|
|
|
|
|
|
int harmonic_voltagevalue = Integer.valueOf(rMpPartHarmonicDetailDS.stream().filter(temp ->temp.getIsV()==1).count()+"");
|
|
|
|
|
|
|
|
|
|
pqTypicalSourceCreatePO.setVOvNum(harmonic_voltagevalue);
|
|
|
|
|
pqTypicalSourceCreatePO.setVOvRate(divideAndRound(harmonic_voltagevalue,count));
|
|
|
|
|
pqTypicalSourceCreatePO.setVAvgOvRate(divideAndRound(harmonic_voltagevalue,count));
|
|
|
|
|
|
|
|
|
|
int harmonic_Ivalue = Integer.valueOf(rMpPartHarmonicDetailDS.stream().filter(temp ->temp.getIsI()==1).count()+"");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pqTypicalSourceCreatePO.setFlickerOvCount(flickervalue);
|
|
|
|
|
pqTypicalSourceCreatePO.setHarmiOvCount(harmonic_Ivalue);
|
|
|
|
|
pqTypicalSourceCreatePO.setInseqOvCount(inseqOvNum);
|
|
|
|
|
pqTypicalSourceCreatePO.setUnbanOvCount(phase_voltagevalue);
|
|
|
|
|
pqTypicalSourceCreatePO.setHarmvOvCount(harmonic_voltagevalue);
|
|
|
|
|
|
|
|
|
|
pqTypicalSourceCreatePO.setOvCount(ovNum);
|
|
|
|
|
pqTypicalSourceCreatePO.setInterferenceSourceCount(count);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return pqTypicalSourceCreatePO;
|
|
|
|
|
}
|
|
|
|
|
|