From f48ef25666ddd692d31872cdc7c163b64f61dde6 Mon Sep 17 00:00:00 2001 From: hongawen <83944980@qq.com> Date: Mon, 25 Sep 2023 15:52:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4influx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/njcn/autocode/utils/GenerateCode.java | 8 +- pqs-event/event-boot/pom.xml | 6 +- .../com/njcn/event/EventBootApplication.java | 2 + .../event/influxdb/PqsEventDetailQuery.java | 12 +- .../event/influxdb/PqsOnlinerateQuery.java | 8 +- .../com/njcn/event/influxdb/QueryBuilder.java | 2 +- .../Impl/AreaInfoServiceImpl.java | 2 - .../Impl/AreaLineServiceImpl.java | 4 +- .../Impl/EventAnalysisServiceImpl.java | 2 +- .../Impl/EventDetailServiceImpl.java | 2 +- .../Impl/EventReportServiceImpl.java | 6 +- .../njcn/event/EventBootApplicationTest.java | 11 +- .../com/njcn/event/pojo/PqsEventDetail.java | 4 +- .../njcn/event/pojo/PqsEventDetailCount.java | 4 +- .../influx/deprecated/InfluxDbConfig.java | 33 -- .../njcn/influx/deprecated/InfluxDbUtils.java | 378 ------------------ pqs-job/job-executor/pom.xml | 8 +- .../njcn/executor/JobExecutorApplication.java | 2 + .../executor/handler/EleIntegrityJob.java | 4 +- .../executor/handler/EleOnlineRateJob.java | 4 +- .../njcn/executor/handler/ElectricCalJob.java | 5 +- pqs-job/job-executor/src/test/java/Test1.java | 4 +- pqs-prepare/prepare-boot/pom.xml | 37 +- .../controller/area/AreaCountController.java | 28 +- .../impl/DataExceptionInfluxServiceImpl.java | 2 +- .../DataIntegrityRateInfluxServiceImpl.java | 2 +- .../impl/DataVInfluxdbServiceImpl.java | 2 +- .../impl/RStatWorkOrderCreateServiceImpl.java | 2 +- .../DeviceAbnormaStatisticsServiceImpl.java | 2 +- .../mysql/Impl/line/DayDataServiceImpl.java | 2 +- .../Impl/line/DistortionRateServiceImpl.java | 2 +- .../Impl/line/HarmonicGeneralServiceImpl.java | 2 +- .../Impl/line/HarmonicMetricServiceImpl.java | 2 +- .../mysql/Impl/line/IntegrityServiceImpl.java | 2 +- .../mysql/Impl/line/LimitRateService.java | 3 +- .../Impl/line/LimitTargetServiceImpl.java | 2 +- .../Impl/line/NormalLimitServiceImpl.java | 3 +- .../Impl/line/OnlineRateServiceImpl.java | 2 +- .../mysql/Impl/line/ReportServiceImpl.java | 2 +- .../src/main/resources/bootstrap.yml | 9 + pqs-process/process-boot/pom.xml | 9 +- 41 files changed, 105 insertions(+), 521 deletions(-) delete mode 100644 pqs-influx/src/main/java/com/njcn/influx/deprecated/InfluxDbConfig.java delete mode 100644 pqs-influx/src/main/java/com/njcn/influx/deprecated/InfluxDbUtils.java diff --git a/pqs-common/common-autocode/src/main/java/com/njcn/autocode/utils/GenerateCode.java b/pqs-common/common-autocode/src/main/java/com/njcn/autocode/utils/GenerateCode.java index 6c7685006..1a5d5b0f9 100644 --- a/pqs-common/common-autocode/src/main/java/com/njcn/autocode/utils/GenerateCode.java +++ b/pqs-common/common-autocode/src/main/java/com/njcn/autocode/utils/GenerateCode.java @@ -21,7 +21,7 @@ public class GenerateCode { private static final String TARGET_DIR = "D://code"; - private static final String DB_URL = "jdbc:mysql://192.168.1.18:13306/pqsinfo_hb_pv"; + private static final String DB_URL = "jdbc:mysql://192.168.1.18:13306/pqsinfo_sjzx_zl"; private static final String USERNAME = "root"; @@ -30,9 +30,9 @@ public class GenerateCode { public static void main(String[] args) { List modules = Stream.of( - new Module("hongawen", "com.hongawen.mybatis", "zl", Stream.of( - "r_dis_mp_measure_phase_report_d" - ).collect(Collectors.toList()), "") + new Module("hongawen", "com.njcn.mybatis", "advance", Stream.of( + "rocketmq_msg_error_log" + ).collect(Collectors.toList()), "pqs") ).collect(Collectors.toList()); generateJavaFile(modules); } diff --git a/pqs-event/event-boot/pom.xml b/pqs-event/event-boot/pom.xml index 7111b7028..da4917c0c 100644 --- a/pqs-event/event-boot/pom.xml +++ b/pqs-event/event-boot/pom.xml @@ -42,11 +42,7 @@ user-api ${project.version} - - com.njcn - common-influxDB - ${project.version} - + org.freemarker freemarker diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/EventBootApplication.java b/pqs-event/event-boot/src/main/java/com/njcn/event/EventBootApplication.java index 7370c52d6..bfd74feb2 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/EventBootApplication.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/EventBootApplication.java @@ -5,6 +5,7 @@ import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.context.annotation.DependsOn; /** @@ -14,6 +15,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients; * @date 2022-03-07 15:37:00 */ @Slf4j +@DependsOn("proxyMapperRegister") @MapperScan("com.njcn.**.mapper") @EnableFeignClients(basePackages = "com.njcn") @SpringBootApplication(scanBasePackages = "com.njcn") diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/influxdb/PqsEventDetailQuery.java b/pqs-event/event-boot/src/main/java/com/njcn/event/influxdb/PqsEventDetailQuery.java index fdad098c0..d8292aa1c 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/influxdb/PqsEventDetailQuery.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/influxdb/PqsEventDetailQuery.java @@ -5,9 +5,9 @@ import cn.hutool.core.date.DateTime; import com.njcn.event.pojo.po.EventDetail; import com.njcn.event.pojo.po.RmpEventDetailPO; import com.njcn.event.pojo.vo.EventDetailCount; -import com.njcn.influxdb.config.InfluxDbConfig; -import com.njcn.influxdb.utils.InfluxDbUtils; -import lombok.RequiredArgsConstructor; +import com.njcn.influx.config.InfluxDbConfig; +import com.njcn.influx.deprecated.InfluxDBPublicParam; +import com.njcn.influx.utils.InfluxDbUtils; import org.apache.commons.lang3.StringUtils; import org.influxdb.dto.QueryResult; import org.influxdb.querybuilder.SelectQueryImpl; @@ -17,7 +17,6 @@ import org.springframework.stereotype.Component; import javax.annotation.Resource; import java.time.Instant; -import java.time.LocalDateTime; import java.time.ZoneId; import java.util.ArrayList; import java.util.List; @@ -26,7 +25,6 @@ import java.util.function.Function; import java.util.stream.Collectors; -import static com.njcn.influxdb.param.InfluxDBPublicParam.PQS_EVENT_DETAIL; import static org.influxdb.querybuilder.BuiltQuery.QueryBuilder.eq; /** @@ -40,7 +38,7 @@ import static org.influxdb.querybuilder.BuiltQuery.QueryBuilder.eq; public class PqsEventDetailQuery extends QueryBuilder { @Resource - private InfluxDbConfig influxDbConfig; + private InfluxDbConfig influxDbConfig; protected PqsEventDetailQuery(InfluxDbUtils influxDbUtils) { super(influxDbUtils); @@ -68,7 +66,7 @@ public class PqsEventDetailQuery extends QueryBuilder { * @see SelectQueryImpl */ private SelectQueryImpl fromTable(SelectionQueryImpl column) { - return column.from(influxDbConfig.getDatabase(), PQS_EVENT_DETAIL); + return column.from(influxDbConfig.getDatabase(), InfluxDBPublicParam.PQS_EVENT_DETAIL); } /** diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/influxdb/PqsOnlinerateQuery.java b/pqs-event/event-boot/src/main/java/com/njcn/event/influxdb/PqsOnlinerateQuery.java index f16267b3e..416929751 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/influxdb/PqsOnlinerateQuery.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/influxdb/PqsOnlinerateQuery.java @@ -1,8 +1,9 @@ package com.njcn.event.influxdb; import com.njcn.event.pojo.po.PqsOnlinerate; -import com.njcn.influxdb.config.InfluxDbConfig; -import com.njcn.influxdb.utils.InfluxDbUtils; +import com.njcn.influx.config.InfluxDbConfig; +import com.njcn.influx.deprecated.InfluxDBPublicParam; +import com.njcn.influx.utils.InfluxDbUtils; import org.influxdb.dto.QueryResult; import org.influxdb.querybuilder.SelectQueryImpl; import org.influxdb.querybuilder.SelectionQueryImpl; @@ -14,7 +15,6 @@ import java.util.ArrayList; import java.util.List; -import static com.njcn.influxdb.param.InfluxDBPublicParam.PQS_ONLINERATE; import static org.influxdb.querybuilder.BuiltQuery.QueryBuilder.eq; @Component @@ -34,7 +34,7 @@ public class PqsOnlinerateQuery extends QueryBuilder { * @see SelectQueryImpl */ private SelectQueryImpl fromTable(SelectionQueryImpl column) { - return column.from(influxDbConfig.getDatabase(), PQS_ONLINERATE); + return column.from(influxDbConfig.getDatabase(), InfluxDBPublicParam.PQS_ONLINERATE); } /** diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/influxdb/QueryBuilder.java b/pqs-event/event-boot/src/main/java/com/njcn/event/influxdb/QueryBuilder.java index 6fddef7a2..b5f00beda 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/influxdb/QueryBuilder.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/influxdb/QueryBuilder.java @@ -3,7 +3,7 @@ package com.njcn.event.influxdb; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; -import com.njcn.influxdb.utils.InfluxDbUtils; +import com.njcn.influx.utils.InfluxDbUtils; import org.influxdb.InfluxDBMapperException; import org.influxdb.dto.QueryResult; import org.influxdb.impl.InfluxDBResultMapper; diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/AreaInfoServiceImpl.java b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/AreaInfoServiceImpl.java index c7c4aa822..5654f7400 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/AreaInfoServiceImpl.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/AreaInfoServiceImpl.java @@ -6,7 +6,6 @@ import cn.hutool.core.date.DateUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.njcn.device.pq.api.GeneralDeviceInfoClient; import com.njcn.device.pq.api.LineFeignClient; -import com.njcn.device.pq.api.TerminalBaseClient; import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO; import com.njcn.device.pq.pojo.param.DeviceInfoParam; import com.njcn.device.pq.pojo.vo.AreaLineInfoVO; @@ -15,7 +14,6 @@ import com.njcn.event.pojo.po.RmpEventDetailPO; import com.njcn.event.pojo.vo.AreaSubLineVO; import com.njcn.event.service.majornetwork.AreaInfoService; import com.njcn.event.service.majornetwork.EventDetailService; -import com.njcn.influxdb.utils.InfluxDbUtils; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/AreaLineServiceImpl.java b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/AreaLineServiceImpl.java index 4a5233003..6b6c697ba 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/AreaLineServiceImpl.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/AreaLineServiceImpl.java @@ -31,8 +31,8 @@ import com.njcn.event.service.majornetwork.LargeScreenService; import com.njcn.harmonic.pojo.dto.ComAssessDTO; import com.njcn.harmonic.pojo.po.PQSComAssesPO; import com.njcn.harmonic.utils.HarmonicComAssesUtil; -import com.njcn.influxdb.param.InfluxDBPublicParam; -import com.njcn.influxdb.utils.InfluxDbUtils; +import com.njcn.influx.deprecated.InfluxDBPublicParam; +import com.njcn.influx.utils.InfluxDbUtils; import com.njcn.system.api.DicDataFeignClient; import com.njcn.system.enums.DicDataEnum; import com.njcn.system.pojo.enums.StatisticsEnum; diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/EventAnalysisServiceImpl.java b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/EventAnalysisServiceImpl.java index 34ad81dd1..e7d6a0ddf 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/EventAnalysisServiceImpl.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/EventAnalysisServiceImpl.java @@ -22,7 +22,7 @@ import com.njcn.event.pojo.po.RmpEventDetailPO; import com.njcn.event.pojo.vo.*; import com.njcn.event.service.majornetwork.EventAnalysisService; import com.njcn.event.service.majornetwork.EventDetailService; -import com.njcn.influxdb.utils.InfluxDbUtils; +import com.njcn.influx.utils.InfluxDbUtils; import com.njcn.system.api.DicDataFeignClient; import com.njcn.system.enums.DicDataEnum; import com.njcn.system.enums.DicDataTypeEnum; diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/EventDetailServiceImpl.java b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/EventDetailServiceImpl.java index 2553ed99e..70bb93cb7 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/EventDetailServiceImpl.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/EventDetailServiceImpl.java @@ -10,7 +10,7 @@ import com.njcn.event.mapper.majornetwork.EventDetailMapper; import com.njcn.event.pojo.po.EventDetail; import com.njcn.event.pojo.po.RmpEventDetailPO; import com.njcn.event.service.majornetwork.EventDetailService; -import com.njcn.influxdb.utils.InfluxDbUtils; +import com.njcn.influx.utils.InfluxDbUtils; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.influxdb.dto.QueryResult; diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/EventReportServiceImpl.java b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/EventReportServiceImpl.java index 5ba553bdb..71a2f7c67 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/EventReportServiceImpl.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/EventReportServiceImpl.java @@ -1,18 +1,14 @@ package com.njcn.event.service.majornetwork.Impl; -import com.google.common.collect.Lists; import cn.hutool.core.date.DateUtil; -import com.njcn.common.pojo.response.HttpResult; import com.njcn.event.pojo.constant.Param; import com.njcn.event.pojo.param.StatisticsParam; import com.njcn.event.pojo.po.EventDetail; import com.njcn.event.pojo.po.EventDetailNew; import com.njcn.event.pojo.vo.*; import com.njcn.event.service.majornetwork.EventReportService; -import com.njcn.event.service.majornetwork.ReportService; -import com.njcn.influxdb.utils.InfluxDbUtils; -import com.njcn.system.enums.DicDataTypeEnum; +import com.njcn.influx.utils.InfluxDbUtils; import com.njcn.system.pojo.po.DictData; import lombok.RequiredArgsConstructor; import org.influxdb.dto.QueryResult; diff --git a/pqs-event/event-boot/src/test/java/com/njcn/event/EventBootApplicationTest.java b/pqs-event/event-boot/src/test/java/com/njcn/event/EventBootApplicationTest.java index 4e5d19c81..0e42db116 100644 --- a/pqs-event/event-boot/src/test/java/com/njcn/event/EventBootApplicationTest.java +++ b/pqs-event/event-boot/src/test/java/com/njcn/event/EventBootApplicationTest.java @@ -1,6 +1,5 @@ package com.njcn.event; -import com.njcn.event.enums.EventResponseEnum; import com.njcn.event.file.component.WaveFileComponent; import com.njcn.event.file.pojo.dto.EigenvalueDTO; import com.njcn.event.file.pojo.dto.WaveDataDTO; @@ -9,8 +8,9 @@ import com.njcn.event.pojo.PqsEventDetail; import com.njcn.event.pojo.PqsOnlinerateAggregate; import com.njcn.event.pojo.PqsEventDetailCount; import com.njcn.huawei.obs.util.OBSUtil; -import com.njcn.influxdb.config.InfluxDbConfig; -import com.njcn.influxdb.utils.InfluxDbUtils; +import com.njcn.influx.config.InfluxDbConfig; +import com.njcn.influx.deprecated.InfluxDBPublicParam; +import com.njcn.influx.utils.InfluxDbUtils; import com.njcn.oss.constant.OssPath; import org.influxdb.dto.QueryResult; import org.influxdb.impl.InfluxDBResultMapper; @@ -34,7 +34,6 @@ import java.util.List; import java.util.Objects; -import static com.njcn.influxdb.param.InfluxDBPublicParam.PQS_EVENT_DETAIL; import static org.influxdb.querybuilder.BuiltQuery.QueryBuilder.*; import static org.influxdb.querybuilder.FunctionFactory.sum; @@ -63,7 +62,7 @@ public class EventBootApplicationTest { // or 条件数据 List clauses = getClauses(); - SelectQueryImpl selectQuery = select().column("line_id").column("eventass_index").from(influxDbConfig.getDatabase(), PQS_EVENT_DETAIL); + SelectQueryImpl selectQuery = select().column("line_id").column("eventass_index").from(influxDbConfig.getDatabase(), InfluxDBPublicParam.PQS_EVENT_DETAIL); WhereQueryImpl where = selectQuery.where(); // WHERE (line_id = '1' OR line_id = '2' OR line_id = '3') 加上前后() @@ -84,7 +83,7 @@ public class EventBootApplicationTest { // or 条件数据 List clauses = getClauses(); - SelectQueryImpl selectQuery = select().count("eventass_index").from(influxDbConfig.getDatabase(), PQS_EVENT_DETAIL); + SelectQueryImpl selectQuery = select().count("eventass_index").from(influxDbConfig.getDatabase(), InfluxDBPublicParam.PQS_EVENT_DETAIL); WhereQueryImpl where = selectQuery.where(); // WHERE (line_id = '1' OR line_id = '2' OR line_id = '3') 加上前后() diff --git a/pqs-event/event-boot/src/test/java/com/njcn/event/pojo/PqsEventDetail.java b/pqs-event/event-boot/src/test/java/com/njcn/event/pojo/PqsEventDetail.java index d5eba9f22..e87e84dec 100644 --- a/pqs-event/event-boot/src/test/java/com/njcn/event/pojo/PqsEventDetail.java +++ b/pqs-event/event-boot/src/test/java/com/njcn/event/pojo/PqsEventDetail.java @@ -1,15 +1,15 @@ package com.njcn.event.pojo; +import com.njcn.influx.deprecated.InfluxDBPublicParam; import lombok.Data; import org.influxdb.annotation.Column; import org.influxdb.annotation.Measurement; import java.time.Instant; -import static com.njcn.influxdb.param.InfluxDBPublicParam.PQS_EVENT_DETAIL; @Data -@Measurement(name = PQS_EVENT_DETAIL) +@Measurement(name = InfluxDBPublicParam.PQS_EVENT_DETAIL) public class PqsEventDetail { @Column(name = "line_id") diff --git a/pqs-event/event-boot/src/test/java/com/njcn/event/pojo/PqsEventDetailCount.java b/pqs-event/event-boot/src/test/java/com/njcn/event/pojo/PqsEventDetailCount.java index 48fe14f65..5d2934fc1 100644 --- a/pqs-event/event-boot/src/test/java/com/njcn/event/pojo/PqsEventDetailCount.java +++ b/pqs-event/event-boot/src/test/java/com/njcn/event/pojo/PqsEventDetailCount.java @@ -1,15 +1,15 @@ package com.njcn.event.pojo; +import com.njcn.influx.deprecated.InfluxDBPublicParam; import lombok.Data; import org.influxdb.annotation.Column; import org.influxdb.annotation.Measurement; import java.time.Instant; -import static com.njcn.influxdb.param.InfluxDBPublicParam.PQS_EVENT_DETAIL; @Data -@Measurement(name = PQS_EVENT_DETAIL) +@Measurement(name = InfluxDBPublicParam.PQS_EVENT_DETAIL) public class PqsEventDetailCount { @Column(name = "time") diff --git a/pqs-influx/src/main/java/com/njcn/influx/deprecated/InfluxDbConfig.java b/pqs-influx/src/main/java/com/njcn/influx/deprecated/InfluxDbConfig.java deleted file mode 100644 index 00267b2d7..000000000 --- a/pqs-influx/src/main/java/com/njcn/influx/deprecated/InfluxDbConfig.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.njcn.influx.deprecated; - -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.context.annotation.Bean; -import org.springframework.stereotype.Component; - -/** - * 类的介绍: - * - * @author xuyang - * @version 1.0.0 - * @createTime 2021/12/10 10:48 - */ -@Data -@Component -@ConfigurationProperties(prefix = "spring.influx") -@Deprecated -public class InfluxDbConfig { - - private String url; - - private String user; - - private String password; - - private String database; - - @Bean - public InfluxDbUtils influxDbUtils() { - return new InfluxDbUtils(user, password, url, database, "autogen"); - } -} diff --git a/pqs-influx/src/main/java/com/njcn/influx/deprecated/InfluxDbUtils.java b/pqs-influx/src/main/java/com/njcn/influx/deprecated/InfluxDbUtils.java deleted file mode 100644 index d032d176b..000000000 --- a/pqs-influx/src/main/java/com/njcn/influx/deprecated/InfluxDbUtils.java +++ /dev/null @@ -1,378 +0,0 @@ -package com.njcn.influx.deprecated; - - -import lombok.Data; -import lombok.extern.slf4j.Slf4j; -import okhttp3.OkHttpClient; -import org.influxdb.InfluxDB; -import org.influxdb.InfluxDB.ConsistencyLevel; -import org.influxdb.InfluxDBFactory; -import org.influxdb.dto.*; -import org.influxdb.dto.Point.Builder; - -import java.time.Instant; -import java.time.LocalDateTime; -import java.time.ZoneId; -import java.time.format.DateTimeFormatter; -import java.time.format.DateTimeFormatterBuilder; -import java.time.temporal.ChronoField; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; - -/** - * 类的介绍: - * - * @author xuyang - * @version 1.0.0 - * @createTime 2021/11/16 10:20 - */ -@Slf4j -@Data -@Deprecated -public class InfluxDbUtils { - static OkHttpClient.Builder client = new OkHttpClient.Builder() - .connectTimeout(1000,TimeUnit.SECONDS) - .readTimeout(1000, TimeUnit.SECONDS) - .writeTimeout(1000, TimeUnit.SECONDS); - private static final int FRACTION_MIN_WIDTH = 0; - private static final int FRACTION_MAX_WIDTH = 9; - private static final boolean ADD_DECIMAL_POINT = true; - private static final DateTimeFormatter RFC3339_FORMATTER = new DateTimeFormatterBuilder() - .appendPattern("yyyy-MM-dd'T'HH:mm:ss") - .appendFraction(ChronoField.NANO_OF_SECOND, FRACTION_MIN_WIDTH, FRACTION_MAX_WIDTH, ADD_DECIMAL_POINT) - .appendZoneOrOffsetId() - .toFormatter(); - - /**用户名*/ - private String username; - /**密码*/ - private String password; - /**链接地址*/ - private String openurl; - /**数据库*/ - private String dbName; - /**保留策略*/ - private String retentionPolicy; - - private InfluxDB influxDB; - - public InfluxDbUtils(String username, String password, String url, String dbName, String retentionPolicy) { - this.username = username; - this.password = password; - this.openurl = url; - this.dbName = dbName; - this.retentionPolicy = retentionPolicy == null || retentionPolicy.equals("") ? "autogen" : retentionPolicy; - influxDbBuild(); - } - - - /** - * 连接时序数据库 ,若不存在则创建 - * - * @return - */ - public InfluxDB influxDbBuild() { - if (influxDB == null) { - influxDB = InfluxDBFactory.connect(openurl, username, password,client); - } - try { - // if (!influxDB.databaseExists(database)) { - // influxDB.createDatabase(database); - // } - } catch (Exception e) { - // 该数据库可能设置动态代理,不支持创建数据库 - // e.printStackTrace(); - } finally { - influxDB.setRetentionPolicy(retentionPolicy); - } - influxDB.setLogLevel(InfluxDB.LogLevel.NONE); - return influxDB; - } - - - - - /** - * 创建数据库 - * - * @param dbName - */ - @SuppressWarnings("deprecation") - public void createDB(String dbName) { - influxDB.createDatabase(dbName); - } - - /** - * 删除数据库 - * - * @param dbName - */ - @SuppressWarnings("deprecation") - public void deleteDB(String dbName) { - influxDB.deleteDatabase(dbName); - } - - /** - * 测试连接是否正常 - * - * @return true 正常 - */ - public boolean ping() { - boolean isConnected = false; - Pong pong; - try { - pong = influxDB.ping(); - if (pong != null) { - isConnected = true; - } - } catch (Exception e) { - e.printStackTrace(); - } - return isConnected; - } - - /** - * 创建自定义保留策略 - * - * @param policyName 策略名 - * @param days 保存天数 - * @param replication 保存副本数量 - * @param isDefault 是否设为默认保留策略 - */ - public void createRetentionPolicy(String dataBaseName, String policyName, int days, int replication, - Boolean isDefault) { - String sql = String.format("CREATE RETENTION POLICY \"%s\" ON \"%s\" DURATION %sd REPLICATION %s ", policyName, - dataBaseName, days, replication); - if (isDefault) { - sql = sql + " DEFAULT"; - } - query(sql); - } - - /** - * 创建默认的保留策略 - * - * 策略名:hour,保存天数:30天,保存副本数量:1,设为默认保留策略 - */ - public void createDefaultRetentionPolicy() { - String command = String - .format("CREATE RETENTION POLICY \"%s\" ON \"%s\" DURATION %s REPLICATION %s DEFAULT", "hour", dbName, - "30d", 1); - this.query(command); - } - - /** - * 查询 - * - * @param command 查询语句 - * @return - */ - public QueryResult query(String command) { - return influxDB.query(new Query(command, dbName)); - } - - /** - * 插入 - * - * @param measurement 表 - * @param tags 标签 - * @param fields 字段 - */ - public void insert(String measurement, Map tags, Map fields, long time, - TimeUnit timeUnit) { - Builder builder = Point.measurement(measurement); - builder.tag(tags); - builder.fields(fields); - if (0 != time) { - builder.time(time, timeUnit); - } - influxDB.write(dbName, retentionPolicy, builder.build()); - } - - - - /** - * 批量写入测点 - * - * @param batchPoints - */ - public void batchInsert(BatchPoints batchPoints, TimeUnit timeUnit) { - influxDB.write(batchPoints); - // influxDB.enableGzip(); - // influxDB.enableBatch(2000,100,timeUnit); - // influxDB.disableGzip(); - // influxDB.disableBatch(); - } - - /** - * 批量写入数据 - * - * @param database 数据库 - * @param retentionPolicy 保存策略 - * @param consistency 一致性 - * @param records 要保存的数据(调用BatchPoints.lineProtocol()可得到一条record) - */ - public void batchInsert(final String database, final String retentionPolicy, final ConsistencyLevel consistency,TimeUnit timeUnit, final List records) { - influxDB.write(database, retentionPolicy, consistency, records); - } - - /** - * 批量写入数据 - * - * @param database 数据库 - * @param retentionPolicy 保存策略 - * @param consistency 一致性 - * @param records 要保存的数据(调用BatchPoints.lineProtocol()可得到一条record) - */ - public void batchInsert(final String database, final String retentionPolicy, final ConsistencyLevel consistency, final List records) { - influxDB.write(database, retentionPolicy, consistency, records); - } - - - /** - * 删除 - * - * @param command 删除语句 - * @return 返回错误信息 - */ - public String deleteMeasurementData(String command) { - QueryResult result = influxDB.query(new Query(command, dbName)); - return result.getError(); - } - - /** - * 关闭数据库 - */ - public void close() { - influxDB.close(); - } - - /** - * 构建Point - * - * @param measurement - * @param time - * @param fields - * @return - */ - public Point pointBuilder(String measurement, long time, TimeUnit timeUnit, Map tags, - Map fields) { - Point point = Point.measurement(measurement).time(time, timeUnit).tag(tags).fields(fields).build(); - return point; - } - - - - - - //单条查询语句封装 - /** - * 查询结果封装到map - * @param commond 单条sql语句 - * @return 查询结果 - */ - @Deprecated - public List> getResult(String commond){ - List> retList = new ArrayList<>(); - QueryResult queryResult = influxDB.query(new Query(commond,dbName)); - List results = queryResult.getResults(); - if (results==null||results.isEmpty()){ - return retList; - } - QueryResult.Result result = results.get(0); - List seriess = result.getSeries(); - if (seriess==null||seriess.isEmpty()){ - return retList; - } - QueryResult.Series series = seriess.get(0); - List columns = series.getColumns(); - List> values = series.getValues(); - for (List columnValue :values){ - Map map = new HashMap<>(1); - for (int i=0;i> getResult(String commond, String type){ - - List> retList = new ArrayList<>(); - QueryResult queryResult = influxDB.query(new Query(commond,dbName)); - List results = queryResult.getResults(); - if (results==null||results.isEmpty()){ - return retList; - } - QueryResult.Result result = results.get(0); - List seriess = result.getSeries(); - if (seriess==null||seriess.isEmpty()){ - return retList; - } - QueryResult.Series series = seriess.get(0); - List columns = series.getColumns(); - List> values = series.getValues(); - for (List columnValue :values){ - Map map = new HashMap<>(1); - for (int i=0;i> getMapResult(String commond){ - - List> retList = new ArrayList<>(); - QueryResult queryResult = influxDB.query(new Query(commond,dbName)); - List results = queryResult.getResults(); - if (results==null||results.isEmpty()){ - return retList; - } - QueryResult.Result result = results.get(0); - List seriess = result.getSeries(); - if (seriess==null||seriess.isEmpty()){ - return retList; - } - QueryResult.Series series = seriess.get(0); - List columns = series.getColumns(); - List> values = series.getValues(); - for (List columnValue :values){ - Map map = new HashMap<>(1); - for (int i=0;i com.njcn - common-influxDB + pqs-influx ${project.version} - compile com.njcn @@ -78,6 +77,11 @@ process-api ${project.version} + + org.springframework.boot + spring-boot-starter-web + + diff --git a/pqs-job/job-executor/src/main/java/com/njcn/executor/JobExecutorApplication.java b/pqs-job/job-executor/src/main/java/com/njcn/executor/JobExecutorApplication.java index 698ab352d..0b13cc17b 100644 --- a/pqs-job/job-executor/src/main/java/com/njcn/executor/JobExecutorApplication.java +++ b/pqs-job/job-executor/src/main/java/com/njcn/executor/JobExecutorApplication.java @@ -5,6 +5,7 @@ import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.context.annotation.DependsOn; /** * @author hongawen @@ -12,6 +13,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients; * @date 2022年03月22日 10:07 */ @Slf4j +@DependsOn("proxyMapperRegister") @EnableFeignClients(basePackages = "com.njcn") @SpringBootApplication(scanBasePackages = "com.njcn") public class JobExecutorApplication { diff --git a/pqs-job/job-executor/src/main/java/com/njcn/executor/handler/EleIntegrityJob.java b/pqs-job/job-executor/src/main/java/com/njcn/executor/handler/EleIntegrityJob.java index e1be8016d..0b518c0a7 100644 --- a/pqs-job/job-executor/src/main/java/com/njcn/executor/handler/EleIntegrityJob.java +++ b/pqs-job/job-executor/src/main/java/com/njcn/executor/handler/EleIntegrityJob.java @@ -2,8 +2,8 @@ package com.njcn.executor.handler; import com.njcn.energy.pojo.api.EleIntegrityFeignClient; import com.njcn.executor.pojo.dto.HarmonicDTO; -import com.njcn.influxdb.config.InfluxDbConfig; -import com.njcn.influxdb.utils.InfluxDbUtils; +import com.njcn.influx.config.InfluxDbConfig; +import com.njcn.influx.utils.InfluxDbUtils; import com.xxl.job.core.handler.annotation.XxlJob; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/pqs-job/job-executor/src/main/java/com/njcn/executor/handler/EleOnlineRateJob.java b/pqs-job/job-executor/src/main/java/com/njcn/executor/handler/EleOnlineRateJob.java index 6d32d8153..67ae4541f 100644 --- a/pqs-job/job-executor/src/main/java/com/njcn/executor/handler/EleOnlineRateJob.java +++ b/pqs-job/job-executor/src/main/java/com/njcn/executor/handler/EleOnlineRateJob.java @@ -2,8 +2,8 @@ package com.njcn.executor.handler; import com.njcn.energy.pojo.api.EleOnlineRateFeignClient; import com.njcn.energy.pojo.dto.OnlineRateDTO; -import com.njcn.influxdb.config.InfluxDbConfig; -import com.njcn.influxdb.utils.InfluxDbUtils; +import com.njcn.influx.config.InfluxDbConfig; +import com.njcn.influx.utils.InfluxDbUtils; import com.xxl.job.core.handler.annotation.XxlJob; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/pqs-job/job-executor/src/main/java/com/njcn/executor/handler/ElectricCalJob.java b/pqs-job/job-executor/src/main/java/com/njcn/executor/handler/ElectricCalJob.java index 29c92ef15..8538310fe 100644 --- a/pqs-job/job-executor/src/main/java/com/njcn/executor/handler/ElectricCalJob.java +++ b/pqs-job/job-executor/src/main/java/com/njcn/executor/handler/ElectricCalJob.java @@ -1,9 +1,8 @@ package com.njcn.executor.handler; import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.util.IdUtil; -import com.njcn.influxdb.config.InfluxDbConfig; -import com.njcn.influxdb.utils.InfluxDbUtils; +import com.njcn.influx.config.InfluxDbConfig; +import com.njcn.influx.utils.InfluxDbUtils; import com.xxl.job.core.handler.annotation.XxlJob; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/pqs-job/job-executor/src/test/java/Test1.java b/pqs-job/job-executor/src/test/java/Test1.java index c56d3c2de..250e032d5 100644 --- a/pqs-job/job-executor/src/test/java/Test1.java +++ b/pqs-job/job-executor/src/test/java/Test1.java @@ -1,6 +1,6 @@ import com.njcn.executor.pojo.vo.DataFlicker; -import com.njcn.influxdb.config.InfluxDbConfig; -import com.njcn.influxdb.utils.InfluxDbUtils; +import com.njcn.influx.config.InfluxDbConfig; +import com.njcn.influx.utils.InfluxDbUtils; import org.influxdb.dto.QueryResult; import org.influxdb.impl.InfluxDBResultMapper; import org.influxdb.querybuilder.SelectQueryImpl; diff --git a/pqs-prepare/prepare-boot/pom.xml b/pqs-prepare/prepare-boot/pom.xml index bf154340a..0acc48e2d 100644 --- a/pqs-prepare/prepare-boot/pom.xml +++ b/pqs-prepare/prepare-boot/pom.xml @@ -40,13 +40,6 @@ ${project.version} compile - - - - - - - com.njcn common-web @@ -143,23 +136,23 @@ - - - - - + + com.njcn + influxdb-springboot-starter + 1.0.0 + - - - - - + + com.yomahub + liteflow-spring-boot-starter + 2.11.0 + - - - - - + + + + + diff --git a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/controller/area/AreaCountController.java b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/controller/area/AreaCountController.java index 9091a164d..d9d7b8670 100644 --- a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/controller/area/AreaCountController.java +++ b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/controller/area/AreaCountController.java @@ -42,31 +42,29 @@ import java.util.stream.Collectors; @RequiredArgsConstructor public class AreaCountController extends BaseController { - private @Autowired - DeptFeignClient deptFeignClient; + private final DeptFeignClient deptFeignClient; - private @Autowired - AreaCountService areaCountService; + private final AreaCountService areaCountService; @ApiOperation("区域统计有效接入监测点个数计算(r_stat_org_d表数据)") - @ApiImplicitParam(value = "primaryGridParam",name = "primaryGridParam",required = true) + @ApiImplicitParam(value = "primaryGridParam", name = "primaryGridParam", required = true) @PostMapping("areaCountHanlder") @OperateInfo(info = LogEnum.BUSINESS_MEDIUM) - public HttpResult areaCountHanlder(@RequestBody PrimaryGridParam primaryGridParam ){ - log.info(LocalDateTime.now()+"areaCountHanlder开始执行"); + public HttpResult areaCountHanlder(@RequestBody PrimaryGridParam primaryGridParam) { + log.info(LocalDateTime.now() + "areaCountHanlder开始执行"); String methodDescribe = getMethodDescribe("areaCountHanlder"); Boolean result = true; - List orgIdList = new ArrayList<> (); - if(CollectionUtils.isEmpty (primaryGridParam.getOrgIdList ())){ + List orgIdList = new ArrayList<>(); + if (CollectionUtils.isEmpty(primaryGridParam.getOrgIdList())) { List dept = deptFeignClient.allDeptList().getData(); - orgIdList = dept.stream ( ).map (PvTerminalTreeVO::getId).collect (Collectors.toList ( )); - }else{ - orgIdList = primaryGridParam.getOrgIdList (); + orgIdList = dept.stream().map(PvTerminalTreeVO::getId).collect(Collectors.toList()); + } else { + orgIdList = primaryGridParam.getOrgIdList(); } - primaryGridParam.setOrgIdList (orgIdList); + primaryGridParam.setOrgIdList(orgIdList); - areaCountService.areaCountHanlder (primaryGridParam); - if (result){ + areaCountService.areaCountHanlder(primaryGridParam); + if (result) { return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe); } else { return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe); diff --git a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/influxdb/impl/DataExceptionInfluxServiceImpl.java b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/influxdb/impl/DataExceptionInfluxServiceImpl.java index 16454df0c..afa76a0d7 100644 --- a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/influxdb/impl/DataExceptionInfluxServiceImpl.java +++ b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/influxdb/impl/DataExceptionInfluxServiceImpl.java @@ -4,8 +4,8 @@ import cn.hutool.core.date.DateTime; import com.njcn.device.pq.pojo.po.DataV; import com.njcn.influx.deprecated.InfluxDBPublicParam; import com.njcn.influx.deprecated.InfluxDBSqlConstant; -import com.njcn.influx.deprecated.InfluxDbUtils; import com.njcn.influx.pojo.constant.InfluxDBTableConstant; +import com.njcn.influx.utils.InfluxDbUtils; import com.njcn.prepare.harmonic.service.influxdb.DataExceptionInfluxService; import com.njcn.prepare.harmonic.utils.PublicUtil; import lombok.RequiredArgsConstructor; diff --git a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/influxdb/impl/DataIntegrityRateInfluxServiceImpl.java b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/influxdb/impl/DataIntegrityRateInfluxServiceImpl.java index e0a90439c..05557d5dd 100644 --- a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/influxdb/impl/DataIntegrityRateInfluxServiceImpl.java +++ b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/influxdb/impl/DataIntegrityRateInfluxServiceImpl.java @@ -4,9 +4,9 @@ import cn.hutool.core.date.DateTime; import com.njcn.device.pq.pojo.po.DataV; import com.njcn.influx.deprecated.InfluxDBPublicParam; import com.njcn.influx.deprecated.InfluxDBSqlConstant; -import com.njcn.influx.deprecated.InfluxDbUtils; import com.njcn.influx.pojo.constant.InfluxDBTableConstant; import com.njcn.influx.pojo.po.DataFlicker; +import com.njcn.influx.utils.InfluxDbUtils; import com.njcn.prepare.harmonic.service.influxdb.DataIntegrityRateInfluxService; import com.njcn.prepare.harmonic.utils.PublicUtil; import lombok.RequiredArgsConstructor; diff --git a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/influxdb/impl/DataVInfluxdbServiceImpl.java b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/influxdb/impl/DataVInfluxdbServiceImpl.java index b9977cf2b..cd193fb1f 100644 --- a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/influxdb/impl/DataVInfluxdbServiceImpl.java +++ b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/influxdb/impl/DataVInfluxdbServiceImpl.java @@ -5,7 +5,7 @@ import com.google.common.base.Objects; import com.njcn.common.utils.NjcnBeanUtil; import com.njcn.device.pq.pojo.po.DataV; import com.njcn.influx.deprecated.InfluxDBPublicParam; -import com.njcn.influx.deprecated.InfluxDbUtils; +import com.njcn.influx.utils.InfluxDbUtils; import com.njcn.prepare.harmonic.pojo.dto.DataVFiveItemDTO; import com.njcn.prepare.harmonic.service.influxdb.DataVInfluxdbService; import lombok.RequiredArgsConstructor; diff --git a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/influxdb/impl/RStatWorkOrderCreateServiceImpl.java b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/influxdb/impl/RStatWorkOrderCreateServiceImpl.java index b49f0acc4..ad0c70477 100644 --- a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/influxdb/impl/RStatWorkOrderCreateServiceImpl.java +++ b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/influxdb/impl/RStatWorkOrderCreateServiceImpl.java @@ -3,9 +3,9 @@ package com.njcn.prepare.harmonic.service.influxdb.impl; import com.njcn.device.pms.api.MonitorClient; import com.njcn.device.biz.pojo.po.Overlimit; import com.njcn.influx.deprecated.InfluxDBPublicParam; -import com.njcn.influx.deprecated.InfluxDbUtils; import com.njcn.influx.pojo.po.DataI; import com.njcn.influx.pojo.po.DataV; +import com.njcn.influx.utils.InfluxDbUtils; import com.njcn.prepare.harmonic.pojo.dto.OverLimitFlagDTO; import com.njcn.prepare.harmonic.pojo.param.LineParam; import com.njcn.prepare.harmonic.service.influxdb.RStatWorkOrderCreateService; diff --git a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/device/DeviceAbnormaStatisticsServiceImpl.java b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/device/DeviceAbnormaStatisticsServiceImpl.java index a0dbdd775..77d8c6b34 100644 --- a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/device/DeviceAbnormaStatisticsServiceImpl.java +++ b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/device/DeviceAbnormaStatisticsServiceImpl.java @@ -3,8 +3,8 @@ package com.njcn.prepare.harmonic.service.mysql.Impl.device; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DateUtil; import com.njcn.influx.deprecated.InfluxDBPublicParam; -import com.njcn.influx.deprecated.InfluxDbUtils; import com.njcn.influx.pojo.po.PqsCommunicate; +import com.njcn.influx.utils.InfluxDbUtils; import com.njcn.prepare.harmonic.mapper.mysql.device.DeviceAbnormaStatisticsMapper; import com.njcn.prepare.harmonic.pojo.mysql.po.line.AlarmPO; import com.njcn.prepare.harmonic.pojo.mysql.po.line.AlarmStrategyVO; diff --git a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/DayDataServiceImpl.java b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/DayDataServiceImpl.java index 2eb68a1d8..4cee2b1d7 100644 --- a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/DayDataServiceImpl.java +++ b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/DayDataServiceImpl.java @@ -3,8 +3,8 @@ package com.njcn.prepare.harmonic.service.mysql.Impl.line; import com.njcn.harmonic.pojo.po.*; import com.njcn.harmonic.pojo.po.day.*; import com.njcn.influx.deprecated.InfluxDBPublicParam; -import com.njcn.influx.deprecated.InfluxDbUtils; import com.njcn.influx.pojo.po.*; +import com.njcn.influx.utils.InfluxDbUtils; import com.njcn.prepare.harmonic.constant.InfluxdbPOConverter; import com.njcn.prepare.harmonic.pojo.mysql.po.line.RMpFlickerReportDPO; import com.njcn.prepare.harmonic.pojo.mysql.po.line.RMpHarmonicPReportDPO; diff --git a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/DistortionRateServiceImpl.java b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/DistortionRateServiceImpl.java index 53fb52fc0..a99b3b755 100644 --- a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/DistortionRateServiceImpl.java +++ b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/DistortionRateServiceImpl.java @@ -5,8 +5,8 @@ import cn.hutool.core.date.LocalDateTimeUtil; import com.njcn.device.pq.api.LineFeignClient; import com.njcn.device.biz.pojo.po.Overlimit; import com.njcn.harmonic.pojo.po.RMpVThd; -import com.njcn.influx.deprecated.InfluxDbUtils; import com.njcn.influx.pojo.po.DataV; +import com.njcn.influx.utils.InfluxDbUtils; import com.njcn.prepare.harmonic.constant.AlgorithmParam; import com.njcn.prepare.harmonic.mapper.mysql.line.RMpVThdMapper; import com.njcn.prepare.harmonic.pojo.oracle.PqLinedetailPO; diff --git a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/HarmonicGeneralServiceImpl.java b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/HarmonicGeneralServiceImpl.java index 672c52c04..35e8fca53 100644 --- a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/HarmonicGeneralServiceImpl.java +++ b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/HarmonicGeneralServiceImpl.java @@ -6,9 +6,9 @@ import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; import com.njcn.device.pq.api.LineFeignClient; import com.njcn.device.biz.pojo.po.Overlimit; import com.njcn.harmonic.pojo.po.day.RStatComassesDPO; -import com.njcn.influx.deprecated.InfluxDbUtils; import com.njcn.influx.pojo.po.DataFlicker; import com.njcn.influx.pojo.po.DataV; +import com.njcn.influx.utils.InfluxDbUtils; import com.njcn.prepare.harmonic.mapper.mysql.day.RStatComassesDMapper; import com.njcn.prepare.harmonic.pojo.param.LineParam; import com.njcn.prepare.harmonic.service.mysql.line.HarmonicGeneralService; diff --git a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/HarmonicMetricServiceImpl.java b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/HarmonicMetricServiceImpl.java index a17d67845..5215f4e91 100644 --- a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/HarmonicMetricServiceImpl.java +++ b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/HarmonicMetricServiceImpl.java @@ -6,9 +6,9 @@ import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; import com.njcn.device.pq.api.LineFeignClient; import com.njcn.device.biz.pojo.po.Overlimit; import com.njcn.harmonic.pojo.po.day.RStatAssesDPO; -import com.njcn.influx.deprecated.InfluxDbUtils; import com.njcn.influx.pojo.po.DataPlt; import com.njcn.influx.pojo.po.DataV; +import com.njcn.influx.utils.InfluxDbUtils; import com.njcn.prepare.harmonic.mapper.mysql.day.RStatAssesDMapper; import com.njcn.prepare.harmonic.pojo.param.LineParam; import com.njcn.prepare.harmonic.service.mysql.line.HarmonicMetricService; diff --git a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/IntegrityServiceImpl.java b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/IntegrityServiceImpl.java index ff76600a2..0522480c1 100644 --- a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/IntegrityServiceImpl.java +++ b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/IntegrityServiceImpl.java @@ -9,8 +9,8 @@ import com.njcn.device.biz.pojo.param.DeptGetLineParam; import com.njcn.device.pq.api.LineFeignClient; import com.njcn.device.pq.pojo.po.RStatIntegrityD; import com.njcn.influx.deprecated.InfluxDBPublicParam; -import com.njcn.influx.deprecated.InfluxDbUtils; import com.njcn.influx.pojo.po.DataV; +import com.njcn.influx.utils.InfluxDbUtils; import com.njcn.prepare.harmonic.mapper.mysql.day.RStatIntegrityDMapper; import com.njcn.prepare.harmonic.pojo.param.LineParam; import com.njcn.prepare.harmonic.service.mysql.line.IntegrityService; diff --git a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/LimitRateService.java b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/LimitRateService.java index 8a9490d06..b3a169839 100644 --- a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/LimitRateService.java +++ b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/LimitRateService.java @@ -3,14 +3,13 @@ package com.njcn.prepare.harmonic.service.mysql.Impl.line; import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; import com.njcn.common.utils.NjcnBeanUtil; import com.njcn.device.biz.commApi.CommTerminalGeneralClient; -import com.njcn.device.pq.api.LineFeignClient; import com.njcn.device.biz.pojo.po.Overlimit; import com.njcn.harmonic.pojo.po.LimitRate; import com.njcn.harmonic.pojo.po.LimitRatePO; import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO; import com.njcn.influx.deprecated.InfluxDBPublicParam; -import com.njcn.influx.deprecated.InfluxDbUtils; import com.njcn.influx.pojo.po.*; +import com.njcn.influx.utils.InfluxDbUtils; import com.njcn.prepare.harmonic.mapper.mysql.line.LimitRatePOMapper; import com.njcn.prepare.harmonic.service.mysql.day.IRStatLimitRateDService; import lombok.AllArgsConstructor; diff --git a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/LimitTargetServiceImpl.java b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/LimitTargetServiceImpl.java index 7aea3444e..ea36e77ac 100644 --- a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/LimitTargetServiceImpl.java +++ b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/LimitTargetServiceImpl.java @@ -7,7 +7,7 @@ import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; import com.njcn.harmonic.pojo.po.LimitRate; import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO; import com.njcn.harmonic.pojo.po.day.RStatLimitTargetDPO; -import com.njcn.influx.deprecated.InfluxDbUtils; +import com.njcn.influx.utils.InfluxDbUtils; import com.njcn.prepare.harmonic.mapper.mysql.day.RStatLimitTargetDMapper; import com.njcn.prepare.harmonic.pojo.param.LineParam; import com.njcn.prepare.harmonic.service.mysql.day.IRStatLimitRateDService; diff --git a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/NormalLimitServiceImpl.java b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/NormalLimitServiceImpl.java index 8f3fee179..42bc05320 100644 --- a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/NormalLimitServiceImpl.java +++ b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/NormalLimitServiceImpl.java @@ -9,7 +9,7 @@ import com.njcn.device.pq.api.LineFeignClient; import com.njcn.device.pq.api.OverLimitClient; import com.njcn.harmonic.pojo.po.day.*; import com.njcn.influx.deprecated.InfluxDBPublicParam; -import com.njcn.influx.deprecated.InfluxDbUtils; +import com.njcn.influx.utils.InfluxDbUtils; import com.njcn.prepare.harmonic.mapper.mysql.day.*; import com.njcn.prepare.harmonic.mapper.mysql.line.AbnormalMapper; import com.njcn.prepare.harmonic.pojo.mysql.po.line.MpSurplusAbnormalD; @@ -28,7 +28,6 @@ import java.time.format.DateTimeFormatter; import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; -import java.util.stream.Stream; /** * @author denghuajun diff --git a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/OnlineRateServiceImpl.java b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/OnlineRateServiceImpl.java index 84ff63ad6..4259791b5 100644 --- a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/OnlineRateServiceImpl.java +++ b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/OnlineRateServiceImpl.java @@ -8,8 +8,8 @@ import com.njcn.device.pq.api.LineFeignClient; import com.njcn.device.pq.pojo.po.RStatOnlinerateD; import com.njcn.energy.pojo.constant.ModelState; import com.njcn.influx.deprecated.InfluxDBPublicParam; -import com.njcn.influx.deprecated.InfluxDbUtils; import com.njcn.influx.pojo.po.PqsCommunicate; +import com.njcn.influx.utils.InfluxDbUtils; import com.njcn.prepare.harmonic.mapper.mysql.day.RStatOnlineRateDMapper; import com.njcn.prepare.harmonic.pojo.dto.OnLineRateDTO; import com.njcn.prepare.harmonic.pojo.param.LineParam; diff --git a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/ReportServiceImpl.java b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/ReportServiceImpl.java index 5dbc6072f..6f5e36cce 100644 --- a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/ReportServiceImpl.java +++ b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/line/ReportServiceImpl.java @@ -22,8 +22,8 @@ import com.njcn.harmonic.pojo.po.ExcelRpt; import com.njcn.harmonic.pojo.po.ExcelRptTemp; import com.njcn.harmonic.pojo.po.SysDeptTemp; import com.njcn.influx.deprecated.InfluxDBSqlConstant; -import com.njcn.influx.deprecated.InfluxDbUtils; import com.njcn.influx.pojo.constant.InfluxDBTableConstant; +import com.njcn.influx.utils.InfluxDbUtils; import com.njcn.oss.constant.OssPath; import com.njcn.oss.utils.FileStorageUtil; import com.njcn.prepare.harmonic.constant.AlgorithmParam; diff --git a/pqs-prepare/prepare-boot/src/main/resources/bootstrap.yml b/pqs-prepare/prepare-boot/src/main/resources/bootstrap.yml index 21e2ed5c1..48561c101 100644 --- a/pqs-prepare/prepare-boot/src/main/resources/bootstrap.yml +++ b/pqs-prepare/prepare-boot/src/main/resources/bootstrap.yml @@ -36,6 +36,15 @@ spring: main: allow-bean-definition-overriding: true +liteflow: + rule-source-ext-data-map: + serverAddr: @nacos.url@ + dataId: prepare_liteflow + group: DEFAULT_GROUP + namespace: @nacos.namespace@ + username: nacos + password: nacos + #项目日志的配置 logging: diff --git a/pqs-process/process-boot/pom.xml b/pqs-process/process-boot/pom.xml index 85acd5733..b5ec27640 100644 --- a/pqs-process/process-boot/pom.xml +++ b/pqs-process/process-boot/pom.xml @@ -36,9 +36,8 @@ com.njcn - common-influxDB + pqs-influx ${project.version} - compile com.njcn @@ -50,7 +49,11 @@ pms-device-api ${project.version} - + + com.njcn + harmonic-api + ${project.version} + com.njcn system-api