联调有功功率,解决部分bug
This commit is contained in:
@@ -83,5 +83,5 @@ public interface DeptLineMapper extends BaseMapper<DeptLine> {
|
||||
|
||||
List<SubGetBase> selectSubStationList(@Param("param") SubstationParam substationParam);
|
||||
|
||||
List<String> getLineByDeptIdAndNewStation(@Param("id") String id,@Param("dictTree")List<String> dictTree);
|
||||
List<String> getLineByDeptIdAndNewStation(@Param("ids") List<String> id,@Param("dictTree")List<String> dictTree);
|
||||
}
|
||||
|
||||
@@ -206,8 +206,11 @@
|
||||
INNER JOIN pq_line_detail pld ON pdl.Line_Id = pld.Id
|
||||
<where>
|
||||
pld.Obj_Id IS NOT NULL and pld.Obj_Id !=''
|
||||
<if test="id !=null and id !='' ">
|
||||
and pdl.Id = #{id}
|
||||
<if test="ids!=null and ids.size!=0">
|
||||
and pdl.Id in
|
||||
<foreach collection="ids" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="dictTree!=null and dictTree.size!=0">
|
||||
and pld.Big_Obj_Type in
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.device.pq.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -35,7 +36,6 @@ import java.util.stream.Collectors;
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @date 2022/1/12 17:32
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@@ -80,8 +80,8 @@ public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> i
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getLineByDeptIds(List<String> ids,List<Integer> runFlag,List<Integer> dataType,String objType) {
|
||||
return this.baseMapper.getLineIdByDeptIds(ids,runFlag,dataType,objType);
|
||||
public List<String> getLineByDeptIds(List<String> ids, List<Integer> runFlag, List<Integer> dataType, String objType) {
|
||||
return this.baseMapper.getLineIdByDeptIds(ids, runFlag, dataType, objType);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -100,15 +100,19 @@ public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> i
|
||||
public List<String> getLineByDeptIdAndNewStation(String id) {
|
||||
List<String> dictTree = new ArrayList<>();
|
||||
DictTreeVO powerStation = dictTreeFeignClient.queryByCode(DicTreeEnum.Power_Station.getCode()).getData();
|
||||
if(ObjectUtil.isNotNull(powerStation)){
|
||||
if (ObjectUtil.isNotNull(powerStation)) {
|
||||
dictTree.add(powerStation.getId());
|
||||
}
|
||||
DictTreeVO windFarms = dictTreeFeignClient.queryByCode(DicTreeEnum.Wind_Farms.getCode()).getData();
|
||||
if(ObjectUtil.isNotNull(windFarms)){
|
||||
if (ObjectUtil.isNotNull(windFarms)) {
|
||||
dictTree.add(windFarms.getId());
|
||||
}
|
||||
if(CollUtil.isNotEmpty(dictTree)){
|
||||
return this.baseMapper.getLineByDeptIdAndNewStation(id,dictTree);
|
||||
if (CollUtil.isNotEmpty(dictTree)) {
|
||||
List<String> ids = new ArrayList<>();
|
||||
if (StrUtil.isNotBlank(id)) {
|
||||
ids.addAll(deptFeignClient.getDepSonIdtByDeptId(id).getData());
|
||||
}
|
||||
return this.baseMapper.getLineByDeptIdAndNewStation(ids, dictTree);
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
@@ -134,24 +138,24 @@ public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> i
|
||||
@Override
|
||||
public Map<String, List<String>> getLineByDeptRelation(Integer devDataType) {
|
||||
List<DeptLine> deptLines = deptLineMapper.getLineByDeptRelation(devDataType);
|
||||
return deptLines.stream ( ).collect (Collectors.groupingBy (DeptLine::getId, Collectors.mapping (DeptLine::getLineId,Collectors.toList ())));
|
||||
return deptLines.stream().collect(Collectors.groupingBy(DeptLine::getId, Collectors.mapping(DeptLine::getLineId, Collectors.toList())));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<LineDevGetDTO>> lineDevGet(List<Integer> devDataType,Integer type,Integer lineRunFlag) {
|
||||
List<LineDevGetDTO> deptLines = deptLineMapper.lineDevGet(devDataType,type, lineRunFlag);
|
||||
return deptLines.stream ().collect (Collectors.groupingBy (LineDevGetDTO::getUnitId));
|
||||
public Map<String, List<LineDevGetDTO>> lineDevGet(List<Integer> devDataType, Integer type, Integer lineRunFlag) {
|
||||
List<LineDevGetDTO> deptLines = deptLineMapper.lineDevGet(devDataType, type, lineRunFlag);
|
||||
return deptLines.stream().collect(Collectors.groupingBy(LineDevGetDTO::getUnitId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<TerminalGetBase>> orgSubStationGet(List<Integer> devDataType) {
|
||||
List<TerminalGetBase> deptLines = deptLineMapper.orgSubStationGet(devDataType);
|
||||
return deptLines.stream ().collect (Collectors.groupingBy (TerminalGetBase::getUnitId));
|
||||
return deptLines.stream().collect(Collectors.groupingBy(TerminalGetBase::getUnitId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TerminalGetBase.Extend> orgSubStationInfoGet(List<Integer> devType,Integer powerFlag,Integer lineRunFlag) {
|
||||
return deptLineMapper.orgSubStationInfoGet(devType, powerFlag,lineRunFlag);
|
||||
public List<TerminalGetBase.Extend> orgSubStationInfoGet(List<Integer> devType, Integer powerFlag, Integer lineRunFlag) {
|
||||
return deptLineMapper.orgSubStationInfoGet(devType, powerFlag, lineRunFlag);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -162,7 +166,7 @@ public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> i
|
||||
@Override
|
||||
public DeptLine getLineByLineIds(String ids) {
|
||||
return this.getOne(new LambdaQueryWrapper<DeptLine>()
|
||||
.eq(DeptLine::getLineId,ids)
|
||||
.eq(DeptLine::getLineId, ids)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.event.controller.majornetwork;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
@@ -71,13 +72,17 @@ public class TransientController extends BaseController {
|
||||
byte[] bytes = null;
|
||||
String methodDescribe = getMethodDescribe("getTransientAnalyseWaveToByteArray");
|
||||
WaveDataDTO wave = transientService.getTransientAnalyseWave(param);
|
||||
try {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
ObjectOutputStream oos = new ObjectOutputStream(baos);
|
||||
oos.writeObject(wave);
|
||||
bytes = baos.toByteArray();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
if(ObjectUtil.isNotNull(wave)){
|
||||
try {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
ObjectOutputStream oos = new ObjectOutputStream(baos);
|
||||
oos.writeObject(wave);
|
||||
bytes = baos.toByteArray();
|
||||
baos.close();
|
||||
oos.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, bytes, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.njcn.event.service.majornetwork.Impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.event.mapper.majornetwork.SpThroughMapper;
|
||||
@@ -38,15 +40,18 @@ public class SpThroughServiceImpl extends MppServiceImpl<SpThroughMapper, SpThro
|
||||
SpThroughVO spThroughVO = new SpThroughVO();
|
||||
spThroughVO.setLowPressure("0");
|
||||
spThroughVO.setHighPressure("0");
|
||||
String treeId = dicTreeId(spThroughParam);
|
||||
DictData dip = dicDataFeignClient.getDicDataByCode(DicDataEnum.VOLTAGE_DIP.getCode()).getData();
|
||||
if (ObjectUtil.isNotNull(dip)) {
|
||||
spThroughVO.setHighPressure(eventCount(spThroughParam, treeId, dip) + "");
|
||||
}
|
||||
DictData rise = dicDataFeignClient.getDicDataByCode(DicDataEnum.VOLTAGE_RISE.getCode()).getData();
|
||||
if (ObjectUtil.isNotNull(rise)) {
|
||||
spThroughVO.setLowPressure(eventCount(spThroughParam, treeId, rise) + "");
|
||||
if(CollUtil.isNotEmpty(spThroughParam.getEventIds())){
|
||||
String treeId = dicTreeId(spThroughParam);
|
||||
DictData dip = dicDataFeignClient.getDicDataByCode(DicDataEnum.VOLTAGE_DIP.getCode()).getData();
|
||||
if (ObjectUtil.isNotNull(dip)) {
|
||||
spThroughVO.setHighPressure(eventCount(spThroughParam, treeId, dip) + "");
|
||||
}
|
||||
DictData rise = dicDataFeignClient.getDicDataByCode(DicDataEnum.VOLTAGE_RISE.getCode()).getData();
|
||||
if (ObjectUtil.isNotNull(rise)) {
|
||||
spThroughVO.setLowPressure(eventCount(spThroughParam, treeId, rise) + "");
|
||||
}
|
||||
}
|
||||
|
||||
return spThroughVO;
|
||||
}
|
||||
|
||||
@@ -73,6 +78,7 @@ public class SpThroughServiceImpl extends MppServiceImpl<SpThroughMapper, SpThro
|
||||
public List<String> formatEventIds(SpThroughParam spThroughParam) {
|
||||
LambdaQueryWrapper<SpThroughPO> lambdaQueryWrapper = new LambdaQueryWrapper();
|
||||
lambdaQueryWrapper.in(SpThroughPO::getEventId, spThroughParam.getEventIds())
|
||||
.eq(StrUtil.isNotBlank(spThroughParam.getFrequencyType()),SpThroughPO::getEventType,spThroughParam.getFrequencyType())
|
||||
.eq(SpThroughPO::getIsOrNot, 1)
|
||||
.eq(SpThroughPO::getStationType, dicTreeId(spThroughParam))
|
||||
.eq(SpThroughPO::getState, 1);
|
||||
|
||||
@@ -24,6 +24,7 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -31,8 +32,9 @@ import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 高低电压穿越统计 服务类实现类
|
||||
* 高低电压穿越统计 服务类实现类
|
||||
* </p>
|
||||
*
|
||||
* @author guofeihu
|
||||
* @since 2024-08-14
|
||||
*/
|
||||
@@ -54,32 +56,32 @@ public class VoltageRideThroughEventServiceImpl implements VoltageRideThroughEve
|
||||
List<VoltageRideThroughVo> voltageRideThroughVos = new ArrayList<>();
|
||||
//根据当前选择的部门ID获取其下的子部门集合
|
||||
List<DeptDTO> deptDTOS = deptFeignClient.getDepSonDetailByDeptId(param.getAreaId()).getData();
|
||||
for(DeptDTO deptDTO : deptDTOS){
|
||||
for (DeptDTO deptDTO : deptDTOS) {
|
||||
//子部门信息
|
||||
VoltageRideThroughVo voltageRideThroughVo = new VoltageRideThroughVo();
|
||||
//赋值子部门名称及ID
|
||||
BeanUtils.copyProperties(deptDTO,voltageRideThroughVo);
|
||||
BeanUtils.copyProperties(deptDTO, voltageRideThroughVo);
|
||||
//根据部门的area获取经纬度
|
||||
Area area = areaFeignClient.selectIdArea(deptDTO.getArea()).getData();
|
||||
if(area != null){
|
||||
if (area != null) {
|
||||
voltageRideThroughVo.setLat(area.getLat());
|
||||
voltageRideThroughVo.setLng(area.getLng());
|
||||
}
|
||||
//开始计算当前地区高低压穿越次数
|
||||
//获取当前部门下所有的已绑定能源站的监测点
|
||||
List<String> lineIds = deptLineFeignClient.getLineByDeptIdAndNewStation(deptDTO.getId()).getData();
|
||||
if(!lineIds.isEmpty()){
|
||||
if (!lineIds.isEmpty()) {
|
||||
//根据已绑定能源站的监测点获取关联的暂态事件
|
||||
List<EventDetail> eventDetails = eventDetailService.getEventDetail(lineIds,
|
||||
DateUtil.beginOfDay(DateUtil.parse(param.getSearchBeginTime())).toString(),
|
||||
DateUtil.beginOfDay(DateUtil.parse(param.getSearchEndTime())).toString());
|
||||
if(CollUtil.isNotEmpty(eventDetails)){
|
||||
if (CollUtil.isNotEmpty(eventDetails)) {
|
||||
List<String> eventDetailIds = eventDetails.stream().map(EventDetail::getEventId).collect(Collectors.toList());
|
||||
SpThroughParam spThroughParam = new SpThroughParam(eventDetailIds,param.getType());
|
||||
SpThroughParam spThroughParam = new SpThroughParam(eventDetailIds,null, param.getType());
|
||||
List<String> eventIds = spThroughService.formatEventIds(spThroughParam);
|
||||
spThroughParam.setEventIds(eventIds);
|
||||
//赋值子部门高低电压穿越次数
|
||||
BeanUtils.copyProperties(spThroughService.getDataByEventIds(spThroughParam),voltageRideThroughVo);
|
||||
BeanUtils.copyProperties(spThroughService.getDataByEventIds(spThroughParam), voltageRideThroughVo);
|
||||
}
|
||||
}
|
||||
voltageRideThroughVos.add(voltageRideThroughVo);
|
||||
@@ -93,28 +95,28 @@ public class VoltageRideThroughEventServiceImpl implements VoltageRideThroughEve
|
||||
List<String> lineIds = new ArrayList<>();
|
||||
//获取当前部门下所有的已绑定能源站的监测点
|
||||
lineIds.addAll(deptLineFeignClient.getLineByDeptIdAndNewStation(param.getAreaId()).getData());
|
||||
if(!lineIds.isEmpty()){
|
||||
if (!lineIds.isEmpty()) {
|
||||
//根据监测点获取监测点下所有的事件集合
|
||||
List<EventDetail> eventDetail = eventDetailService.getEventDetail(lineIds,
|
||||
DateUtil.beginOfDay(DateUtil.parse(param.getSearchBeginTime())).toString(),
|
||||
DateUtil.beginOfDay(DateUtil.parse(param.getSearchEndTime())).toString());
|
||||
eventNewStationVos = BeanUtil.copyToList(eventDetail, EventNewStationVo.class);
|
||||
if(!eventNewStationVos.isEmpty()){
|
||||
if (!eventNewStationVos.isEmpty()) {
|
||||
List<String> eventDetailIds = eventNewStationVos.stream().map(EventNewStationVo::getEventId).collect(Collectors.toList());
|
||||
SpThroughParam spThroughParam = new SpThroughParam(eventDetailIds,param.getType());
|
||||
SpThroughParam spThroughParam = new SpThroughParam(eventDetailIds,param.getFrequencyType(), param.getType());
|
||||
//eventNewStationVos:事件集合中是包含了所有符合条件的事件,可能有部分事件并没有被高低电压穿越记录定时任务所执行 所以需要过滤下 具体逻辑说请看spThroughFeignClient.formatEventIds
|
||||
List<String> eventIds = spThroughService.formatEventIds(spThroughParam);
|
||||
//过滤掉不符合的事件(eventIds为有效事件ID)
|
||||
eventNewStationVos = eventNewStationVos.stream().filter(item->eventIds.contains(item.getEventId())).collect(Collectors.toList());
|
||||
eventNewStationVos = eventNewStationVos.stream().filter(item -> eventIds.contains(item.getEventId())).collect(Collectors.toList());
|
||||
List<LineDetailDataVO> lineDetailDataVOS = lineFeignClient.getLineDetailList(lineIds).getData();
|
||||
Map<String, String> lineDetailDataMap = lineDetailDataVOS.stream().collect(Collectors.toMap(LineDetailDataVO::getLineId, LineDetailDataVO::getObyId));
|
||||
//特殊处理事件集合中新能源场站名称
|
||||
List<NewUserReportVO> userReportVOS = userLedgerFeignClient.getUserReportByIds(new ArrayList<>(lineDetailDataMap.values())).getData();
|
||||
Map<String, String> userReportMap = userReportVOS.stream().collect(Collectors.toMap(NewUserReportVO::getId, NewUserReportVO::getProjectName));
|
||||
for(EventNewStationVo eventNewStationVo : eventNewStationVos){
|
||||
if(lineDetailDataMap.containsKey(eventNewStationVo.getLineId())){
|
||||
for (EventNewStationVo eventNewStationVo : eventNewStationVos) {
|
||||
if (lineDetailDataMap.containsKey(eventNewStationVo.getLineId())) {
|
||||
String lineID = lineDetailDataMap.get(eventNewStationVo.getLineId());
|
||||
if(userReportMap.containsKey(lineID)){
|
||||
if (userReportMap.containsKey(lineID)) {
|
||||
eventNewStationVo.setNewStationName(userReportMap.get(lineID));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,9 @@ public class ThdDataVO {
|
||||
@ApiModelProperty("最小值C相")
|
||||
private String MINPhaseC;
|
||||
|
||||
@ApiModelProperty("最小值T相")
|
||||
private String MINPhaseT;
|
||||
|
||||
@ApiModelProperty("最大值A相")
|
||||
private String MAXPhaseA;
|
||||
|
||||
@@ -35,6 +38,9 @@ public class ThdDataVO {
|
||||
@ApiModelProperty("最大值C相")
|
||||
private String MAXPhaseC;
|
||||
|
||||
@ApiModelProperty("最大值T相")
|
||||
private String MAXPhaseT;
|
||||
|
||||
@ApiModelProperty("平均值A相")
|
||||
private String AVGPhaseA;
|
||||
|
||||
@@ -44,6 +50,9 @@ public class ThdDataVO {
|
||||
@ApiModelProperty("平均值C相")
|
||||
private String AVGPhaseC;
|
||||
|
||||
@ApiModelProperty("平均值T相")
|
||||
private String AVGPhaseT;
|
||||
|
||||
@ApiModelProperty("CP95A相")
|
||||
private String CP95PhaseA;
|
||||
|
||||
@@ -53,6 +62,9 @@ public class ThdDataVO {
|
||||
@ApiModelProperty("CP95C相")
|
||||
private String CP95PhaseC;
|
||||
|
||||
@ApiModelProperty("CP95T相")
|
||||
private String CP95PhaseT;
|
||||
|
||||
@ApiModelProperty("国标限值")
|
||||
private Float limit;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn.harmonic.pojo.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -13,14 +14,17 @@ import lombok.Data;
|
||||
public class ThdDataVOExcel {
|
||||
|
||||
@ApiModelProperty("时间")
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(index =0,value = "时间")
|
||||
private String time;
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(index =1,value = "指标")
|
||||
private String anotherName;
|
||||
|
||||
@ApiModelProperty("单位")
|
||||
@ColumnWidth(10)
|
||||
@ExcelProperty(index =2,value = "单位")
|
||||
private String unit;
|
||||
|
||||
|
||||
@@ -104,17 +104,17 @@ public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
||||
List<PowerStatisticsTargetVO> record = new ArrayList<>();
|
||||
RActivePowerRangeVO rActivePowerRangePO = rActivePowerRangeService.getDataByLineId(powerStatisticsParam.getLineId(),
|
||||
powerStatisticsParam.getSearchBeginTime(), powerStatisticsParam.getSearchEndTime());
|
||||
//获取电压数据
|
||||
LineCountEvaluateParam lineParam = new LineCountEvaluateParam();
|
||||
lineParam.setLineId(Collections.singletonList(rActivePowerRangePO.getLineId()));
|
||||
LineCountEvaluateParam lineCountEvaluateParam = new LineCountEvaluateParam();
|
||||
lineCountEvaluateParam.setLineId(Collections.singletonList(rActivePowerRangePO.getLineId()));
|
||||
lineCountEvaluateParam.setStartTime(powerStatisticsParam.getSearchBeginTime());
|
||||
lineCountEvaluateParam.setEndTime(powerStatisticsParam.getSearchBeginTime());
|
||||
//获取超标数据
|
||||
List<DataLimitRateDetailTimeDto> dtoList = dataLimitRateDetailFeignClient.getLimitRateDetailTimeList(lineCountEvaluateParam).getData();
|
||||
Map<String, DataLimitRateDetailTimeDto> timeDateMap = dtoList.stream().collect(Collectors.toMap(x -> x.getTime(), Function.identity()));
|
||||
if (ObjectUtil.isNotNull(rActivePowerRangePO)) {
|
||||
//获取电压数据
|
||||
LineCountEvaluateParam lineParam = new LineCountEvaluateParam();
|
||||
lineParam.setLineId(Collections.singletonList(rActivePowerRangePO.getLineId()));
|
||||
LineCountEvaluateParam lineCountEvaluateParam = new LineCountEvaluateParam();
|
||||
lineCountEvaluateParam.setLineId(Collections.singletonList(rActivePowerRangePO.getLineId()));
|
||||
lineCountEvaluateParam.setStartTime(powerStatisticsParam.getSearchBeginTime());
|
||||
lineCountEvaluateParam.setEndTime(powerStatisticsParam.getSearchBeginTime());
|
||||
//获取超标数据
|
||||
List<DataLimitRateDetailTimeDto> dtoList = dataLimitRateDetailFeignClient.getLimitRateDetailTimeList(lineCountEvaluateParam).getData();
|
||||
Map<String, DataLimitRateDetailTimeDto> timeDateMap = dtoList.stream().collect(Collectors.toMap(x -> x.getTime(), Function.identity()));
|
||||
List<String> timeId = rActivePowerRangePO.getTimeId();
|
||||
String times = reflexObjValue(rActivePowerRangePO, "minsTime" + powerStatisticsParam.getField()).toString().replace("null", "");
|
||||
List<String> timeList = JSONArray.parseArray(times, String.class);
|
||||
@@ -156,6 +156,7 @@ public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
||||
evaluateParam.setLineId(Collections.singletonList(param.getLineId()));
|
||||
evaluateParam.setStartTime(param.getSearchBeginTime());
|
||||
evaluateParam.setEndTime(param.getSearchEndTime());
|
||||
String time = param.getSearchBeginTime();
|
||||
if ("1".equals(param.getStatisticalId())) {
|
||||
//电压数据
|
||||
List<DataVDto> dataVAllTime = dataVFeignClient.getRawData(evaluateParam).getData();
|
||||
@@ -165,42 +166,50 @@ public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
||||
List<DataIDto> dataIList = dataIFeignClient.getRawData(evaluateParam).getData();
|
||||
//电压偏差
|
||||
if ("Dev".equals(param.getCode()) || StrUtil.isBlank(param.getCode())) {
|
||||
addThdData(info, overlimit.getVoltageDev(), "vuDev", dataVAllTime, "电压上偏差");
|
||||
addThdData(info, overlimit.getUvoltageDev(), "vlDev", dataVAllTime, "电压下偏差");
|
||||
addThdData(info, overlimit.getVoltageDev(), "vuDev", dataVAllTime, "电压上偏差","%",time);
|
||||
addThdData(info, overlimit.getUvoltageDev(), "vlDev", dataVAllTime, "电压下偏差","%",time);
|
||||
}
|
||||
//电压不平横度
|
||||
if ("Unbalance".equals(param.getCode()) || StrUtil.isBlank(param.getCode())) {
|
||||
addThdData(info, overlimit.getUbalance(), "vUnbalance", dataVAllTime, "三相电压不平横度");
|
||||
addThdData(info, overlimit.getUbalance(), "vUnbalance", dataVAllTime, "三相电压不平横度","%",time);
|
||||
}
|
||||
//闪变
|
||||
if ("plt".equals(param.getCode()) || StrUtil.isBlank(param.getCode())) {
|
||||
addThdData(info, overlimit.getFlicker(), "plt", dataFlickerAllTime, "长时闪变");
|
||||
addThdData(info, overlimit.getFlicker(), "plt", dataFlickerAllTime, "长时闪变","",time);
|
||||
}
|
||||
//电流不平衡度
|
||||
//负序电流不平衡度
|
||||
if ("iNeg".equals(param.getCode()) || StrUtil.isBlank(param.getCode())) {
|
||||
addThdData(info, overlimit.getINeg(), "iNeg", dataIList, "电流不平衡度");
|
||||
addThdData(info, overlimit.getINeg(), "iNeg", dataIList, "电流不平衡度","",time);
|
||||
}
|
||||
//频率偏差越限
|
||||
if ("freq".equals(param.getCode()) || StrUtil.isBlank(param.getCode())) {
|
||||
addThdData(info, overlimit.getINeg(), "freqDev", dataVAllTime, "频率偏差","Hz",time);
|
||||
}
|
||||
//电压谐波畸变率
|
||||
if ("freq".equals(param.getCode()) || StrUtil.isBlank(param.getCode())) {
|
||||
addThdData(info, overlimit.getINeg(), "vThd", dataVAllTime, "电压谐波畸变率","%",time);
|
||||
}
|
||||
|
||||
}
|
||||
if ("2".equals(param.getStatisticalId())) {
|
||||
//谐波数据
|
||||
List<DataHarmDto> dataVHarmList = dataHarmRateVFeignClient.getRawData(evaluateParam).getData();
|
||||
addThdData(info, overlimit, "getUharm", "v", 2, 26, dataVHarmList, "谐波电压");
|
||||
addThdData(info, overlimit, "getUharm", "v", 2, 26, dataVHarmList, "谐波电压","%",time);
|
||||
}
|
||||
if ("3".equals(param.getStatisticalId())) {
|
||||
//电流数据
|
||||
List<DataIDto> dataIList = dataIFeignClient.getRawData(evaluateParam).getData();
|
||||
addThdData(info, overlimit, "getUharm", "i", 2, 26, dataIList, "谐波电流");
|
||||
|
||||
addThdData(info, overlimit, "getUharm", "i", 2, 26, dataIList, "谐波电流","A",time);
|
||||
}
|
||||
if ("4".equals(param.getStatisticalId())) {
|
||||
//间谐波数据
|
||||
List<DataHarmDto> dataVInHarmList = dataInharmVFeignClient.getRawData(evaluateParam).getData();
|
||||
addThdData(info, overlimit, "getInuharm", "v", 1, 17, dataVInHarmList, "间谐波电压");
|
||||
addThdData(info, overlimit, "getInuharm", "v", 1, 17, dataVInHarmList, "间谐波电压","%",time);
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
private void addThdData(List<ThdDataVO> info, Overlimit overlimit, String limitField, String fieldName, Integer start, Integer end, List<?> dataAllTime, String anotherName) {
|
||||
private void addThdData(List<ThdDataVO> info, Overlimit overlimit, String limitField, String fieldName, Integer start, Integer end, List<?> dataAllTime, String anotherName,String unit,String time) {
|
||||
if (CollUtil.isNotEmpty(dataAllTime)) {
|
||||
for (int i = start; i < end; i++) {
|
||||
int finalI = i;
|
||||
@@ -215,6 +224,8 @@ public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
vo.setAnotherName(anotherName);
|
||||
vo.setUnit(unit);
|
||||
vo.setTime(time);
|
||||
if ("getInuharm".equals(limitField)) {
|
||||
vo.setAnotherName(i - 0.5 + "次");
|
||||
} else {
|
||||
@@ -230,13 +241,15 @@ public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
||||
}
|
||||
}
|
||||
|
||||
private void addThdData(List<ThdDataVO> info, Float limit, String fieldName, List<?> dataAllTime, String anotherName) {
|
||||
private void addThdData(List<ThdDataVO> info, Float limit, String fieldName, List<?> dataAllTime, String anotherName,String unit,String time) {
|
||||
if (CollUtil.isNotEmpty(dataAllTime)) {
|
||||
List<String> collect = dataAllTime.stream().map(x -> data(x, fieldName)).filter(x -> ObjectUtil.isNotNull(x)).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(collect)) {
|
||||
ThdDataVO vo = new ThdDataVO();
|
||||
vo.setLimit(limit);
|
||||
vo.setAnotherName(anotherName);
|
||||
vo.setUnit(unit);
|
||||
vo.setTime(time);
|
||||
for (String s : collect) {
|
||||
setDataV(vo, s);
|
||||
}
|
||||
@@ -285,7 +298,7 @@ public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
||||
if (timeCross.contains(time)) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -74,7 +74,6 @@ public class RActivePowerRangeServiceImpl extends MppServiceImpl<RActivePowerRan
|
||||
rActivePowerRangePO.setLineId(lineId);
|
||||
rActivePowerRangePO.setTimeId(rActivePowerRangePOS.stream().map(RActivePowerRangePO::getTimeId).collect(Collectors.toList()));
|
||||
|
||||
|
||||
//多条记录则次数累加,是否越限只要有一个区间越限则统一视为该区间越限
|
||||
rActivePowerRangePO.setMinsNum0(rActivePowerRangePOS.stream().mapToInt(RActivePowerRangePO::getMinsNum0).sum());
|
||||
rActivePowerRangePO.setMinsNum1(rActivePowerRangePOS.stream().mapToInt(RActivePowerRangePO::getMinsNum1).sum());
|
||||
@@ -86,16 +85,16 @@ public class RActivePowerRangeServiceImpl extends MppServiceImpl<RActivePowerRan
|
||||
rActivePowerRangePO.setMinsNum7(rActivePowerRangePOS.stream().mapToInt(RActivePowerRangePO::getMinsNum7).sum());
|
||||
rActivePowerRangePO.setMinsNum8(rActivePowerRangePOS.stream().mapToInt(RActivePowerRangePO::getMinsNum8).sum());
|
||||
rActivePowerRangePO.setMinsNum9(rActivePowerRangePOS.stream().mapToInt(RActivePowerRangePO::getMinsNum9).sum());
|
||||
rActivePowerRangePO.setIsOrNot0(rActivePowerRangePOS.stream().mapToInt(RActivePowerRangePO::getMinsNum0).sum());
|
||||
rActivePowerRangePO.setIsOrNot1(rActivePowerRangePOS.stream().mapToInt(RActivePowerRangePO::getMinsNum1).sum());
|
||||
rActivePowerRangePO.setIsOrNot2(rActivePowerRangePOS.stream().mapToInt(RActivePowerRangePO::getMinsNum2).sum());
|
||||
rActivePowerRangePO.setIsOrNot3(rActivePowerRangePOS.stream().mapToInt(RActivePowerRangePO::getMinsNum3).sum());
|
||||
rActivePowerRangePO.setIsOrNot4(rActivePowerRangePOS.stream().mapToInt(RActivePowerRangePO::getMinsNum4).sum());
|
||||
rActivePowerRangePO.setIsOrNot5(rActivePowerRangePOS.stream().mapToInt(RActivePowerRangePO::getMinsNum5).sum());
|
||||
rActivePowerRangePO.setIsOrNot6(rActivePowerRangePOS.stream().mapToInt(RActivePowerRangePO::getMinsNum6).sum());
|
||||
rActivePowerRangePO.setIsOrNot7(rActivePowerRangePOS.stream().mapToInt(RActivePowerRangePO::getMinsNum7).sum());
|
||||
rActivePowerRangePO.setIsOrNot8(rActivePowerRangePOS.stream().mapToInt(RActivePowerRangePO::getMinsNum8).sum());
|
||||
rActivePowerRangePO.setIsOrNot9(rActivePowerRangePOS.stream().mapToInt(RActivePowerRangePO::getMinsNum9).sum());
|
||||
rActivePowerRangePO.setIsOrNot0(rActivePowerRangePOS.stream().mapToInt(RActivePowerRangePO::getIsOrNot0).sum());
|
||||
rActivePowerRangePO.setIsOrNot1(rActivePowerRangePOS.stream().mapToInt(RActivePowerRangePO::getIsOrNot1).sum());
|
||||
rActivePowerRangePO.setIsOrNot2(rActivePowerRangePOS.stream().mapToInt(RActivePowerRangePO::getIsOrNot2).sum());
|
||||
rActivePowerRangePO.setIsOrNot3(rActivePowerRangePOS.stream().mapToInt(RActivePowerRangePO::getIsOrNot3).sum());
|
||||
rActivePowerRangePO.setIsOrNot4(rActivePowerRangePOS.stream().mapToInt(RActivePowerRangePO::getIsOrNot4).sum());
|
||||
rActivePowerRangePO.setIsOrNot5(rActivePowerRangePOS.stream().mapToInt(RActivePowerRangePO::getIsOrNot5).sum());
|
||||
rActivePowerRangePO.setIsOrNot6(rActivePowerRangePOS.stream().mapToInt(RActivePowerRangePO::getIsOrNot6).sum());
|
||||
rActivePowerRangePO.setIsOrNot7(rActivePowerRangePOS.stream().mapToInt(RActivePowerRangePO::getIsOrNot7).sum());
|
||||
rActivePowerRangePO.setIsOrNot8(rActivePowerRangePOS.stream().mapToInt(RActivePowerRangePO::getIsOrNot8).sum());
|
||||
rActivePowerRangePO.setIsOrNot9(rActivePowerRangePOS.stream().mapToInt(RActivePowerRangePO::getIsOrNot9).sum());
|
||||
|
||||
|
||||
rActivePowerRangePO.setMinsTime0(rActivePowerRangePOS.stream().map(RActivePowerRangePO::getMinsTime0).collect(Collectors.toList()));
|
||||
|
||||
@@ -14,11 +14,15 @@ public class SpThroughParam {
|
||||
@ApiModelProperty(name = "eventIds",value = "事件ID集合")
|
||||
private List<String> eventIds;
|
||||
|
||||
@ApiModelProperty("高电压,低电压字典")
|
||||
private String frequencyType;
|
||||
|
||||
@ApiModelProperty(name = "lineType",value = "监测点类别(1:风电场、2:光伏电站)")
|
||||
private String stationType;
|
||||
|
||||
public SpThroughParam(List<String> eventIds, String stationType) {
|
||||
public SpThroughParam(List<String> eventIds,String frequencyType, String stationType) {
|
||||
this.eventIds = eventIds;
|
||||
this.frequencyType = frequencyType;
|
||||
this.stationType = stationType;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user