国网上送提交代码
This commit is contained in:
@@ -97,4 +97,28 @@ public class PqTypicalSourceCreateDTO {
|
|||||||
/*平均超标天数 当统计类型是月数据、年数据时必填是否必填:*/
|
/*平均超标天数 当统计类型是月数据、年数据时必填是否必填:*/
|
||||||
private BigDecimal averageOvDays;
|
private BigDecimal averageOvDays;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private Integer isUploadHead;
|
||||||
|
/*当年累计月数*/
|
||||||
|
private Integer monthsCount;
|
||||||
|
/*累计闪变超标数*/
|
||||||
|
private Integer flickerOvCount;
|
||||||
|
/*累计谐波电流超标数*/
|
||||||
|
private Integer harmiOvCount;
|
||||||
|
/*累计负序电流超标数*/
|
||||||
|
private Integer inseqOvCount;
|
||||||
|
/*累计三相不平衡超标数*/
|
||||||
|
private Integer unbanOvCount;
|
||||||
|
/*累计谐波电压超标数*/
|
||||||
|
private Integer harmvOvCount;
|
||||||
|
/*累计实现监测数量*/
|
||||||
|
private Integer monitorCount;
|
||||||
|
/*电压等级*/
|
||||||
|
private String voltageLevel;
|
||||||
|
/*累计超标总数*/
|
||||||
|
private Integer ovCount;
|
||||||
|
/*累计干扰源总数*/
|
||||||
|
private Integer interferenceSourceCount;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,4 +126,27 @@ public class PqTypicalSourceCreatePO {
|
|||||||
*/
|
*/
|
||||||
@TableField(value = "is_upload_head")
|
@TableField(value = "is_upload_head")
|
||||||
private Integer isUploadHead;
|
private Integer isUploadHead;
|
||||||
|
@TableField("monthsCount")
|
||||||
|
private Integer monthsCount;
|
||||||
|
@TableField("flickerOvCount")
|
||||||
|
private Integer flickerOvCount;
|
||||||
|
@TableField("harmiOvCount")
|
||||||
|
private Integer harmiOvCount;
|
||||||
|
@TableField("inseqOvCount")
|
||||||
|
private Integer inseqOvCount;
|
||||||
|
@TableField("unbanOvCount")
|
||||||
|
private Integer unbanOvCount;
|
||||||
|
@TableField("harmvOvCount")
|
||||||
|
private Integer harmvOvCount;
|
||||||
|
@TableField("monitorCount")
|
||||||
|
private Integer monitorCount;
|
||||||
|
@TableField("voltageLevel")
|
||||||
|
private String voltageLevel;
|
||||||
|
@TableField("ovCount")
|
||||||
|
private Integer ovCount;
|
||||||
|
@TableField("interferenceSourceCount")
|
||||||
|
private Integer interferenceSourceCount;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -124,6 +124,7 @@ public class PqTypicalSourceCreatePOServiceImpl extends ServiceImpl<PqTypicalSou
|
|||||||
pendingIds.forEach(temp->{
|
pendingIds.forEach(temp->{
|
||||||
SendParam sendParam = new SendParam();
|
SendParam sendParam = new SendParam();
|
||||||
sendParam.setStats(temp);
|
sendParam.setStats(temp);
|
||||||
|
sendParam.setStatisticalDate(temp.get(0).getStatisticalDate());
|
||||||
String s = JSONObject.toJSONStringWithDateFormat(sendParam, JSON.DEFFAULT_DATE_FORMAT);
|
String s = JSONObject.toJSONStringWithDateFormat(sendParam, JSON.DEFFAULT_DATE_FORMAT);
|
||||||
log.info(Thread.currentThread().getName() + "获取返回体 换流站指标统计明细数据接口数据:" + s + "开始----!");
|
log.info(Thread.currentThread().getName() + "获取返回体 换流站指标统计明细数据接口数据:" + s + "开始----!");
|
||||||
Map<String, String> send = GwSendUtil.send(sendParam, GWSendEnum.TYPICAL_SOURCE);
|
Map<String, String> send = GwSendUtil.send(sendParam, GWSendEnum.TYPICAL_SOURCE);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.njcn.prepare.harmonic.service.mysql.newalgorithm.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||||
import com.njcn.common.utils.PubUtils;
|
import com.njcn.common.utils.PubUtils;
|
||||||
@@ -16,9 +17,9 @@ import com.njcn.prepare.harmonic.service.mysql.newalgorithm.IPmsStatisticsSpecia
|
|||||||
import com.njcn.user.api.DeptFeignClient;
|
import com.njcn.user.api.DeptFeignClient;
|
||||||
import com.njcn.user.pojo.po.Dept;
|
import com.njcn.user.pojo.po.Dept;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -35,13 +36,14 @@ import java.util.stream.Collectors;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
public class PmsStatisticsSpecialMonitorServiceImpl extends MppServiceImpl<PmsStatisticsSpecialMonitorMapper, PmsStatisticsSpecialMonitor> implements IPmsStatisticsSpecialMonitorService {
|
public class PmsStatisticsSpecialMonitorServiceImpl extends MppServiceImpl<PmsStatisticsSpecialMonitorMapper, PmsStatisticsSpecialMonitor> implements IPmsStatisticsSpecialMonitorService {
|
||||||
|
|
||||||
private final CommTerminalGeneralClient commTerminalGeneralClient;
|
private final CommTerminalGeneralClient commTerminalGeneralClient;
|
||||||
private final DeptFeignClient deptFeignClient;
|
private final DeptFeignClient deptFeignClient;
|
||||||
@Override
|
@Override
|
||||||
@Async("asyncExecutor")
|
@Async("asyncExecutor")
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
// @Transactional(rollbackFor = {Exception.class})
|
||||||
public void pmsStatisticsSpecialMonitorHandler(LineParam jobParam) {
|
public void pmsStatisticsSpecialMonitorHandler(LineParam jobParam) {
|
||||||
List<PmsStatisticsSpecialMonitor> info=new ArrayList<>();
|
List<PmsStatisticsSpecialMonitor> info=new ArrayList<>();
|
||||||
Dept dept = deptFeignClient.getRootDept().getData();
|
Dept dept = deptFeignClient.getRootDept().getData();
|
||||||
@@ -66,6 +68,7 @@ public class PmsStatisticsSpecialMonitorServiceImpl extends MppServiceImpl<PmsSt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(info)) {
|
if (CollUtil.isNotEmpty(info)) {
|
||||||
|
log.info("info______________-"+JSON.toJSONString(info));
|
||||||
this.saveOrUpdateBatchByMultiId(info, 500);
|
this.saveOrUpdateBatchByMultiId(info, 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.device.biz.pojo.dto.DeptGetChildrenMoreDTO;
|
import com.njcn.device.biz.pojo.dto.DeptGetChildrenMoreDTO;
|
||||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
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.RMpPartHarmonicDetailD;
|
||||||
import com.njcn.harmonic.pojo.po.RMpSurplusHarmonicDetailD;
|
import com.njcn.harmonic.pojo.po.RMpSurplusHarmonicDetailD;
|
||||||
import com.njcn.harmonic.pojo.po.send.PqTypicalSourceCreatePO;
|
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.line.ROperatingMonitorService;
|
||||||
import com.njcn.prepare.harmonic.service.mysql.send.PqTypicalSourceCreatePOService;
|
import com.njcn.prepare.harmonic.service.mysql.send.PqTypicalSourceCreatePOService;
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
|
import com.njcn.system.api.DictTreeFeignClient;
|
||||||
import com.njcn.system.enums.DicDataEnum;
|
import com.njcn.system.enums.DicDataEnum;
|
||||||
import com.njcn.system.enums.DicDataTypeEnum;
|
import com.njcn.system.enums.DicDataTypeEnum;
|
||||||
import com.njcn.system.pojo.po.DictData;
|
import com.njcn.system.pojo.po.DictData;
|
||||||
|
import com.njcn.system.pojo.po.SysDicTreePO;
|
||||||
import com.njcn.user.api.DeptFeignClient;
|
import com.njcn.user.api.DeptFeignClient;
|
||||||
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -36,6 +40,7 @@ import java.util.Map;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
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 DeptFeignClient deptFeignClient;
|
||||||
private final DicDataFeignClient dicDataFeignClient;
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
|
private final MonitorClient monitorClient;
|
||||||
|
private final DictTreeFeignClient dictTreeFeignClient;
|
||||||
|
|
||||||
private final RMpPartHarmonicDetailDMapper rMpPartHarmonicDetailDMapper;
|
private final RMpPartHarmonicDetailDMapper rMpPartHarmonicDetailDMapper;
|
||||||
private final RMpSurplusHarmonicDetailDMapper rMpSurplusHarmonicDetailDMapper;
|
private final RMpSurplusHarmonicDetailDMapper rMpSurplusHarmonicDetailDMapper;
|
||||||
@@ -73,25 +80,96 @@ public class PqTypicalSourceCreatePOServiceImpl extends ServiceImpl<PqTypicalSou
|
|||||||
|
|
||||||
QueryWrapper<RMpPartHarmonicDetailD> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<RMpPartHarmonicDetailD> queryWrapper = new QueryWrapper<>();
|
||||||
QueryWrapper<RMpSurplusHarmonicDetailD> rMpSurplusHarmonicDetailDQueryWrapper = 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();
|
List<PvTerminalTreeVO> deptList = deptFeignClient.allDeptList().getData();
|
||||||
Map<String, PvTerminalTreeVO> mapCode = deptList.stream().collect(Collectors.toMap(PvTerminalTreeVO::getCode, Function.identity()));
|
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()));
|
Map<String, PvTerminalTreeVO> mapList = deptList.stream().collect(Collectors.toMap(PvTerminalTreeVO::getId, Function.identity()));
|
||||||
List<DictData> indicatorTypeDate = dicDataFeignClient.getDicDataByTypeCode(
|
// List<DictData> indicatorTypeDate = dicDataFeignClient.getDicDataByTypeCode(
|
||||||
DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
|
// 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()) {
|
for (DeptGetChildrenMoreDTO deptGetChildrenMoreDTO : calculatedParam.getIdList()) {
|
||||||
List<String> collect1 = deptGetChildrenMoreDTO.getLineBaseList().stream().filter(temp->Objects.equals(temp.getIsUpToGrid(),1)).map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
List<String> collect1 = deptGetChildrenMoreDTO.getLineBaseList().stream().filter(temp->Objects.equals(temp.getIsUpToGrid(),1)).map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
||||||
|
List<Monitor> monitorList;
|
||||||
|
if (!CollectionUtils.isEmpty(collect1)) {
|
||||||
|
monitorList = monitorClient.getMonitorList(collect1).getData();
|
||||||
|
} else {
|
||||||
|
monitorList = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
collect.stream().forEach(temp->{
|
||||||
|
PqTypicalSourceCreatePO pqTypicalSourceCreatePO = new PqTypicalSourceCreatePO();
|
||||||
|
|
||||||
|
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());
|
||||||
|
|
||||||
|
} 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());
|
||||||
|
|
||||||
|
}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;
|
Integer effectiveMonitorNum;
|
||||||
|
|
||||||
List<RMpPartHarmonicDetailD> rMpPartHarmonicDetailDS;
|
List<RMpPartHarmonicDetailD> rMpPartHarmonicDetailDS;
|
||||||
List<RMpSurplusHarmonicDetailD> rMpSurplusHarmonicDetailDS;
|
List<RMpSurplusHarmonicDetailD> rMpSurplusHarmonicDetailDS;
|
||||||
if (!CollectionUtils.isEmpty(collect1)) {
|
if (!CollectionUtils.isEmpty(monitorIds)) {
|
||||||
List<ROperatingMonitorDPO> list = rOperatingMonitorService.lambdaQuery().
|
List<ROperatingMonitorDPO> list = rOperatingMonitorService.lambdaQuery().
|
||||||
in(ROperatingMonitorDPO::getMeasurementPointId, collect1).
|
in(ROperatingMonitorDPO::getMeasurementPointId, monitorIds).
|
||||||
eq(ROperatingMonitorDPO::getDataDate, calculatedParam.getDataDate()).
|
eq(ROperatingMonitorDPO::getDataDate, calculatedParam.getDataDate()).
|
||||||
ge(ROperatingMonitorDPO::getDataIntegrityRate, 0.95).
|
ge(ROperatingMonitorDPO::getDataIntegrityRate, 0.95).
|
||||||
eq(ROperatingMonitorDPO::getIsUnusual, 1).list();
|
eq(ROperatingMonitorDPO::getIsUnusual, 1).list();
|
||||||
@@ -99,13 +177,13 @@ public class PqTypicalSourceCreatePOServiceImpl extends ServiceImpl<PqTypicalSou
|
|||||||
|
|
||||||
queryWrapper.clear();
|
queryWrapper.clear();
|
||||||
queryWrapper.
|
queryWrapper.
|
||||||
in("measurement_point_id",collect1).
|
in("measurement_point_id",monitorIds).
|
||||||
eq("data_date",localDate);
|
eq("data_date",localDate);
|
||||||
rMpPartHarmonicDetailDS = rMpPartHarmonicDetailDMapper.selectList(queryWrapper);
|
rMpPartHarmonicDetailDS = rMpPartHarmonicDetailDMapper.selectList(queryWrapper);
|
||||||
|
|
||||||
rMpSurplusHarmonicDetailDQueryWrapper.clear();
|
rMpSurplusHarmonicDetailDQueryWrapper.clear();
|
||||||
rMpSurplusHarmonicDetailDQueryWrapper.
|
rMpSurplusHarmonicDetailDQueryWrapper.
|
||||||
in("measurement_point_id",collect1).
|
in("measurement_point_id",monitorIds).
|
||||||
eq("data_date",localDate);
|
eq("data_date",localDate);
|
||||||
rMpSurplusHarmonicDetailDS = rMpSurplusHarmonicDetailDMapper.selectList(rMpSurplusHarmonicDetailDQueryWrapper);
|
rMpSurplusHarmonicDetailDS = rMpSurplusHarmonicDetailDMapper.selectList(rMpSurplusHarmonicDetailDQueryWrapper);
|
||||||
|
|
||||||
@@ -114,30 +192,13 @@ public class PqTypicalSourceCreatePOServiceImpl extends ServiceImpl<PqTypicalSou
|
|||||||
rMpPartHarmonicDetailDS = new ArrayList<>();
|
rMpPartHarmonicDetailDS = new ArrayList<>();
|
||||||
effectiveMonitorNum = 0;
|
effectiveMonitorNum = 0;
|
||||||
}
|
}
|
||||||
|
pqTypicalSourceCreatePO = initPqTypicalSourceCreatePO(pqTypicalSourceCreatePO,rMpPartHarmonicDetailDS,rMpSurplusHarmonicDetailDS,collect1.size());
|
||||||
// rStatOrgDPOQueryWrapper.clear();
|
pqTypicalSourceCreatePO.setIndexType(temp);
|
||||||
// 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);
|
|
||||||
|
|
||||||
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.setStatisticalDate(calculatedParam.getDataDate());
|
||||||
pqTypicalSourceCreatePO.setStatisticalType("03");
|
pqTypicalSourceCreatePO.setStatisticalType("03");
|
||||||
|
|
||||||
pqTypicalSourceCreatePO.setMonitorNum(effectiveMonitorNum);
|
pqTypicalSourceCreatePO.setMonitorNum(effectiveMonitorNum);
|
||||||
|
pqTypicalSourceCreatePO.setMonitorCount(effectiveMonitorNum);
|
||||||
pqTypicalSourceCreatePO.setMonitoringRate(divideAndRound(effectiveMonitorNum,collect1.size()));
|
pqTypicalSourceCreatePO.setMonitoringRate(divideAndRound(effectiveMonitorNum,collect1.size()));
|
||||||
|
|
||||||
|
|
||||||
if (mapCode.containsKey(deptGetChildrenMoreDTO.getUnitId())) {
|
if (mapCode.containsKey(deptGetChildrenMoreDTO.getUnitId())) {
|
||||||
PvTerminalTreeVO pvTerminalTreeVO = mapCode.get(deptGetChildrenMoreDTO.getUnitId());
|
PvTerminalTreeVO pvTerminalTreeVO = mapCode.get(deptGetChildrenMoreDTO.getUnitId());
|
||||||
String[] split = (pvTerminalTreeVO.getPids() + StrUtil.COMMA + pvTerminalTreeVO.getId())
|
String[] split = (pvTerminalTreeVO.getPids() + StrUtil.COMMA + pvTerminalTreeVO.getId())
|
||||||
@@ -180,7 +241,7 @@ public class PqTypicalSourceCreatePOServiceImpl extends ServiceImpl<PqTypicalSou
|
|||||||
}
|
}
|
||||||
pqTypicalSourceCreatePO.setId(deptGetChildrenMoreDTO.getUnitId()+"-"+pqTypicalSourceCreatePO.getIndexType()+"-"+calculatedParam.getDataDate());
|
pqTypicalSourceCreatePO.setId(deptGetChildrenMoreDTO.getUnitId()+"-"+pqTypicalSourceCreatePO.getIndexType()+"-"+calculatedParam.getDataDate());
|
||||||
pqTypicalSourceCreatePOList.add(pqTypicalSourceCreatePO);
|
pqTypicalSourceCreatePOList.add(pqTypicalSourceCreatePO);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -190,8 +251,9 @@ public class PqTypicalSourceCreatePOServiceImpl extends ServiceImpl<PqTypicalSou
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private PqTypicalSourceCreatePO initPqTypicalSourceCreatePO(PqTypicalSourceCreatePO pqTypicalSourceCreatePO,
|
private PqTypicalSourceCreatePO initPqTypicalSourceCreatePO(PqTypicalSourceCreatePO pqTypicalSourceCreatePO,
|
||||||
String code,
|
// String code,
|
||||||
List<RMpPartHarmonicDetailD> rMpPartHarmonicDetailDS,
|
List<RMpPartHarmonicDetailD> rMpPartHarmonicDetailDS,
|
||||||
List<RMpSurplusHarmonicDetailD> rMpSurplusHarmonicDetailDS,
|
List<RMpSurplusHarmonicDetailD> rMpSurplusHarmonicDetailDS,
|
||||||
int count) {
|
int count) {
|
||||||
@@ -231,44 +293,45 @@ public class PqTypicalSourceCreatePOServiceImpl extends ServiceImpl<PqTypicalSou
|
|||||||
pqTypicalSourceCreatePO.setAverageOvDays(initialvalue);
|
pqTypicalSourceCreatePO.setAverageOvDays(initialvalue);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Objects.equals(code,DicDataEnum.FLICKER.getCode())) {
|
int flickervalue = Integer.valueOf(rMpSurplusHarmonicDetailDS.stream().filter(temp ->temp.getIsFlicker()==1).count()+"");
|
||||||
pqTypicalSourceCreatePO.setIndexType("02");
|
pqTypicalSourceCreatePO.setFlickerOvNum(flickervalue);
|
||||||
int value = Integer.valueOf(rMpSurplusHarmonicDetailDS.stream().filter(temp ->temp.getIsFlicker()==1).count()+"");
|
pqTypicalSourceCreatePO.setFlickerOvRate(divideAndRound(flickervalue,count));
|
||||||
pqTypicalSourceCreatePO.setFlickerOvNum(value);
|
pqTypicalSourceCreatePO.setFlickerAvgOvRate(divideAndRound(flickervalue,count));
|
||||||
pqTypicalSourceCreatePO.setFlickerOvRate(divideAndRound(value,count));
|
|
||||||
pqTypicalSourceCreatePO.setFlickerAvgOvRate(divideAndRound(value,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);
|
int neg_currentvalue = Integer.valueOf(rMpPartHarmonicDetailDS.stream().filter(temp ->temp.getIsINeg()==1).count()+"");
|
||||||
pqTypicalSourceCreatePO.setInseqOvRate(divideAndRound(value,count));
|
|
||||||
pqTypicalSourceCreatePO.setInseqAvgOvRate(divideAndRound(value,count));
|
|
||||||
|
|
||||||
}
|
pqTypicalSourceCreatePO.setInseqOvNum(neg_currentvalue);
|
||||||
// else if (Objects.equals(code,DicDataEnum.HARMONIC_CURRENT.getCode())) {
|
pqTypicalSourceCreatePO.setInseqOvRate(divideAndRound(neg_currentvalue,count));
|
||||||
// pqTypicalSourceCreatePO.setIndexType("02");
|
pqTypicalSourceCreatePO.setInseqAvgOvRate(divideAndRound(neg_currentvalue,count));
|
||||||
//
|
|
||||||
// }
|
|
||||||
else if (Objects.equals(code,DicDataEnum.phase_Voltage.getCode())) {
|
|
||||||
int value = Integer.valueOf(rMpPartHarmonicDetailDS.stream().filter(temp ->temp.getIsUnbalance()==1).count()+"");
|
|
||||||
|
|
||||||
pqTypicalSourceCreatePO.setIndexType("03");
|
|
||||||
|
|
||||||
pqTypicalSourceCreatePO.setUnbanOvNum(value);
|
int phase_voltagevalue = Integer.valueOf(rMpPartHarmonicDetailDS.stream().filter(temp ->temp.getIsUnbalance()==1).count()+"");
|
||||||
pqTypicalSourceCreatePO.setUnbanOvRate(divideAndRound(value,count));
|
|
||||||
pqTypicalSourceCreatePO.setUnbanAvgOvRate(divideAndRound(value,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.setUnbanOvNum(phase_voltagevalue);
|
||||||
pqTypicalSourceCreatePO.setVOvNum(value);
|
pqTypicalSourceCreatePO.setUnbanOvRate(divideAndRound(phase_voltagevalue,count));
|
||||||
pqTypicalSourceCreatePO.setVOvRate(divideAndRound(value,count));
|
pqTypicalSourceCreatePO.setUnbanAvgOvRate(divideAndRound(phase_voltagevalue,count));
|
||||||
pqTypicalSourceCreatePO.setVAvgOvRate(divideAndRound(value,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;
|
return pqTypicalSourceCreatePO;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -515,7 +515,34 @@ public enum DicDataEnum {
|
|||||||
Nocarried("未开展","Nocarried"),
|
Nocarried("未开展","Nocarried"),
|
||||||
Progressing("开展中","Progressing"),
|
Progressing("开展中","Progressing"),
|
||||||
Reviewing("待审核","Reviewing"),
|
Reviewing("待审核","Reviewing"),
|
||||||
Completed("已完成","Completed")
|
Completed("已完成","Completed"),
|
||||||
|
|
||||||
|
/*3.45 典型源荷用户类型*/
|
||||||
|
TRACTIONSTATION("牵引站","01"),
|
||||||
|
WINDFARM_USER("风电场用户","02"),
|
||||||
|
PHOTOVOLTAICSIT_EUSERS("光伏场站用户","03"),
|
||||||
|
OTHER_INTERFERENCESOURCE_USERS("其他干扰源用户","04"),
|
||||||
|
|
||||||
|
/*3.39 监测对象类型-大类*/
|
||||||
|
SEMICONDUCTOR_MANUFACTURING("半导体制造","2401"),
|
||||||
|
PRECISION_MACHINING("精密加工","2402"),
|
||||||
|
PARTY_GOVERNMENT("党政机关","2403"),
|
||||||
|
NOSOCOMIUM("医院","2404"),
|
||||||
|
TRANSPORTATION_HUB("交通枢纽(公交场站、客运站、火车站等)","2405"),
|
||||||
|
AERODROME("机场","2406"),
|
||||||
|
FINANCE("金融","2407"),
|
||||||
|
DATA_CENTER("数据中心","2408"),
|
||||||
|
HAZARDOUS_CHEMICALS("危险化学品","2409"),
|
||||||
|
EXPLOSIVE_PRODUCTS("易燃易爆品制造","2410"),
|
||||||
|
LARGEVENUE("大型场馆(体育场、剧院等)","2411"),
|
||||||
|
WINDPOWER_STATION("风电场","1401"),
|
||||||
|
PHOTOVOLTAIC_POWER_STATION("光伏电站","1402"),
|
||||||
|
ELECTRIFIED_RAILWAY("电气化铁路","1300"),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user