diff --git a/pqs-harmonic/harmonic-boot/pom.xml b/pqs-harmonic/harmonic-boot/pom.xml index ecf3c401b..1967f83b2 100644 --- a/pqs-harmonic/harmonic-boot/pom.xml +++ b/pqs-harmonic/harmonic-boot/pom.xml @@ -64,19 +64,7 @@ ${project.version} - - - com.baomidou - dynamic-datasource-spring-boot-starter - 3.5.1 - - - - com.baomidou - dynamic-datasource-spring-boot-starter - ${dynamic-datasource.version} - com.oracle.database.jdbc ojdbc8 @@ -122,7 +110,6 @@ com.njcn.platform data-processing-api 1.0.0 - compile diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/influxdb/DataHarmRateIMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/influxdb/DataHarmRateIMapper.java index 5fb616382..da0f25ac8 100644 --- a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/influxdb/DataHarmRateIMapper.java +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/influxdb/DataHarmRateIMapper.java @@ -1,11 +1,11 @@ -package com.njcn.harmonic.mapper.influxdb; - -import com.njcn.dataProcess.po.influx.DataHarmrateI; -import com.njcn.influx.base.InfluxDbBaseMapper; - -/** - * @author xy - */ -public interface DataHarmRateIMapper extends InfluxDbBaseMapper { - -} +//package com.njcn.harmonic.mapper.influxdb; +// +//import com.njcn.dataProcess.po.influx.DataHarmrateI; +//import com.njcn.influx.base.InfluxDbBaseMapper; +// +///** +// * @author xy +// */ +//public interface DataHarmRateIMapper extends InfluxDbBaseMapper { +// +//} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/influxdb/DataHarmRateVMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/influxdb/DataHarmRateVMapper.java index 4ad0a724d..8f9143137 100644 --- a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/influxdb/DataHarmRateVMapper.java +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/influxdb/DataHarmRateVMapper.java @@ -1,11 +1,11 @@ -package com.njcn.harmonic.mapper.influxdb; - -import com.njcn.dataProcess.po.influx.DataHarmrateV; -import com.njcn.influx.base.InfluxDbBaseMapper; - -/** - * @author xy - */ -public interface DataHarmRateVMapper extends InfluxDbBaseMapper { - -} +//package com.njcn.harmonic.mapper.influxdb; +// +//import com.njcn.dataProcess.po.influx.DataHarmrateV; +//import com.njcn.influx.base.InfluxDbBaseMapper; +// +///** +// * @author xy +// */ +//public interface DataHarmRateVMapper extends InfluxDbBaseMapper { +// +//} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/influxdb/DataIMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/influxdb/DataIMapper.java index 59d49e5ce..8dd259af1 100644 --- a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/influxdb/DataIMapper.java +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/influxdb/DataIMapper.java @@ -1,16 +1,16 @@ -package com.njcn.harmonic.mapper.influxdb; - -import com.njcn.dataProcess.po.influx.DataI; -import com.njcn.influx.base.InfluxDbBaseMapper; - - -/** - * @author hongawen - * @version 1.0 - * @data 2024/11/7 18:49 - */ -public interface DataIMapper extends InfluxDbBaseMapper { - - - -} +//package com.njcn.harmonic.mapper.influxdb; +// +//import com.njcn.dataProcess.po.influx.DataI; +//import com.njcn.influx.base.InfluxDbBaseMapper; +// +// +///** +// * @author hongawen +// * @version 1.0 +// * @data 2024/11/7 18:49 +// */ +//public interface DataIMapper extends InfluxDbBaseMapper { +// +// +// +//} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/influxdb/DataInharmVMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/influxdb/DataInharmVMapper.java index dcc108da2..3d589d9d2 100644 --- a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/influxdb/DataInharmVMapper.java +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/influxdb/DataInharmVMapper.java @@ -1,17 +1,17 @@ -package com.njcn.harmonic.mapper.influxdb; - - -import com.njcn.dataProcess.po.influx.DataInharmV; -import com.njcn.influx.base.InfluxDbBaseMapper; - -/** - *

- * Mapper 接口 - *

- * - * @author hongawen - * @since 2023-12-28 - */ -public interface DataInharmVMapper extends InfluxDbBaseMapper { - -} +//package com.njcn.harmonic.mapper.influxdb; +// +// +//import com.njcn.dataProcess.po.influx.DataInharmV; +//import com.njcn.influx.base.InfluxDbBaseMapper; +// +///** +// *

