diff --git a/pqs-common/common-core/src/main/java/com/njcn/common/pojo/constant/BizParamConstant.java b/pqs-common/common-core/src/main/java/com/njcn/common/pojo/constant/BizParamConstant.java
index 013225fb8..66f3b2013 100644
--- a/pqs-common/common-core/src/main/java/com/njcn/common/pojo/constant/BizParamConstant.java
+++ b/pqs-common/common-core/src/main/java/com/njcn/common/pojo/constant/BizParamConstant.java
@@ -11,7 +11,6 @@ public interface BizParamConstant {
* 前端查询时间类型
* 1年 2季度 3月份 4周 5日
*/
- String s = "测试jenkins打包";
String STAT_BIZ_YEAR = "1";
String STAT_BIZ_QUARTER = "2";
String STAT_BIZ_MONTH = "3";
diff --git a/pqs-common/common-core/src/main/java/com/njcn/common/pojo/enums/response/CommonResponseEnum.java b/pqs-common/common-core/src/main/java/com/njcn/common/pojo/enums/response/CommonResponseEnum.java
index 0883e1434..8c76b4785 100644
--- a/pqs-common/common-core/src/main/java/com/njcn/common/pojo/enums/response/CommonResponseEnum.java
+++ b/pqs-common/common-core/src/main/java/com/njcn/common/pojo/enums/response/CommonResponseEnum.java
@@ -66,7 +66,9 @@ public enum CommonResponseEnum {
REQUEST_EMPTY("A0027", "当前请求web环境为空"),
- EXPORT_FILE_ERROR("A00551","数据完整报表下载异常"),
+ EXPORT_FILE_ERROR("A0051","数据完整报表下载异常"),
+
+ PREPARE_RESPONSE_ENUM("A0089", "预处理响应枚举类型"),
USER_RESPONSE_ENUM("A0090", "用户响应枚举类型"),
diff --git a/pqs-harmonic/harmonic-api/pom.xml b/pqs-harmonic/harmonic-api/pom.xml
index f865a4f43..7648960b7 100644
--- a/pqs-harmonic/harmonic-api/pom.xml
+++ b/pqs-harmonic/harmonic-api/pom.xml
@@ -51,19 +51,17 @@
com.njcn
pqs-influx
- 0.0.1-SNAPSHOT
+ ${project.version}
com.njcn
pq-device-api
1.0.0
- compile
com.github.jeffreyning
mybatisplus-plus
1.5.1-RELEASE
- compile
diff --git a/pqs-influx/pom.xml b/pqs-influx/pom.xml
index 68a1cfb22..39c393ebe 100644
--- a/pqs-influx/pom.xml
+++ b/pqs-influx/pom.xml
@@ -8,7 +8,6 @@
1.0.0
pqs-influx
- 0.0.1-SNAPSHOT
influx公共模块
pqs-influx
diff --git a/pqs-influx/src/main/java/com/njcn/influx/PqsInfluxApplication.java b/pqs-influx/src/main/java/com/njcn/influx/PqsInfluxApplication.java
deleted file mode 100644
index e7375c650..000000000
--- a/pqs-influx/src/main/java/com/njcn/influx/PqsInfluxApplication.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.njcn.influx;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.annotation.DependsOn;
-
-@SpringBootApplication
-@DependsOn("proxyMapperRegister")
-public class PqsInfluxApplication {
-
- public static void main(String[] args) {
- SpringApplication.run(PqsInfluxApplication.class, args);
- }
-
-}
diff --git a/pqs-influx/src/main/java/com/njcn/influx/deprecated/InfluxDBPublicParam.java b/pqs-influx/src/main/java/com/njcn/influx/deprecated/InfluxDBPublicParam.java
new file mode 100644
index 000000000..c9e1619ee
--- /dev/null
+++ b/pqs-influx/src/main/java/com/njcn/influx/deprecated/InfluxDBPublicParam.java
@@ -0,0 +1,279 @@
+package com.njcn.influx.deprecated;
+
+/**
+ * 类的介绍:使用influxDB查询时的公共参数
+ *
+ * @author xuyang
+ * @version 1.0.0
+ * @createTime 2022/6/24 15:02
+ */
+@Deprecated
+public interface InfluxDBPublicParam {
+
+ /**
+ * 暂态事件汇总表
+ */
+ String PQS_EVENT_DETAIL = " pqs_eventdetail";
+
+ /**
+ * 电压波动闪变表
+ */
+ String DATA_FLICKER = "data_flicker";
+
+ /**
+ * 电压波动表
+ */
+ String DATA_FLUC = "data_fluc";
+
+ /**
+ * 谐波电流角度表
+ */
+ String DATA_HARM_PHASIC_I = "data_harmphasic_i";
+
+ /**
+ * 谐波电压角度表
+ */
+ String DATA_HARM_PHASIC_V = "data_harmphasic_v";
+
+ /**
+ * 有功功率表
+ */
+ String DATA_HARM_POWER_P = "data_harmpower_p";
+
+ /**
+ * 无功功率表
+ */
+ String DATA_HARM_POWER_Q = "data_harmpower_q";
+
+ /**
+ * 视在功率表
+ */
+ String DATA_HARM_POWER_S = "data_harmpower_s";
+
+ /**
+ * 谐波电流含有率表
+ */
+ String DATA_HARM_RATE_I = "data_harmrate_i";
+
+ /**
+ * 谐波电压含有率表
+ */
+ String DATA_HARM_RATE_V = "data_harmrate_v";
+
+ /**
+ * 电流表
+ */
+ String DATA_I = "data_i";
+
+ /**
+ * 电流间谐波幅值表
+ */
+ String DATA_IN_HARM_I = "data_inharm_i";
+
+ /**
+ * 电压间谐波幅值表
+ */
+ String DATA_IN_HARM_V = "data_inharm_v";
+
+ /**
+ * 长时闪变表
+ */
+ String DATA_PLT = "data_plt";
+
+ /**
+ * 电压表
+ */
+ String DATA_V = "data_v";
+
+ /**
+ * 日统计-电压波动闪变表
+ */
+ String DAY_FLICKER = "day_flicker";
+
+ /**
+ * 日统计-电压波动表
+ */
+ String DAY_FLUC = "day_fluc";
+
+ /**
+ * 日统计-谐波电流角度表
+ */
+ String DAY_HARM_PHASIC_I = "day_harmphasic_i";
+
+ /**
+ * 日统计-谐波电压角度表
+ */
+ String DAY_HARM_PHASIC_V = "day_harmphasic_v";
+
+ /**
+ * 日统计-有功功率表
+ */
+ String DAY_HARM_POWER_P = "day_harmpower_p";
+
+ /**
+ * 日统计-无功功率表
+ */
+ String DAY_HARM_POWER_Q = "day_harmpower_q";
+
+ /**
+ * 日统计-视在功率表
+ */
+ String DAY_HARM_POWER_S = "day_harmpower_s";
+
+ /**
+ * 日统计-谐波电流含有率表
+ */
+ String DAY_HARM_RATE_I = "day_harmrate_i";
+
+ /**
+ * 日统计-谐波电压含有率表
+ */
+ String DAY_HARM_RATE_V = "day_harmrate_v";
+
+ /**
+ * 日统计-电流表
+ */
+ String DAY_I = "day_i";
+
+ /**
+ * 日统计-电流间谐波幅值表
+ */
+ String DAY_IN_HARM_I = "day_inharm_i";
+
+ /**
+ * 日统计-电压间谐波幅值表
+ */
+ String DAY_IN_HARM_V = "day_inharm_v";
+
+ /**
+ * 日统计-长时闪变表
+ */
+ String DAY_PLT = "day_plt";
+
+ /**
+ * 日统计-电压表
+ */
+ String DAY_V = "day_v";
+
+ /**
+ * 时区
+ */
+ String TIME_ZONE = " tz('Asia/Shanghai')";
+
+ String TZ = "Asia/Shanghai";
+
+
+ /**
+ * 日起始时间
+ */
+ String START_TIME = " 00:00:00";
+
+ /**
+ * 日结束时间
+ */
+ String END_TIME = " 23:59:59";
+
+ /**
+ * 时间
+ */
+ String TIME = "time";
+
+ /**
+ * 数据线路号
+ */
+ String LINE_ID = "line_id";
+
+ /**
+ * 装置ID
+ */
+ String DEV_ID = "dev_id";
+
+ /**
+ * 数据类型
+ */
+ String PHASIC_TYPE = "phasic_type";
+
+ /**
+ * 指标类型
+ */
+ String VALUE_TYPE = "value_type";
+
+ /**
+ * 数据质量标志
+ */
+ String QUALITY_FLAG = "quality_flag";
+
+ /**
+ * limit_rate
+ */
+ String LIMIT_RATE = "limit_rate";
+
+ /**
+ * limit_target
+ */
+ String LIMIT_TARGET = "limit_target";
+
+ /**
+ * pqs_comasses
+ */
+ String PQS_COMASSES = "pqs_comasses";
+
+ /**
+ * 终端运维日志表
+ */
+ String PQS_TERMINAL_LOGS = "pqs_terminal_logs";
+
+ /**
+ * 监测点状态信息表
+ */
+ String PQS_COMMUNICATE = "pqs_communicate";
+
+ String PQS_ACTUAL_FLOW = "pqs_actual_flow";
+
+ String CLD_STATIS_FLOW = "cld_statis_flow";
+
+ /**
+ * 终端在线率表
+ */
+ String PQS_ONLINERATE = "pqs_onlinerate";
+
+ /**
+ * 数据完整性表
+ */
+ String PQS_INTEGRITY = "pqs_integrity";
+
+ /**
+ * 终端在线率表公共字段
+ */
+ String ONLINE_MIN = "online_min";
+
+ String OFFLINE_MIN = "offline_min";
+
+ String ONLINE_RATE = "online_rate";
+
+ /**
+ * data表中InfluxDBPublicParam
+ */
+ String VALUETYPE = "value_type";
+
+
+ /**
+ * 数据完整性表公共字段
+ */
+ String DUE = "due";
+
+ String REAL = "real";
+
+ String DEV_INDEX = "dev_id";
+
+ /**
+ * 稳态数据分析字段
+ */
+ String PHASIC_TYPET = "T";
+
+ /**
+ * 每天固定时间分钟
+ */
+ Integer DAY_MINUTE = 1440;
+
+}
diff --git a/pqs-influx/src/main/java/com/njcn/influx/deprecated/InfluxDBSqlConstant.java b/pqs-influx/src/main/java/com/njcn/influx/deprecated/InfluxDBSqlConstant.java
new file mode 100644
index 000000000..19f23de24
--- /dev/null
+++ b/pqs-influx/src/main/java/com/njcn/influx/deprecated/InfluxDBSqlConstant.java
@@ -0,0 +1,111 @@
+package com.njcn.influx.deprecated;
+
+import cn.hutool.core.text.StrPool;
+
+/**
+ * 拼接influx查询语句相关常量
+ *
+ * @author hongawen
+ * @version 1.0.0
+ * @date 2022年10月14日 14:02
+ */
+@Deprecated
+public interface InfluxDBSqlConstant {
+
+ /**
+ * "SELECT "
+ */
+ String SELECT = "SELECT" + StrPool.C_SPACE;
+
+ /**
+ * "* "
+ */
+ String ALL = "*" + StrPool.C_SPACE;
+
+ /**
+ * "FROM "
+ */
+ String FROM = "FROM" + StrPool.C_SPACE;
+
+ /**
+ * " WHERE "
+ */
+ String WHERE = StrPool.C_SPACE + "WHERE" + StrPool.C_SPACE;
+
+ /**
+ * " AND "
+ */
+ String AND = StrPool.C_SPACE + "AND" + StrPool.C_SPACE;
+
+ /**
+ * " OR "
+ */
+ String OR = StrPool.C_SPACE + "OR" + StrPool.C_SPACE;
+
+ /**
+ * " GROUP BY "
+ */
+ String GB = StrPool.C_SPACE + "GROUP BY" + StrPool.C_SPACE;
+
+ /**
+ * " ORDER BY "
+ */
+ String OB = StrPool.C_SPACE + "ORDER BY" + StrPool.C_SPACE;
+
+ /**
+ * “DESC ”
+ */
+ String DESC = "DESC" + StrPool.C_SPACE;
+
+ /**
+ * " as value "
+ */
+ String AS_VALUE = StrPool.C_SPACE + "as value" + StrPool.C_SPACE;
+
+ String EQ = "=";
+ String QM = "'";
+ String LBK = "(";
+ String RBK = ")";
+ String GT = ">";
+ String GE = ">=";
+ String LT = "<";
+ String LE = "<=";
+
+ /**
+ * influxDB函数拼接
+ */
+ String MAX = "MAX";
+ String MIN = "MIN";
+ String AVG = "MEAN";
+ String NUM_95 = ",95";
+ String CP95 = "PERCENTILE";
+
+ /**
+ * “ tz('Asia/Shanghai')”
+ */
+ String TZ = StrPool.C_SPACE + "tz('Asia/Shanghai')";
+ String TIME_AREA = "Asia/Shanghai";
+
+
+ /**
+ * 日起始时间
+ */
+ String START_TIME = " 00:00:00";
+
+ /**
+ * 日结束时间
+ */
+ String END_TIME = " 23:59:59";
+
+ /**
+ * 时间
+ */
+ String TIME = "time" + StrPool.C_SPACE;
+
+ /**
+ * 每天固定时间分钟
+ */
+ Integer DAY_MINUTE = 1440;
+
+
+}
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
new file mode 100644
index 000000000..00267b2d7
--- /dev/null
+++ b/pqs-influx/src/main/java/com/njcn/influx/deprecated/InfluxDbConfig.java
@@ -0,0 +1,33 @@
+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
new file mode 100644
index 000000000..d032d176b
--- /dev/null
+++ b/pqs-influx/src/main/java/com/njcn/influx/deprecated/InfluxDbUtils.java
@@ -0,0 +1,378 @@
+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