From 20d5dbc942454e9542e64d955361106480960e50 Mon Sep 17 00:00:00 2001 From: wr <1754607820@qq.com> Date: Tue, 8 Apr 2025 16:35:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=94=E8=B0=83=E6=9C=89=E5=8A=9F=E5=8A=9F?= =?UTF-8?q?=E7=8E=87=EF=BC=8C=E8=A7=A3=E5=86=B3=E9=83=A8=E5=88=86bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../njcn/device/pq/mapper/DeptLineMapper.java | 2 +- .../pq/mapper/mapping/DeptLineMapper.xml | 7 ++- .../pq/service/impl/DeptLineServiceImpl.java | 34 ++++++----- .../majornetwork/TransientController.java | 19 +++--- .../Impl/SpThroughServiceImpl.java | 22 ++++--- .../VoltageRideThroughEventServiceImpl.java | 32 +++++----- .../com/njcn/harmonic/pojo/vo/ThdDataVO.java | 12 ++++ .../njcn/harmonic/pojo/vo/ThdDataVOExcel.java | 4 ++ .../impl/PowerStatisticsServiceImpl.java | 59 +++++++++++-------- .../impl/RActivePowerRangeServiceImpl.java | 21 ++++--- .../harmonic/pojo/param/SpThroughParam.java | 6 +- 11 files changed, 135 insertions(+), 83 deletions(-) diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/DeptLineMapper.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/DeptLineMapper.java index d368606f1..698e4a708 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/DeptLineMapper.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/DeptLineMapper.java @@ -83,5 +83,5 @@ public interface DeptLineMapper extends BaseMapper { List selectSubStationList(@Param("param") SubstationParam substationParam); - List getLineByDeptIdAndNewStation(@Param("id") String id,@Param("dictTree")List dictTree); + List getLineByDeptIdAndNewStation(@Param("ids") List id,@Param("dictTree")List dictTree); } diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/DeptLineMapper.xml b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/DeptLineMapper.xml index 8f37da4f7..3fb0fb0a8 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/DeptLineMapper.xml +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/DeptLineMapper.xml @@ -206,8 +206,11 @@ INNER JOIN pq_line_detail pld ON pdl.Line_Id = pld.Id pld.Obj_Id IS NOT NULL and pld.Obj_Id !='' - - and pdl.Id = #{id} + + and pdl.Id in + + #{item} + and pld.Big_Obj_Type in diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/DeptLineServiceImpl.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/DeptLineServiceImpl.java index e1c352aff..ec4da3b90 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/DeptLineServiceImpl.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/DeptLineServiceImpl.java @@ -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 i } @Override - public List getLineByDeptIds(List ids,List runFlag,List dataType,String objType) { - return this.baseMapper.getLineIdByDeptIds(ids,runFlag,dataType,objType); + public List getLineByDeptIds(List ids, List runFlag, List dataType, String objType) { + return this.baseMapper.getLineIdByDeptIds(ids, runFlag, dataType, objType); } @Override @@ -100,15 +100,19 @@ public class DeptLineServiceImpl extends ServiceImpl i public List getLineByDeptIdAndNewStation(String id) { List 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 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 i @Override public Map> getLineByDeptRelation(Integer devDataType) { List 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> lineDevGet(List devDataType,Integer type,Integer lineRunFlag) { - List deptLines = deptLineMapper.lineDevGet(devDataType,type, lineRunFlag); - return deptLines.stream ().collect (Collectors.groupingBy (LineDevGetDTO::getUnitId)); + public Map> lineDevGet(List devDataType, Integer type, Integer lineRunFlag) { + List deptLines = deptLineMapper.lineDevGet(devDataType, type, lineRunFlag); + return deptLines.stream().collect(Collectors.groupingBy(LineDevGetDTO::getUnitId)); } @Override public Map> orgSubStationGet(List devDataType) { List deptLines = deptLineMapper.orgSubStationGet(devDataType); - return deptLines.stream ().collect (Collectors.groupingBy (TerminalGetBase::getUnitId)); + return deptLines.stream().collect(Collectors.groupingBy(TerminalGetBase::getUnitId)); } @Override - public List orgSubStationInfoGet(List devType,Integer powerFlag,Integer lineRunFlag) { - return deptLineMapper.orgSubStationInfoGet(devType, powerFlag,lineRunFlag); + public List orgSubStationInfoGet(List devType, Integer powerFlag, Integer lineRunFlag) { + return deptLineMapper.orgSubStationInfoGet(devType, powerFlag, lineRunFlag); } @Override @@ -162,7 +166,7 @@ public class DeptLineServiceImpl extends ServiceImpl i @Override public DeptLine getLineByLineIds(String ids) { return this.getOne(new LambdaQueryWrapper() - .eq(DeptLine::getLineId,ids) + .eq(DeptLine::getLineId, ids) ); } diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/controller/majornetwork/TransientController.java b/pqs-event/event-boot/src/main/java/com/njcn/event/controller/majornetwork/TransientController.java index c8d972537..f43d157b8 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/controller/majornetwork/TransientController.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/controller/majornetwork/TransientController.java @@ -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); } diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/SpThroughServiceImpl.java b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/SpThroughServiceImpl.java index cb7fe9ebe..57f369091 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/SpThroughServiceImpl.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/SpThroughServiceImpl.java @@ -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 formatEventIds(SpThroughParam spThroughParam) { LambdaQueryWrapper 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); diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/VoltageRideThroughEventServiceImpl.java b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/VoltageRideThroughEventServiceImpl.java index d6baf047a..3f0bcb930 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/VoltageRideThroughEventServiceImpl.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/VoltageRideThroughEventServiceImpl.java @@ -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; /** *