+// * Mapper 接口 +// *

+// * +// * @author hongawen +// * @since 2023-12-28 +// */ +//public interface DataInharmVMapper extends InfluxDbBaseMapper { +// +//} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/influxdb/DataPltMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/influxdb/DataPltMapper.java index 5aefda9e2..f15b4fa01 100644 --- a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/influxdb/DataPltMapper.java +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/influxdb/DataPltMapper.java @@ -1,17 +1,17 @@ -package com.njcn.harmonic.mapper.influxdb; - - -import com.njcn.dataProcess.po.influx.DataPlt; -import com.njcn.influx.base.InfluxDbBaseMapper; - -/** - *

- * Mapper 接口 - *

- * - * @author hongawen - * @since 2023-12-28 - */ -public interface DataPltMapper extends InfluxDbBaseMapper { - -} +//package com.njcn.harmonic.mapper.influxdb; +// +// +//import com.njcn.dataProcess.po.influx.DataPlt; +//import com.njcn.influx.base.InfluxDbBaseMapper; +// +///** +// *

+// * Mapper 接口 +// *

+// * +// * @author hongawen +// * @since 2023-12-28 +// */ +//public interface DataPltMapper extends InfluxDbBaseMapper { +// +//} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/influxdb/DataVMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/influxdb/DataVMapper.java index ad77f6c29..cbe032d13 100644 --- a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/influxdb/DataVMapper.java +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/influxdb/DataVMapper.java @@ -1,27 +1,27 @@ -package com.njcn.harmonic.mapper.influxdb; - -import com.njcn.dataProcess.dto.LineDataVFiveItemDTO; -import com.njcn.dataProcess.dto.MeasurementCountDTO; -import com.njcn.dataProcess.po.influx.DataV; -import com.njcn.influx.base.InfluxDbBaseMapper; -import com.njcn.influx.query.InfluxQueryWrapper; - -import java.util.List; - -/** - * @author hongawen - * @version 1.0 - * @data 2024/11/7 18:49 - */ -public interface DataVMapper extends InfluxDbBaseMapper { - - - List queryDataValue(InfluxQueryWrapper dataVQueryWrapper); - - - List getMeasurementCount(InfluxQueryWrapper influxQueryWrapper); - - - - -} +//package com.njcn.harmonic.mapper.influxdb; +// +//import com.njcn.dataProcess.dto.LineDataVFiveItemDTO; +//import com.njcn.dataProcess.dto.MeasurementCountDTO; +//import com.njcn.dataProcess.po.influx.DataV; +//import com.njcn.influx.base.InfluxDbBaseMapper; +//import com.njcn.influx.query.InfluxQueryWrapper; +// +//import java.util.List; +// +///** +// * @author hongawen +// * @version 1.0 +// * @data 2024/11/7 18:49 +// */ +//public interface DataVMapper extends InfluxDbBaseMapper { +// +// +// List queryDataValue(InfluxQueryWrapper dataVQueryWrapper); +// +// +// List getMeasurementCount(InfluxQueryWrapper influxQueryWrapper); +// +// +// +// +//} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/influxdb/impl/InfluxdbDataHarmRateVImpl.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/influxdb/impl/InfluxdbDataHarmRateVImpl.java index 21b1ee82c..29486da1b 100644 --- a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/influxdb/impl/InfluxdbDataHarmRateVImpl.java +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/influxdb/impl/InfluxdbDataHarmRateVImpl.java @@ -1,17 +1,18 @@ package com.njcn.harmonic.service.influxdb.impl; -import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollectionUtil; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import com.njcn.common.utils.HarmonicTimesUtil; + + import com.njcn.dataProcess.param.LineCountEvaluateParam; -import com.njcn.dataProcess.po.influx.DataHarmrateV; import com.njcn.dataProcess.pojo.dto.DataHarmDto; -import com.njcn.harmonic.mapper.influxdb.DataHarmRateVMapper; import com.njcn.harmonic.service.influxdb.IDataHarmRateV; import com.njcn.influx.constant.InfluxDbSqlConstant; +import com.njcn.influx.imapper.DataHarmRateVMapper; +import com.njcn.influx.pojo.po.DataHarmRateV; import com.njcn.influx.query.InfluxQueryWrapper; import com.njcn.redis.utils.RedisUtil; import lombok.RequiredArgsConstructor; @@ -31,7 +32,7 @@ import java.util.stream.Collectors; @RequiredArgsConstructor public class InfluxdbDataHarmRateVImpl implements IDataHarmRateV { private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault()); - private final DataHarmRateVMapper dataHarmRateVMapper; + private final DataHarmRateVMapper DataHarmRateVMapper; private static final Map PHASE_MAPPING = new HashMap() {{ put("AB", "A"); put("BC", "B"); @@ -48,7 +49,7 @@ public class InfluxdbDataHarmRateVImpl implements IDataHarmRateV { @Override public List getRawData(LineCountEvaluateParam lineParam) { List result = new ArrayList<>(); - List list = getMinuteData(lineParam); + List list = getMinuteData(lineParam); list.forEach(item->{ DataHarmDto dto = new DataHarmDto(); BeanUtils.copyProperties(item,dto); @@ -68,30 +69,30 @@ public class InfluxdbDataHarmRateVImpl implements IDataHarmRateV { * 2.异常数据和无异常数据参杂,剔除异常数据,只计算正常数据; * 3.全是异常数据,则使用异常数据进行计算,但是日表中需要标记出来,此数据有异常 */ - public List getMinuteData(LineCountEvaluateParam lineParam) { - List dataList; - List result = new ArrayList<>(); - List data = new ArrayList<>(); + public List getMinuteData(LineCountEvaluateParam lineParam) { + List dataList; + List result = new ArrayList<>(); + List data = new ArrayList<>(); //获取监测点、接线方式数据 Type type = new TypeToken>(){}.getType(); Map map = new Gson().fromJson( String.valueOf(redisUtil.getObjectByKey("wlLineDetail")), type ); - InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmrateV.class); + InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmRateV.class); influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, InfluxDbSqlConstant.V, HarmonicTimesUtil.harmonicTimesList(1, 50, 1)); - influxQueryWrapper.regular(DataHarmrateV::getLineId, lineParam.getLineId()) - .select(DataHarmrateV::getLineId) - .select(DataHarmrateV::getPhasicType) - .select(DataHarmrateV::getValueType) - .select(DataHarmrateV::getQualityFlag) - .select(DataHarmrateV::getAbnormalFlag) - .between(DataHarmrateV::getTime, lineParam.getStartTime(), lineParam.getEndTime()) - .eq(DataHarmrateV::getQualityFlag,"0"); + influxQueryWrapper.regular(DataHarmRateV::getLineId, lineParam.getLineId()) + .select(DataHarmRateV::getLineId) + .select(DataHarmRateV::getPhaseType) + .select(DataHarmRateV::getValueType) + .select(DataHarmRateV::getQualityFlag) + .select(DataHarmRateV::getAbnormalFlag) + .between(DataHarmRateV::getTime, lineParam.getStartTime(), lineParam.getEndTime()) + .eq(DataHarmRateV::getQualityFlag,"0"); if(CollUtil.isNotEmpty(lineParam.getPhasicType())){ - influxQueryWrapper.regular(DataHarmrateV::getPhasicType,lineParam.getPhasicType()); + influxQueryWrapper.regular(DataHarmRateV::getPhaseType,lineParam.getPhasicType()); } - List list = dataHarmRateVMapper.selectByQueryWrapper(influxQueryWrapper); + List list = DataHarmRateVMapper.selectByQueryWrapper(influxQueryWrapper); if(CollUtil.isNotEmpty(list)){ //过滤掉暂态事件影响的数据 true过滤 false不过滤 if (lineParam.getDataType()) { @@ -99,14 +100,14 @@ public class InfluxdbDataHarmRateVImpl implements IDataHarmRateV { } else { dataList = list; } - Map> lineMap = dataList.stream().collect(Collectors.groupingBy(DataHarmrateV::getLineId)); + Map> lineMap = dataList.stream().collect(Collectors.groupingBy(DataHarmRateV::getLineId)); //有异常数据 if (CollectionUtil.isNotEmpty(lineParam.getAbnormalTime())) { lineMap.forEach((k,v)->{ List timeList = lineParam.getAbnormalTime().get(k); //有异常数据,当前监测点自身的异常数据 if (CollectionUtil.isNotEmpty(timeList)) { - List filterList = v.stream().filter(item -> !timeList.contains(DATE_TIME_FORMATTER.format(item.getTime()))).collect(Collectors.toList()); + List filterList = v.stream().filter(item -> !timeList.contains(DATE_TIME_FORMATTER.format(item.getTime()))).collect(Collectors.toList()); //1.过滤掉异常数据后还有正常数据,则用正常数据计算 if (CollectionUtil.isNotEmpty(filterList)) { result.addAll(filterList); @@ -131,14 +132,14 @@ public class InfluxdbDataHarmRateVImpl implements IDataHarmRateV { if (CollectionUtil.isNotEmpty(result)) { if (!Objects.isNull(map)) { //现根据监测点分组,然后根据接线方式排除多于数据,在修改相别 - Map> lineMap = result.stream().collect(Collectors.groupingBy(DataHarmrateV::getLineId)); + Map> lineMap = result.stream().collect(Collectors.groupingBy(DataHarmRateV::getLineId)); lineMap.forEach((k,v)->{ if (Objects.isNull(map.get(k))) { return; } Integer conType = map.get(k); Set validPhasicTypes = (conType != 0) ? LINE_VOLTAGE_TYPES : PHASE_VOLTAGE_TYPES; - List result2 = v.stream().filter(item -> validPhasicTypes.contains(item.getPhasicType())).collect(Collectors.toList()); + List result2 = v.stream().filter(item -> validPhasicTypes.contains(item.getPhaseType())).collect(Collectors.toList()); data.addAll(result2); }); } else { @@ -146,9 +147,9 @@ public class InfluxdbDataHarmRateVImpl implements IDataHarmRateV { } if (CollectionUtil.isNotEmpty(data)) { data.forEach(item -> { - String newType = PHASE_MAPPING.get(item.getPhasicType()); + String newType = PHASE_MAPPING.get(item.getPhaseType()); if (newType != null) { - item.setPhasicType(newType); + item.setPhaseType(newType); } }); } diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/influxdb/impl/InfluxdbDataIImpl.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/influxdb/impl/InfluxdbDataIImpl.java index 8ccbd9f23..06c1a6b25 100644 --- a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/influxdb/impl/InfluxdbDataIImpl.java +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/influxdb/impl/InfluxdbDataIImpl.java @@ -4,11 +4,11 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollectionUtil; import com.njcn.common.utils.HarmonicTimesUtil; import com.njcn.dataProcess.param.LineCountEvaluateParam; -import com.njcn.dataProcess.po.influx.DataI; import com.njcn.dataProcess.pojo.dto.DataIDto; -import com.njcn.harmonic.mapper.influxdb.DataIMapper; import com.njcn.harmonic.service.influxdb.IDataI; import com.njcn.influx.constant.InfluxDbSqlConstant; +import com.njcn.influx.imapper.DataIMapper; +import com.njcn.influx.pojo.po.DataI; import com.njcn.influx.query.InfluxQueryWrapper; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -69,7 +69,7 @@ public class InfluxdbDataIImpl implements IDataI { influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.I, InfluxDbSqlConstant.I, HarmonicTimesUtil.harmonicTimesList(1, 50, 1)); influxQueryWrapper.regular(DataI::getLineId, lineParam.getLineId()) .select(DataI::getLineId) - .select(DataI::getPhasicType) + .select(DataI::getPhaseType) .select(DataI::getValueType) .select(DataI::getINeg) .select(DataI::getIPos) @@ -82,7 +82,7 @@ public class InfluxdbDataIImpl implements IDataI { .between(DataI::getTime, lineParam.getStartTime(), lineParam.getEndTime()) .eq(DataI::getQualityFlag,"0"); if(CollUtil.isNotEmpty(lineParam.getPhasicType())){ - influxQueryWrapper.regular(DataI::getPhasicType,lineParam.getPhasicType()); + influxQueryWrapper.regular(DataI::getPhaseType,lineParam.getPhasicType()); } List list = dataIMapper.selectByQueryWrapper(influxQueryWrapper); @@ -124,9 +124,9 @@ public class InfluxdbDataIImpl implements IDataI { } if (CollectionUtil.isNotEmpty(result)) { result.forEach(item -> { - String newType = PHASE_MAPPING.get(item.getPhasicType()); + String newType = PHASE_MAPPING.get(item.getPhaseType()); if (newType != null) { - item.setPhasicType(newType); + item.setPhaseType(newType); } }); } diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/influxdb/impl/InfluxdbDataInharmVImpl.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/influxdb/impl/InfluxdbDataInharmVImpl.java index a86568896..034b617a6 100644 --- a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/influxdb/impl/InfluxdbDataInharmVImpl.java +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/influxdb/impl/InfluxdbDataInharmVImpl.java @@ -4,11 +4,11 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollectionUtil; import com.njcn.common.utils.HarmonicTimesUtil; import com.njcn.dataProcess.param.LineCountEvaluateParam; -import com.njcn.dataProcess.po.influx.DataInharmV; import com.njcn.dataProcess.pojo.dto.DataHarmDto; -import com.njcn.harmonic.mapper.influxdb.DataInharmVMapper; import com.njcn.harmonic.service.influxdb.IDataInHarmV; import com.njcn.influx.constant.InfluxDbSqlConstant; +import com.njcn.influx.imapper.DataInHarmVMapper; +import com.njcn.influx.pojo.po.DataInHarmV; import com.njcn.influx.query.InfluxQueryWrapper; import lombok.RequiredArgsConstructor; import org.springframework.beans.BeanUtils; @@ -32,7 +32,7 @@ import java.util.stream.Collectors; public class InfluxdbDataInharmVImpl implements IDataInHarmV { private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault()); - private final DataInharmVMapper dataInharmVMapper; + private final DataInHarmVMapper DataInHarmVMapper; private static final Map PHASE_MAPPING = new HashMap() {{ put("AB", "A"); @@ -46,7 +46,7 @@ public class InfluxdbDataInharmVImpl implements IDataInHarmV { @Override public List getRawData(LineCountEvaluateParam lineParam) { List result = new ArrayList<>(); - List list = getMinuteData(lineParam); + List list = getMinuteData(lineParam); list.forEach(item->{ DataHarmDto dto = new DataHarmDto(); BeanUtils.copyProperties(item,dto); @@ -66,23 +66,23 @@ public class InfluxdbDataInharmVImpl implements IDataInHarmV { * 2.异常数据和无异常数据参杂,剔除异常数据,只计算正常数据; * 3.全是异常数据,则使用异常数据进行计算,但是日表中需要标记出来,此数据有异常 */ - public List getMinuteData(LineCountEvaluateParam lineParam) { - List dataList; - List result = new ArrayList<>(); - InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataInharmV.class); + public List getMinuteData(LineCountEvaluateParam lineParam) { + List dataList; + List result = new ArrayList<>(); + InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataInHarmV.class); influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, InfluxDbSqlConstant.V, HarmonicTimesUtil.harmonicTimesList(1, 50, 1)); - influxQueryWrapper.regular(DataInharmV::getLineId, lineParam.getLineId()) - .select(DataInharmV::getLineId) - .select(DataInharmV::getPhasicType) - .select(DataInharmV::getValueType) - .select(DataInharmV::getQualityFlag) - .select(DataInharmV::getAbnormalFlag) - .between(DataInharmV::getTime, lineParam.getStartTime(), lineParam.getEndTime()) - .eq(DataInharmV::getQualityFlag,"0"); + influxQueryWrapper.regular(DataInHarmV::getLineId, lineParam.getLineId()) + .select(DataInHarmV::getLineId) + .select(DataInHarmV::getPhaseType) + .select(DataInHarmV::getValueType) + .select(DataInHarmV::getQualityFlag) + .select(DataInHarmV::getAbnormalFlag) + .between(DataInHarmV::getTime, lineParam.getStartTime(), lineParam.getEndTime()) + .eq(DataInHarmV::getQualityFlag,"0"); if(CollUtil.isNotEmpty(lineParam.getPhasicType())){ - influxQueryWrapper.regular(DataInharmV::getPhasicType,lineParam.getPhasicType()); + influxQueryWrapper.regular(DataInHarmV::getPhaseType,lineParam.getPhasicType()); } - List list = dataInharmVMapper.selectByQueryWrapper(influxQueryWrapper); + List list = DataInHarmVMapper.selectByQueryWrapper(influxQueryWrapper); if(CollUtil.isNotEmpty(list)){ //过滤掉暂态事件影响的数据 true过滤 false不过滤 if (lineParam.getDataType()) { @@ -90,14 +90,14 @@ public class InfluxdbDataInharmVImpl implements IDataInHarmV { } else { dataList = list; } - Map> lineMap = dataList.stream().collect(Collectors.groupingBy(DataInharmV::getLineId)); + Map> lineMap = dataList.stream().collect(Collectors.groupingBy(DataInHarmV::getLineId)); //有异常数据 if (CollectionUtil.isNotEmpty(lineParam.getAbnormalTime())) { lineMap.forEach((k,v)->{ List timeList = lineParam.getAbnormalTime().get(k); //有异常数据,当前监测点自身的异常数据 if (CollectionUtil.isNotEmpty(timeList)) { - List filterList = v.stream().filter(item -> !timeList.contains(DATE_TIME_FORMATTER.format(item.getTime()))).collect(Collectors.toList()); + List filterList = v.stream().filter(item -> !timeList.contains(DATE_TIME_FORMATTER.format(item.getTime()))).collect(Collectors.toList()); //1.过滤掉异常数据后还有正常数据,则用正常数据计算 if (CollectionUtil.isNotEmpty(filterList)) { result.addAll(filterList); @@ -121,9 +121,9 @@ public class InfluxdbDataInharmVImpl implements IDataInHarmV { } if (CollectionUtil.isNotEmpty(result)) { result.forEach(item -> { - String newType = PHASE_MAPPING.get(item.getPhasicType()); + String newType = PHASE_MAPPING.get(item.getPhaseType()); if (newType != null) { - item.setPhasicType(newType); + item.setPhaseType(newType); } }); } diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/influxdb/impl/InfluxdbDataPltImpl.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/influxdb/impl/InfluxdbDataPltImpl.java index d9b43d536..a3375dd96 100644 --- a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/influxdb/impl/InfluxdbDataPltImpl.java +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/influxdb/impl/InfluxdbDataPltImpl.java @@ -5,11 +5,11 @@ import cn.hutool.core.collection.CollectionUtil; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import com.njcn.dataProcess.param.LineCountEvaluateParam; -import com.njcn.dataProcess.po.influx.DataPlt; -import com.njcn.dataProcess.po.influx.DataV; +import com.njcn.influx.pojo.po.DataPlt; import com.njcn.dataProcess.pojo.dto.DataPltDto; -import com.njcn.harmonic.mapper.influxdb.DataPltMapper; import com.njcn.harmonic.service.influxdb.IDataPlt; +import com.njcn.influx.imapper.DataPltMapper; +import com.njcn.influx.pojo.po.DataV; import com.njcn.influx.query.InfluxQueryWrapper; import com.njcn.redis.utils.RedisUtil; import lombok.RequiredArgsConstructor; @@ -80,14 +80,14 @@ public class InfluxdbDataPltImpl implements IDataPlt { InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataPlt.class); influxQueryWrapper.regular(DataPlt::getLineId, lineParam.getLineId()) .select(DataPlt::getLineId) - .select(DataPlt::getPhasicType) + .select(DataPlt::getPhaseType) .select(DataPlt::getPlt) .select(DataPlt::getQualityFlag) .select(DataPlt::getAbnormalFlag) .between(DataPlt::getTime, lineParam.getStartTime(), lineParam.getEndTime()) .eq(DataPlt::getQualityFlag,"0"); if(CollUtil.isNotEmpty(lineParam.getPhasicType())){ - influxQueryWrapper.regular(DataV::getPhasicType,lineParam.getPhasicType()); + influxQueryWrapper.regular(DataV::getPhaseType,lineParam.getPhasicType()); } List list = dataPltMapper.selectByQueryWrapper(influxQueryWrapper); if(CollUtil.isNotEmpty(list)){ @@ -136,7 +136,7 @@ public class InfluxdbDataPltImpl implements IDataPlt { } Integer conType = map.get(k); Set validPhasicTypes = (conType != 0) ? LINE_VOLTAGE_TYPES : PHASE_VOLTAGE_TYPES; - List result2 = v.stream().filter(item -> validPhasicTypes.contains(item.getPhasicType())).collect(Collectors.toList()); + List result2 = v.stream().filter(item -> validPhasicTypes.contains(item.getPhaseType())).collect(Collectors.toList()); data.addAll(result2); }); } else { @@ -144,9 +144,9 @@ public class InfluxdbDataPltImpl implements IDataPlt { } if (CollectionUtil.isNotEmpty(data)) { data.forEach(item -> { - String newType = PHASE_MAPPING.get(item.getPhasicType()); + String newType = PHASE_MAPPING.get(item.getPhaseType()); if (newType != null) { - item.setPhasicType(newType); + item.setPhaseType(newType); } }); } diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/influxdb/impl/InfluxdbDataVImpl.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/influxdb/impl/InfluxdbDataVImpl.java index 037213150..606cf81f6 100644 --- a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/influxdb/impl/InfluxdbDataVImpl.java +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/influxdb/impl/InfluxdbDataVImpl.java @@ -7,10 +7,10 @@ import com.google.gson.reflect.TypeToken; import com.njcn.common.utils.HarmonicTimesUtil; import com.njcn.dataProcess.param.LineCountEvaluateParam; import com.njcn.dataProcess.pojo.dto.DataVDto; -import com.njcn.harmonic.mapper.influxdb.DataVMapper; import com.njcn.harmonic.service.influxdb.IDataV; import com.njcn.influx.constant.InfluxDbSqlConstant; -import com.njcn.dataProcess.po.influx.DataV; +import com.njcn.influx.imapper.DataVMapper; +import com.njcn.influx.pojo.po.DataV; import com.njcn.influx.query.InfluxQueryWrapper; import com.njcn.redis.utils.RedisUtil; import lombok.extern.slf4j.Slf4j; @@ -86,7 +86,7 @@ public class InfluxdbDataVImpl implements IDataV { influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, InfluxDbSqlConstant.V, HarmonicTimesUtil.harmonicTimesList(1, 50, 1)); influxQueryWrapper.regular(DataV::getLineId, lineParam.getLineId()) .select(DataV::getLineId) - .select(DataV::getPhasicType) + .select(DataV::getPhaseType) .select(DataV::getValueType) .select(DataV::getFreq) .select(DataV::getFreqDev) @@ -104,7 +104,7 @@ public class InfluxdbDataVImpl implements IDataV { .between(DataV::getTime, lineParam.getStartTime(), lineParam.getEndTime()) .eq(DataV::getQualityFlag, "0"); if (CollUtil.isNotEmpty(lineParam.getPhasicType())) { - influxQueryWrapper.regular(DataV::getPhasicType, lineParam.getPhasicType()); + influxQueryWrapper.regular(DataV::getPhaseType, lineParam.getPhasicType()); } quality(result, influxQueryWrapper, lineParam); if (CollectionUtil.isNotEmpty(result)) { @@ -117,18 +117,18 @@ public class InfluxdbDataVImpl implements IDataV { } //这边需要特殊处理下,将线电压数据赋值 Map lineVoltageIndex = v.stream() - .filter(d -> PHASE_MAPPING.containsKey(d.getPhasicType())) + .filter(d -> PHASE_MAPPING.containsKey(d.getPhaseType())) .filter(d -> d.getRmsLvr() != null) .collect(Collectors.toMap( - d -> buildKey(d.getTime(), d.getValueType(), d.getPhasicType()), + d -> buildKey(d.getTime(), d.getValueType(), d.getPhaseType()), Function.identity(), (existing, replacement) -> existing )); v.stream() - .filter(d -> PHASE_VOLTAGE_TYPES.contains(d.getPhasicType())) + .filter(d -> PHASE_VOLTAGE_TYPES.contains(d.getPhaseType())) .forEach(phaseData -> { // 根据当前相电压反查对应的线电压相别 - String targetLinePhasic = getReverseLinePhasic(phaseData.getPhasicType()); + String targetLinePhasic = getReverseLinePhasic(phaseData.getPhaseType()); if (targetLinePhasic == null) { return; } @@ -140,7 +140,7 @@ public class InfluxdbDataVImpl implements IDataV { }); Integer conType = map.get(k); Set validPhasicTypes = (conType != 0) ? LINE_VOLTAGE_TYPES : PHASE_VOLTAGE_TYPES; - List result2 = v.stream().filter(item -> validPhasicTypes.contains(item.getPhasicType())).collect(Collectors.toList()); + List result2 = v.stream().filter(item -> validPhasicTypes.contains(item.getPhaseType())).collect(Collectors.toList()); data.addAll(result2); }); } else { @@ -148,9 +148,9 @@ public class InfluxdbDataVImpl implements IDataV { } if (CollectionUtil.isNotEmpty(data)) { data.forEach(item -> { - String newType = PHASE_MAPPING.get(item.getPhasicType()); + String newType = PHASE_MAPPING.get(item.getPhaseType()); if (newType != null) { - item.setPhasicType(newType); + item.setPhaseType(newType); } }); }