From 0f54dc51999c3d6f1d3f86efa20460b767dd5e96 Mon Sep 17 00:00:00 2001 From: wr <1754607820@qq.com> Date: Wed, 19 Mar 2025 16:31:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BB=BC=E5=90=88=E8=AF=84?= =?UTF-8?q?=E4=BC=B0=E7=AE=97=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../executor/MeasurementExecutor.java | 34 + .../service/line/IDataComAssService.java | 25 + .../service/line/IPollutionService.java | 72 +- .../line/DataComAssServiceImpl.java | 267 +++++ .../line/IDataCrossingServiceImpl.java | 60 +- .../line/IDataCrossingServiceImpl2.java | 1061 +++++++++++++++++ .../line/PollutionServiceImpl.java | 295 +++-- .../api/DataComAssFeignClient.java | 30 + .../api/DataPollutionFeignClient.java | 25 + .../DataComAssFeignClientFallbackFactory.java | 49 + ...taPollutionFeignClientFallbackFactory.java | 58 + .../dataProcess/pojo/dto/DataPollutionD.java | 40 + .../pojo/dto/DataPollutionOrgD.java | 41 + .../pojo/dto/DataPollutionOrgM.java | 40 + .../pojo/dto/DataPollutionOrgQ.java | 40 + .../pojo/dto/DataPollutionOrgY.java | 40 + .../pojo/dto/DataPollutionSubstationD.java | 40 + .../pojo/dto/DataPollutionSubstationM.java | 40 + .../pojo/dto/DataPollutionSubstationQ.java | 40 + .../pojo/dto/DataPollutionSubstationY.java | 40 + .../po/RMpPollutionD.java} | 23 +- .../pojo/po/RStatLimitQualifiedD.java | 142 +-- .../pojo/po/RStatPollutionOrgD.java | 53 + .../pojo/po/RStatPollutionOrgM.java | 52 + .../pojo/po/RStatPollutionOrgQ.java | 52 + .../pojo/po/RStatPollutionOrgY.java | 52 + .../pojo/po/RStatPollutionSubstationD.java | 52 + .../pojo/po/RStatPollutionSubstationM.java | 52 + .../pojo/po/RStatPollutionSubstationQ.java | 52 + .../pojo/po/RStatPollutionSubstationY.java | 52 + .../controller/DataComAssController.java | 55 + .../controller/DataPollutionController.java | 58 + .../relation/mapper/RMpPollutionDMapper.java | 15 + .../mapper/RStatDataComAssMapper.java | 16 + .../mapper/RStatPollutionOrgDMapper.java | 15 + .../mapper/RStatPollutionOrgMMapper.java | 13 + .../mapper/RStatPollutionOrgQMapper.java | 14 + .../mapper/RStatPollutionOrgYMapper.java | 13 + .../RStatPollutionSubstationDMapper.java | 14 + .../RStatPollutionSubstationMMapper.java | 14 + .../RStatPollutionSubstationQMapper.java | 13 + .../RStatPollutionSubstationYMapper.java | 13 + .../dataProcess/service/IDataPollution.java | 23 + .../service/IDataPollutionOrgD.java | 14 + .../service/IDataPollutionOrgM.java | 14 + .../service/IDataPollutionOrgQ.java | 14 + .../service/IDataPollutionOrgY.java | 14 + .../service/IDataPollutionSubstationD.java | 14 + .../service/IDataPollutionSubstationM.java | 14 + .../service/IDataPollutionSubstationQ.java | 14 + .../service/IDataPollutionSubstationY.java | 14 + .../dataProcess/service/IRmpEventDetail.java | 1 - .../impl/influxdb/InfluxdbDataComAssImpl.java | 26 + .../influxdb/InfluxdbDataFlickerImpl.java | 30 +- .../influxdb/InfluxdbDataPollutionImpl.java | 28 + .../InfluxdbDataPollutionOrgDImpl.java | 23 + .../InfluxdbDataPollutionOrgMImpl.java | 23 + .../InfluxdbDataPollutionOrgQImpl.java | 23 + .../InfluxdbDataPollutionOrgYImpl.java | 23 + .../InfluxdbDataPollutionSubstationDImpl.java | 22 + .../InfluxdbDataPollutionSubstationMImpl.java | 22 + .../InfluxdbDataPollutionSubstationQImpl.java | 22 + .../InfluxdbDataPollutionSubstationYImpl.java | 22 + .../impl/influxdb/InfluxdbDataVImpl.java | 4 +- .../impl/relation/RelationDataComAssImpl.java | 36 + .../relation/RelationDataPollutionImpl.java | 37 + .../RelationDataPollutionOrgDImpl.java | 23 + .../RelationDataPollutionOrgMImpl.java | 23 + .../RelationDataPollutionOrgQImpl.java | 23 + .../RelationDataPollutionOrgYImpl.java | 23 + .../RelationDataPollutionSubstationDImpl.java | 22 + .../RelationDataPollutionSubstationMImpl.java | 22 + .../RelationDataPollutionSubstationQImpl.java | 22 + .../RelationDataPollutionSubstationYImpl.java | 22 + 74 files changed, 3580 insertions(+), 249 deletions(-) create mode 100644 algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/line/IDataComAssService.java create mode 100644 algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/DataComAssServiceImpl.java create mode 100644 algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/IDataCrossingServiceImpl2.java create mode 100644 data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/api/DataComAssFeignClient.java create mode 100644 data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/api/DataPollutionFeignClient.java create mode 100644 data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/api/fallback/DataComAssFeignClientFallbackFactory.java create mode 100644 data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/api/fallback/DataPollutionFeignClientFallbackFactory.java create mode 100644 data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionD.java create mode 100644 data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionOrgD.java create mode 100644 data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionOrgM.java create mode 100644 data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionOrgQ.java create mode 100644 data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionOrgY.java create mode 100644 data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionSubstationD.java create mode 100644 data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionSubstationM.java create mode 100644 data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionSubstationQ.java create mode 100644 data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionSubstationY.java rename data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/{po/relation/RMpPollutionDPO.java => pojo/po/RMpPollutionD.java} (74%) create mode 100644 data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionOrgD.java create mode 100644 data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionOrgM.java create mode 100644 data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionOrgQ.java create mode 100644 data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionOrgY.java create mode 100644 data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionSubstationD.java create mode 100644 data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionSubstationM.java create mode 100644 data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionSubstationQ.java create mode 100644 data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionSubstationY.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/controller/DataComAssController.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/controller/DataPollutionController.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RMpPollutionDMapper.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatDataComAssMapper.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionOrgDMapper.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionOrgMMapper.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionOrgQMapper.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionOrgYMapper.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionSubstationDMapper.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionSubstationMMapper.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionSubstationQMapper.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionSubstationYMapper.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollution.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionOrgD.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionOrgM.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionOrgQ.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionOrgY.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionSubstationD.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionSubstationM.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionSubstationQ.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionSubstationY.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataComAssImpl.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionImpl.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionOrgDImpl.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionOrgMImpl.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionOrgQImpl.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionOrgYImpl.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionSubstationDImpl.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionSubstationMImpl.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionSubstationQImpl.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionSubstationYImpl.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataComAssImpl.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionImpl.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionOrgDImpl.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionOrgMImpl.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionOrgQImpl.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionOrgYImpl.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionSubstationDImpl.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionSubstationMImpl.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionSubstationQImpl.java create mode 100644 data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionSubstationYImpl.java diff --git a/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/executor/MeasurementExecutor.java b/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/executor/MeasurementExecutor.java index 508935c..69c5f5c 100644 --- a/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/executor/MeasurementExecutor.java +++ b/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/executor/MeasurementExecutor.java @@ -33,6 +33,10 @@ public class MeasurementExecutor extends BaseExecutor { private IDataIntegrityService dataIntegrityService; @Resource private IEventDetailService eventDetailService; + @Resource + private IDataComAssService dataComAssService; + @Resource + private IPollutionService pollutionService; /** * 数据清洗 电压表 @@ -389,6 +393,36 @@ public class MeasurementExecutor extends BaseExecutor { dataCrossingService.limitQualifiedDayHandler(bindCmp.getRequestData()); } + /** + * 综合评估 + * @param bindCmp + * @return + */ + @LiteflowMethod(value = LiteFlowMethodEnum.IS_ACCESS, nodeId = "dataComAss", nodeType = NodeTypeEnum.COMMON) + public boolean dataComAssAccess(NodeComponent bindCmp) { + return isAccess(bindCmp); + } + + @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "dataComAss", nodeType = NodeTypeEnum.COMMON) + public void dataComAssProcess(NodeComponent bindCmp) { + dataComAssService.dataComAssHandler(bindCmp.getRequestData()); + } + + /** + * 监测点污区图 + * @param bindCmp + * @return + */ + @LiteflowMethod(value = LiteFlowMethodEnum.IS_ACCESS, nodeId = "dataPollution", nodeType = NodeTypeEnum.COMMON) + public boolean dataPollutionAccess(NodeComponent bindCmp) { + return isAccess(bindCmp); + } + + @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "dataPollution", nodeType = NodeTypeEnum.COMMON) + public void dataPollutionProcess(NodeComponent bindCmp) { + pollutionService.handleDay(bindCmp.getRequestData()); + } + /** * 监测点数据完整性 diff --git a/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/line/IDataComAssService.java b/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/line/IDataComAssService.java new file mode 100644 index 0000000..51cbd0a --- /dev/null +++ b/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/line/IDataComAssService.java @@ -0,0 +1,25 @@ +package com.njcn.algorithm.service.line; + + +import com.njcn.algorithm.pojo.bo.CalculatedParam; + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/6 10:22 + */ +public interface IDataComAssService { + + + + + /** + * 电能质量综合评估-日表 + * @param calculatedParam + * @Author: wr + * @Date: 2025/3/18 13:48 + */ + void dataComAssHandler(CalculatedParam calculatedParam); + + +} diff --git a/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/line/IPollutionService.java b/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/line/IPollutionService.java index 16f6808..fffd563 100644 --- a/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/line/IPollutionService.java +++ b/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/line/IPollutionService.java @@ -1,11 +1,81 @@ package com.njcn.algorithm.service.line; import com.njcn.algorithm.pojo.bo.CalculatedParam; +import com.njcn.device.biz.pojo.dto.DeptGetChildrenMoreDTO; /** * 测点污区数据 */ public interface IPollutionService { - + /** + * 监测点误区图计算 + * @param calculatedParam + * @Author: wr + * @Date: 2025/3/19 14:03 + */ void handleDay(CalculatedParam calculatedParam); + /** + * 单位(天)误区图计算 + * @param calculatedParam + * @Author: wr + * @Date: 2025/3/19 14:03 + */ + void handleOrgDay(CalculatedParam calculatedParam); + + /** + * 单位(月)误区图计算 + * @param calculatedParam + * @Author: wr + * @Date: 2025/3/19 14:03 + */ + void handleOrgMonth(CalculatedParam calculatedParam); + + /** + * 单位(季)误区图计算 + * @param calculatedParam + * @Author: wr + * @Date: 2025/3/19 14:03 + */ + void handleOrgQtr(CalculatedParam calculatedParam); + + /** + * 单位(年)误区图计算 + * @param calculatedParam + * @Author: wr + * @Date: 2025/3/19 14:03 + */ + void handleOrgYear(CalculatedParam calculatedParam); + + /** + * 变电站(天)误区图计算 + * @param calculatedParam + * @Author: wr + * @Date: 2025/3/19 14:03 + */ + void handleSubstationDay(CalculatedParam calculatedParam); + + /** + * 变电站(月)误区图计算 + * @param calculatedParam + * @Author: wr + * @Date: 2025/3/19 14:03 + */ + void handleSubstationMonth(CalculatedParam calculatedParam); + + /** + * 变电站(季)误区图计算 + * @param calculatedParam + * @Author: wr + * @Date: 2025/3/19 14:03 + */ + void handleSubstationQtr(CalculatedParam calculatedParam); + + /** + * 变电站(年)误区图计算 + * @param calculatedParam + * @Author: wr + * @Date: 2025/3/19 14:03 + */ + void handleSubstationYear(CalculatedParam calculatedParam); + } diff --git a/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/DataComAssServiceImpl.java b/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/DataComAssServiceImpl.java new file mode 100644 index 0000000..631439d --- /dev/null +++ b/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/DataComAssServiceImpl.java @@ -0,0 +1,267 @@ +package com.njcn.algorithm.serviceimpl.line; + +import cn.hutool.core.collection.CollUtil; +import com.njcn.algorithm.pojo.bo.CalculatedParam; +import com.njcn.algorithm.service.line.IDataComAssService; +import com.njcn.dataProcess.api.DataComAssFeignClient; +import com.njcn.dataProcess.api.DataFlickerFeignClient; +import com.njcn.dataProcess.api.DataVFeignClient; +import com.njcn.dataProcess.param.LineCountEvaluateParam; +import com.njcn.dataProcess.pojo.dto.DataComassesDPO; +import com.njcn.dataProcess.util.TimeUtils; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.time.LocalDateTime; +import java.util.*; + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/18 13:47 + */ + +@Slf4j +@Component +@RequiredArgsConstructor +public class DataComAssServiceImpl implements IDataComAssService { + + private static final Logger logger = LoggerFactory.getLogger(DayDataServiceImpl.class); + @Value("${line.num}") + private Integer NUM = 100; + @Resource + private DataVFeignClient dataVFeignClient; + + @Resource + private DataFlickerFeignClient dataFlickerFeignClient; + @Resource + private DataComAssFeignClient dataComAssFeignClient; + + @Override + public void dataComAssHandler(CalculatedParam calculatedParam) { + List list = new ArrayList<>(); + logger.info("{},r_stat_comasses_d算法开始=====》", LocalDateTime.now()); + LineCountEvaluateParam lineParam = new LineCountEvaluateParam(); + lineParam.setStartTime(TimeUtils.getBeginOfDay(calculatedParam.getDataDate())); + lineParam.setEndTime(TimeUtils.getEndOfDay(calculatedParam.getDataDate())); + List lineIdList = calculatedParam.getIdList(); + for (String lineId : lineIdList) { + DataComassesDPO rStatComassesDpo = new DataComassesDPO(); + rStatComassesDpo.setTime(calculatedParam.getDataDate()); + rStatComassesDpo.setLineId(lineId); + lineParam.setLineId(Arrays.asList(lineId)); + Map fields = getGeneralData(lineParam); + if (CollUtil.isNotEmpty(fields)) { + rStatComassesDpo.setFreqDev1(Objects.isNull(fields.get("freq_dev1")) ? 0.0 : Double.parseDouble(fields.get("freq_dev1").toString())); + rStatComassesDpo.setFreqDev2(Objects.isNull(fields.get("freq_dev2")) ? 0.0 : Double.parseDouble(fields.get("freq_dev2").toString())); + rStatComassesDpo.setFreqDev3(Objects.isNull(fields.get("freq_dev3")) ? 0.0 : Double.parseDouble(fields.get("freq_dev3").toString())); + rStatComassesDpo.setFreqDev4(Objects.isNull(fields.get("freq_dev4")) ? 0.0 : Double.parseDouble(fields.get("freq_dev4").toString())); + rStatComassesDpo.setFreqDev5(Objects.isNull(fields.get("freq_dev5")) ? 0.0 : Double.parseDouble(fields.get("freq_dev5").toString())); + + rStatComassesDpo.setVuDev1(Objects.isNull(fields.get("vu_dev1")) ? 0.0 : Double.parseDouble(fields.get("vu_dev1").toString())); + rStatComassesDpo.setVuDev2(Objects.isNull(fields.get("vu_dev2")) ? 0.0 : Double.parseDouble(fields.get("vu_dev2").toString())); + rStatComassesDpo.setVuDev3(Objects.isNull(fields.get("vu_dev3")) ? 0.0 : Double.parseDouble(fields.get("vu_dev3").toString())); + rStatComassesDpo.setVuDev4(Objects.isNull(fields.get("vu_dev4")) ? 0.0 : Double.parseDouble(fields.get("vu_dev4").toString())); + rStatComassesDpo.setVuDev5(Objects.isNull(fields.get("vu_dev5")) ? 0.0 : Double.parseDouble(fields.get("vu_dev5").toString())); + + rStatComassesDpo.setDataPst1(Objects.isNull(fields.get("data_pst1")) ? 0.0 : Double.parseDouble(fields.get("data_pst1").toString())); + rStatComassesDpo.setDataPst2(Objects.isNull(fields.get("data_pst2")) ? 0.0 : Double.parseDouble(fields.get("data_pst2").toString())); + rStatComassesDpo.setDataPst3(Objects.isNull(fields.get("data_pst3")) ? 0.0 : Double.parseDouble(fields.get("data_pst3").toString())); + rStatComassesDpo.setDataPst4(Objects.isNull(fields.get("data_pst4")) ? 0.0 : Double.parseDouble(fields.get("data_pst4").toString())); + rStatComassesDpo.setDataPst5(Objects.isNull(fields.get("data_pst5")) ? 0.0 : Double.parseDouble(fields.get("data_pst5").toString())); + + rStatComassesDpo.setVUnbalance1(Objects.isNull(fields.get("v_unbalance1")) ? 0.0 : Double.parseDouble(fields.get("v_unbalance1").toString())); + rStatComassesDpo.setVUnbalance2(Objects.isNull(fields.get("v_unbalance2")) ? 0.0 : Double.parseDouble(fields.get("v_unbalance2").toString())); + rStatComassesDpo.setVUnbalance3(Objects.isNull(fields.get("v_unbalance3")) ? 0.0 : Double.parseDouble(fields.get("v_unbalance3").toString())); + rStatComassesDpo.setVUnbalance4(Objects.isNull(fields.get("v_unbalance4")) ? 0.0 : Double.parseDouble(fields.get("v_unbalance4").toString())); + rStatComassesDpo.setVUnbalance5(Objects.isNull(fields.get("v_unbalance5")) ? 0.0 : Double.parseDouble(fields.get("v_unbalance5").toString())); + + rStatComassesDpo.setVThd1(Objects.isNull(fields.get("v_thd1")) ? 0.0 : Double.parseDouble(fields.get("v_thd1").toString())); + rStatComassesDpo.setVThd2(Objects.isNull(fields.get("v_thd2")) ? 0.0 : Double.parseDouble(fields.get("v_thd2").toString())); + rStatComassesDpo.setVThd3(Objects.isNull(fields.get("v_thd3")) ? 0.0 : Double.parseDouble(fields.get("v_thd3").toString())); + rStatComassesDpo.setVThd4(Objects.isNull(fields.get("v_thd4")) ? 0.0 : Double.parseDouble(fields.get("v_thd4").toString())); + rStatComassesDpo.setVThd5(Objects.isNull(fields.get("v_thd5")) ? 0.0 : Double.parseDouble(fields.get("v_thd5").toString())); + + rStatComassesDpo.setEvent1(Objects.isNull(fields.get("event1")) ? 0.0 : Double.parseDouble(fields.get("event1").toString())); + rStatComassesDpo.setEvent2(Objects.isNull(fields.get("event2")) ? 0.0 : Double.parseDouble(fields.get("event2").toString())); + rStatComassesDpo.setEvent3(Objects.isNull(fields.get("event3")) ? 0.0 : Double.parseDouble(fields.get("event3").toString())); + rStatComassesDpo.setEvent4(Objects.isNull(fields.get("event4")) ? 0.0 : Double.parseDouble(fields.get("event4").toString())); + rStatComassesDpo.setEvent5(Objects.isNull(fields.get("event5")) ? 0.0 : Double.parseDouble(fields.get("event5").toString())); + list.add(rStatComassesDpo); + } + } + + if (CollUtil.isNotEmpty(list)) { + dataComAssFeignClient.batchInsertion(list); + } + + } + + private Map getGeneralData(LineCountEvaluateParam lineParam) { + Map outMap = new HashMap<>(30); + BigDecimal hundred = BigDecimal.valueOf(100); + //************************************电压偏差******************************************** + lineParam.setPhasicType(Arrays.asList("A","B","C")); + lineParam.setValueType(Arrays.asList("AVG")); + lineParam.setColumnName("vu_dev"); + lineParam.setGe("10"); + Integer vuDev1 = dataVFeignClient.getColumnNameCountRawData(lineParam).getData(); + + lineParam.setGe("7"); + lineParam.setLt("10"); + Integer vuDev2 = dataVFeignClient.getColumnNameCountRawData(lineParam).getData(); + + lineParam.setGe("4"); + lineParam.setLt("7"); + Integer vuDev3 = dataVFeignClient.getColumnNameCountRawData(lineParam).getData(); + + lineParam.setGe("2"); + lineParam.setLt("4"); + Integer vuDev4 = dataVFeignClient.getColumnNameCountRawData(lineParam).getData(); + + lineParam.setGe("0"); + lineParam.setLt("2"); + Integer vuDev5 = dataVFeignClient.getColumnNameCountRawData(lineParam).getData(); + BigDecimal vuDevAll = BigDecimal.valueOf(vuDev1 + vuDev2 + vuDev3 + vuDev4 + vuDev5); + if (vuDevAll.compareTo(BigDecimal.ZERO) != 0) { + outMap.put("vu_dev1", BigDecimal.valueOf(vuDev1).multiply(hundred).divide(vuDevAll, 3, RoundingMode.HALF_UP)); + outMap.put("vu_dev2", BigDecimal.valueOf(vuDev2).multiply(hundred).divide(vuDevAll, 3, RoundingMode.HALF_UP)); + outMap.put("vu_dev3", BigDecimal.valueOf(vuDev3).multiply(hundred).divide(vuDevAll, 3, RoundingMode.HALF_UP)); + outMap.put("vu_dev4", BigDecimal.valueOf(vuDev4).multiply(hundred).divide(vuDevAll, 3, RoundingMode.HALF_UP)); + outMap.put("vu_dev5", BigDecimal.valueOf(vuDev5).multiply(hundred).divide(vuDevAll, 3, RoundingMode.HALF_UP)); + } + //************************************频率偏差******************************************** + lineParam.setColumnName("freq_dev"); + lineParam.setGe("0.3"); + Integer freqDev1 = dataVFeignClient.getColumnNameCountRawData(lineParam).getData(); + + lineParam.setGe("0.2"); + lineParam.setLt("0.3"); + Integer freqDev2 = dataVFeignClient.getColumnNameCountRawData(lineParam).getData(); + + lineParam.setGe("0.1"); + lineParam.setLt("0.2"); + Integer freqDev3 = dataVFeignClient.getColumnNameCountRawData(lineParam).getData(); + + lineParam.setGe("0.05"); + lineParam.setLt("0.1"); + Integer freqDev4 = dataVFeignClient.getColumnNameCountRawData(lineParam).getData(); + + lineParam.setGe("0"); + lineParam.setLt("0.05"); + Integer freqDev5 = dataVFeignClient.getColumnNameCountRawData(lineParam).getData(); + BigDecimal freqDevAll = BigDecimal.valueOf(freqDev1 + freqDev2 + freqDev3 + freqDev4 + freqDev5); + if (freqDevAll.compareTo(BigDecimal.ZERO) != 0) { + outMap.put("freq_dev1", BigDecimal.valueOf(freqDev1).multiply(hundred).divide(freqDevAll, 3, RoundingMode.HALF_UP)); + outMap.put("freq_dev2", BigDecimal.valueOf(freqDev2).multiply(hundred).divide(freqDevAll, 3, RoundingMode.HALF_UP)); + outMap.put("freq_dev3", BigDecimal.valueOf(freqDev3).multiply(hundred).divide(freqDevAll, 3, RoundingMode.HALF_UP)); + outMap.put("freq_dev4", BigDecimal.valueOf(freqDev4).multiply(hundred).divide(freqDevAll, 3, RoundingMode.HALF_UP)); + outMap.put("freq_dev5", BigDecimal.valueOf(freqDev5).multiply(hundred).divide(freqDevAll, 3, RoundingMode.HALF_UP)); + } + //************************************谐波畸变率******************************************** + lineParam.setColumnName("v_thd"); + lineParam.setValueType(Arrays.asList("CP95")); + lineParam.setGe("6"); + Integer vThd1 = dataVFeignClient.getColumnNameCountRawData(lineParam).getData(); + + lineParam.setGe("4"); + lineParam.setLt("6"); + Integer vThd2 = dataVFeignClient.getColumnNameCountRawData(lineParam).getData(); + + lineParam.setGe("2"); + lineParam.setLt("4"); + Integer vThd3 = dataVFeignClient.getColumnNameCountRawData(lineParam).getData(); + + lineParam.setGe("1"); + lineParam.setLt("2"); + Integer vThd4 = dataVFeignClient.getColumnNameCountRawData(lineParam).getData(); + + lineParam.setGe("0"); + lineParam.setLt("1"); + Integer vThd5 = dataVFeignClient.getColumnNameCountRawData(lineParam).getData(); + BigDecimal vThdAll = BigDecimal.valueOf(vThd1 + vThd2 + vThd3 + vThd4 + vThd5); + if (vThdAll.compareTo(BigDecimal.ZERO) != 0) { + outMap.put("v_thd1", BigDecimal.valueOf(vThd1).multiply(hundred).divide(vThdAll, 3, RoundingMode.HALF_UP)); + outMap.put("v_thd2", BigDecimal.valueOf(vThd2).multiply(hundred).divide(vThdAll, 3, RoundingMode.HALF_UP)); + outMap.put("v_thd3", BigDecimal.valueOf(vThd3).multiply(hundred).divide(vThdAll, 3, RoundingMode.HALF_UP)); + outMap.put("v_thd4", BigDecimal.valueOf(vThd4).multiply(hundred).divide(vThdAll, 3, RoundingMode.HALF_UP)); + outMap.put("v_thd5", BigDecimal.valueOf(vThd5).multiply(hundred).divide(vThdAll, 3, RoundingMode.HALF_UP)); + } + + //************************************三相电压不平衡度******************************************** + lineParam.setColumnName("v_unbalance"); + lineParam.setGe("4"); + Integer vUnbalance1 = dataVFeignClient.getColumnNameCountRawData(lineParam).getData(); + + lineParam.setGe("2"); + lineParam.setLt("4"); + Integer vUnbalance2 = dataVFeignClient.getColumnNameCountRawData(lineParam).getData(); + + lineParam.setGe("1"); + lineParam.setLt("2"); + Integer vUnbalance3 = dataVFeignClient.getColumnNameCountRawData(lineParam).getData(); + + lineParam.setGe("0.5"); + lineParam.setLt("1"); + Integer vUnbalance4 = dataVFeignClient.getColumnNameCountRawData(lineParam).getData(); + + lineParam.setGe("0"); + lineParam.setLt("0.5"); + Integer vUnbalance5 = dataVFeignClient.getColumnNameCountRawData(lineParam).getData(); + BigDecimal vUnbalanceAll = BigDecimal.valueOf(vUnbalance1 + vUnbalance2 + vUnbalance3 + vUnbalance4 + vUnbalance5); + if (vUnbalanceAll.compareTo(BigDecimal.ZERO) != 0) { + outMap.put("v_unbalance1", BigDecimal.valueOf(vUnbalance1).multiply(hundred).divide(vUnbalanceAll, 3, RoundingMode.HALF_UP)); + outMap.put("v_unbalance2", BigDecimal.valueOf(vUnbalance2).multiply(hundred).divide(vUnbalanceAll, 3, RoundingMode.HALF_UP)); + outMap.put("v_unbalance3", BigDecimal.valueOf(vUnbalance3).multiply(hundred).divide(vUnbalanceAll, 3, RoundingMode.HALF_UP)); + outMap.put("v_unbalance4", BigDecimal.valueOf(vUnbalance4).multiply(hundred).divide(vUnbalanceAll, 3, RoundingMode.HALF_UP)); + outMap.put("v_unbalance5", BigDecimal.valueOf(vUnbalance5).multiply(hundred).divide(vUnbalanceAll, 3, RoundingMode.HALF_UP)); + } + //************************************电压波动(短时闪变)******************************************** + lineParam.setColumnName("pst"); + lineParam.setValueType(null); + lineParam.setGe("0.8"); + Integer plt1 = dataFlickerFeignClient.getColumnNameCountRawData(lineParam).getData(); + + lineParam.setGe("0.6"); + lineParam.setLt("0.8"); + Integer plt2 = dataFlickerFeignClient.getColumnNameCountRawData(lineParam).getData(); + + lineParam.setGe("0.4"); + lineParam.setLt("0.6"); + Integer plt3 = dataFlickerFeignClient.getColumnNameCountRawData(lineParam).getData(); + + lineParam.setGe("0.2"); + lineParam.setLt("0.4"); + Integer plt4 = dataFlickerFeignClient.getColumnNameCountRawData(lineParam).getData(); + + lineParam.setGe("0"); + lineParam.setLt("0.2"); + Integer plt5 = dataFlickerFeignClient.getColumnNameCountRawData(lineParam).getData(); + BigDecimal pltAll = BigDecimal.valueOf(plt1 + plt2 + plt3 + plt4 + plt5); + if (pltAll.compareTo(BigDecimal.ZERO) != 0) { + outMap.put("data_plt1", BigDecimal.valueOf(plt1).multiply(hundred).divide(pltAll, 3, RoundingMode.HALF_UP)); + outMap.put("data_plt2", BigDecimal.valueOf(plt2).multiply(hundred).divide(pltAll, 3, RoundingMode.HALF_UP)); + outMap.put("data_plt3", BigDecimal.valueOf(plt3).multiply(hundred).divide(pltAll, 3, RoundingMode.HALF_UP)); + outMap.put("data_plt4", BigDecimal.valueOf(plt4).multiply(hundred).divide(pltAll, 3, RoundingMode.HALF_UP)); + outMap.put("data_plt5", BigDecimal.valueOf(plt5).multiply(hundred).divide(pltAll, 3, RoundingMode.HALF_UP)); + } + + if (!CollUtil.isEmpty(outMap)) { + outMap.put("event1", 100.0); + outMap.put("event2", 0.0); + outMap.put("event3", 0.0); + outMap.put("event4", 0.0); + outMap.put("event5", 0.0); + } + return outMap; + } + + +} diff --git a/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/IDataCrossingServiceImpl.java b/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/IDataCrossingServiceImpl.java index 62ecea8..6fb076b 100644 --- a/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/IDataCrossingServiceImpl.java +++ b/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/IDataCrossingServiceImpl.java @@ -34,6 +34,8 @@ import org.springframework.util.CollectionUtils; import javax.annotation.Resource; import java.lang.reflect.Field; import java.lang.reflect.Method; +import java.math.BigDecimal; +import java.math.RoundingMode; import java.time.LocalDateTime; import java.util.*; import java.util.function.Function; @@ -281,18 +283,18 @@ public class IDataCrossingServiceImpl implements IDataCrossingService { qualified.setTime(calculatedParam.getDataDate()); int all = value.stream().mapToInt(DataLimitRateDto::getAllTime).sum(); if (all > 0) { - qualified.setFreqDevOvertime(PubUtils.doubleRound(2, 100.0 - getaDouble(value.stream().mapToInt(DataLimitRateDto::getFreqDevOvertime).sum() * 100.0, all))); - qualified.setVoltageDevOvertime(PubUtils.doubleRound(2, 100.0 - getaDouble(value.stream().mapToInt(DataLimitRateDto::getVoltageDevOvertime).sum() * 100.0, all))); - qualified.setUbalanceOvertime(PubUtils.doubleRound(2, 100.0 - getaDouble(value.stream().mapToInt(DataLimitRateDto::getUbalanceOvertime).sum() * 100.0, all))); - qualified.setUaberranceOvertime(PubUtils.doubleRound(2, 100.0 - getaDouble(value.stream().mapToInt(DataLimitRateDto::getUaberranceOvertime).sum() * 100.0, all))); - qualified.setINegOvertime(PubUtils.doubleRound(2, 100.0 - getaDouble(value.stream().mapToInt(DataLimitRateDto::getINegOvertime).sum() * 100.0, all))); + qualified.setFreqDevOvertime(PubUtils.doubleRound(2, 100.0 - getaDouble(value.stream().mapToInt(DataLimitRateDto::getFreqDevOvertime).sum(), all))); + qualified.setVoltageDevOvertime(PubUtils.doubleRound(2, 100.0 - getaDouble(value.stream().mapToInt(DataLimitRateDto::getVoltageDevOvertime).sum(), all))); + qualified.setUbalanceOvertime(PubUtils.doubleRound(2, 100.0 - getaDouble(value.stream().mapToInt(DataLimitRateDto::getUbalanceOvertime).sum(), all))); + qualified.setUaberranceOvertime(PubUtils.doubleRound(2, 100.0 - getaDouble(value.stream().mapToInt(DataLimitRateDto::getUaberranceOvertime).sum(), all))); + qualified.setINegOvertime(PubUtils.doubleRound(2, 100.0 - getaDouble(value.stream().mapToInt(DataLimitRateDto::getINegOvertime).sum(), all))); setOverTime(2, 25, "uharm", value, qualified, all); setOverTime(2, 25, "iharm", value, qualified, all); setOverTime(1, 16, "inuharm", value, qualified, all); } int flickerAll = value.stream().mapToInt(DataLimitRateDto::getFlickerAllTime).sum(); if (flickerAll > 0) { - qualified.setFlickerOvertime(PubUtils.doubleRound(2, 100.0 - getaDouble(value.stream().mapToInt(DataLimitRateDto::getFlickerOvertime).sum() * 100.0, flickerAll))); + qualified.setFlickerOvertime(PubUtils.doubleRound(2, 100.0 - getaDouble(value.stream().mapToInt(DataLimitRateDto::getFlickerOvertime).sum(), flickerAll))); } info.add(qualified); @@ -344,39 +346,56 @@ public class IDataCrossingServiceImpl implements IDataCrossingService { DataQualifiedDetail qualified = new DataQualifiedDetail(); qualified.setLineId(key); qualified.setTime(lineParam.getStartTime()); - qualified.setFreqDevOvertime(PubUtils.doubleRound(2, value.stream().mapToDouble(DataQualifiedDetail::getFreqDevOvertime).average().getAsDouble())); - qualified.setVoltageDevOvertime(PubUtils.doubleRound(2, value.stream().mapToDouble(DataQualifiedDetail::getVoltageDevOvertime).average().getAsDouble())); - qualified.setUbalanceOvertime(PubUtils.doubleRound(2, value.stream().mapToDouble(DataQualifiedDetail::getUbalanceOvertime).average().getAsDouble())); - qualified.setUaberranceOvertime(PubUtils.doubleRound(2, value.stream().mapToDouble(DataQualifiedDetail::getUaberranceOvertime).average().getAsDouble())); - qualified.setINegOvertime(PubUtils.doubleRound(2, value.stream().mapToDouble(DataQualifiedDetail::getINegOvertime).average().getAsDouble())); + qualified.setFreqDevOvertime(getaDouble(value.stream().filter(x -> ObjectUtil.isNotNull(x.getFreqDevOvertime())).map(DataQualifiedDetail::getFreqDevOvertime).collect(Collectors.toList()))); + qualified.setVoltageDevOvertime(getaDouble(value.stream().filter(x -> ObjectUtil.isNotNull(x.getVoltageDevOvertime())).map(DataQualifiedDetail::getVoltageDevOvertime).collect(Collectors.toList()))); + qualified.setUbalanceOvertime(getaDouble(value.stream().filter(x -> ObjectUtil.isNotNull(x.getUbalanceOvertime())).map(DataQualifiedDetail::getUbalanceOvertime).collect(Collectors.toList()))); + qualified.setUaberranceOvertime(getaDouble(value.stream().filter(x -> ObjectUtil.isNotNull(x.getUaberranceOvertime())).map(DataQualifiedDetail::getUaberranceOvertime).collect(Collectors.toList()))); + qualified.setINegOvertime(getaDouble(value.stream().filter(x -> ObjectUtil.isNotNull(x.getINegOvertime())).map(DataQualifiedDetail::getINegOvertime).collect(Collectors.toList()))); + qualified.setFlickerOvertime(getaDouble(value.stream().filter(x -> ObjectUtil.isNotNull(x.getFlickerOvertime())).map(DataQualifiedDetail::getFlickerOvertime).collect(Collectors.toList()))); setOverTime(2, 25, "uharm", value, qualified); setOverTime(2, 25, "iharm", value, qualified); setOverTime(1, 16, "inuharm", value, qualified); info.add(qualified); } } + return info; } - private double getaDouble(double value, int all) { - return value * 100.0 / all; + private Double getaDouble(List doubles) { + List numList = doubles.stream().filter(x -> ObjectUtil.isNotNull(x)).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(numList)){ + double asDouble = numList.stream().mapToDouble(Double::doubleValue).average().getAsDouble(); + return PubUtils.doubleRound(2, asDouble); + } + return null; } + + private double getaDouble(double value, int all) { + double v = BigDecimal.valueOf(value * 100.0).divide(BigDecimal.valueOf(all), 4, RoundingMode.HALF_UP).doubleValue(); + return v > 100 ? 100 : v; + } + private void setOverTime(Integer start, Integer end, String targetName, List value, DataQualifiedDetail qualified) { for (int i = start; i <= end; i++) { // 构造方法名 String methodName = targetName + i + "Overtime"; try { - Field finalField = DataLimitRateDto.class.getDeclaredField(methodName); + Field finalField = DataQualifiedDetail.class.getDeclaredField(methodName); finalField.setAccessible(true); - double v = PubUtils.doubleRound(2, value.stream().mapToDouble(temp -> { - Double o; + List collect = value.stream().map(temp -> { + Object o; try { - o = (Double) finalField.get(temp); + o = finalField.get(temp); } catch (IllegalAccessException e) { throw new RuntimeException(e); } - return o.doubleValue(); - }).average().getAsDouble()); + if(ObjectUtil.isNotNull(o)){ + return (Double)o; + } + return null; + }).collect(Collectors.toList()); + Double v = getaDouble(collect); Field declared = DataQualifiedDetail.class.getDeclaredField(methodName); declared.setAccessible(true); declared.set(qualified, v); @@ -385,6 +404,7 @@ public class IDataCrossingServiceImpl implements IDataCrossingService { } } } + private void setOverTime(Integer start, Integer end, String targetName, List value, DataQualifiedDetail qualified, int all) { for (int i = start; i <= end; i++) { // 构造方法名 @@ -400,7 +420,7 @@ public class IDataCrossingServiceImpl implements IDataCrossingService { throw new RuntimeException(e); } return o.intValue(); - }).sum() * 100.0, all)); + }).sum(), all)); Field declared = DataQualifiedDetail.class.getDeclaredField(methodName); declared.setAccessible(true); declared.set(qualified, v); diff --git a/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/IDataCrossingServiceImpl2.java b/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/IDataCrossingServiceImpl2.java new file mode 100644 index 0000000..4a766ac --- /dev/null +++ b/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/IDataCrossingServiceImpl2.java @@ -0,0 +1,1061 @@ +//package com.njcn.algorithm.serviceimpl.line; +// +// +//import cn.hutool.core.collection.CollUtil; +//import cn.hutool.core.collection.ListUtil; +//import cn.hutool.core.date.DatePattern; +//import cn.hutool.core.date.LocalDateTimeUtil; +//import com.njcn.algorithm.pojo.bo.CalculatedParam; +//import com.njcn.algorithm.service.line.IDataCrossingService; +//import com.njcn.dataProcess.api.*; +//import com.njcn.dataProcess.constant.PhaseType; +//import com.njcn.dataProcess.param.LineCountEvaluateParam; +//import com.njcn.dataProcess.pojo.dto.*; +//import com.njcn.dataProcess.util.TimeUtils; +//import com.njcn.device.biz.commApi.CommTerminalGeneralClient; +//import com.njcn.device.biz.pojo.po.Overlimit; +//import com.njcn.influx.constant.InfluxDbSqlConstant; +//import com.njcn.influx.pojo.constant.InfluxDBTableConstant; +//import lombok.RequiredArgsConstructor; +//import lombok.extern.slf4j.Slf4j; +//import org.apache.commons.collections4.ListUtils; +//import org.slf4j.Logger; +//import org.slf4j.LoggerFactory; +//import org.springframework.stereotype.Component; +//import org.springframework.util.CollectionUtils; +// +//import javax.annotation.Resource; +//import java.time.LocalDateTime; +//import java.util.ArrayList; +//import java.util.HashMap; +//import java.util.List; +//import java.util.Map; +//import java.util.function.Function; +//import java.util.stream.Collectors; +// +///** +// * @Description: +// * @Author: wr +// * @Date: 2025/3/6 10:22 +// */ +//@Slf4j +//@Component +//@RequiredArgsConstructor +//public class IDataCrossingServiceImpl2 implements IDataCrossingService { +// +// private static final Logger logger = LoggerFactory.getLogger(DayDataServiceImpl.class); +// private final static Integer NUM = 100; +// @Resource +// private DataVFeignClient dataVFeignClient; +// @Resource +// private CommTerminalGeneralClient commTerminalGeneralClient; +// @Resource +// private DataIFeignClient dataIFeignClient; +// @Resource +// private DataPltFeignClient dataPltFeignClient; +// @Resource +// private DataInharmVFeignClient dataInharmVFeignClient; +// @Resource +// private DataHarmRateVFeignClient dataHarmRateVFeignClient; +// +// +// @Override +// public void limitRateHandler(CalculatedParam calculatedParam) { +// logger.info("{},dataV表转r_stat_data_v_d算法开始=====》", LocalDateTime.now()); +// List result = new ArrayList<>(); +// //远程接口获取分钟数据 +// LineCountEvaluateParam lineParam = new LineCountEvaluateParam(); +// lineParam.setStartTime(TimeUtils.getBeginOfDay(calculatedParam.getDataDate())); +// lineParam.setEndTime(TimeUtils.getEndOfDay(calculatedParam.getDataDate())); +// List lineIds = calculatedParam.getIdList(); +// //获取所有监测点的限值 +// List overLimitList = commTerminalGeneralClient.getOverLimitDataByIds(lineIds).getData(); +// Map overLimitMap = overLimitList.stream().collect(Collectors.toMap(Overlimit::getId, Function.identity())); +// +// +// //以100个监测点分片处理 +// List> pendingIds = ListUtils.partition(lineIds, NUM); +// ArrayList phase = ListUtil.toList(PhaseType.PHASE_A, PhaseType.PHASE_B, PhaseType.PHASE_C); +// pendingIds.forEach(list -> { +// lineParam.setLineId(list); +// //获取电压数据 +// List dataVAllTime = dataVFeignClient.getRawData(lineParam).getData(); +// //闪变数据 +// List dataFlickerAllTime = dataPltFeignClient.getRawData(lineParam).getData(); +// //谐波数据 +// List dataVHarmList = dataHarmRateVFeignClient.getRawData(lineParam).getData(); +// //间谐波数据 +// List dataVInHarmList = dataInharmVFeignClient.getRawData(lineParam).getData(); +// //电流数据 +// List dataIList = dataIFeignClient.getRawData(lineParam).getData(); +// +// /** +// * 功能描述:获取influxDB -> data_v -> +// * 总计算次数(用data_v中phasic_type=A,value_type=avg,quality_flag=0来参与统计) +// */ +// Map> allTime = dataVAllTime.stream() +// .filter(x -> PhaseType.PHASE_A.equals(x.getPhasicType())) +// .filter(x -> InfluxDbSqlConstant.AVG_WEB.equals(x.getValueType())) +// .collect(Collectors.groupingBy(DataVDto::getLineId)); +// +// /** +// * 功能描述:获取influxDB -> data_plt -> +// * 闪变总计算次数(用data_plt中phasic_type=A,quality_flag=0来参与统计) +// */ +// Map> flickerAllTime = dataFlickerAllTime.stream() +// .filter(x -> PhaseType.PHASE_A.equals(x.getValueType())) +// .collect(Collectors.groupingBy(DataPltDto::getLineId)); +// +// /** +// *功能描述:获取influxDB -> data_harmrate_v -> +// * 2-25次谐波电压含有率 -> A相||B相||C相的日95%概率值 +// */ +// Map> harmRateV = dataVHarmList.stream() +// .filter(x -> phase.contains(x.getPhasicType())) +// .filter(x -> InfluxDBTableConstant.CP95.equals(x.getValueType())) +// .collect(Collectors.groupingBy(DataHarmDto::getLineId)); +// +// /** +// * 功能描述:获取influxDB -> data_i -> 2-25次谐波电流 -> 日95%概率值 +// */ +// Map> dataI = dataIList.stream() +// .filter(x -> phase.contains(x.getPhasicType())) +// .filter(x -> InfluxDBTableConstant.CP95.equals(x.getValueType())) +// .collect(Collectors.groupingBy(DataIDto::getLineId)); +// +// +// /** +// * 功能描述:获取influxDB -> data_inharm_v -> 0.5-15.5次间谐波电压含有率 -> 日95%概率值 +// */ +// Map> inHarmV = dataVInHarmList.stream() +// .filter(x -> phase.contains(x.getPhasicType())) +// .filter(x -> InfluxDBTableConstant.CP95.equals(x.getValueType())) +// .collect(Collectors.groupingBy(DataHarmDto::getLineId)); +// +// /** +// * 功能描述:获取influxDB -> data_v -> 电压总谐波畸变率 -> 日95%概率值 +// */ +// Map> dataVThd = dataVAllTime.stream() +// .filter(x -> phase.contains(x.getPhasicType())) +// .filter(x -> InfluxDBTableConstant.CP95.equals(x.getValueType())) +// .collect(Collectors.groupingBy(DataVDto::getLineId)); +// +// /** +// * 功能描述:获取influxDB -> data_v -> 负序电压不平衡度 -> 最大值 && 日95%概率值 +// */ +// Map> dataVUnbalance = dataVAllTime.stream() +// .filter(x -> InfluxDBTableConstant.PHASE_TYPE_T.equals(x.getPhasicType())) +// .filter(x -> InfluxDBTableConstant.CP95.equals(x.getValueType()) || +// InfluxDBTableConstant.MAX.equals(x.getValueType())) +// .collect(Collectors.groupingBy(DataVDto::getLineId)); +// +// /** +// * 功能描述:获取influxDB -> data_i -> 负序电流 -> 最大值 && 日95%概率值 +// */ +// Map> dataINeg = dataIList.stream() +// .filter(x -> InfluxDBTableConstant.PHASE_TYPE_T.equals(x.getPhasicType())) +// .filter(x -> InfluxDBTableConstant.CP95.equals(x.getValueType()) || +// InfluxDBTableConstant.MAX.equals(x.getValueType())) +// .collect(Collectors.groupingBy(DataIDto::getLineId)); +// +// /** +// * 功能描述:获取influxDB -> data_v -> 频率偏差 -> 最大值 && 最小值 +// */ +// Map> dataVFreq = dataVAllTime.stream() +// .filter(x -> InfluxDBTableConstant.PHASE_TYPE_T.equals(x.getPhasicType())) +// .filter(x -> InfluxDBTableConstant.MIN.equals(x.getValueType()) || +// InfluxDBTableConstant.MAX.equals(x.getValueType())) +// .collect(Collectors.groupingBy(DataVDto::getLineId)); +// /** +// * 功能描述:获取influxDB -> data_v -> 电压偏差 -> 最大值 +// */ +// Map> dataVDev = dataVAllTime.stream() +// .filter(x -> phase.contains(x.getPhasicType())) +// .filter(x -> InfluxDBTableConstant.MAX.equals(x.getValueType())) +// .collect(Collectors.groupingBy(DataVDto::getLineId)); +// +// /** +// * 功能描述:获取influxDB -> data_plt -> 长时间闪变 -> 最大值 +// */ +// Map> dataPlt = dataFlickerAllTime.stream() +// .filter(x -> phase.contains(x.getPhasicType())) +// .filter(x -> InfluxDBTableConstant.MAX.equals(x.getValueType())) +// .collect(Collectors.groupingBy(DataPltDto::getLineId)); +// +// for (String item : lineIds) { +// result.addAll(getData(calculatedParam.getDataDate(), +// overLimitMap.get(item), +// allTime.get(item), +// flickerAllTime.get(item), +// harmRateV.get(item), +// dataI.get(item), +// inHarmV.get(item), +// dataVThd.get(item), +// dataVUnbalance.get(item), +// dataINeg.get(item), +// dataVFreq.get(item), +// dataVDev.get(item), +// dataPlt.get(item))); +// +// } +// +// +// }); +// +// if (CollUtil.isNotEmpty(result)) { +// //存储数据 +// +// } +// +// +// } +// +// +// /** +// * @Description: getData +// * @Param: [overlimit, allTimeList, flickerAllTimeList, dataHarmRateVPOList, dataIPOList, dataInHarmVPOList, dataVPOList, dataVPOUnbalanceList, dataIPONegList, dataVPOFreqList, dataVPODevList, dataPltPOList] +// * @return: java.util.List +// * @Author: clam +// * @Date: 2022/10/18 +// */ +// private List getData(String dataDate, +// Overlimit overlimit, +// List allTimeList, +// List flickerAllTimeList, +// List dataHarmRateVPOList, +// List dataIPOList, +// List dataInHarmVPOList, +// List dataVPOList, +// List dataVPOUnbalanceList, +// List dataIPONegList, +// List dataVPOFreqList, +// List dataVPODevList, +// List dataPltPOList) { +// List result = new ArrayList<>(); +// +// Map> harmRateVByPhaseType = new HashMap<>(); +// Map> dataIByPhaseType = new HashMap<>(); +// Map> dataInHarmVPhaseType = new HashMap<>(); +// Map> dataVPhaseType = new HashMap<>(); +// Map> dataVDevPhaseType = new HashMap<>(); +// Map> dataPltPhaseType = new HashMap<>(); +// +// +// Map> harmRateVByTime = new HashMap<>(); +// Map> dataIByTime = new HashMap<>(); +// Map> dataInHarmVByTime = new HashMap<>(); +// Map> dataVByTime = new HashMap<>(); +// Map> dataVUnbalanceByTime = new HashMap<>(); +// Map> dataINegByTime = new HashMap<>(); +// Map> dataVFreqByTime = new HashMap<>(); +// Map> dataVDevByTime = new HashMap<>(); +// Map> dataPltByTime = new HashMap<>(); +// Integer allTime = 0; +// Integer flickerAllTime = 0; +// if (!CollectionUtils.isEmpty(allTimeList)) { +// allTime = allTimeList.size(); +// } +// if (!CollectionUtils.isEmpty(flickerAllTimeList)) { +// flickerAllTime = flickerAllTimeList.size(); +// } +// if (!CollectionUtils.isEmpty(dataHarmRateVPOList)) { +// harmRateVByPhaseType = dataHarmRateVPOList.stream().collect(Collectors.groupingBy(DataHarmDto::getPhasicType)); +// harmRateVByTime = dataHarmRateVPOList.stream().collect(Collectors.groupingBy(DataHarmDto::getMinTime)); +// } +// if (!CollectionUtils.isEmpty(dataIPOList)) { +// dataIByPhaseType = dataIPOList.stream().collect(Collectors.groupingBy(DataIDto::getPhasicType)); +// dataIByTime = dataIPOList.stream().collect(Collectors.groupingBy(DataIDto::getMinTime)); +// } +// if (!CollectionUtils.isEmpty(dataInHarmVPOList)) { +// dataInHarmVPhaseType = dataInHarmVPOList.stream().collect(Collectors.groupingBy(DataHarmDto::getPhasicType)); +// dataInHarmVByTime = dataInHarmVPOList.stream().collect(Collectors.groupingBy(DataHarmDto::getMinTime)); +// } +// if (!CollectionUtils.isEmpty(dataVPOList)) { +// dataVPhaseType = dataVPOList.stream().collect(Collectors.groupingBy(DataVDto::getPhasicType)); +// dataVByTime = dataVPOList.stream().collect(Collectors.groupingBy(DataVDto::getMinTime)); +// } +// if (!CollectionUtils.isEmpty(dataVPOUnbalanceList)) { +// dataVUnbalanceByTime = dataVPOUnbalanceList.stream().collect(Collectors.groupingBy(DataVDto::getMinTime)); +// } +// if (!CollectionUtils.isEmpty(dataIPONegList)) { +// dataINegByTime = dataIPONegList.stream().collect(Collectors.groupingBy(DataIDto::getMinTime)); +// } +// if (!CollectionUtils.isEmpty(dataVPOFreqList)) { +// dataVFreqByTime = dataVPOFreqList.stream().collect(Collectors.groupingBy(DataVDto::getMinTime)); +// } +// if (!CollectionUtils.isEmpty(dataVPODevList)) { +// dataVDevPhaseType = dataVPODevList.stream().collect(Collectors.groupingBy(DataVDto::getPhasicType)); +// dataVDevByTime = dataVPODevList.stream().collect(Collectors.groupingBy(DataVDto::getMinTime)); +// } +// if (!CollectionUtils.isEmpty(dataPltPOList)) { +// dataPltPhaseType = dataPltPOList.stream().collect(Collectors.groupingBy(DataPltDto::getPhasicType)); +// dataPltByTime = dataPltPOList.stream().collect(Collectors.groupingBy(DataPltDto::getMinTime)); +// } +// DataLimitRateDto a = limitRateData(dataDate, overlimit, allTime, flickerAllTime, PhaseType.PHASE_A, overlimit.getId(), harmRateVByPhaseType.get(PhaseType.PHASE_A), dataIByPhaseType.get(PhaseType.PHASE_A), dataInHarmVPhaseType.get(PhaseType.PHASE_A), dataVPhaseType.get(PhaseType.PHASE_A), dataVDevPhaseType.get(PhaseType.PHASE_A), dataPltPhaseType.get(PhaseType.PHASE_A)); +// DataLimitRateDto b = limitRateData(dataDate, overlimit, allTime, flickerAllTime, PhaseType.PHASE_B, overlimit.getId(), harmRateVByPhaseType.get(PhaseType.PHASE_B), dataIByPhaseType.get(PhaseType.PHASE_B), dataInHarmVPhaseType.get(PhaseType.PHASE_B), dataVPhaseType.get(PhaseType.PHASE_B), dataVDevPhaseType.get(PhaseType.PHASE_B), dataPltPhaseType.get(PhaseType.PHASE_B)); +// DataLimitRateDto c = limitRateData(dataDate, overlimit, allTime, flickerAllTime, PhaseType.PHASE_C, overlimit.getId(), harmRateVByPhaseType.get(PhaseType.PHASE_C), dataIByPhaseType.get(PhaseType.PHASE_C), dataInHarmVPhaseType.get(PhaseType.PHASE_C), dataVPhaseType.get(PhaseType.PHASE_C), dataVDevPhaseType.get(PhaseType.PHASE_C), dataPltPhaseType.get(PhaseType.PHASE_C)); +// DataLimitRateDto t = limitRateDataT(dataDate, overlimit, allTime, flickerAllTime, overlimit.getId(), harmRateVByTime, dataIByTime, dataInHarmVByTime, dataVByTime, dataVUnbalanceByTime, dataINegByTime, dataVFreqByTime, dataVDevByTime, dataPltByTime); +// result.add(a); +// result.add(b); +// result.add(c); +// result.add(t); +// return result; +// } +// +// +// /** +// * @Description: limitRateData +// * @Param: [overlimit, allTime, flickerAllTime, phasicType, lineId, dataHarmRateVPOList, dataIPOList, dataInHarmVPOList, dataVPOList, dataVUnbalanceList, dataINegList] +// * @return: com.njcn.harmonic.pojo.po.LimitRate +// * @Author: clam +// * @Date: 2022/10/18 +// */ +// public DataLimitRateDto limitRateData(String dataDate, +// Overlimit overlimit, +// Integer allTime, +// Integer flickerAllTime, +// String phasicType, String lineId, +// List dataHarmRateVPOList, +// List dataIPOList, +// List dataInHarmVPOList, +// List dataVPOList, +// List dataVPODevList, +// List dataPltPOList) { +// int v2 = 0, v3 = 0, v4 = 0, v5 = 0, v6 = 0, v7 = 0, v8 = 0, v9 = 0, v10 = 0, v11 = 0, v12 = 0, v13 = 0, v14 = 0, v15 = 0, v16 = 0, v17 = 0, v18 = 0, v19 = 0, v20 = 0, v21 = 0, v22 = 0, v23 = 0, v24 = 0, v25 = 0; +// int i2 = 0, i3 = 0, i4 = 0, i5 = 0, i6 = 0, i7 = 0, i8 = 0, i9 = 0, i10 = 0, i11 = 0, i12 = 0, i13 = 0, i14 = 0, i15 = 0, i16 = 0, i17 = 0, i18 = 0, i19 = 0, i20 = 0, i21 = 0, i22 = 0, i23 = 0, i24 = 0, i25 = 0; +// int uHarm1 = 0, uHarm2 = 0, uHarm3 = 0, uHarm4 = 0, uHarm5 = 0, uHarm6 = 0, uHarm7 = 0, uHarm8 = 0, uHarm9 = 0, uHarm10 = 0, uHarm11 = 0, uHarm12 = 0, uHarm13 = 0, uHarm14 = 0, uHarm15 = 0, uHarm16 = 0; +// int thd = 0, uDev = 0, flicker = 0; +// //2-25次谐波电压含有率 +// if (!CollectionUtils.isEmpty(dataHarmRateVPOList)) { +// for (DataHarmDto item : dataHarmRateVPOList) { +// if (item.getV2() > overlimit.getUharm2() && item.getV2() >= 0.0 && item.getV2() <= 30.0) { +// v2++; +// } +// if (item.getV3() > overlimit.getUharm3() && item.getV3() >= 0.0 && item.getV3() <= 30.0) { +// v3++; +// } +// if (item.getV4() > overlimit.getUharm4() && item.getV4() >= 0.0 && item.getV4() <= 30.0) { +// v4++; +// } +// if (item.getV5() > overlimit.getUharm5() && item.getV5() >= 0.0 && item.getV5() <= 30.0) { +// v5++; +// } +// if (item.getV6() > overlimit.getUharm6() && item.getV6() >= 0.0 && item.getV6() <= 30.0) { +// v6++; +// } +// if (item.getV7() > overlimit.getUharm7() && item.getV7() >= 0.0 && item.getV7() <= 30.0) { +// v7++; +// } +// if (item.getV8() > overlimit.getUharm8() && item.getV8() >= 0.0 && item.getV8() <= 30.0) { +// v8++; +// } +// if (item.getV9() > overlimit.getUharm9() && item.getV9() >= 0.0 && item.getV9() <= 30.0) { +// v9++; +// } +// if (item.getV10() > overlimit.getUharm10() && item.getV10() >= 0.0 && item.getV10() <= 30.0) { +// v10++; +// } +// if (item.getV11() > overlimit.getUharm11() && item.getV11() >= 0.0 && item.getV11() <= 30.0) { +// v11++; +// } +// if (item.getV12() > overlimit.getUharm12() && item.getV12() >= 0.0 && item.getV12() <= 30.0) { +// v12++; +// } +// if (item.getV13() > overlimit.getUharm13() && item.getV13() >= 0.0 && item.getV13() <= 30.0) { +// v13++; +// } +// if (item.getV14() > overlimit.getUharm14() && item.getV14() >= 0.0 && item.getV14() <= 30.0) { +// v14++; +// } +// if (item.getV15() > overlimit.getUharm15() && item.getV15() >= 0.0 && item.getV15() <= 30.0) { +// v15++; +// } +// if (item.getV16() > overlimit.getUharm16() && item.getV16() >= 0.0 && item.getV16() <= 30.0) { +// v16++; +// } +// if (item.getV17() > overlimit.getUharm17() && item.getV17() >= 0.0 && item.getV17() <= 30.0) { +// v17++; +// } +// if (item.getV18() > overlimit.getUharm18() && item.getV18() >= 0.0 && item.getV18() <= 30.0) { +// v18++; +// } +// if (item.getV19() > overlimit.getUharm19() && item.getV19() >= 0.0 && item.getV19() <= 30.0) { +// v19++; +// } +// if (item.getV20() > overlimit.getUharm20() && item.getV20() >= 0.0 && item.getV20() <= 30.0) { +// v20++; +// } +// if (item.getV21() > overlimit.getUharm21() && item.getV21() >= 0.0 && item.getV21() <= 30.0) { +// v21++; +// } +// if (item.getV22() > overlimit.getUharm22() && item.getV22() >= 0.0 && item.getV22() <= 30.0) { +// v22++; +// } +// if (item.getV23() > overlimit.getUharm23() && item.getV23() >= 0.0 && item.getV23() <= 30.0) { +// v23++; +// } +// if (item.getV24() > overlimit.getUharm24() && item.getV24() >= 0.0 && item.getV24() <= 30.0) { +// v24++; +// } +// if (item.getV25() > overlimit.getUharm25() && item.getV25() >= 0.0 && item.getV25() <= 30.0) { +// v25++; +// } +// } +// } +// //2-25次谐波电流 +// if (!CollectionUtils.isEmpty(dataIPOList)) { +// for (DataIDto item : dataIPOList) { +// if (item.getI2() > overlimit.getIharm2() && item.getI2() >= 0.0 && item.getI2() <= 30.0) { +// i2++; +// } +// if (item.getI3() > overlimit.getIharm3() && item.getI3() >= 0.0 && item.getI3() <= 30.0) { +// i3++; +// } +// if (item.getI4() > overlimit.getIharm4() && item.getI4() >= 0.0 && item.getI4() <= 30.0) { +// i4++; +// } +// if (item.getI5() > overlimit.getIharm5() && item.getI5() >= 0.0 && item.getI5() <= 30.0) { +// i5++; +// } +// if (item.getI6() > overlimit.getIharm6() && item.getI6() >= 0.0 && item.getI6() <= 30.0) { +// i6++; +// } +// if (item.getI7() > overlimit.getIharm7() && item.getI7() >= 0.0 && item.getI7() <= 30.0) { +// i7++; +// } +// if (item.getI8() > overlimit.getIharm8() && item.getI8() >= 0.0 && item.getI8() <= 30.0) { +// i8++; +// } +// if (item.getI9() > overlimit.getIharm9() && item.getI9() >= 0.0 && item.getI9() <= 30.0) { +// i9++; +// } +// if (item.getI10() > overlimit.getIharm10() && item.getI10() >= 0.0 && item.getI10() <= 30.0) { +// i10++; +// } +// if (item.getI11() > overlimit.getIharm11() && item.getI11() >= 0.0 && item.getI11() <= 30.0) { +// i11++; +// } +// if (item.getI12() > overlimit.getIharm12() && item.getI12() >= 0.0 && item.getI12() <= 30.0) { +// i12++; +// } +// if (item.getI13() > overlimit.getIharm13() && item.getI13() >= 0.0 && item.getI13() <= 30.0) { +// i13++; +// } +// if (item.getI14() > overlimit.getIharm14() && item.getI14() >= 0.0 && item.getI14() <= 30.0) { +// i14++; +// } +// if (item.getI15() > overlimit.getIharm15() && item.getI15() >= 0.0 && item.getI15() <= 30.0) { +// i15++; +// } +// if (item.getI16() > overlimit.getIharm16() && item.getI16() >= 0.0 && item.getI16() <= 30.0) { +// i16++; +// } +// if (item.getI17() > overlimit.getIharm17() && item.getI17() >= 0.0 && item.getI17() <= 30.0) { +// i17++; +// } +// if (item.getI18() > overlimit.getIharm18() && item.getI18() >= 0.0 && item.getI18() <= 30.0) { +// i18++; +// } +// if (item.getI19() > overlimit.getIharm19() && item.getI19() >= 0.0 && item.getI19() <= 30.0) { +// i19++; +// } +// if (item.getI20() > overlimit.getIharm20() && item.getI20() >= 0.0 && item.getI20() <= 30.0) { +// i20++; +// } +// if (item.getI21() > overlimit.getIharm21() && item.getI21() >= 0.0 && item.getI21() <= 30.0) { +// i21++; +// } +// if (item.getI22() > overlimit.getIharm22() && item.getI22() >= 0.0 && item.getI22() <= 30.0) { +// i22++; +// } +// if (item.getI23() > overlimit.getIharm23() && item.getI23() >= 0.0 && item.getI23() <= 30.0) { +// i23++; +// } +// if (item.getI24() > overlimit.getIharm24() && item.getI24() >= 0.0 && item.getI24() <= 30.0) { +// i24++; +// } +// if (item.getI25() > overlimit.getIharm25() && item.getI25() >= 0.0 && item.getI25() <= 30.0) { +// i25++; +// } +// } +// } +// //0.5-15.5次间谐波电压含有率 +// if (!CollectionUtils.isEmpty(dataInHarmVPOList)) { +// for (DataHarmDto item : dataInHarmVPOList) { +// if (item.getV1() > overlimit.getInuharm1() && item.getV1() >= 0.0 && item.getV1() <= 30.0) { +// uHarm1++; +// } +// if (item.getV2() > overlimit.getInuharm2() && item.getV2() >= 0.0 && item.getV2() <= 30.0) { +// uHarm2++; +// } +// if (item.getV3() > overlimit.getInuharm3() && item.getV3() >= 0.0 && item.getV3() <= 30.0) { +// uHarm3++; +// } +// if (item.getV4() > overlimit.getInuharm4() && item.getV4() >= 0.0 && item.getV4() <= 30.0) { +// uHarm4++; +// } +// if (item.getV5() > overlimit.getInuharm5() && item.getV5() >= 0.0 && item.getV5() <= 30.0) { +// uHarm5++; +// } +// if (item.getV6() > overlimit.getInuharm6() && item.getV6() >= 0.0 && item.getV6() <= 30.0) { +// uHarm6++; +// } +// if (item.getV7() > overlimit.getInuharm7() && item.getV7() >= 0.0 && item.getV7() <= 30.0) { +// uHarm7++; +// } +// if (item.getV8() > overlimit.getInuharm8() && item.getV8() >= 0.0 && item.getV8() <= 30.0) { +// uHarm8++; +// } +// if (item.getV9() > overlimit.getInuharm9() && item.getV9() >= 0.0 && item.getV9() <= 30.0) { +// uHarm9++; +// } +// if (item.getV10() > overlimit.getInuharm10() && item.getV10() >= 0.0 && item.getV10() <= 30.0) { +// uHarm10++; +// } +// if (item.getV11() > overlimit.getInuharm11() && item.getV11() >= 0.0 && item.getV11() <= 30.0) { +// uHarm11++; +// } +// if (item.getV12() > overlimit.getInuharm12() && item.getV12() >= 0.0 && item.getV12() <= 30.0) { +// uHarm12++; +// } +// if (item.getV13() > overlimit.getInuharm13() && item.getV13() >= 0.0 && item.getV13() <= 30.0) { +// uHarm13++; +// } +// if (item.getV14() > overlimit.getInuharm14() && item.getV14() >= 0.0 && item.getV14() <= 30.0) { +// uHarm14++; +// } +// if (item.getV15() > overlimit.getInuharm15() && item.getV15() >= 0.0 && item.getV15() <= 30.0) { +// uHarm15++; +// } +// if (item.getV16() > overlimit.getInuharm16() && item.getV16() >= 0.0 && item.getV16() <= 30.0) { +// uHarm16++; +// } +// } +// } +// //电压总谐波畸变率 +// if (!CollectionUtils.isEmpty(dataVPOList)) { +// for (DataVDto item : dataVPOList) { +// if (item.getVThd() > overlimit.getUaberrance() && item.getVThd() >= 0.0 && item.getVThd() <= 30.0) { +// thd++; +// } +// } +// } +// //电压上偏差、电压下偏差(根据vl_dev的正负判断是用哪个值判断越限) +// if (!CollectionUtils.isEmpty(dataVPODevList)) { +// for (DataVDto item : dataVPODevList) { +// +// if (item.getVlDev() >= 0) { +// if (item.getVlDev() > overlimit.getVoltageDev() && item.getVlDev() >= 0.0 && item.getVlDev() <= 20.0) { +// uDev++; +// } +// } else { +// if (Math.abs(item.getVuDev()) > Math.abs(overlimit.getUvoltageDev()) && Math.abs(item.getVuDev()) <= 20.0) { +// uDev++; +// } +// } +// } +// } +// //长时间闪变 +// if (!CollectionUtils.isEmpty(dataPltPOList)) { +// for (DataPltDto item : dataPltPOList) { +// if (item.getPlt() > overlimit.getFlicker() && item.getPlt() >= 0 && item.getPlt() <= 20) { +// flicker++; +// } +// } +// } +// DataLimitRateDto limitRate = new DataLimitRateDto(); +// limitRate.setLineId(lineId); +// limitRate.setTime(LocalDateTimeUtil.parseDate(dataDate, DatePattern.NORM_DATE_PATTERN)); +// limitRate.setPhasicType(phasicType); +// limitRate.setAllTime(allTime); +// limitRate.setFlickerAllTime(flickerAllTime); +// limitRate.setUaberranceOvertime(thd); +// limitRate.setINegOvertime(0); +// limitRate.setFreqDevOvertime(0); +// limitRate.setUharm2Overtime(v2); +// limitRate.setUharm3Overtime(v3); +// limitRate.setUharm4Overtime(v4); +// limitRate.setUharm5Overtime(v5); +// limitRate.setUharm6Overtime(v6); +// limitRate.setUharm7Overtime(v7); +// limitRate.setUharm8Overtime(v8); +// limitRate.setUharm9Overtime(v9); +// limitRate.setUharm10Overtime(v10); +// limitRate.setUharm11Overtime(v11); +// limitRate.setUharm12Overtime(v12); +// limitRate.setUharm13Overtime(v13); +// limitRate.setUharm14Overtime(v14); +// limitRate.setUharm15Overtime(v15); +// limitRate.setUharm16Overtime(v16); +// limitRate.setUharm17Overtime(v17); +// limitRate.setUharm18Overtime(v18); +// limitRate.setUharm19Overtime(v19); +// limitRate.setUharm20Overtime(v20); +// limitRate.setUharm21Overtime(v21); +// limitRate.setUharm22Overtime(v22); +// limitRate.setUharm23Overtime(v23); +// limitRate.setUharm24Overtime(v24); +// limitRate.setUharm25Overtime(v25); +// limitRate.setIharm2Overtime(i2); +// limitRate.setIharm3Overtime(i3); +// limitRate.setIharm4Overtime(i4); +// limitRate.setIharm5Overtime(i5); +// limitRate.setIharm6Overtime(i6); +// limitRate.setIharm7Overtime(i7); +// limitRate.setIharm8Overtime(i8); +// limitRate.setIharm9Overtime(i9); +// limitRate.setIharm10Overtime(i10); +// limitRate.setIharm11Overtime(i11); +// limitRate.setIharm12Overtime(i12); +// limitRate.setIharm13Overtime(i13); +// limitRate.setIharm14Overtime(i14); +// limitRate.setIharm15Overtime(i15); +// limitRate.setIharm16Overtime(i16); +// limitRate.setIharm17Overtime(i17); +// limitRate.setIharm18Overtime(i18); +// limitRate.setIharm19Overtime(i19); +// limitRate.setIharm20Overtime(i20); +// limitRate.setIharm21Overtime(i21); +// limitRate.setIharm22Overtime(i22); +// limitRate.setIharm23Overtime(i23); +// limitRate.setIharm24Overtime(i24); +// limitRate.setIharm25Overtime(i25); +// limitRate.setInuharm1Overtime(uHarm1); +// limitRate.setInuharm2Overtime(uHarm2); +// limitRate.setInuharm3Overtime(uHarm3); +// limitRate.setInuharm4Overtime(uHarm4); +// limitRate.setInuharm5Overtime(uHarm5); +// limitRate.setInuharm6Overtime(uHarm6); +// limitRate.setInuharm7Overtime(uHarm7); +// limitRate.setInuharm8Overtime(uHarm8); +// limitRate.setInuharm9Overtime(uHarm9); +// limitRate.setInuharm10Overtime(uHarm10); +// limitRate.setInuharm11Overtime(uHarm11); +// limitRate.setInuharm12Overtime(uHarm12); +// limitRate.setInuharm13Overtime(uHarm13); +// limitRate.setInuharm14Overtime(uHarm14); +// limitRate.setInuharm15Overtime(uHarm15); +// limitRate.setInuharm16Overtime(uHarm16); +// limitRate.setUbalanceOvertime(0); +// limitRate.setVoltageDevOvertime(uDev); +// limitRate.setFlickerOvertime(flicker); +// return limitRate; +// } +// +// +// public DataLimitRateDto limitRateDataT( +// String dataDate, +// Overlimit overlimit, +// Integer allTime, +// Integer flickerAllTime, +// String lineId, +// Map> map1, +// Map> map2, +// Map> map3, +// Map> map4, +// Map> map5, +// Map> map6, +// Map> map7, +// Map> map8, +// Map> map9) { +// DataLimitRateDto limitRate = new DataLimitRateDto(); +// int v2 = 0, v3 = 0, v4 = 0, v5 = 0, v6 = 0, v7 = 0, v8 = 0, v9 = 0, v10 = 0, v11 = 0, v12 = 0, v13 = 0, v14 = 0, v15 = 0, v16 = 0, v17 = 0, v18 = 0, v19 = 0, v20 = 0, v21 = 0, v22 = 0, v23 = 0, v24 = 0, v25 = 0; +// int i2 = 0, i3 = 0, i4 = 0, i5 = 0, i6 = 0, i7 = 0, i8 = 0, i9 = 0, i10 = 0, i11 = 0, i12 = 0, i13 = 0, i14 = 0, i15 = 0, i16 = 0, i17 = 0, i18 = 0, i19 = 0, i20 = 0, i21 = 0, i22 = 0, i23 = 0, i24 = 0, i25 = 0; +// int uHarm1 = 0, uHarm2 = 0, uHarm3 = 0, uHarm4 = 0, uHarm5 = 0, uHarm6 = 0, uHarm7 = 0, uHarm8 = 0, uHarm9 = 0, uHarm10 = 0, uHarm11 = 0, uHarm12 = 0, uHarm13 = 0, uHarm14 = 0, uHarm15 = 0, uHarm16 = 0; +// int thd = 0, uDev = 0, flicker = 0, freqDev = 0, uAberrance = 0, iNeg = 0; +// //2-25次谐波电压含有率 +// for (String time : map1.keySet()) { +// List list = map1.get(time); +// List l2 = list.stream().filter(s -> s.getV2() > overlimit.getUharm2() && s.getV2() >= 0.0 && s.getV2() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l2)) { +// v2++; +// } +// List l3 = list.stream().filter(s -> s.getV3() > overlimit.getUharm3() && s.getV3() >= 0.0 && s.getV3() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l3)) { +// v3++; +// } +// List l4 = list.stream().filter(s -> s.getV4() > overlimit.getUharm4() && s.getV4() >= 0.0 && s.getV4() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l4)) { +// v4++; +// } +// List l5 = list.stream().filter(s -> s.getV5() > overlimit.getUharm5() && s.getV5() >= 0.0 && s.getV5() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l5)) { +// v5++; +// } +// List l6 = list.stream().filter(s -> s.getV6() > overlimit.getUharm6() && s.getV6() >= 0.0 && s.getV6() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l6)) { +// v6++; +// } +// List l7 = list.stream().filter(s -> s.getV7() > overlimit.getUharm7() && s.getV7() >= 0.0 && s.getV7() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l7)) { +// v7++; +// } +// List l8 = list.stream().filter(s -> s.getV8() > overlimit.getUharm8() && s.getV8() >= 0.0 && s.getV8() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l8)) { +// v8++; +// } +// List l9 = list.stream().filter(s -> s.getV9() > overlimit.getUharm9() && s.getV9() >= 0.0 && s.getV9() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l9)) { +// v9++; +// } +// List l10 = list.stream().filter(s -> s.getV10() > overlimit.getUharm10() && s.getV10() >= 0.0 && s.getV10() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l10)) { +// v10++; +// } +// List l11 = list.stream().filter(s -> s.getV11() > overlimit.getUharm11() && s.getV11() >= 0.0 && s.getV11() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l11)) { +// v11++; +// } +// List l12 = list.stream().filter(s -> s.getV12() > overlimit.getUharm12() && s.getV12() >= 0.0 && s.getV12() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l12)) { +// v12++; +// } +// List l13 = list.stream().filter(s -> s.getV13() > overlimit.getUharm13() && s.getV13() >= 0.0 && s.getV13() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l13)) { +// v13++; +// } +// List l14 = list.stream().filter(s -> s.getV14() > overlimit.getUharm14() && s.getV14() >= 0.0 && s.getV14() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l14)) { +// v14++; +// } +// List l15 = list.stream().filter(s -> s.getV15() > overlimit.getUharm15() && s.getV15() >= 0.0 && s.getV15() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l15)) { +// v15++; +// } +// List l16 = list.stream().filter(s -> s.getV16() > overlimit.getUharm16() && s.getV16() >= 0.0 && s.getV16() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l16)) { +// v16++; +// } +// List l17 = list.stream().filter(s -> s.getV17() > overlimit.getUharm17() && s.getV17() >= 0.0 && s.getV17() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l17)) { +// v17++; +// } +// List l18 = list.stream().filter(s -> s.getV18() > overlimit.getUharm18() && s.getV18() >= 0.0 && s.getV18() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l18)) { +// v18++; +// } +// List l19 = list.stream().filter(s -> s.getV19() > overlimit.getUharm19() && s.getV19() >= 0.0 && s.getV19() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l19)) { +// v19++; +// } +// List l20 = list.stream().filter(s -> s.getV20() > overlimit.getUharm20() && s.getV20() >= 0.0 && s.getV20() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l20)) { +// v20++; +// } +// List l21 = list.stream().filter(s -> s.getV21() > overlimit.getUharm21() && s.getV21() >= 0.0 && s.getV21() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l21)) { +// v21++; +// } +// List l22 = list.stream().filter(s -> s.getV22() > overlimit.getUharm22() && s.getV22() >= 0.0 && s.getV22() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l22)) { +// v22++; +// } +// List l23 = list.stream().filter(s -> s.getV23() > overlimit.getUharm23() && s.getV23() >= 0.0 && s.getV23() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l23)) { +// v23++; +// } +// List l24 = list.stream().filter(s -> s.getV24() > overlimit.getUharm24() && s.getV24() >= 0.0 && s.getV24() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l24)) { +// v24++; +// } +// List l25 = list.stream().filter(s -> s.getV25() > overlimit.getUharm25() && s.getV25() >= 0.0 && s.getV25() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l25)) { +// v25++; +// } +// } +// //2-25次谐波电流 +// for (String time : map2.keySet()) { +// List list = map2.get(time); +// List l2 = list.stream().filter(s -> s.getI2() > overlimit.getIharm2() && s.getI2() >= 0.0 && s.getI2() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l2)) { +// i2++; +// } +// List l3 = list.stream().filter(s -> s.getI3() > overlimit.getIharm3() && s.getI3() >= 0.0 && s.getI3() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l3)) { +// i3++; +// } +// List l4 = list.stream().filter(s -> s.getI4() > overlimit.getIharm4() && s.getI4() >= 0.0 && s.getI4() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l4)) { +// i4++; +// } +// List l5 = list.stream().filter(s -> s.getI5() > overlimit.getIharm5() && s.getI5() >= 0.0 && s.getI5() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l5)) { +// i5++; +// } +// List l6 = list.stream().filter(s -> s.getI6() > overlimit.getIharm6() && s.getI6() >= 0.0 && s.getI6() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l6)) { +// i6++; +// } +// List l7 = list.stream().filter(s -> s.getI7() > overlimit.getIharm7() && s.getI7() >= 0.0 && s.getI7() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l7)) { +// i7++; +// } +// List l8 = list.stream().filter(s -> s.getI8() > overlimit.getIharm8() && s.getI8() >= 0.0 && s.getI8() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l8)) { +// i8++; +// } +// List l9 = list.stream().filter(s -> s.getI9() > overlimit.getIharm9() && s.getI9() >= 0.0 && s.getI9() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l9)) { +// i9++; +// } +// List l10 = list.stream().filter(s -> s.getI10() > overlimit.getIharm10() && s.getI10() >= 0.0 && s.getI10() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l10)) { +// i10++; +// } +// List l11 = list.stream().filter(s -> s.getI11() > overlimit.getIharm11() && s.getI11() >= 0.0 && s.getI11() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l11)) { +// i11++; +// } +// List l12 = list.stream().filter(s -> s.getI12() > overlimit.getIharm12() && s.getI12() >= 0.0 && s.getI12() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l12)) { +// i12++; +// } +// List l13 = list.stream().filter(s -> s.getI13() > overlimit.getIharm13() && s.getI13() >= 0.0 && s.getI13() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l13)) { +// i13++; +// } +// List l14 = list.stream().filter(s -> s.getI14() > overlimit.getIharm14() && s.getI14() >= 0.0 && s.getI14() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l14)) { +// i14++; +// } +// List l15 = list.stream().filter(s -> s.getI15() > overlimit.getIharm15() && s.getI15() >= 0.0 && s.getI15() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l15)) { +// i15++; +// } +// List l16 = list.stream().filter(s -> s.getI16() > overlimit.getIharm16() && s.getI16() >= 0.0 && s.getI16() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l16)) { +// i16++; +// } +// List l17 = list.stream().filter(s -> s.getI17() > overlimit.getIharm17() && s.getI17() >= 0.0 && s.getI17() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l17)) { +// i17++; +// } +// List l18 = list.stream().filter(s -> s.getI18() > overlimit.getIharm18() && s.getI18() >= 0.0 && s.getI18() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l18)) { +// i18++; +// } +// List l19 = list.stream().filter(s -> s.getI19() > overlimit.getIharm19() && s.getI19() >= 0.0 && s.getI19() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l19)) { +// i19++; +// } +// List l20 = list.stream().filter(s -> s.getI20() > overlimit.getIharm20() && s.getI20() >= 0.0 && s.getI20() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l20)) { +// i20++; +// } +// List l21 = list.stream().filter(s -> s.getI21() > overlimit.getIharm21() && s.getI21() >= 0.0 && s.getI21() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l21)) { +// i21++; +// } +// List l22 = list.stream().filter(s -> s.getI22() > overlimit.getIharm22() && s.getI22() >= 0.0 && s.getI22() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l22)) { +// i22++; +// } +// List l23 = list.stream().filter(s -> s.getI23() > overlimit.getIharm23() && s.getI23() >= 0.0 && s.getI23() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l23)) { +// i23++; +// } +// List l24 = list.stream().filter(s -> s.getI24() > overlimit.getIharm24() && s.getI24() >= 0.0 && s.getI24() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l24)) { +// i24++; +// } +// List l25 = list.stream().filter(s -> s.getI25() > overlimit.getIharm25() && s.getI25() >= 0.0 && s.getI25() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l25)) { +// i25++; +// } +// } +// //0.5-15.5次间谐波电压含有率 +// for (String time : map3.keySet()) { +// List list3 = map3.get(time); +// List l2 = list3.stream().filter(s -> s.getV1() > overlimit.getInuharm1() && s.getV1() >= 0.0 && s.getV1() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l2)) { +// uHarm1++; +// } +// List l3 = list3.stream().filter(s -> s.getV2() > overlimit.getInuharm2() && s.getV2() >= 0.0 && s.getV2() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l3)) { +// uHarm2++; +// } +// List l4 = list3.stream().filter(s -> s.getV3() > overlimit.getInuharm3() && s.getV3() >= 0.0 && s.getV3() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l4)) { +// uHarm3++; +// } +// List l5 = list3.stream().filter(s -> s.getV4() > overlimit.getInuharm4() && s.getV4() >= 0.0 && s.getV4() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l5)) { +// uHarm4++; +// } +// List l6 = list3.stream().filter(s -> s.getV5() > overlimit.getInuharm5() && s.getV5() >= 0.0 && s.getV5() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l6)) { +// uHarm5++; +// } +// List l7 = list3.stream().filter(s -> s.getV6() > overlimit.getInuharm6() && s.getV6() >= 0.0 && s.getV6() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l7)) { +// uHarm6++; +// } +// List l8 = list3.stream().filter(s -> s.getV7() > overlimit.getInuharm7() && s.getV7() >= 0.0 && s.getV7() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l8)) { +// uHarm7++; +// } +// List l9 = list3.stream().filter(s -> s.getV8() > overlimit.getInuharm8() && s.getV8() >= 0.0 && s.getV8() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l9)) { +// uHarm8++; +// } +// List l10 = list3.stream().filter(s -> s.getV9() > overlimit.getInuharm9() && s.getV9() >= 0.0 && s.getV9() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l10)) { +// uHarm9++; +// } +// List l11 = list3.stream().filter(s -> s.getV10() > overlimit.getInuharm10() && s.getV10() >= 0.0 && s.getV10() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l11)) { +// uHarm10++; +// } +// List l12 = list3.stream().filter(s -> s.getV11() > overlimit.getInuharm11() && s.getV11() >= 0.0 && s.getV11() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l12)) { +// uHarm11++; +// } +// List l13 = list3.stream().filter(s -> s.getV12() > overlimit.getInuharm12() && s.getV12() >= 0.0 && s.getV12() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l13)) { +// uHarm12++; +// } +// List l14 = list3.stream().filter(s -> s.getV13() > overlimit.getInuharm13() && s.getV13() >= 0.0 && s.getV13() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l14)) { +// uHarm13++; +// } +// List l15 = list3.stream().filter(s -> s.getV14() > overlimit.getInuharm14() && s.getV14() >= 0.0 && s.getV14() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l15)) { +// uHarm14++; +// } +// List l16 = list3.stream().filter(s -> s.getV15() > overlimit.getInuharm15() && s.getV15() >= 0.0 && s.getV15() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l16)) { +// uHarm15++; +// } +// List l17 = list3.stream().filter(s -> s.getV16() > overlimit.getInuharm16() && s.getV16() >= 0.0 && s.getV16() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l17)) { +// uHarm16++; +// } +// } +// //电压总谐波畸变率 +// for (String time : map4.keySet()) { +// List list = map4.get(time); +// List l = list.stream().filter(s -> s.getVThd() > overlimit.getUaberrance() && s.getVThd() >= 0.0 && s.getVThd() <= 30.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l)) { +// thd++; +// } +// } +// //三相电压不平衡度 +// for (String time : map5.keySet()) { +// List list = map5.get(time); +// List l = list.stream().filter(s -> s.getVUnbalance() > overlimit.getUbalance() && s.getVUnbalance() >= 0.0 && s.getVUnbalance() <= 40.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l)) { +// uAberrance++; +// } +// } +// //负序电流 +// for (String time : map6.keySet()) { +// List list = map6.get(time); +// List l = list.stream().filter(s -> s.getINeg() > overlimit.getINeg()).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l)) { +// iNeg++; +// } +// } +// //频率偏差 +// for (String time : map7.keySet()) { +// List list = map7.get(time); +// List l = list.stream().filter(s -> s.getFreqDev() > overlimit.getFreqDev() && Math.abs(s.getFreqDev()) <= 7.5).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l)) { +// freqDev++; +// } +// } +// //电压上偏差、电压下偏差 +// for (String time : map8.keySet()) { +// List list = map8.get(time); +// List l1 = list.stream().filter(s -> s.getVlDev() >= 0.0 && s.getVlDev() <= 20.0 && s.getVlDev() > overlimit.getVoltageDev()).collect(Collectors.toList()); +// List l2 = list.stream().filter(s -> s.getVuDev() >= -20.0 && s.getVuDev() <= 0.0 && Math.abs(s.getVuDev()) > Math.abs(overlimit.getUvoltageDev())).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l1) || !CollectionUtils.isEmpty(l2)) { +// uDev++; +// } +// } +// //长时间闪变 +// for (String time : map9.keySet()) { +// List list = map9.get(time); +// List l = list.stream().filter(s -> s.getPlt() > overlimit.getFlicker() && s.getPlt() >= 0.0 && s.getPlt() <= 20.0).collect(Collectors.toList()); +// if (!CollectionUtils.isEmpty(l)) { +// flicker++; +// } +// } +// limitRate.setLineId(lineId); +// limitRate.setPhasicType("T"); +// limitRate.setAllTime(allTime); +// limitRate.setTime(LocalDateTimeUtil.parseDate(dataDate, DatePattern.NORM_DATE_PATTERN)); +// limitRate.setFlickerAllTime(flickerAllTime); +// limitRate.setUaberranceOvertime(thd); +// limitRate.setINegOvertime(iNeg); +// limitRate.setFreqDevOvertime(freqDev); +// limitRate.setUharm2Overtime(v2); +// limitRate.setUharm3Overtime(v3); +// limitRate.setUharm4Overtime(v4); +// limitRate.setUharm5Overtime(v5); +// limitRate.setUharm6Overtime(v6); +// limitRate.setUharm7Overtime(v7); +// limitRate.setUharm8Overtime(v8); +// limitRate.setUharm9Overtime(v9); +// limitRate.setUharm10Overtime(v10); +// limitRate.setUharm11Overtime(v11); +// limitRate.setUharm12Overtime(v12); +// limitRate.setUharm13Overtime(v13); +// limitRate.setUharm14Overtime(v14); +// limitRate.setUharm15Overtime(v15); +// limitRate.setUharm16Overtime(v16); +// limitRate.setUharm17Overtime(v17); +// limitRate.setUharm18Overtime(v18); +// limitRate.setUharm19Overtime(v19); +// limitRate.setUharm20Overtime(v20); +// limitRate.setUharm21Overtime(v21); +// limitRate.setUharm22Overtime(v22); +// limitRate.setUharm23Overtime(v23); +// limitRate.setUharm24Overtime(v24); +// limitRate.setUharm25Overtime(v25); +// limitRate.setIharm2Overtime(i2); +// limitRate.setIharm3Overtime(i3); +// limitRate.setIharm4Overtime(i4); +// limitRate.setIharm5Overtime(i5); +// limitRate.setIharm6Overtime(i6); +// limitRate.setIharm7Overtime(i7); +// limitRate.setIharm8Overtime(i8); +// limitRate.setIharm9Overtime(i9); +// limitRate.setIharm10Overtime(i10); +// limitRate.setIharm11Overtime(i11); +// limitRate.setIharm12Overtime(i12); +// limitRate.setIharm13Overtime(i13); +// limitRate.setIharm14Overtime(i14); +// limitRate.setIharm15Overtime(i15); +// limitRate.setIharm16Overtime(i16); +// limitRate.setIharm17Overtime(i17); +// limitRate.setIharm18Overtime(i18); +// limitRate.setIharm19Overtime(i19); +// limitRate.setIharm20Overtime(i20); +// limitRate.setIharm21Overtime(i21); +// limitRate.setIharm22Overtime(i22); +// limitRate.setIharm23Overtime(i23); +// limitRate.setIharm24Overtime(i24); +// limitRate.setIharm25Overtime(i25); +// limitRate.setInuharm1Overtime(uHarm1); +// limitRate.setInuharm2Overtime(uHarm2); +// limitRate.setInuharm3Overtime(uHarm3); +// limitRate.setInuharm4Overtime(uHarm4); +// limitRate.setInuharm5Overtime(uHarm5); +// limitRate.setInuharm6Overtime(uHarm6); +// limitRate.setInuharm7Overtime(uHarm7); +// limitRate.setInuharm8Overtime(uHarm8); +// limitRate.setInuharm9Overtime(uHarm9); +// limitRate.setInuharm10Overtime(uHarm10); +// limitRate.setInuharm11Overtime(uHarm11); +// limitRate.setInuharm12Overtime(uHarm12); +// limitRate.setInuharm13Overtime(uHarm13); +// limitRate.setInuharm14Overtime(uHarm14); +// limitRate.setInuharm15Overtime(uHarm15); +// limitRate.setInuharm16Overtime(uHarm16); +// limitRate.setUbalanceOvertime(uAberrance); +// limitRate.setVoltageDevOvertime(uDev); +// limitRate.setFlickerOvertime(flicker); +// return limitRate; +// } +// +//} diff --git a/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/PollutionServiceImpl.java b/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/PollutionServiceImpl.java index f56303e..6ed8afb 100644 --- a/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/PollutionServiceImpl.java +++ b/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/PollutionServiceImpl.java @@ -1,38 +1,27 @@ package com.njcn.algorithm.serviceimpl.line; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.LocalDateTimeUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.api.R; import com.njcn.algorithm.pojo.bo.CalculatedParam; import com.njcn.algorithm.service.line.IPollutionService; -import com.njcn.dataProcess.api.DataHarmRateVFeignClient; -import com.njcn.dataProcess.api.DataIFeignClient; -import com.njcn.dataProcess.api.DataPltFeignClient; -import com.njcn.dataProcess.api.DataVFeignClient; -import com.njcn.dataProcess.dto.DataVDTO; -import com.njcn.dataProcess.dto.PollutionDTO; +import com.njcn.dataProcess.api.*; import com.njcn.dataProcess.param.LineCountEvaluateParam; -import com.njcn.dataProcess.po.relation.RMpPollutionDPO; -import com.njcn.dataProcess.pojo.dto.DataHarmDto; -import com.njcn.dataProcess.pojo.dto.DataIDto; -import com.njcn.dataProcess.pojo.dto.DataPltDto; -import com.njcn.dataProcess.pojo.dto.DataVDto; -import com.njcn.dataProcess.pojo.po.RStatDataVD; +import com.njcn.dataProcess.pojo.dto.*; import com.njcn.device.biz.commApi.CommTerminalGeneralClient; +import com.njcn.device.biz.pojo.dto.DeptGetChildrenMoreDTO; +import com.njcn.device.biz.pojo.dto.LineDevGetDTO; import com.njcn.device.biz.pojo.po.Overlimit; import com.njcn.system.api.DicDataFeignClient; -import com.njcn.system.enums.DicDataEnum; import com.njcn.system.enums.DicDataTypeEnum; import com.njcn.system.pojo.po.DictData; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections.CollectionUtils; import org.springframework.stereotype.Service; -import java.math.BigDecimal; -import java.math.RoundingMode; import java.time.LocalDate; import java.util.*; import java.util.function.BinaryOperator; @@ -51,20 +40,16 @@ import java.util.stream.Stream; public class PollutionServiceImpl implements IPollutionService { private final DicDataFeignClient dicDataFeignClient; - private final CommTerminalGeneralClient commTerminalGeneralClient; - private final DataVFeignClient dataVFeignClient; - private final DataHarmRateVFeignClient dataHarmRateVFeignClient; - private final DataPltFeignClient dataPltFeignClient; - private final DataIFeignClient dataIFeignClient; + private final DataPollutionFeignClient dataPollutionFeignClient; @Override public void handleDay(CalculatedParam calculatedParam) { - List pollutionList; + List pollutionList; List dictDataList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.POLLUTION_STATIS.getCode()).getData(); Map dictData = dictDataList.stream().collect(Collectors.toMap(DictData::getId, Function.identity())); @@ -82,49 +67,99 @@ public class PollutionServiceImpl implements IPollutionService { lineCountEvaluateParam.setEndTime(endDay); //指标数据获取 - Map harmonicVoltageList = getHarmonicVoltage(lineCountEvaluateParam, limitMap); - Map harmonicCurrentList = getHarmonicCurrent(lineCountEvaluateParam, limitMap); - Map frequencyDeviationList = getFrequencyDeviation(lineCountEvaluateParam, limitMap); - Map voltageDeviationList = getVoltageDeviation(lineCountEvaluateParam, limitMap); - Map threePhaseVoltageList = getThreePhaseVoltageUnbalance(lineCountEvaluateParam, limitMap); - Map negativeSequenceList = getNegativeSequenceCurrent(lineCountEvaluateParam, limitMap); - Map interHarmonicVoltageList = getInterharmonicVoltage(lineCountEvaluateParam, limitMap); - Map voltageFlickerList = getVoltageFlicker(lineCountEvaluateParam, limitMap); + Map harmonicVoltageList = getHarmonicVoltage(lineCountEvaluateParam, limitMap); + Map harmonicCurrentList = getHarmonicCurrent(lineCountEvaluateParam, limitMap); + Map frequencyDeviationList = getFrequencyDeviation(lineCountEvaluateParam, limitMap); + Map voltageDeviationList = getVoltageDeviation(lineCountEvaluateParam, limitMap); + Map threePhaseVoltageList = getThreePhaseVoltageUnbalance(lineCountEvaluateParam, limitMap); + Map negativeSequenceList = getNegativeSequenceCurrent(lineCountEvaluateParam, limitMap); + Map interHarmonicVoltageList = getInterharmonicVoltage(lineCountEvaluateParam, limitMap); + Map voltageFlickerList = getVoltageFlicker(lineCountEvaluateParam, limitMap); - pollutionList = processPollutionList(local,idList,dictData, harmonicVoltageList, harmonicCurrentList, frequencyDeviationList, voltageDeviationList, + pollutionList = processPollutionList(local, idList, dictData, harmonicVoltageList, harmonicCurrentList, frequencyDeviationList, voltageDeviationList, threePhaseVoltageList, negativeSequenceList, interHarmonicVoltageList, voltageFlickerList); //TODO 插入数据库 + if (CollUtil.isNotEmpty(pollutionList)) { + dataPollutionFeignClient.batchInsertion(pollutionList); + } + } + + @Override + public void handleOrgDay(CalculatedParam calculatedParam) { + LocalDate local = LocalDateTimeUtil.parseDate(calculatedParam.getDataDate()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + + for (DeptGetChildrenMoreDTO deptGetChildrenMoreDTO : calculatedParam.getIdList()) { + Collection union = CollectionUtils.union(Optional.ofNullable(deptGetChildrenMoreDTO.getLineBaseList()).orElse(new ArrayList<>()), + Optional.ofNullable(deptGetChildrenMoreDTO.getPwMonitorIds()).orElse(new ArrayList<>())); + List lineIds = union.stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList()); + + } + } + + @Override + public void handleOrgMonth(CalculatedParam calculatedParam) { + + } + + @Override + public void handleOrgQtr(CalculatedParam calculatedParam) { + + } + + @Override + public void handleOrgYear(CalculatedParam calculatedParam) { + + } + + @Override + public void handleSubstationDay(CalculatedParam calculatedParam) { + + } + + @Override + public void handleSubstationMonth(CalculatedParam calculatedParam) { + + } + + @Override + public void handleSubstationQtr(CalculatedParam calculatedParam) { + + } + + @Override + public void handleSubstationYear(CalculatedParam calculatedParam) { + } - - private void assPollution(String lineId, LocalDate local, DictData dic, Map map,List result) { - if(map.containsKey(lineId)){ - RMpPollutionDPO tem = map.get(lineId); + private void assPollution(String lineId, LocalDate local, DictData dic, Map map, List result) { + DataPollutionD tem; + if (map.containsKey(lineId)) { + tem = map.get(lineId); tem.setPollutionType(dic.getId()); tem.setDataDate(local); - result.add(tem); - }else{ - RMpPollutionDPO tem = new RMpPollutionDPO(); + } else { + tem = new DataPollutionD(); tem.setLineId(lineId); tem.setPollutionType(dic.getId()); tem.setDataDate(local); tem.setValue(0.0); - result.add(tem); } + result.add(tem); } /** * 参数拼装处理 */ - private List processPollutionList(LocalDate local, List lineIds, Map dictData, - Map harmonicVoltageMap, Map harmonicCurrentMap, - Map frequencyDeviationMap, Map voltageDeviationMap, - Map threePhaseVoltageMap, Map negativeSequenceMap, - Map interharmonicVoltageMap, Map voltageFlickerMap) { - List result = new ArrayList<>(); + private List processPollutionList(LocalDate local, List lineIds, Map dictData, + Map harmonicVoltageMap, Map harmonicCurrentMap, + Map frequencyDeviationMap, Map voltageDeviationMap, + Map threePhaseVoltageMap, Map negativeSequenceMap, + Map interharmonicVoltageMap, Map voltageFlickerMap) { + List result = new ArrayList<>(); DictData dicVHarmonic = dictData.get("V_Harmonic"); DictData dicIHarmonic = dictData.get("I_All"); DictData I_Neg = dictData.get("I_Neg"); @@ -134,14 +169,14 @@ public class PollutionServiceImpl implements IPollutionService { DictData Plt = dictData.get("Plt"); DictData Freq_Dev = dictData.get("Freq_Dev"); for (String lineId : lineIds) { - assPollution(lineId,local,dicVHarmonic,harmonicVoltageMap,result); - assPollution(lineId,local,dicIHarmonic,harmonicCurrentMap,result); - assPollution(lineId,local,I_Neg,negativeSequenceMap,result); - assPollution(lineId,local,Plt,voltageFlickerMap,result); - assPollution(lineId,local,V_Dev,voltageDeviationMap,result); - assPollution(lineId,local,V_Unbalance,threePhaseVoltageMap,result); - assPollution(lineId,local,Freq_Dev,frequencyDeviationMap,result); - assPollution(lineId,local,V_Inharm,interharmonicVoltageMap,result); + assPollution(lineId, local, dicVHarmonic, harmonicVoltageMap, result); + assPollution(lineId, local, dicIHarmonic, harmonicCurrentMap, result); + assPollution(lineId, local, I_Neg, negativeSequenceMap, result); + assPollution(lineId, local, Plt, voltageFlickerMap, result); + assPollution(lineId, local, V_Dev, voltageDeviationMap, result); + assPollution(lineId, local, V_Unbalance, threePhaseVoltageMap, result); + assPollution(lineId, local, Freq_Dev, frequencyDeviationMap, result); + assPollution(lineId, local, V_Inharm, interharmonicVoltageMap, result); } return result; } @@ -150,64 +185,64 @@ public class PollutionServiceImpl implements IPollutionService { /** * 谐波电压:取监测点最新的A、B、C三相数据,再取电压总谐波畸变率、各次谐波电压含有率(2~25次)中的最大值,作为结果 */ - private Map getHarmonicVoltage(LineCountEvaluateParam lineCountEvaluateParam, Map limitMap) { - List list = new ArrayList<>(); + private Map getHarmonicVoltage(LineCountEvaluateParam lineCountEvaluateParam, Map limitMap) { + List list = new ArrayList<>(); lineCountEvaluateParam.setValueType(Stream.of("CP95").collect(Collectors.toList())); lineCountEvaluateParam.setPhasicType(Stream.of("A", "B", "C").collect(Collectors.toList())); - Map threePhase = getThreePhaseData(lineCountEvaluateParam, limitMap); - Map distortionRate = getDistortionRateData(lineCountEvaluateParam, limitMap); + Map threePhase = getThreePhaseData(lineCountEvaluateParam, limitMap); + Map distortionRate = getDistortionRateData(lineCountEvaluateParam, limitMap); for (String key : threePhase.keySet()) { list.add(threePhase.get(key)); } for (String key : distortionRate.keySet()) { list.add(distortionRate.get(key)); } - Comparator comparator = Comparator.comparing(RMpPollutionDPO::getValue); - Map> outMap = list.stream().collect(Collectors.groupingBy(RMpPollutionDPO::getLineId, Collectors.reducing(BinaryOperator.maxBy(comparator)))); + Comparator comparator = Comparator.comparing(DataPollutionD::getValue); + Map> outMap = list.stream().collect(Collectors.groupingBy(DataPollutionD::getLineId, Collectors.reducing(BinaryOperator.maxBy(comparator)))); return process(outMap); } /** * 出参处理 */ - private Map process(Map> outMap) { - Map map = new HashMap<>(); + private Map process(Map> outMap) { + Map map = new HashMap<>(); for (String key : outMap.keySet()) { map.put(key, outMap.get(key).get()); } return map; } - private Map getThreePhaseData(LineCountEvaluateParam lineCountEvaluateParam, Map limitMap) { + private Map getThreePhaseData(LineCountEvaluateParam lineCountEvaluateParam, Map limitMap) { List threePhaseList = dataVFeignClient.getDataV(lineCountEvaluateParam).getData(); Map> dataVMap = threePhaseList.stream().collect(Collectors.groupingBy(DataVDto::getLineId)); - Map map = new HashMap<>(); + Map map = new HashMap<>(); dataVMap.forEach((lineId, vList) -> { - RMpPollutionDPO RMpPollutionDPO = new RMpPollutionDPO(); + DataPollutionD dataPollutionD = new DataPollutionD(); if (limitMap.containsKey(lineId)) { Overlimit overlimit = limitMap.get(lineId); double val = vList.stream().mapToDouble(DataVDto::getVThd).max().getAsDouble(); double vUnbalance = val / overlimit.getUaberrance(); - RMpPollutionDPO.setLineId(lineId); - RMpPollutionDPO.setValue(vUnbalance); - map.put(lineId, RMpPollutionDPO); + dataPollutionD.setLineId(lineId); + dataPollutionD.setValue(vUnbalance); + map.put(lineId, dataPollutionD); } }); return map; } - private Map getDistortionRateData(LineCountEvaluateParam lineCountEvaluateParam, Map limitMap) { - Map mapResult = new HashMap<>(); + private Map getDistortionRateData(LineCountEvaluateParam lineCountEvaluateParam, Map limitMap) { + Map mapResult = new HashMap<>(); List distortionRateList = dataHarmRateVFeignClient.getHarmRateVData(lineCountEvaluateParam).getData(); Map> harmDataMap = distortionRateList.stream().collect(Collectors.groupingBy(DataHarmDto::getLineId)); harmDataMap.forEach((lineId, vList) -> { Overlimit overlimit = limitMap.get(lineId); - List temList = new ArrayList<>(); + List temList = new ArrayList<>(); for (DataHarmDto dayHarmrateV : vList) { - RMpPollutionDPO tem = new RMpPollutionDPO(); + DataPollutionD tem = new DataPollutionD(); double v2 = dayHarmrateV.getV2() / overlimit.getUharm2(); double v3 = dayHarmrateV.getV3() / overlimit.getUharm3(); double v4 = dayHarmrateV.getV4() / overlimit.getUharm4(); @@ -238,10 +273,10 @@ public class PollutionServiceImpl implements IPollutionService { tem.setValue(result); temList.add(tem); } - RMpPollutionDPO rMpPollutionDPO = new RMpPollutionDPO(); - rMpPollutionDPO.setLineId(lineId); - rMpPollutionDPO.setValue(temList.stream().mapToDouble(RMpPollutionDPO::getValue).max().getAsDouble()); - mapResult.put(lineId, rMpPollutionDPO); + DataPollutionD dataPollutionD = new DataPollutionD(); + dataPollutionD.setLineId(lineId); + dataPollutionD.setValue(temList.stream().mapToDouble(DataPollutionD::getValue).max().getAsDouble()); + mapResult.put(lineId, dataPollutionD); }); return mapResult; @@ -250,8 +285,8 @@ public class PollutionServiceImpl implements IPollutionService { /** * 谐波电流:各次谐波电流(2~25次),取各监测点最新的A、B、C三相数据。 */ - private Map getHarmonicCurrent(LineCountEvaluateParam lineCountEvaluateParam, Map limitMap) { - Map map = new HashMap(); + private Map getHarmonicCurrent(LineCountEvaluateParam lineCountEvaluateParam, Map limitMap) { + Map map = new HashMap(); lineCountEvaluateParam.setValueType(Stream.of("CP95").collect(Collectors.toList())); lineCountEvaluateParam.setPhasicType(Stream.of("A", "B", "C").collect(Collectors.toList())); List list = dataIFeignClient.getDataI(lineCountEvaluateParam).getData(); @@ -259,7 +294,7 @@ public class PollutionServiceImpl implements IPollutionService { dataMap.forEach((lineId, valList) -> { if (limitMap.containsKey(lineId)) { Overlimit overlimit = limitMap.get(lineId); - List temList = new ArrayList<>(); + List temList = new ArrayList<>(); for (DataIDto dayI : valList) { double v2 = dayI.getI2() / overlimit.getIharm2(); double v3 = dayI.getI3() / overlimit.getIharm3(); @@ -287,16 +322,16 @@ public class PollutionServiceImpl implements IPollutionService { double v25 = dayI.getI25() / overlimit.getIharm25(); List data = Stream.of(v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25).collect(Collectors.toList()); double result = data.stream().max(Comparator.comparing(Double::doubleValue)).get(); - RMpPollutionDPO RMpPollutionDPO = new RMpPollutionDPO(); - RMpPollutionDPO.setLineId(dayI.getLineId()); - RMpPollutionDPO.setValue(result); - temList.add(RMpPollutionDPO); + DataPollutionD dataPollutionD = new DataPollutionD(); + dataPollutionD.setLineId(dayI.getLineId()); + dataPollutionD.setValue(result); + temList.add(dataPollutionD); } - double val = temList.stream().mapToDouble(RMpPollutionDPO::getValue).max().getAsDouble(); - RMpPollutionDPO RMpPollutionDPO = new RMpPollutionDPO(); - RMpPollutionDPO.setLineId(lineId); - RMpPollutionDPO.setValue(val); - map.put(lineId, RMpPollutionDPO); + double val = temList.stream().mapToDouble(DataPollutionD::getValue).max().getAsDouble(); + DataPollutionD dataPollutionD = new DataPollutionD(); + dataPollutionD.setLineId(lineId); + dataPollutionD.setValue(val); + map.put(lineId, dataPollutionD); } }); return map; @@ -305,8 +340,8 @@ public class PollutionServiceImpl implements IPollutionService { /** * 频率偏差:各监测点最新的T相数据,取频率上下偏差的绝对值中的最大值。 */ - private Map getFrequencyDeviation(LineCountEvaluateParam lineCountEvaluateParam, Map limitMap) { - Map lineData = new HashMap<>(); + private Map getFrequencyDeviation(LineCountEvaluateParam lineCountEvaluateParam, Map limitMap) { + Map lineData = new HashMap<>(); lineCountEvaluateParam.setColumnName("freq_dev,line_id"); lineCountEvaluateParam.setValueType(Stream.of("MAX").collect(Collectors.toList())); @@ -319,10 +354,10 @@ public class PollutionServiceImpl implements IPollutionService { Overlimit overlimit = limitMap.get(lineId); double dayV = valList.stream().map(it -> Math.abs(it.getFreqDev())).max(Comparator.comparing(Double::doubleValue)).get(); double freqDev = dayV / overlimit.getFreqDev(); - RMpPollutionDPO RMpPollutionDPO = new RMpPollutionDPO(); - RMpPollutionDPO.setLineId(lineId); - RMpPollutionDPO.setValue(freqDev); - lineData.put(lineId, RMpPollutionDPO); + DataPollutionD dataPollutionD = new DataPollutionD(); + dataPollutionD.setLineId(lineId); + dataPollutionD.setValue(freqDev); + lineData.put(lineId, dataPollutionD); } }); return lineData; @@ -331,8 +366,8 @@ public class PollutionServiceImpl implements IPollutionService { /** * 电压偏差:各监测点最新的A、B、C三相数据,取电压上下偏差的绝对值中的最大值。 */ - private Map getVoltageDeviation(LineCountEvaluateParam lineCountEvaluateParam, Map limitMap) { - Map lineData = new HashMap<>(); + private Map getVoltageDeviation(LineCountEvaluateParam lineCountEvaluateParam, Map limitMap) { + Map lineData = new HashMap<>(); lineCountEvaluateParam.setColumnName("vu_dev,line_id"); lineCountEvaluateParam.setValueType(Stream.of("MAX").collect(Collectors.toList())); lineCountEvaluateParam.setPhasicType(Stream.of("A", "B", "C").collect(Collectors.toList())); @@ -344,10 +379,10 @@ public class PollutionServiceImpl implements IPollutionService { Overlimit overlimit = limitMap.get(lineId); double dayV = valList.stream().map(it -> Math.abs(it.getVuDev())).max(Comparator.comparing(Double::doubleValue)).get(); double vDev = dayV / overlimit.getUvoltageDev(); - RMpPollutionDPO RMpPollutionDPO = new RMpPollutionDPO(); - RMpPollutionDPO.setLineId(lineId); - RMpPollutionDPO.setValue(vDev); - lineData.put(lineId, RMpPollutionDPO); + DataPollutionD dataPollutionD = new DataPollutionD(); + dataPollutionD.setLineId(lineId); + dataPollutionD.setValue(vDev); + lineData.put(lineId, dataPollutionD); } }); return lineData; @@ -356,8 +391,8 @@ public class PollutionServiceImpl implements IPollutionService { /** * 三相电压不平衡度:各监测点最新的T相数据。 */ - private Map getThreePhaseVoltageUnbalance(LineCountEvaluateParam lineCountEvaluateParam, Map limitMap) { - Map lineData = new HashMap<>(); + private Map getThreePhaseVoltageUnbalance(LineCountEvaluateParam lineCountEvaluateParam, Map limitMap) { + Map lineData = new HashMap<>(); lineCountEvaluateParam.setColumnName("v_unbalance,line_id"); lineCountEvaluateParam.setValueType(Stream.of("CP95").collect(Collectors.toList())); lineCountEvaluateParam.setPhasicType(Stream.of("T").collect(Collectors.toList())); @@ -369,10 +404,10 @@ public class PollutionServiceImpl implements IPollutionService { Overlimit overlimit = limitMap.get(lineId); double dayV = valList.stream().mapToDouble(DataVDto::getVUnbalance).max().getAsDouble(); double vUb = dayV / overlimit.getUbalance(); - RMpPollutionDPO RMpPollutionDPO = new RMpPollutionDPO(); - RMpPollutionDPO.setLineId(lineId); - RMpPollutionDPO.setValue(vUb); - lineData.put(lineId, RMpPollutionDPO); + DataPollutionD dataPollutionD = new DataPollutionD(); + dataPollutionD.setLineId(lineId); + dataPollutionD.setValue(vUb); + lineData.put(lineId, dataPollutionD); } }); return lineData; @@ -381,8 +416,8 @@ public class PollutionServiceImpl implements IPollutionService { /** * 负序电流:各监测点最新的T相数据。 */ - private Map getNegativeSequenceCurrent(LineCountEvaluateParam lineCountEvaluateParam, Map limitMap) { - Map lineData = new HashMap<>(); + private Map getNegativeSequenceCurrent(LineCountEvaluateParam lineCountEvaluateParam, Map limitMap) { + Map lineData = new HashMap<>(); lineCountEvaluateParam.setColumnName("i_neg,line_id"); lineCountEvaluateParam.setValueType(Stream.of("CP95").collect(Collectors.toList())); lineCountEvaluateParam.setPhasicType(Stream.of("T").collect(Collectors.toList())); @@ -393,10 +428,10 @@ public class PollutionServiceImpl implements IPollutionService { Overlimit overlimit = limitMap.get(lineId); double dayI = valList.stream().mapToDouble(DataIDto::getINeg).max().getAsDouble(); double iNeg = dayI / overlimit.getINeg(); - RMpPollutionDPO RMpPollutionDPO = new RMpPollutionDPO(); - RMpPollutionDPO.setLineId(lineId); - RMpPollutionDPO.setValue(iNeg); - lineData.put(lineId, RMpPollutionDPO); + DataPollutionD dataPollutionD = new DataPollutionD(); + dataPollutionD.setLineId(lineId); + dataPollutionD.setValue(iNeg); + lineData.put(lineId, dataPollutionD); } }); return lineData; @@ -405,8 +440,8 @@ public class PollutionServiceImpl implements IPollutionService { /** * 间谐波电压含有率:各监测点最新的A、B、C三相数据。 */ - private Map getInterharmonicVoltage(LineCountEvaluateParam lineCountEvaluateParam, Map limitMap) { - Map lineData = new HashMap<>(); + private Map getInterharmonicVoltage(LineCountEvaluateParam lineCountEvaluateParam, Map limitMap) { + Map lineData = new HashMap<>(); lineCountEvaluateParam.setPhasicType(Stream.of("A", "B", "C").collect(Collectors.toList())); lineCountEvaluateParam.setValueType(Stream.of("CP95").collect(Collectors.toList())); List dataHarmDtoList = dataHarmRateVFeignClient.getHarmRateVData(lineCountEvaluateParam).getData(); @@ -415,7 +450,7 @@ public class PollutionServiceImpl implements IPollutionService { dataMap.forEach((lineId, valList) -> { if (limitMap.containsKey(lineId)) { Overlimit overlimit = limitMap.get(lineId); - List temList = new ArrayList<>(); + List temList = new ArrayList<>(); for (DataHarmDto dayInharmV : valList) { double v1 = Math.abs(dayInharmV.getV1() / overlimit.getInuharm1()); double v2 = Math.abs(dayInharmV.getV2() / overlimit.getInuharm2()); @@ -434,17 +469,17 @@ public class PollutionServiceImpl implements IPollutionService { double v15 = Math.abs(dayInharmV.getV15() / overlimit.getInuharm15()); double v16 = Math.abs(dayInharmV.getV16() / overlimit.getInuharm16()); double data = Stream.of(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16).max(Comparator.comparing(Double::doubleValue)).get(); - RMpPollutionDPO RMpPollutionDPO = new RMpPollutionDPO(); - RMpPollutionDPO.setLineId(lineId); - RMpPollutionDPO.setValue(data); - temList.add(RMpPollutionDPO); + DataPollutionD dataPollutionD = new DataPollutionD(); + dataPollutionD.setLineId(lineId); + dataPollutionD.setValue(data); + temList.add(dataPollutionD); } - double val = temList.stream().map(RMpPollutionDPO::getValue).max(Comparator.comparing(Double::doubleValue)).get(); - RMpPollutionDPO RMpPollutionDPO = new RMpPollutionDPO(); - RMpPollutionDPO.setLineId(lineId); - RMpPollutionDPO.setValue(val); - lineData.put(lineId, RMpPollutionDPO); + double val = temList.stream().map(DataPollutionD::getValue).max(Comparator.comparing(Double::doubleValue)).get(); + DataPollutionD dataPollutionD = new DataPollutionD(); + dataPollutionD.setLineId(lineId); + dataPollutionD.setValue(val); + lineData.put(lineId, dataPollutionD); } }); return lineData; @@ -453,8 +488,8 @@ public class PollutionServiceImpl implements IPollutionService { /** * 长时电压闪变:各监测点最新的A、B、C三相数据。 */ - private Map getVoltageFlicker(LineCountEvaluateParam lineCountEvaluateParam, Map limitMap) { - Map lineData = new HashMap<>(); + private Map getVoltageFlicker(LineCountEvaluateParam lineCountEvaluateParam, Map limitMap) { + Map lineData = new HashMap<>(); lineCountEvaluateParam.setColumnName("plt"); lineCountEvaluateParam.setValueType(Stream.of("CP95").collect(Collectors.toList())); @@ -467,10 +502,10 @@ public class PollutionServiceImpl implements IPollutionService { Overlimit overlimit = limitMap.get(lineId); double dayPlt = valList.stream().mapToDouble(DataPltDto::getPlt).max().getAsDouble(); double plt = dayPlt / overlimit.getFlicker(); - RMpPollutionDPO RMpPollutionDPO = new RMpPollutionDPO(); - RMpPollutionDPO.setLineId(lineId); - RMpPollutionDPO.setValue(plt); - lineData.put(lineId, RMpPollutionDPO); + DataPollutionD dataPollutionD = new DataPollutionD(); + dataPollutionD.setLineId(lineId); + dataPollutionD.setValue(plt); + lineData.put(lineId, dataPollutionD); } }); return lineData; diff --git a/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/api/DataComAssFeignClient.java b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/api/DataComAssFeignClient.java new file mode 100644 index 0000000..b48bc81 --- /dev/null +++ b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/api/DataComAssFeignClient.java @@ -0,0 +1,30 @@ +package com.njcn.dataProcess.api; + +import com.njcn.common.pojo.constant.ServerInfo; +import com.njcn.common.pojo.response.HttpResult; +import com.njcn.dataProcess.api.fallback.DataComAssFeignClientFallbackFactory; +import com.njcn.dataProcess.api.fallback.DataIFeignClientFallbackFactory; +import com.njcn.dataProcess.dto.DataIDTO; +import com.njcn.dataProcess.param.LineCountEvaluateParam; +import com.njcn.dataProcess.pojo.dto.CommonMinuteDto; +import com.njcn.dataProcess.pojo.dto.DataComassesDPO; +import com.njcn.dataProcess.pojo.dto.DataIDto; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; + +/** + * @author denghuajun + * @version 1.0.0 + * @date 2022年01月05日 15:11 + */ +@FeignClient(value = ServerInfo.PLATFORM_DATA_PROCESSING_BOOT, path = "/dataComAss", fallbackFactory = DataComAssFeignClientFallbackFactory.class, contextId = "dataComAss") +public interface DataComAssFeignClient { + + @PostMapping("/batchInsertion") + HttpResult batchInsertion(@RequestBody List dataIDTOList); + + +} diff --git a/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/api/DataPollutionFeignClient.java b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/api/DataPollutionFeignClient.java new file mode 100644 index 0000000..27050f5 --- /dev/null +++ b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/api/DataPollutionFeignClient.java @@ -0,0 +1,25 @@ +package com.njcn.dataProcess.api; + +import com.njcn.common.pojo.constant.ServerInfo; +import com.njcn.common.pojo.response.HttpResult; +import com.njcn.dataProcess.api.fallback.DataPollutionFeignClientFallbackFactory; +import com.njcn.dataProcess.pojo.dto.DataPollutionD; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; + +/** + * @author denghuajun + * @version 1.0.0 + * @date 2022年01月05日 15:11 + */ +@FeignClient(value = ServerInfo.PLATFORM_DATA_PROCESSING_BOOT, path = "/dataPollution", fallbackFactory = DataPollutionFeignClientFallbackFactory.class, contextId = "dataPollution") +public interface DataPollutionFeignClient { + + @PostMapping("/batchInsertion") + HttpResult batchInsertion(@RequestBody List dataIDTOList); + + +} diff --git a/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/api/fallback/DataComAssFeignClientFallbackFactory.java b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/api/fallback/DataComAssFeignClientFallbackFactory.java new file mode 100644 index 0000000..c2b8749 --- /dev/null +++ b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/api/fallback/DataComAssFeignClientFallbackFactory.java @@ -0,0 +1,49 @@ +package com.njcn.dataProcess.api.fallback; + +import com.njcn.common.pojo.enums.response.CommonResponseEnum; +import com.njcn.common.pojo.exception.BusinessException; +import com.njcn.common.pojo.response.HttpResult; +import com.njcn.dataProcess.api.DataComAssFeignClient; +import com.njcn.dataProcess.pojo.dto.DataComassesDPO; +import com.njcn.dataProcess.util.DataProcessingEnumUtil; +import feign.hystrix.FallbackFactory; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/19 10:19 + */ +@Slf4j +@Component +public class DataComAssFeignClientFallbackFactory implements FallbackFactory { + + + /** + * 输出远程请求接口异常日志 + * @param cause RPC请求异常 + */ + @Override + public DataComAssFeignClient create(Throwable cause) { + //判断抛出异常是否为解码器抛出的业务异常 + Enum exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK; + if(cause.getCause() instanceof BusinessException){ + BusinessException businessException = (BusinessException) cause.getCause(); + exceptionEnum = DataProcessingEnumUtil.getExceptionEnum(businessException.getResult()); + } + Enum finalExceptionEnum = exceptionEnum; + return new DataComAssFeignClient() { + + @Override + public HttpResult batchInsertion(List dataFlucDTOList) { + log.error("{}异常,降级处理,异常为:{}","批量插入数据",cause.toString()); + throw new BusinessException(finalExceptionEnum); + } + + + }; + } +} diff --git a/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/api/fallback/DataPollutionFeignClientFallbackFactory.java b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/api/fallback/DataPollutionFeignClientFallbackFactory.java new file mode 100644 index 0000000..6f4ce07 --- /dev/null +++ b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/api/fallback/DataPollutionFeignClientFallbackFactory.java @@ -0,0 +1,58 @@ +package com.njcn.dataProcess.api.fallback; + +import com.njcn.common.pojo.enums.response.CommonResponseEnum; +import com.njcn.common.pojo.exception.BusinessException; +import com.njcn.common.pojo.response.HttpResult; +import com.njcn.dataProcess.api.DataPollutionFeignClient; +import com.njcn.dataProcess.api.DataVFeignClient; +import com.njcn.dataProcess.dto.DataVDTO; +import com.njcn.dataProcess.dto.MeasurementCountDTO; +import com.njcn.dataProcess.param.LineCountEvaluateParam; +import com.njcn.dataProcess.pojo.dto.CommonMinuteDto; +import com.njcn.dataProcess.pojo.dto.DataPollutionD; +import com.njcn.dataProcess.pojo.dto.DataVCvtDto; +import com.njcn.dataProcess.pojo.dto.DataVDto; +import com.njcn.dataProcess.util.DataProcessingEnumUtil; +import feign.hystrix.FallbackFactory; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.RequestBody; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * @author denghuajun + * @version 1.0.0 + * @date 2022年01月05日 15:08 + */ +@Slf4j +@Component +public class DataPollutionFeignClientFallbackFactory implements FallbackFactory { + + + /** + * 输出远程请求接口异常日志 + * @param cause RPC请求异常 + */ + @Override + public DataPollutionFeignClient create(Throwable cause) { + //判断抛出异常是否为解码器抛出的业务异常 + Enum exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK; + if(cause.getCause() instanceof BusinessException){ + BusinessException businessException = (BusinessException) cause.getCause(); + exceptionEnum = DataProcessingEnumUtil.getExceptionEnum(businessException.getResult()); + } + Enum finalExceptionEnum = exceptionEnum; + return new DataPollutionFeignClient() { + + @Override + public HttpResult batchInsertion(List dataVDTOList) { + log.error("{}异常,降级处理,异常为:{}","批量插入数据",cause.toString()); + throw new BusinessException(finalExceptionEnum); + } + + + }; + } +} diff --git a/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionD.java b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionD.java new file mode 100644 index 0000000..8f0d506 --- /dev/null +++ b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionD.java @@ -0,0 +1,40 @@ +package com.njcn.dataProcess.pojo.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDate; + +/** + * @Description: 单位污区图统计日表 + * @Author: wr + * @Date: 2025/3/19 14:13 + */ +@Data +public class DataPollutionD implements Serializable { + /** + * 单位id + */ + @ApiModelProperty(value = "监测点") + private String lineId; + + /** + * 时间 + */ + @ApiModelProperty(value = "时间") + private LocalDate dataDate; + + /** + * 污区图统计类型 + */ + @ApiModelProperty(value = "污区图统计类型") + private String pollutionType; + + /** + * 统计值 + */ + @ApiModelProperty(value = "统计值") + private Double value; + +} \ No newline at end of file diff --git a/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionOrgD.java b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionOrgD.java new file mode 100644 index 0000000..edddd1b --- /dev/null +++ b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionOrgD.java @@ -0,0 +1,41 @@ +package com.njcn.dataProcess.pojo.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDate; + +/** + * @Description: 单位污区图统计日表 + * @Author: wr + * @Date: 2025/3/19 14:15 + */ + +@Data +public class DataPollutionOrgD implements Serializable { + /** + * 单位id + */ + @ApiModelProperty(value="单位id") + private String orgId; + + /** + * 时间 + */ + @ApiModelProperty(value="时间") + private LocalDate dataDate; + + /** + * 污区图统计类型 + */ + @ApiModelProperty(value="污区图统计类型") + private String pollutionType; + + /** + * 统计值 + */ + @ApiModelProperty(value="统计值") + private Double value; + +} diff --git a/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionOrgM.java b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionOrgM.java new file mode 100644 index 0000000..73b8258 --- /dev/null +++ b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionOrgM.java @@ -0,0 +1,40 @@ +package com.njcn.dataProcess.pojo.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDate; + +/** + * @Description: 单位污区图统计月表 + * @Author: wr + * @Date: 2025/3/19 14:15 + */ +@Data +public class DataPollutionOrgM implements Serializable { + /** + * 单位id + */ + @ApiModelProperty(value="单位id") + private String orgId; + + /** + * 时间 + */ + @ApiModelProperty(value="时间") + private LocalDate dataDate; + + /** + * 污区图统计类型 + */ + @ApiModelProperty(value="污区图统计类型") + private String pollutionType; + + /** + * 统计值 + */ + @ApiModelProperty(value="统计值") + private Double value; + +} diff --git a/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionOrgQ.java b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionOrgQ.java new file mode 100644 index 0000000..7ad9432 --- /dev/null +++ b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionOrgQ.java @@ -0,0 +1,40 @@ +package com.njcn.dataProcess.pojo.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDate; + +/** + * @Description: 单位污区图统计季表 + * @Author: wr + * @Date: 2025/3/19 14:15 + */ +@Data +public class DataPollutionOrgQ implements Serializable { + /** + * 单位id + */ + @ApiModelProperty(value="单位id") + private String orgId; + + /** + * 时间 + */ + @ApiModelProperty(value="时间") + private LocalDate dataDate; + + /** + * 污区图统计类型 + */ + @ApiModelProperty(value="污区图统计类型") + private String pollutionType; + + /** + * 统计值 + */ + @ApiModelProperty(value="统计值") + private Double value; + +} diff --git a/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionOrgY.java b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionOrgY.java new file mode 100644 index 0000000..85ce390 --- /dev/null +++ b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionOrgY.java @@ -0,0 +1,40 @@ +package com.njcn.dataProcess.pojo.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDate; + +/** + * @Description: 单位污区图统计年表 + * @Author: wr + * @Date: 2025/3/19 14:15 + */ +@Data +public class DataPollutionOrgY implements Serializable { + /** + * 单位id + */ + @ApiModelProperty(value="单位id") + private String orgId; + + /** + * 时间 + */ + @ApiModelProperty(value="时间") + private LocalDate dataDate; + + /** + * 污区图统计类型 + */ + @ApiModelProperty(value="污区图统计类型") + private String pollutionType; + + /** + * 统计值 + */ + @ApiModelProperty(value="统计值") + private Double value; + +} diff --git a/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionSubstationD.java b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionSubstationD.java new file mode 100644 index 0000000..8de0df5 --- /dev/null +++ b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionSubstationD.java @@ -0,0 +1,40 @@ +package com.njcn.dataProcess.pojo.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDate; + +/** + * @Description: 变电站污区图统计日表 + * @Author: wr + * @Date: 2025/3/19 14:16 + */ +@Data +public class DataPollutionSubstationD implements Serializable { + /** + * 变电站id + */ + @ApiModelProperty(value = "变电站id") + private String substationId; + + /** + * 时间 + */ + @ApiModelProperty(value = "时间") + private LocalDate dataDate; + + /** + * 污区图统计类型 + */ + @ApiModelProperty(value = "污区图统计类型") + private String pollutionType; + + /** + * 统计值 + */ + @ApiModelProperty(value = "统计值") + private Double value; + +} diff --git a/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionSubstationM.java b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionSubstationM.java new file mode 100644 index 0000000..327e8db --- /dev/null +++ b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionSubstationM.java @@ -0,0 +1,40 @@ +package com.njcn.dataProcess.pojo.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDate; + +/** + * @Description: 变电站污区图统计月表 + * @Author: wr + * @Date: 2025/3/19 14:16 + */ +@Data +public class DataPollutionSubstationM implements Serializable { + /** + * 变电站id + */ + @ApiModelProperty(value = "变电站id") + private String substationId; + + /** + * 时间 + */ + @ApiModelProperty(value = "时间") + private LocalDate dataDate; + + /** + * 污区图统计类型 + */ + @ApiModelProperty(value = "污区图统计类型") + private String pollutionType; + + /** + * 统计值 + */ + @ApiModelProperty(value = "统计值") + private Double value; + +} \ No newline at end of file diff --git a/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionSubstationQ.java b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionSubstationQ.java new file mode 100644 index 0000000..ffdf3a8 --- /dev/null +++ b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionSubstationQ.java @@ -0,0 +1,40 @@ +package com.njcn.dataProcess.pojo.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDate; + +/** + * @Description: 变电站污区图统计季表 + * @Author: wr + * @Date: 2025/3/19 14:16 + */ +@Data +public class DataPollutionSubstationQ implements Serializable { + /** + * 变电站id + */ + @ApiModelProperty(value="变电站id") + private String substationId; + + /** + * 时间 + */ + @ApiModelProperty(value="时间") + private LocalDate dataDate; + + /** + * 污区图统计类型 + */ + @ApiModelProperty(value="污区图统计类型") + private String pollutionType; + + /** + * 统计值 + */ + @ApiModelProperty(value="统计值") + private Double value; + +} diff --git a/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionSubstationY.java b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionSubstationY.java new file mode 100644 index 0000000..b46a994 --- /dev/null +++ b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/dto/DataPollutionSubstationY.java @@ -0,0 +1,40 @@ +package com.njcn.dataProcess.pojo.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDate; + +/** + * @Description: 变电站污区图统计年表 + * @Author: wr + * @Date: 2025/3/19 14:16 + */ +@Data +public class DataPollutionSubstationY implements Serializable { + /** + * 变电站id + */ + @ApiModelProperty(value="变电站id") + private String substationId; + + /** + * 时间 + */ + @ApiModelProperty(value="时间") + private LocalDate dataDate; + + /** + * 污区图统计类型 + */ + @ApiModelProperty(value="污区图统计类型") + private String pollutionType; + + /** + * 统计值 + */ + @ApiModelProperty(value="统计值") + private Double value; + +} diff --git a/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/po/relation/RMpPollutionDPO.java b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RMpPollutionD.java similarity index 74% rename from data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/po/relation/RMpPollutionDPO.java rename to data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RMpPollutionD.java index f41a4cd..e9d46f4 100644 --- a/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/po/relation/RMpPollutionDPO.java +++ b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RMpPollutionD.java @@ -1,23 +1,28 @@ -package com.njcn.dataProcess.po.relation; +package com.njcn.dataProcess.pojo.po; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; import java.io.Serializable; import java.time.LocalDate; /** - * @Author: cdf - * @CreateTime: 2025-03-19 - * @Description: 监测点污区实体 + * @Description: 单位污区图统计日表 + * @Author: wr + * @Date: 2025/3/19 14:13 */ @Data +@AllArgsConstructor +@NoArgsConstructor @TableName(value = "r_mp_pollution_d") -public class RMpPollutionDPO implements Serializable { - private static final long serialVersionUID = 1L; - +public class RMpPollutionD implements Serializable { + /** + * 单位id + */ @TableField(value = "line_id") @ApiModelProperty(value = "监测点") private String lineId; @@ -43,5 +48,5 @@ public class RMpPollutionDPO implements Serializable { @ApiModelProperty(value = "统计值") private Double value; - -} + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatLimitQualifiedD.java b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatLimitQualifiedD.java index 9b39abd..43ff98c 100644 --- a/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatLimitQualifiedD.java +++ b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatLimitQualifiedD.java @@ -25,427 +25,427 @@ public class RStatLimitQualifiedD implements Serializable { @MppMultiId @TableField(value = "time_id") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") - private LocalDate time; + private String time; /** * 闪变越限次数 */ @TableField(value = "flicker_overtime") - private Integer flickerOvertime; + private Double flickerOvertime; /** * 频率偏差越限次数 */ @TableField(value = "freq_dev_overtime") - private Integer freqDevOvertime; + private Double freqDevOvertime; /** * 电压偏差越限次数 */ @TableField(value = "voltage_dev_overtime") - private Integer voltageDevOvertime; + private Double voltageDevOvertime; /** * 三相电压不平衡度越限次数 */ @TableField(value = "ubalance_overtime") - private Integer ubalanceOvertime; + private Double ubalanceOvertime; /** * 电压谐波畸变率越限次数 */ @TableField(value = "uaberrance_overtime") - private Integer uaberranceOvertime; + private Double uaberranceOvertime; /** * 负序电流限值次数 */ @TableField(value = "i_neg_overtime") - private Integer iNegOvertime; + private Double iNegOvertime; /** * 2次电压谐波含有率越限次数 */ @TableField(value = "uharm_2_overtime") - private Integer uharm2Overtime; + private Double uharm2Overtime; /** * 3次电压谐波含有率越限次数 */ @TableField(value = "uharm_3_overtime") - private Integer uharm3Overtime; + private Double uharm3Overtime; /** * 4次电压谐波含有率越限次数 */ @TableField(value = "uharm_4_overtime") - private Integer uharm4Overtime; + private Double uharm4Overtime; /** * 5次电压谐波含有率越限次数 */ @TableField(value = "uharm_5_overtime") - private Integer uharm5Overtime; + private Double uharm5Overtime; /** * 6次电压谐波含有率越限次数 */ @TableField(value = "uharm_6_overtime") - private Integer uharm6Overtime; + private Double uharm6Overtime; /** * 7次电压谐波含有率越限次数 */ @TableField(value = "uharm_7_overtime") - private Integer uharm7Overtime; + private Double uharm7Overtime; /** * 8次电压谐波含有率越限次数 */ @TableField(value = "uharm_8_overtime") - private Integer uharm8Overtime; + private Double uharm8Overtime; /** * 9次电压谐波含有率越限次数 */ @TableField(value = "uharm_9_overtime") - private Integer uharm9Overtime; + private Double uharm9Overtime; /** * 10次电压谐波含有率越限次数 */ @TableField(value = "uharm_10_overtime") - private Integer uharm10Overtime; + private Double uharm10Overtime; /** * 11次电压谐波含有率越限次数 */ @TableField(value = "uharm_11_overtime") - private Integer uharm11Overtime; + private Double uharm11Overtime; /** * 12次电压谐波含有率越限次数 */ @TableField(value = "uharm_12_overtime") - private Integer uharm12Overtime; + private Double uharm12Overtime; /** * 13次电压谐波含有率越限次数 */ @TableField(value = "uharm_13_overtime") - private Integer uharm13Overtime; + private Double uharm13Overtime; /** * 14次电压谐波含有率越限次数 */ @TableField(value = "uharm_14_overtime") - private Integer uharm14Overtime; + private Double uharm14Overtime; /** * 15次电压谐波含有率越限次数 */ @TableField(value = "uharm_15_overtime") - private Integer uharm15Overtime; + private Double uharm15Overtime; /** * 16次电压谐波含有率越限次数 */ @TableField(value = "uharm_16_overtime") - private Integer uharm16Overtime; + private Double uharm16Overtime; /** * 17次电压谐波含有率越限次数 */ @TableField(value = "uharm_17_overtime") - private Integer uharm17Overtime; + private Double uharm17Overtime; /** * 18次电压谐波含有率越限次数 */ @TableField(value = "uharm_18_overtime") - private Integer uharm18Overtime; + private Double uharm18Overtime; /** * 19次电压谐波含有率越限次数 */ @TableField(value = "uharm_19_overtime") - private Integer uharm19Overtime; + private Double uharm19Overtime; /** * 20次电压谐波含有率越限次数 */ @TableField(value = "uharm_20_overtime") - private Integer uharm20Overtime; + private Double uharm20Overtime; /** * 21次电压谐波含有率越限次数 */ @TableField(value = "uharm_21_overtime") - private Integer uharm21Overtime; + private Double uharm21Overtime; /** * 22次电压谐波含有率越限次数 */ @TableField(value = "uharm_22_overtime") - private Integer uharm22Overtime; + private Double uharm22Overtime; /** * 23次电压谐波含有率越限次数 */ @TableField(value = "uharm_23_overtime") - private Integer uharm23Overtime; + private Double uharm23Overtime; /** * 24次电压谐波含有率越限次数 */ @TableField(value = "uharm_24_overtime") - private Integer uharm24Overtime; + private Double uharm24Overtime; /** * 25次电压谐波含有率越限次数 */ @TableField(value = "uharm_25_overtime") - private Integer uharm25Overtime; + private Double uharm25Overtime; /** * 2次电流谐波幅值越限次数 */ @TableField(value = "iharm_2_overtime") - private Integer iharm2Overtime; + private Double iharm2Overtime; /** * 3次电流谐波幅值越限次数 */ @TableField(value = "iharm_3_overtime") - private Integer iharm3Overtime; + private Double iharm3Overtime; /** * 4次电流谐波幅值越限次数 */ @TableField(value = "iharm_4_overtime") - private Integer iharm4Overtime; + private Double iharm4Overtime; /** * 5次电流谐波幅值越限次数 */ @TableField(value = "iharm_5_overtime") - private Integer iharm5Overtime; + private Double iharm5Overtime; /** * 6次电流谐波幅值越限次数 */ @TableField(value = "iharm_6_overtime") - private Integer iharm6Overtime; + private Double iharm6Overtime; /** * 7次电流谐波幅值越限次数 */ @TableField(value = "iharm_7_overtime") - private Integer iharm7Overtime; + private Double iharm7Overtime; /** * 8次电流谐波幅值越限次数 */ @TableField(value = "iharm_8_overtime") - private Integer iharm8Overtime; + private Double iharm8Overtime; /** * 9次电流谐波幅值越限次数 */ @TableField(value = "iharm_9_overtime") - private Integer iharm9Overtime; + private Double iharm9Overtime; /** * 10次电流谐波幅值越限次数 */ @TableField(value = "iharm_10_overtime") - private Integer iharm10Overtime; + private Double iharm10Overtime; /** * 11次电流谐波幅值越限次数 */ @TableField(value = "iharm_11_overtime") - private Integer iharm11Overtime; + private Double iharm11Overtime; /** * 12次电流谐波幅值越限次数 */ @TableField(value = "iharm_12_overtime") - private Integer iharm12Overtime; + private Double iharm12Overtime; /** * 13次电流谐波幅值越限次数 */ @TableField(value = "iharm_13_overtime") - private Integer iharm13Overtime; + private Double iharm13Overtime; /** * 14次电流谐波幅值越限次数 */ @TableField(value = "iharm_14_overtime") - private Integer iharm14Overtime; + private Double iharm14Overtime; /** * 15次电流谐波幅值越限次数 */ @TableField(value = "iharm_15_overtime") - private Integer iharm15Overtime; + private Double iharm15Overtime; /** * 16次电流谐波幅值越限次数 */ @TableField(value = "iharm_16_overtime") - private Integer iharm16Overtime; + private Double iharm16Overtime; /** * 17次电流谐波幅值越限次数 */ @TableField(value = "iharm_17_overtime") - private Integer iharm17Overtime; + private Double iharm17Overtime; /** * 18次电流谐波幅值越限次数 */ @TableField(value = "iharm_18_overtime") - private Integer iharm18Overtime; + private Double iharm18Overtime; /** * 19次电流谐波幅值越限次数 */ @TableField(value = "iharm_19_overtime") - private Integer iharm19Overtime; + private Double iharm19Overtime; /** * 20次电流谐波幅值越限次数 */ @TableField(value = "iharm_20_overtime") - private Integer iharm20Overtime; + private Double iharm20Overtime; /** * 21次电流谐波幅值越限次数 */ @TableField(value = "iharm_21_overtime") - private Integer iharm21Overtime; + private Double iharm21Overtime; /** * 22次电流谐波幅值越限次数 */ @TableField(value = "iharm_22_overtime") - private Integer iharm22Overtime; + private Double iharm22Overtime; /** * 23次电流谐波幅值越限次数 */ @TableField(value = "iharm_23_overtime") - private Integer iharm23Overtime; + private Double iharm23Overtime; /** * 24次电流谐波幅值越限次数 */ @TableField(value = "iharm_24_overtime") - private Integer iharm24Overtime; + private Double iharm24Overtime; /** * 25次电流谐波幅值越限次数 */ @TableField(value = "iharm_25_overtime") - private Integer iharm25Overtime; + private Double iharm25Overtime; /** * 0.5次间谐波电压限值次数 */ @TableField(value = "inuharm_1_overtime") - private Integer inuharm1Overtime; + private Double inuharm1Overtime; /** * 1.5次间谐波电压限值次数 */ @TableField(value = "inuharm_2_overtime") - private Integer inuharm2Overtime; + private Double inuharm2Overtime; /** * 2.5次间谐波电压限值次数 */ @TableField(value = "inuharm_3_overtime") - private Integer inuharm3Overtime; + private Double inuharm3Overtime; /** * 3.5次间谐波电压限值次数 */ @TableField(value = "inuharm_4_overtime") - private Integer inuharm4Overtime; + private Double inuharm4Overtime; /** * 4.5次间谐波电压限值次数 */ @TableField(value = "inuharm_5_overtime") - private Integer inuharm5Overtime; + private Double inuharm5Overtime; /** * 5.5次间谐波电压限值次数 */ @TableField(value = "inuharm_6_overtime") - private Integer inuharm6Overtime; + private Double inuharm6Overtime; /** * 6.5次间谐波电压限值次数 */ @TableField(value = "inuharm_7_overtime") - private Integer inuharm7Overtime; + private Double inuharm7Overtime; /** * 7.5次间谐波电压限值次数 */ @TableField(value = "inuharm_8_overtime") - private Integer inuharm8Overtime; + private Double inuharm8Overtime; /** * 8.5次间谐波电压限值次数 */ @TableField(value = "inuharm_9_overtime") - private Integer inuharm9Overtime; + private Double inuharm9Overtime; /** * 9.5次间谐波电压限值次数 */ @TableField(value = "inuharm_10_overtime") - private Integer inuharm10Overtime; + private Double inuharm10Overtime; /** * 10.5次间谐波电压限值次数 */ @TableField(value = "inuharm_11_overtime") - private Integer inuharm11Overtime; + private Double inuharm11Overtime; /** * 11.5次间谐波电压限值次数 */ @TableField(value = "inuharm_12_overtime") - private Integer inuharm12Overtime; + private Double inuharm12Overtime; /** * 12.5次间谐波电压限值次数 */ @TableField(value = "inuharm_13_overtime") - private Integer inuharm13Overtime; + private Double inuharm13Overtime; /** * 13.5次间谐波电压限值次数 */ @TableField(value = "inuharm_14_overtime") - private Integer inuharm14Overtime; + private Double inuharm14Overtime; /** * 14.5次间谐波电压限值次数 */ @TableField(value = "inuharm_15_overtime") - private Integer inuharm15Overtime; + private Double inuharm15Overtime; /** * 15.5次间谐波电压限值次数 */ @TableField(value = "inuharm_16_overtime") - private Integer inuharm16Overtime; + private Double inuharm16Overtime; } diff --git a/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionOrgD.java b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionOrgD.java new file mode 100644 index 0000000..912c50a --- /dev/null +++ b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionOrgD.java @@ -0,0 +1,53 @@ +package com.njcn.dataProcess.pojo.po; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.time.LocalDate; + +/** + * @Description: 单位污区图统计日表 + * @Author: wr + * @Date: 2025/3/19 14:15 + */ + +@Data +@AllArgsConstructor +@NoArgsConstructor +@TableName(value = "r_stat_pollution_org_d") +public class RStatPollutionOrgD implements Serializable { + /** + * 单位id + */ + @TableField(value = "org_id") + @ApiModelProperty(value="单位id") + private String orgId; + + /** + * 时间 + */ + @TableField(value = "data_date") + @ApiModelProperty(value="时间") + private LocalDate dataDate; + + /** + * 污区图统计类型 + */ + @TableField(value = "pollution_type") + @ApiModelProperty(value="污区图统计类型") + private String pollutionType; + + /** + * 统计值 + */ + @TableField(value = "value") + @ApiModelProperty(value="统计值") + private Double value; + + private static final long serialVersionUID = 1L; +} diff --git a/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionOrgM.java b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionOrgM.java new file mode 100644 index 0000000..a6d9ec1 --- /dev/null +++ b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionOrgM.java @@ -0,0 +1,52 @@ +package com.njcn.dataProcess.pojo.po; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.time.LocalDate; + +/** + * @Description: 单位污区图统计月表 + * @Author: wr + * @Date: 2025/3/19 14:15 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@TableName(value = "r_stat_pollution_org_m") +public class RStatPollutionOrgM implements Serializable { + /** + * 单位id + */ + @TableField(value = "org_id") + @ApiModelProperty(value="单位id") + private String orgId; + + /** + * 时间 + */ + @TableField(value = "data_date") + @ApiModelProperty(value="时间") + private LocalDate dataDate; + + /** + * 污区图统计类型 + */ + @TableField(value = "pollution_type") + @ApiModelProperty(value="污区图统计类型") + private String pollutionType; + + /** + * 统计值 + */ + @TableField(value = "value") + @ApiModelProperty(value="统计值") + private Double value; + + private static final long serialVersionUID = 1L; +} diff --git a/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionOrgQ.java b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionOrgQ.java new file mode 100644 index 0000000..73e0abc --- /dev/null +++ b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionOrgQ.java @@ -0,0 +1,52 @@ +package com.njcn.dataProcess.pojo.po; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.time.LocalDate; + +/** + * @Description: 单位污区图统计季表 + * @Author: wr + * @Date: 2025/3/19 14:15 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@TableName(value = "r_stat_pollution_org_q") +public class RStatPollutionOrgQ implements Serializable { + /** + * 单位id + */ + @TableField(value = "org_id") + @ApiModelProperty(value="单位id") + private String orgId; + + /** + * 时间 + */ + @TableField(value = "data_date") + @ApiModelProperty(value="时间") + private LocalDate dataDate; + + /** + * 污区图统计类型 + */ + @TableField(value = "pollution_type") + @ApiModelProperty(value="污区图统计类型") + private String pollutionType; + + /** + * 统计值 + */ + @TableField(value = "value") + @ApiModelProperty(value="统计值") + private Double value; + + private static final long serialVersionUID = 1L; +} diff --git a/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionOrgY.java b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionOrgY.java new file mode 100644 index 0000000..f6bac57 --- /dev/null +++ b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionOrgY.java @@ -0,0 +1,52 @@ +package com.njcn.dataProcess.pojo.po; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.time.LocalDate; + +/** + * @Description: 单位污区图统计年表 + * @Author: wr + * @Date: 2025/3/19 14:15 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@TableName(value = "r_stat_pollution_org_y") +public class RStatPollutionOrgY implements Serializable { + /** + * 单位id + */ + @TableField(value = "org_id") + @ApiModelProperty(value="单位id") + private String orgId; + + /** + * 时间 + */ + @TableField(value = "data_date") + @ApiModelProperty(value="时间") + private LocalDate dataDate; + + /** + * 污区图统计类型 + */ + @TableField(value = "pollution_type") + @ApiModelProperty(value="污区图统计类型") + private String pollutionType; + + /** + * 统计值 + */ + @TableField(value = "value") + @ApiModelProperty(value="统计值") + private Double value; + + private static final long serialVersionUID = 1L; +} diff --git a/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionSubstationD.java b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionSubstationD.java new file mode 100644 index 0000000..17d77f2 --- /dev/null +++ b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionSubstationD.java @@ -0,0 +1,52 @@ +package com.njcn.dataProcess.pojo.po; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.time.LocalDate; + +/** + * @Description: 变电站污区图统计日表 + * @Author: wr + * @Date: 2025/3/19 14:16 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@TableName(value = "r_stat_pollution_substation_d") +public class RStatPollutionSubstationD implements Serializable { + /** + * 变电站id + */ + @TableField(value = "substation_id") + @ApiModelProperty(value = "变电站id") + private String substationId; + + /** + * 时间 + */ + @TableField(value = "data_date") + @ApiModelProperty(value = "时间") + private LocalDate dataDate; + + /** + * 污区图统计类型 + */ + @TableField(value = "pollution_type") + @ApiModelProperty(value = "污区图统计类型") + private String pollutionType; + + /** + * 统计值 + */ + @TableField(value = "value") + @ApiModelProperty(value = "统计值") + private Double value; + + private static final long serialVersionUID = 1L; +} diff --git a/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionSubstationM.java b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionSubstationM.java new file mode 100644 index 0000000..2a1c080 --- /dev/null +++ b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionSubstationM.java @@ -0,0 +1,52 @@ +package com.njcn.dataProcess.pojo.po; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.time.LocalDate; + +/** + * @Description: 变电站污区图统计月表 + * @Author: wr + * @Date: 2025/3/19 14:16 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@TableName(value = "r_stat_pollution_substation_m") +public class RStatPollutionSubstationM implements Serializable { + /** + * 变电站id + */ + @TableField(value = "substation_id") + @ApiModelProperty(value = "变电站id") + private String substationId; + + /** + * 时间 + */ + @TableField(value = "data_date") + @ApiModelProperty(value = "时间") + private LocalDate dataDate; + + /** + * 污区图统计类型 + */ + @TableField(value = "pollution_type") + @ApiModelProperty(value = "污区图统计类型") + private String pollutionType; + + /** + * 统计值 + */ + @TableField(value = "value") + @ApiModelProperty(value = "统计值") + private Double value; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionSubstationQ.java b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionSubstationQ.java new file mode 100644 index 0000000..c547fa3 --- /dev/null +++ b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionSubstationQ.java @@ -0,0 +1,52 @@ +package com.njcn.dataProcess.pojo.po; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.time.LocalDate; + +/** + * @Description: 变电站污区图统计季表 + * @Author: wr + * @Date: 2025/3/19 14:16 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@TableName(value = "r_stat_pollution_substation_q") +public class RStatPollutionSubstationQ implements Serializable { + /** + * 变电站id + */ + @TableField(value = "substation_id") + @ApiModelProperty(value="变电站id") + private String substationId; + + /** + * 时间 + */ + @TableField(value = "data_date") + @ApiModelProperty(value="时间") + private LocalDate dataDate; + + /** + * 污区图统计类型 + */ + @TableField(value = "pollution_type") + @ApiModelProperty(value="污区图统计类型") + private String pollutionType; + + /** + * 统计值 + */ + @TableField(value = "value") + @ApiModelProperty(value="统计值") + private Double value; + + private static final long serialVersionUID = 1L; +} diff --git a/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionSubstationY.java b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionSubstationY.java new file mode 100644 index 0000000..f5aab8a --- /dev/null +++ b/data-processing/data-processing-api/src/main/java/com/njcn/dataProcess/pojo/po/RStatPollutionSubstationY.java @@ -0,0 +1,52 @@ +package com.njcn.dataProcess.pojo.po; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.time.LocalDate; + +/** + * @Description: 变电站污区图统计年表 + * @Author: wr + * @Date: 2025/3/19 14:16 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@TableName(value = "r_stat_pollution_substation_y") +public class RStatPollutionSubstationY implements Serializable { + /** + * 变电站id + */ + @TableField(value = "substation_id") + @ApiModelProperty(value="变电站id") + private String substationId; + + /** + * 时间 + */ + @TableField(value = "data_date") + @ApiModelProperty(value="时间") + private LocalDate dataDate; + + /** + * 污区图统计类型 + */ + @TableField(value = "pollution_type") + @ApiModelProperty(value="污区图统计类型") + private String pollutionType; + + /** + * 统计值 + */ + @TableField(value = "value") + @ApiModelProperty(value="统计值") + private Double value; + + private static final long serialVersionUID = 1L; +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/controller/DataComAssController.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/controller/DataComAssController.java new file mode 100644 index 0000000..9ac72be --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/controller/DataComAssController.java @@ -0,0 +1,55 @@ +package com.njcn.dataProcess.controller; + +import com.njcn.common.pojo.annotation.OperateInfo; +import com.njcn.common.pojo.constant.OperateType; +import com.njcn.common.pojo.enums.common.LogEnum; +import com.njcn.common.pojo.enums.response.CommonResponseEnum; +import com.njcn.common.pojo.response.HttpResult; +import com.njcn.common.utils.HttpResultUtil; +import com.njcn.dataProcess.annotation.InsertBean; +import com.njcn.dataProcess.annotation.QueryBean; +import com.njcn.dataProcess.pojo.dto.DataComassesDPO; +import com.njcn.dataProcess.service.IDataComAss; +import com.njcn.web.controller.BaseController; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Controller; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @author hongawen + * @version 1.0 + * @data 2024/11/6 19:48 + */ +@Validated +@Slf4j +@Controller +@RestController +@RequestMapping("/dataComAss") +@Api(tags = "综合评估数据") +public class DataComAssController extends BaseController { + + @QueryBean + private IDataComAss dataComAssQuery; + + @InsertBean + private IDataComAss dataComAssInsert; + + + @OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD) + @PostMapping("/batchInsertion") + @ApiOperation("批量插入") + public HttpResult batchInsertion(@RequestBody List dataVDTOList) { + String methodDescribe = getMethodDescribe("batchInsertion"); + dataComAssInsert.batchInsertion(dataVDTOList); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); + } + + + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/controller/DataPollutionController.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/controller/DataPollutionController.java new file mode 100644 index 0000000..c336c81 --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/controller/DataPollutionController.java @@ -0,0 +1,58 @@ +package com.njcn.dataProcess.controller; + +import com.njcn.common.pojo.annotation.OperateInfo; +import com.njcn.common.pojo.constant.OperateType; +import com.njcn.common.pojo.enums.common.LogEnum; +import com.njcn.common.pojo.enums.response.CommonResponseEnum; +import com.njcn.common.pojo.response.HttpResult; +import com.njcn.common.utils.HttpResultUtil; +import com.njcn.dataProcess.annotation.InsertBean; +import com.njcn.dataProcess.annotation.QueryBean; +import com.njcn.dataProcess.pojo.dto.DataPollutionD; +import com.njcn.dataProcess.service.IDataPollution; +import com.njcn.web.controller.BaseController; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Controller; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @author hongawen + * @version 1.0 + * @data 2024/11/6 19:48 + */ +@Validated +@Slf4j +@Controller +@RestController +@RequestMapping("/dataPollution") +@Api(tags = "污区图数据") +public class DataPollutionController extends BaseController { + + @QueryBean + private IDataPollution dataPollutionQuery; + + @InsertBean + private IDataPollution dataPollutionInsert; + + + @OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD) + @PostMapping("/batchInsertion") + @ApiOperation("批量插入") + public HttpResult batchInsertion(@RequestBody List dataIDTOList) { + String methodDescribe = getMethodDescribe("batchInsertion"); + dataPollutionInsert.batchInsertion(dataIDTOList); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); + } + + + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RMpPollutionDMapper.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RMpPollutionDMapper.java new file mode 100644 index 0000000..aecc614 --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RMpPollutionDMapper.java @@ -0,0 +1,15 @@ +package com.njcn.dataProcess.dao.relation.mapper; + +import com.njcn.dataProcess.pojo.po.RMpPollutionD; +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; + +/** + * @Description: 监测点污区图统计日表 Mapper 接口 + * @Author: wr + * @Date: 2025/3/19 14:30 + */ +public interface RMpPollutionDMapper extends MppBaseMapper { + + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatDataComAssMapper.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatDataComAssMapper.java new file mode 100644 index 0000000..9ee3cf6 --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatDataComAssMapper.java @@ -0,0 +1,16 @@ +package com.njcn.dataProcess.dao.relation.mapper; + +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.dataProcess.pojo.po.RStatComassesDPO; + + +/** + *

+ * Mapper 接口 + *

+ */ +public interface RStatDataComAssMapper extends MppBaseMapper { + + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionOrgDMapper.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionOrgDMapper.java new file mode 100644 index 0000000..7ad0893 --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionOrgDMapper.java @@ -0,0 +1,15 @@ +package com.njcn.dataProcess.dao.relation.mapper; + +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.dataProcess.pojo.po.RStatPollutionOrgD; + + +/** + * @Description: 单位污区图统计日表 Mapper 接口 + * @Author: wr + * @Date: 2025/3/19 14:30 + */ +public interface RStatPollutionOrgDMapper extends MppBaseMapper { + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionOrgMMapper.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionOrgMMapper.java new file mode 100644 index 0000000..d3b4d9e --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionOrgMMapper.java @@ -0,0 +1,13 @@ +package com.njcn.dataProcess.dao.relation.mapper; + +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.dataProcess.pojo.po.RStatPollutionOrgM; + +/** + * @Description: 单位污区图统计月表 Mapper 接口 + * @Author: wr + * @Date: 2025/3/19 14:30 + */ +public interface RStatPollutionOrgMMapper extends MppBaseMapper { + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionOrgQMapper.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionOrgQMapper.java new file mode 100644 index 0000000..dd6ad9b --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionOrgQMapper.java @@ -0,0 +1,14 @@ +package com.njcn.dataProcess.dao.relation.mapper; + +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.dataProcess.pojo.po.RStatPollutionOrgQ; + + +/** + * @Description: 单位污区图统计季表 Mapper 接口 + * @Author: wr + * @Date: 2025/3/19 14:31 + */ +public interface RStatPollutionOrgQMapper extends MppBaseMapper { + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionOrgYMapper.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionOrgYMapper.java new file mode 100644 index 0000000..82ea444 --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionOrgYMapper.java @@ -0,0 +1,13 @@ +package com.njcn.dataProcess.dao.relation.mapper; + +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.dataProcess.pojo.po.RStatPollutionOrgY; + +/** + * @Description: 单位污区图统计年表 Mapper 接口 + * @Author: wr + * @Date: 2025/3/19 14:31 + */ +public interface RStatPollutionOrgYMapper extends MppBaseMapper { + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionSubstationDMapper.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionSubstationDMapper.java new file mode 100644 index 0000000..f427a3c --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionSubstationDMapper.java @@ -0,0 +1,14 @@ +package com.njcn.dataProcess.dao.relation.mapper; + +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.dataProcess.pojo.po.RStatPollutionSubstationD; + +/** + * @Description: 变电站污区图统计日表 Mapper 接口 + * @Author: wr + * @Date: 2025/3/19 14:31 + */ +public interface RStatPollutionSubstationDMapper extends MppBaseMapper { + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionSubstationMMapper.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionSubstationMMapper.java new file mode 100644 index 0000000..4877256 --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionSubstationMMapper.java @@ -0,0 +1,14 @@ +package com.njcn.dataProcess.dao.relation.mapper; + +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.dataProcess.pojo.po.RStatPollutionSubstationM; + + +/** + * @Description: 变电站污区图统计月表 Mapper 接口 + * @Author: wr + * @Date: 2025/3/19 14:31 + */ +public interface RStatPollutionSubstationMMapper extends MppBaseMapper { + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionSubstationQMapper.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionSubstationQMapper.java new file mode 100644 index 0000000..e429f9a --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionSubstationQMapper.java @@ -0,0 +1,13 @@ +package com.njcn.dataProcess.dao.relation.mapper; + +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.dataProcess.pojo.po.RStatPollutionSubstationQ; + +/** + * @Description: 变电站污区图统计季表 Mapper 接口 + * @Author: wr + * @Date: 2025/3/19 14:31 + */ +public interface RStatPollutionSubstationQMapper extends MppBaseMapper { + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionSubstationYMapper.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionSubstationYMapper.java new file mode 100644 index 0000000..74b63c8 --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/dao/relation/mapper/RStatPollutionSubstationYMapper.java @@ -0,0 +1,13 @@ +package com.njcn.dataProcess.dao.relation.mapper; + +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.dataProcess.pojo.po.RStatPollutionSubstationY; + +/** + * @Description: 变电站污区图统计年表 Mapper 接口 + * @Author: wr + * @Date: 2025/3/19 14:31 + */ +public interface RStatPollutionSubstationYMapper extends MppBaseMapper { + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollution.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollution.java new file mode 100644 index 0000000..19b40ed --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollution.java @@ -0,0 +1,23 @@ +package com.njcn.dataProcess.service; + +import com.github.jeffreyning.mybatisplus.service.IMppService; +import com.njcn.dataProcess.pojo.dto.DataPollutionD; +import com.njcn.dataProcess.pojo.po.RMpPollutionD; + +import java.util.List; + + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/19 14:40 + */ +public interface IDataPollution extends IMppService { + + /** + * 批量插入数据 + * @param pollutionList + */ + void batchInsertion(List pollutionList); + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionOrgD.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionOrgD.java new file mode 100644 index 0000000..1298c0f --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionOrgD.java @@ -0,0 +1,14 @@ +package com.njcn.dataProcess.service; + +import com.github.jeffreyning.mybatisplus.service.IMppService; +import com.njcn.dataProcess.pojo.po.RStatPollutionOrgD; + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/19 14:40 + */ +public interface IDataPollutionOrgD extends IMppService { + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionOrgM.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionOrgM.java new file mode 100644 index 0000000..eb4e393 --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionOrgM.java @@ -0,0 +1,14 @@ +package com.njcn.dataProcess.service; + +import com.github.jeffreyning.mybatisplus.service.IMppService; +import com.njcn.dataProcess.pojo.po.RStatPollutionOrgM; + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/19 14:40 + */ +public interface IDataPollutionOrgM extends IMppService { + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionOrgQ.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionOrgQ.java new file mode 100644 index 0000000..c4f49d5 --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionOrgQ.java @@ -0,0 +1,14 @@ +package com.njcn.dataProcess.service; + +import com.github.jeffreyning.mybatisplus.service.IMppService; +import com.njcn.dataProcess.pojo.po.RStatPollutionOrgQ; + +/** + * @author hongawen + * @version 1.0 + * @data 2024/11/7 10:54 + */ +public interface IDataPollutionOrgQ extends IMppService { + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionOrgY.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionOrgY.java new file mode 100644 index 0000000..56c49f4 --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionOrgY.java @@ -0,0 +1,14 @@ +package com.njcn.dataProcess.service; + +import com.github.jeffreyning.mybatisplus.service.IMppService; +import com.njcn.dataProcess.pojo.po.RStatPollutionOrgY; + +/** + * @author hongawen + * @version 1.0 + * @data 2024/11/7 10:54 + */ +public interface IDataPollutionOrgY extends IMppService { + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionSubstationD.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionSubstationD.java new file mode 100644 index 0000000..c19567d --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionSubstationD.java @@ -0,0 +1,14 @@ +package com.njcn.dataProcess.service; + +import com.github.jeffreyning.mybatisplus.service.IMppService; +import com.njcn.dataProcess.pojo.po.RStatPollutionSubstationD; + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/19 14:41 + */ +public interface IDataPollutionSubstationD extends IMppService { + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionSubstationM.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionSubstationM.java new file mode 100644 index 0000000..e364617 --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionSubstationM.java @@ -0,0 +1,14 @@ +package com.njcn.dataProcess.service; + +import com.github.jeffreyning.mybatisplus.service.IMppService; +import com.njcn.dataProcess.pojo.po.RStatPollutionSubstationM; + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/19 14:41 + */ +public interface IDataPollutionSubstationM extends IMppService { + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionSubstationQ.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionSubstationQ.java new file mode 100644 index 0000000..16cb204 --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionSubstationQ.java @@ -0,0 +1,14 @@ +package com.njcn.dataProcess.service; + +import com.github.jeffreyning.mybatisplus.service.IMppService; +import com.njcn.dataProcess.pojo.po.RStatPollutionSubstationQ; + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/19 14:41 + */ +public interface IDataPollutionSubstationQ extends IMppService { + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionSubstationY.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionSubstationY.java new file mode 100644 index 0000000..16681fa --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IDataPollutionSubstationY.java @@ -0,0 +1,14 @@ +package com.njcn.dataProcess.service; + +import com.github.jeffreyning.mybatisplus.service.IMppService; +import com.njcn.dataProcess.pojo.po.RStatPollutionSubstationY; + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/19 14:41 + */ +public interface IDataPollutionSubstationY extends IMppService { + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IRmpEventDetail.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IRmpEventDetail.java index 04a2cc7..c43aa08 100644 --- a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IRmpEventDetail.java +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/IRmpEventDetail.java @@ -2,7 +2,6 @@ package com.njcn.dataProcess.service; import com.njcn.dataProcess.dto.RmpEventDetailDTO; import com.njcn.dataProcess.param.LineCountEvaluateParam; -import com.njcn.dataProcess.pojo.dto.PqsCommunicateDto; import java.util.List; diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataComAssImpl.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataComAssImpl.java new file mode 100644 index 0000000..7f446f7 --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataComAssImpl.java @@ -0,0 +1,26 @@ +package com.njcn.dataProcess.service.impl.influxdb; + +import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; +import com.njcn.dataProcess.dao.relation.mapper.RStatDataComAssMapper; +import com.njcn.dataProcess.pojo.dto.DataComassesDPO; +import com.njcn.dataProcess.pojo.po.RStatComassesDPO; +import com.njcn.dataProcess.service.IDataComAss; +import org.springframework.stereotype.Service; + +import java.util.List; + + +/** + * @author hongawen + * @version 1.0 + * @data 2024/11/7 11:02 + */ +@Service("InfluxdbDataComAssImpl") +public class InfluxdbDataComAssImpl extends MppServiceImpl implements IDataComAss { + + + @Override + public void batchInsertion(List limitQualifiedList) { + + } +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataFlickerImpl.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataFlickerImpl.java index 475d3ed..efaed7f 100644 --- a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataFlickerImpl.java +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataFlickerImpl.java @@ -48,7 +48,7 @@ public class InfluxdbDataFlickerImpl extends MppServiceImpl dataFlickerDTOList) { int totalCount = dataFlickerDTOList.size(); - if(totalCount<=0){ + if (totalCount <= 0) { return; } @@ -68,9 +68,9 @@ public class InfluxdbDataFlickerImpl extends MppServiceImpl getRawData(LineCountEvaluateParam lineParam) { List result = new ArrayList<>(); List list = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime()); - list.forEach(item->{ + list.forEach(item -> { DataFlickerDto dto = new DataFlickerDto(); - BeanUtils.copyProperties(item,dto); + BeanUtils.copyProperties(item, dto); dto.setMinTime(DATE_TIME_FORMATTER.format(item.getTime())); result.add(dto); }); @@ -80,20 +80,20 @@ public class InfluxdbDataFlickerImpl extends MppServiceImpl getBaseData(LineCountEvaluateParam lineParam) { List result = new ArrayList<>(); - List dataIList = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(),lineParam.getAbnormalTime()); + List dataIList = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime()); if (CollectionUtil.isNotEmpty(dataIList)) { String time = TimeUtils.StringTimeToString(lineParam.getStartTime()); //以监测点分组 - Map> lineMap = dataIList.stream().collect(Collectors.groupingBy(DataFlicker::getLineId)); - lineMap.forEach((line,lineList)->{ + Map> lineMap = dataIList.stream().collect(Collectors.groupingBy(DataFlicker::getLineId)); + lineMap.forEach((line, lineList) -> { CommonMinuteDto dto = new CommonMinuteDto(); dto.setLineId(line); dto.setTime(time); dto.setQualityFlag(lineList.get(0).getQualityFlag()); //以相别分组 - Map> phasicTypeMap = lineList.stream().collect(Collectors.groupingBy(DataFlicker::getPhasicType)); + Map> phasicTypeMap = lineList.stream().collect(Collectors.groupingBy(DataFlicker::getPhasicType)); List phasicTypes = new ArrayList<>(); - phasicTypeMap.forEach((phasicType,phasicTypeList)->{ + phasicTypeMap.forEach((phasicType, phasicTypeList) -> { CommonMinuteDto.PhasicType type = new CommonMinuteDto.PhasicType(); type.setPhasicType(phasicType); @@ -106,7 +106,7 @@ public class InfluxdbDataFlickerImpl extends MppServiceImpl data2 = phasicTypeList.stream().map(DataFlicker::getPlt).collect(Collectors.toList()); List data3 = phasicTypeList.stream().map(DataFlicker::getPst).collect(Collectors.toList()); - List> lists = Arrays.asList(data1,data2,data3); + List> lists = Arrays.asList(data1, data2, data3); value.setValueList(lists); valueTypes.add(value); @@ -139,10 +139,10 @@ public class InfluxdbDataFlickerImpl extends MppServiceImpl dataFlickers = dataFlickerMapper.selectByQueryWrapper(influxQueryWrapper); return dataFlickers.size(); @@ -156,7 +156,7 @@ public class InfluxdbDataFlickerImpl extends MppServiceImpl getMinuteData(List lineList, String startTime, String endTime, Map> timeMap) { + public List getMinuteData(List lineList, String startTime, String endTime, Map> timeMap) { List result = new ArrayList<>(); InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataFlicker.class); influxQueryWrapper.regular(DataFlicker::getLineId, lineList) @@ -167,12 +167,12 @@ public class InfluxdbDataFlickerImpl extends MppServiceImpl list = dataFlickerMapper.selectByQueryWrapper(influxQueryWrapper); - Map> lineMap = list.stream().collect(Collectors.groupingBy(DataFlicker::getLineId)); + Map> lineMap = list.stream().collect(Collectors.groupingBy(DataFlicker::getLineId)); //有异常数据 if (CollectionUtil.isNotEmpty(timeMap)) { - lineMap.forEach((k,v)->{ + lineMap.forEach((k, v) -> { List timeList = timeMap.get(k); //有异常数据,当前监测点自身的异常数据 if (CollectionUtil.isNotEmpty(timeList)) { diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionImpl.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionImpl.java new file mode 100644 index 0000000..dccab98 --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionImpl.java @@ -0,0 +1,28 @@ +package com.njcn.dataProcess.service.impl.influxdb; + +import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; +import com.njcn.dataProcess.dao.relation.mapper.RMpPollutionDMapper; +import com.njcn.dataProcess.pojo.dto.DataPollutionD; +import com.njcn.dataProcess.pojo.po.RMpPollutionD; +import com.njcn.dataProcess.service.IDataPollution; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.List; + + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/19 14:44 + */ +@Service("InfluxdbDataPollutionImpl") +@RequiredArgsConstructor +public class InfluxdbDataPollutionImpl extends MppServiceImpl implements IDataPollution { + + + @Override + public void batchInsertion(List pollutionList) { + + } +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionOrgDImpl.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionOrgDImpl.java new file mode 100644 index 0000000..7f1e9f8 --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionOrgDImpl.java @@ -0,0 +1,23 @@ +package com.njcn.dataProcess.service.impl.influxdb; + +import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; +import com.njcn.dataProcess.dao.relation.mapper.RStatPollutionOrgDMapper; +import com.njcn.dataProcess.pojo.po.RStatPollutionOrgD; +import com.njcn.dataProcess.service.IDataPollutionOrgD; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + + + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/19 14:44 + */ +@Service("InfluxdbDataPollutionOrgDImpl") +@RequiredArgsConstructor +public class InfluxdbDataPollutionOrgDImpl extends MppServiceImpl implements IDataPollutionOrgD { + + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionOrgMImpl.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionOrgMImpl.java new file mode 100644 index 0000000..235caae --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionOrgMImpl.java @@ -0,0 +1,23 @@ +package com.njcn.dataProcess.service.impl.influxdb; + +import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; +import com.njcn.dataProcess.dao.relation.mapper.RStatPollutionOrgMMapper; +import com.njcn.dataProcess.pojo.po.RStatPollutionOrgM; +import com.njcn.dataProcess.service.IDataPollutionOrgM; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + + + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/19 14:44 + */ +@Service("InfluxdbDataPollutionOrgMImpl") +@RequiredArgsConstructor +public class InfluxdbDataPollutionOrgMImpl extends MppServiceImpl implements IDataPollutionOrgM { + + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionOrgQImpl.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionOrgQImpl.java new file mode 100644 index 0000000..7332b6a --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionOrgQImpl.java @@ -0,0 +1,23 @@ +package com.njcn.dataProcess.service.impl.influxdb; + +import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; +import com.njcn.dataProcess.dao.relation.mapper.RStatPollutionOrgQMapper; +import com.njcn.dataProcess.pojo.po.RStatPollutionOrgQ; +import com.njcn.dataProcess.service.IDataPollutionOrgQ; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + + + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/19 14:44 + */ +@Service("InfluxdbDataPollutionOrgQImpl") +@RequiredArgsConstructor +public class InfluxdbDataPollutionOrgQImpl extends MppServiceImpl implements IDataPollutionOrgQ { + + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionOrgYImpl.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionOrgYImpl.java new file mode 100644 index 0000000..7f0f7bd --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionOrgYImpl.java @@ -0,0 +1,23 @@ +package com.njcn.dataProcess.service.impl.influxdb; + +import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; +import com.njcn.dataProcess.dao.relation.mapper.RStatPollutionOrgYMapper; +import com.njcn.dataProcess.pojo.po.RStatPollutionOrgY; +import com.njcn.dataProcess.service.IDataPollutionOrgY; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + + + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/19 14:44 + */ +@Service("InfluxdbDataPollutionOrgYImpl") +@RequiredArgsConstructor +public class InfluxdbDataPollutionOrgYImpl extends MppServiceImpl implements IDataPollutionOrgY { + + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionSubstationDImpl.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionSubstationDImpl.java new file mode 100644 index 0000000..7bfd72d --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionSubstationDImpl.java @@ -0,0 +1,22 @@ +package com.njcn.dataProcess.service.impl.influxdb; + +import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; +import com.njcn.dataProcess.dao.relation.mapper.RStatPollutionSubstationDMapper; +import com.njcn.dataProcess.pojo.po.RStatPollutionSubstationD; +import com.njcn.dataProcess.service.IDataPollutionSubstationD; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/19 14:44 + */ +@Service("InfluxdbDataPollutionSubstationDImpl") +@RequiredArgsConstructor +public class InfluxdbDataPollutionSubstationDImpl extends MppServiceImpl implements IDataPollutionSubstationD { + + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionSubstationMImpl.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionSubstationMImpl.java new file mode 100644 index 0000000..312cc55 --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionSubstationMImpl.java @@ -0,0 +1,22 @@ +package com.njcn.dataProcess.service.impl.influxdb; + +import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; +import com.njcn.dataProcess.dao.relation.mapper.RStatPollutionSubstationMMapper; +import com.njcn.dataProcess.pojo.po.RStatPollutionSubstationM; +import com.njcn.dataProcess.service.IDataPollutionSubstationM; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/19 14:44 + */ +@Service("InfluxdbDataPollutionSubstationMImpl") +@RequiredArgsConstructor +public class InfluxdbDataPollutionSubstationMImpl extends MppServiceImpl implements IDataPollutionSubstationM { + + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionSubstationQImpl.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionSubstationQImpl.java new file mode 100644 index 0000000..b54c784 --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionSubstationQImpl.java @@ -0,0 +1,22 @@ +package com.njcn.dataProcess.service.impl.influxdb; + +import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; +import com.njcn.dataProcess.dao.relation.mapper.RStatPollutionSubstationQMapper; +import com.njcn.dataProcess.pojo.po.RStatPollutionSubstationQ; +import com.njcn.dataProcess.service.IDataPollutionSubstationQ; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/19 14:44 + */ +@Service("InfluxdbDataPollutionSubstationQImpl") +@RequiredArgsConstructor +public class InfluxdbDataPollutionSubstationQImpl extends MppServiceImpl implements IDataPollutionSubstationQ { + + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionSubstationYImpl.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionSubstationYImpl.java new file mode 100644 index 0000000..5ed1251 --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataPollutionSubstationYImpl.java @@ -0,0 +1,22 @@ +package com.njcn.dataProcess.service.impl.influxdb; + +import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; +import com.njcn.dataProcess.dao.relation.mapper.RStatPollutionSubstationYMapper; +import com.njcn.dataProcess.pojo.po.RStatPollutionSubstationY; +import com.njcn.dataProcess.service.IDataPollutionSubstationY; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/19 14:44 + */ +@Service("InfluxdbDataPollutionSubstationYImpl") +@RequiredArgsConstructor +public class InfluxdbDataPollutionSubstationYImpl extends MppServiceImpl implements IDataPollutionSubstationY { + + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataVImpl.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataVImpl.java index ccb01a5..65dd399 100644 --- a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataVImpl.java +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataVImpl.java @@ -186,10 +186,10 @@ public class InfluxdbDataVImpl extends MppServiceImpl dataVS = dataVMapper.selectByQueryWrapper(influxQueryWrapper); return dataVS.size(); diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataComAssImpl.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataComAssImpl.java new file mode 100644 index 0000000..2600d35 --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataComAssImpl.java @@ -0,0 +1,36 @@ +package com.njcn.dataProcess.service.impl.relation; + +import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; +import com.njcn.dataProcess.dao.relation.mapper.RStatDataComAssMapper; +import com.njcn.dataProcess.pojo.dto.DataComassesDPO; +import com.njcn.dataProcess.pojo.po.RStatComassesDPO; +import com.njcn.dataProcess.pojo.po.RStatLimitRateDetailD; +import com.njcn.dataProcess.service.IDataComAss; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/19 10:15 + */ +@Service("RelationDataComAssImpl") +@RequiredArgsConstructor +public class RelationDataComAssImpl extends MppServiceImpl implements IDataComAss { + + + @Override + public void batchInsertion(List limitQualifiedList) { + List result = new ArrayList<>(); + limitQualifiedList.forEach(item->{ + RStatComassesDPO limitRate = new RStatComassesDPO(); + BeanUtils.copyProperties(item, limitRate); + result.add(limitRate); + }); + this.saveOrUpdateBatchByMultiId(result); + } +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionImpl.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionImpl.java new file mode 100644 index 0000000..ab9977a --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionImpl.java @@ -0,0 +1,37 @@ +package com.njcn.dataProcess.service.impl.relation; + +import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; +import com.njcn.dataProcess.dao.relation.mapper.RMpPollutionDMapper; +import com.njcn.dataProcess.pojo.dto.DataPollutionD; +import com.njcn.dataProcess.pojo.po.RMpPollutionD; +import com.njcn.dataProcess.pojo.po.RStatLimitRateD; +import com.njcn.dataProcess.service.IDataPollution; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/19 14:44 + */ +@Service("RelationDataPollutionImpl") +@RequiredArgsConstructor +public class RelationDataPollutionImpl extends MppServiceImpl implements IDataPollution { + + + @Override + public void batchInsertion(List pollutionList) { + List result = new ArrayList<>(); + pollutionList.forEach(item->{ + RMpPollutionD limitRate = new RMpPollutionD(); + BeanUtils.copyProperties(item, limitRate); + result.add(limitRate); + }); + this.saveOrUpdateBatchByMultiId(result); + } +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionOrgDImpl.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionOrgDImpl.java new file mode 100644 index 0000000..dff89e2 --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionOrgDImpl.java @@ -0,0 +1,23 @@ +package com.njcn.dataProcess.service.impl.relation; + +import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; +import com.njcn.dataProcess.dao.relation.mapper.RStatPollutionOrgDMapper; +import com.njcn.dataProcess.pojo.po.RStatPollutionOrgD; +import com.njcn.dataProcess.service.IDataPollutionOrgD; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + + + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/19 14:44 + */ +@Service("RelationDataPollutionOrgDImpl") +@RequiredArgsConstructor +public class RelationDataPollutionOrgDImpl extends MppServiceImpl implements IDataPollutionOrgD { + + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionOrgMImpl.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionOrgMImpl.java new file mode 100644 index 0000000..421256a --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionOrgMImpl.java @@ -0,0 +1,23 @@ +package com.njcn.dataProcess.service.impl.relation; + +import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; +import com.njcn.dataProcess.dao.relation.mapper.RStatPollutionOrgMMapper; +import com.njcn.dataProcess.pojo.po.RStatPollutionOrgM; +import com.njcn.dataProcess.service.IDataPollutionOrgM; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + + + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/19 14:44 + */ +@Service("RelationDataPollutionOrgMImpl") +@RequiredArgsConstructor +public class RelationDataPollutionOrgMImpl extends MppServiceImpl implements IDataPollutionOrgM { + + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionOrgQImpl.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionOrgQImpl.java new file mode 100644 index 0000000..2a03cab --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionOrgQImpl.java @@ -0,0 +1,23 @@ +package com.njcn.dataProcess.service.impl.relation; + +import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; +import com.njcn.dataProcess.dao.relation.mapper.RStatPollutionOrgQMapper; +import com.njcn.dataProcess.pojo.po.RStatPollutionOrgQ; +import com.njcn.dataProcess.service.IDataPollutionOrgQ; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + + + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/19 14:44 + */ +@Service("RelationDataPollutionOrgQImpl") +@RequiredArgsConstructor +public class RelationDataPollutionOrgQImpl extends MppServiceImpl implements IDataPollutionOrgQ { + + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionOrgYImpl.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionOrgYImpl.java new file mode 100644 index 0000000..729f361 --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionOrgYImpl.java @@ -0,0 +1,23 @@ +package com.njcn.dataProcess.service.impl.relation; + +import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; +import com.njcn.dataProcess.dao.relation.mapper.RStatPollutionOrgYMapper; +import com.njcn.dataProcess.pojo.po.RStatPollutionOrgY; +import com.njcn.dataProcess.service.IDataPollutionOrgY; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + + + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/19 14:44 + */ +@Service("RelationDataPollutionOrgYImpl") +@RequiredArgsConstructor +public class RelationDataPollutionOrgYImpl extends MppServiceImpl implements IDataPollutionOrgY { + + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionSubstationDImpl.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionSubstationDImpl.java new file mode 100644 index 0000000..19b8686 --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionSubstationDImpl.java @@ -0,0 +1,22 @@ +package com.njcn.dataProcess.service.impl.relation; + +import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; +import com.njcn.dataProcess.dao.relation.mapper.RStatPollutionSubstationDMapper; +import com.njcn.dataProcess.pojo.po.RStatPollutionSubstationD; +import com.njcn.dataProcess.service.IDataPollutionSubstationD; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/19 14:44 + */ +@Service("RelationDataPollutionSubstationDImpl") +@RequiredArgsConstructor +public class RelationDataPollutionSubstationDImpl extends MppServiceImpl implements IDataPollutionSubstationD { + + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionSubstationMImpl.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionSubstationMImpl.java new file mode 100644 index 0000000..cd45669 --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionSubstationMImpl.java @@ -0,0 +1,22 @@ +package com.njcn.dataProcess.service.impl.relation; + +import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; +import com.njcn.dataProcess.dao.relation.mapper.RStatPollutionSubstationMMapper; +import com.njcn.dataProcess.pojo.po.RStatPollutionSubstationM; +import com.njcn.dataProcess.service.IDataPollutionSubstationM; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/19 14:44 + */ +@Service("RelationDataPollutionSubstationMImpl") +@RequiredArgsConstructor +public class RelationDataPollutionSubstationMImpl extends MppServiceImpl implements IDataPollutionSubstationM { + + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionSubstationQImpl.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionSubstationQImpl.java new file mode 100644 index 0000000..b4ea0b8 --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionSubstationQImpl.java @@ -0,0 +1,22 @@ +package com.njcn.dataProcess.service.impl.relation; + +import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; +import com.njcn.dataProcess.dao.relation.mapper.RStatPollutionSubstationQMapper; +import com.njcn.dataProcess.pojo.po.RStatPollutionSubstationQ; +import com.njcn.dataProcess.service.IDataPollutionSubstationQ; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/19 14:44 + */ +@Service("RelationDataPollutionSubstationQImpl") +@RequiredArgsConstructor +public class RelationDataPollutionSubstationQImpl extends MppServiceImpl implements IDataPollutionSubstationQ { + + + +} diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionSubstationYImpl.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionSubstationYImpl.java new file mode 100644 index 0000000..15a59ac --- /dev/null +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/relation/RelationDataPollutionSubstationYImpl.java @@ -0,0 +1,22 @@ +package com.njcn.dataProcess.service.impl.relation; + +import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; +import com.njcn.dataProcess.dao.relation.mapper.RStatPollutionSubstationYMapper; +import com.njcn.dataProcess.pojo.po.RStatPollutionSubstationY; +import com.njcn.dataProcess.service.IDataPollutionSubstationY; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + + +/** + * @Description: + * @Author: wr + * @Date: 2025/3/19 14:44 + */ +@Service("RelationDataPollutionSubstationYImpl") +@RequiredArgsConstructor +public class RelationDataPollutionSubstationYImpl extends MppServiceImpl implements IDataPollutionSubstationY { + + + +}