- * 高低电压穿越统计 服务类实现类 + * 高低电压穿越统计 服务类实现类 *

+ * * @author guofeihu * @since 2024-08-14 */ @@ -54,32 +56,32 @@ public class VoltageRideThroughEventServiceImpl implements VoltageRideThroughEve List voltageRideThroughVos = new ArrayList<>(); //根据当前选择的部门ID获取其下的子部门集合 List 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 lineIds = deptLineFeignClient.getLineByDeptIdAndNewStation(deptDTO.getId()).getData(); - if(!lineIds.isEmpty()){ + if (!lineIds.isEmpty()) { //根据已绑定能源站的监测点获取关联的暂态事件 List 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 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 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 lineIds = new ArrayList<>(); //获取当前部门下所有的已绑定能源站的监测点 lineIds.addAll(deptLineFeignClient.getLineByDeptIdAndNewStation(param.getAreaId()).getData()); - if(!lineIds.isEmpty()){ + if (!lineIds.isEmpty()) { //根据监测点获取监测点下所有的事件集合 List 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 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 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 lineDetailDataVOS = lineFeignClient.getLineDetailList(lineIds).getData(); Map lineDetailDataMap = lineDetailDataVOS.stream().collect(Collectors.toMap(LineDetailDataVO::getLineId, LineDetailDataVO::getObyId)); //特殊处理事件集合中新能源场站名称 List userReportVOS = userLedgerFeignClient.getUserReportByIds(new ArrayList<>(lineDetailDataMap.values())).getData(); Map 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)); } } diff --git a/pqs-harmonic/harmonic-api/src/main/java/com/njcn/harmonic/pojo/vo/ThdDataVO.java b/pqs-harmonic/harmonic-api/src/main/java/com/njcn/harmonic/pojo/vo/ThdDataVO.java index a7ad7eaf6..b3b7869ba 100644 --- a/pqs-harmonic/harmonic-api/src/main/java/com/njcn/harmonic/pojo/vo/ThdDataVO.java +++ b/pqs-harmonic/harmonic-api/src/main/java/com/njcn/harmonic/pojo/vo/ThdDataVO.java @@ -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; diff --git a/pqs-harmonic/harmonic-api/src/main/java/com/njcn/harmonic/pojo/vo/ThdDataVOExcel.java b/pqs-harmonic/harmonic-api/src/main/java/com/njcn/harmonic/pojo/vo/ThdDataVOExcel.java index dcf783bb5..04ec677da 100644 --- a/pqs-harmonic/harmonic-api/src/main/java/com/njcn/harmonic/pojo/vo/ThdDataVOExcel.java +++ b/pqs-harmonic/harmonic-api/src/main/java/com/njcn/harmonic/pojo/vo/ThdDataVOExcel.java @@ -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; diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/activepowerrange/impl/PowerStatisticsServiceImpl.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/activepowerrange/impl/PowerStatisticsServiceImpl.java index 481cf0e8b..4bceadeb5 100644 --- a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/activepowerrange/impl/PowerStatisticsServiceImpl.java +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/activepowerrange/impl/PowerStatisticsServiceImpl.java @@ -104,17 +104,17 @@ public class PowerStatisticsServiceImpl implements PowerStatisticsService { List 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 dtoList = dataLimitRateDetailFeignClient.getLimitRateDetailTimeList(lineCountEvaluateParam).getData(); - Map 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 dtoList = dataLimitRateDetailFeignClient.getLimitRateDetailTimeList(lineCountEvaluateParam).getData(); + Map timeDateMap = dtoList.stream().collect(Collectors.toMap(x -> x.getTime(), Function.identity())); List timeId = rActivePowerRangePO.getTimeId(); String times = reflexObjValue(rActivePowerRangePO, "minsTime" + powerStatisticsParam.getField()).toString().replace("null", ""); List 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 dataVAllTime = dataVFeignClient.getRawData(evaluateParam).getData(); @@ -165,42 +166,50 @@ public class PowerStatisticsServiceImpl implements PowerStatisticsService { List 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 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 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 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 info, Overlimit overlimit, String limitField, String fieldName, Integer start, Integer end, List dataAllTime, String anotherName) { + private void addThdData(List 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 info, Float limit, String fieldName, List dataAllTime, String anotherName) { + private void addThdData(List info, Float limit, String fieldName, List dataAllTime, String anotherName,String unit,String time) { if (CollUtil.isNotEmpty(dataAllTime)) { List 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; } /** diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/activepowerrange/impl/RActivePowerRangeServiceImpl.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/activepowerrange/impl/RActivePowerRangeServiceImpl.java index 2ed0c7def..eb197ab57 100644 --- a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/activepowerrange/impl/RActivePowerRangeServiceImpl.java +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/activepowerrange/impl/RActivePowerRangeServiceImpl.java @@ -74,7 +74,6 @@ public class RActivePowerRangeServiceImpl extends MppServiceImpl eventIds; + @ApiModelProperty("高电压,低电压字典") + private String frequencyType; + @ApiModelProperty(name = "lineType",value = "监测点类别(1:风电场、2:光伏电站)") private String stationType; - public SpThroughParam(List eventIds, String stationType) { + public SpThroughParam(List eventIds,String frequencyType, String stationType) { this.eventIds = eventIds; + this.frequencyType = frequencyType; this.stationType = stationType; }