代码调整
This commit is contained in:
16
pom.xml
16
pom.xml
@@ -22,8 +22,7 @@
|
|||||||
<module>pqs-prepare</module>
|
<module>pqs-prepare</module>
|
||||||
<module>pqs-process</module>
|
<module>pqs-process</module>
|
||||||
<module>pqs-algorithm</module>
|
<module>pqs-algorithm</module>
|
||||||
|
<module>pqs-influx</module>
|
||||||
|
|
||||||
</modules>
|
</modules>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<name>灿能微服务生态系统</name>
|
<name>灿能微服务生态系统</name>
|
||||||
@@ -41,22 +40,17 @@
|
|||||||
</distributionManagement>
|
</distributionManagement>
|
||||||
<properties>
|
<properties>
|
||||||
<!--中间件目标地址-->
|
<!--中间件目标地址-->
|
||||||
<!-- <middle.server.url>198.120.100.195</middle.server.url>-->
|
<middle.server.url>192.168.1.13</middle.server.url>
|
||||||
<middle.server.url>192.168.1.18</middle.server.url>
|
|
||||||
<!--微服务模块发布地址-->
|
<!--微服务模块发布地址-->
|
||||||
<!-- <service.server.url>198.120.100.195</service.server.url>-->
|
<service.server.url>192.168.1.111</service.server.url>
|
||||||
<service.server.url>192.168.1.166</service.server.url>
|
|
||||||
<!--docker仓库地址-->
|
<!--docker仓库地址-->
|
||||||
<docker.server.url>192.168.1.13</docker.server.url>
|
<docker.server.url>192.168.1.31</docker.server.url>
|
||||||
<!--nacos的ip:port-->
|
<!--nacos的ip:port-->
|
||||||
<nacos.url>${middle.server.url}:18848</nacos.url>
|
<nacos.url>${middle.server.url}:18848</nacos.url>
|
||||||
<!--服务器发布内容为空-->
|
<!--服务器发布内容为空-->
|
||||||
<!-- <nacos.namespace></nacos.namespace>-->
|
<!-- <nacos.namespace></nacos.namespace>-->
|
||||||
<!-- <nacos.namespace>fd74182b-1fce-4dba-afa7-2623b0376205</nacos.namespace>-->
|
<nacos.namespace>fd74182b-1fce-4dba-afa7-2623b0376205</nacos.namespace>
|
||||||
<!-- <nacos.namespace>ba3ba5d1-3480-4755-8b87-6b1fce16201c</nacos.namespace>-->
|
|
||||||
<nacos.namespace>012fcc94-a4d4-4dff-a75a-396a1b997f25</nacos.namespace>
|
|
||||||
<!--sentinel:port-->
|
<!--sentinel:port-->
|
||||||
<!-- <sentinel.url>192.168.1.14:8080</sentinel.url>-->
|
|
||||||
<sentinel.url>${middle.server.url}:8080</sentinel.url>
|
<sentinel.url>${middle.server.url}:8080</sentinel.url>
|
||||||
<!--网关地址,主要用于配置swagger中认证token-->
|
<!--网关地址,主要用于配置swagger中认证token-->
|
||||||
<gateway.url>${service.server.url}:10215</gateway.url>
|
<gateway.url>${service.server.url}:10215</gateway.url>
|
||||||
|
|||||||
74
pqs-influx/pom.xml
Normal file
74
pqs-influx/pom.xml
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<artifactId>pqs</artifactId>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</parent>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>pqs-influx</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
<name>influx公共模块</name>
|
||||||
|
<description>pqs-influx</description>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>8</maven.compiler.source>
|
||||||
|
<maven.compiler.target>8</maven.compiler.target>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>influxdb-springboot-starter</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>com.squareup.okhttp3</groupId>
|
||||||
|
<artifactId>okhttp</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>com.squareup.okhttp3</groupId>
|
||||||
|
<artifactId>logging-interceptor</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.squareup.okhttp3</groupId>
|
||||||
|
<artifactId>okhttp</artifactId>
|
||||||
|
<version>4.9.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.squareup.okhttp3</groupId>
|
||||||
|
<artifactId>logging-interceptor</artifactId>
|
||||||
|
<version>4.9.0</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<finalName>njcn-influx</finalName>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.8.0</version>
|
||||||
|
<configuration>
|
||||||
|
<compilerArgument>-Xlint:unchecked</compilerArgument>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>repackage</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.njcn.influx.mapper;
|
||||||
|
|
||||||
|
import com.njcn.influx.base.InfluxDbBaseMapper;
|
||||||
|
import com.njcn.influx.pojo.po.CldStatisFlow;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2023年05月04日 20:50
|
||||||
|
*/
|
||||||
|
public interface CldStatisticsFlowMapper extends InfluxDbBaseMapper<CldStatisFlow>{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.njcn.influx.mapper;
|
||||||
|
|
||||||
|
import com.njcn.influx.base.InfluxDbBaseMapper;
|
||||||
|
import com.njcn.influx.pojo.dto.DataFlickerDTO;
|
||||||
|
import com.njcn.influx.pojo.po.DataFlicker;
|
||||||
|
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2023年05月05日 08:55
|
||||||
|
*/
|
||||||
|
public interface DataFlickerMapper extends InfluxDbBaseMapper<DataFlicker> {
|
||||||
|
|
||||||
|
List<DataFlickerDTO> getStatisticsByWraper(InfluxQueryWrapper influxQueryWrapper);
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.njcn.influx.mapper;
|
||||||
|
|
||||||
|
import com.njcn.influx.base.InfluxDbBaseMapper;
|
||||||
|
import com.njcn.influx.pojo.po.DataFluc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2023年05月05日 08:56
|
||||||
|
*/
|
||||||
|
public interface DataFlucMapper extends InfluxDbBaseMapper<DataFluc> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.njcn.influx.mapper;
|
||||||
|
|
||||||
|
import com.njcn.influx.base.InfluxDbBaseMapper;
|
||||||
|
import com.njcn.influx.pojo.po.DataHarmPhasicI;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2023年05月05日 08:56
|
||||||
|
*/
|
||||||
|
public interface DataHarmPhasicIMapper extends InfluxDbBaseMapper<DataHarmPhasicI> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.njcn.influx.mapper;
|
||||||
|
|
||||||
|
import com.njcn.influx.base.InfluxDbBaseMapper;
|
||||||
|
import com.njcn.influx.pojo.po.DataHarmPhasicV;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2023年05月05日 08:56
|
||||||
|
*/
|
||||||
|
public interface DataHarmPhasicVMapper extends InfluxDbBaseMapper<DataHarmPhasicV> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.njcn.influx.mapper;
|
||||||
|
|
||||||
|
import com.njcn.influx.base.InfluxDbBaseMapper;
|
||||||
|
import com.njcn.influx.pojo.po.DataHarmPowerP;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2023年05月05日 09:00
|
||||||
|
*/
|
||||||
|
public interface DataHarmPowerPMapper extends InfluxDbBaseMapper<DataHarmPowerP> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.njcn.influx.pojo.dto;
|
||||||
|
|
||||||
|
import com.njcn.influx.pojo.po.DataFlicker;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.influxdb.annotation.Measurement;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2023年05月05日 10:17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class DataFlickerDTO extends DataFlicker implements Serializable {
|
||||||
|
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.njcn.influx.pojo.po;
|
||||||
|
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.njcn.common.utils.serializer.InstantDateSerializer;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.influxdb.annotation.Column;
|
||||||
|
import org.influxdb.annotation.Measurement;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Measurement(name = "cld_statis_flow")
|
||||||
|
public class CldStatisFlow {
|
||||||
|
|
||||||
|
@Column(name="time")
|
||||||
|
@JsonSerialize(using = InstantDateSerializer.class)
|
||||||
|
private Instant time;
|
||||||
|
|
||||||
|
@Column(name="actual_value")
|
||||||
|
private Integer actualValue;
|
||||||
|
|
||||||
|
@Column(name="dev_id")
|
||||||
|
private String devId;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.njcn.influx.pojo.po;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.njcn.common.utils.serializer.InstantDateSerializer;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.influxdb.annotation.Column;
|
||||||
|
import org.influxdb.annotation.Measurement;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Measurement(name = "data_flicker")
|
||||||
|
public class DataFlicker {
|
||||||
|
|
||||||
|
@Column(name = "time")
|
||||||
|
@JsonSerialize(using = InstantDateSerializer.class)
|
||||||
|
private Instant time;
|
||||||
|
|
||||||
|
@Column(name = "fluc")
|
||||||
|
private Double fluc;
|
||||||
|
|
||||||
|
@Column(name = "line_id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@Column(name = "phasic_type")
|
||||||
|
private String phaseType;
|
||||||
|
|
||||||
|
@Column(name = "plt")
|
||||||
|
private Double plt;
|
||||||
|
|
||||||
|
@Column(name = "pst")
|
||||||
|
private Double pst;
|
||||||
|
|
||||||
|
@Column(name = "quality_flag")
|
||||||
|
private String qualityFlag;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.njcn.influx.pojo.po;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.njcn.common.utils.serializer.InstantDateSerializer;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.influxdb.annotation.Column;
|
||||||
|
import org.influxdb.annotation.Measurement;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Measurement(name = "data_fluc")
|
||||||
|
public class DataFluc {
|
||||||
|
|
||||||
|
@Column(name = "time")
|
||||||
|
@JsonSerialize(using = InstantDateSerializer.class)
|
||||||
|
private Instant time;
|
||||||
|
|
||||||
|
@Column(name = "fluc")
|
||||||
|
private Double fluc;
|
||||||
|
|
||||||
|
@Column(name = "fluccf")
|
||||||
|
private Double fluccf;
|
||||||
|
|
||||||
|
@Column(name = "line_id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@Column(name = "phasic_type")
|
||||||
|
private String phaseType;
|
||||||
|
|
||||||
|
@Column(name = "quality_flag")
|
||||||
|
private String qualityFlag;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,187 @@
|
|||||||
|
package com.njcn.influx.pojo.po;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.njcn.common.utils.serializer.InstantDateSerializer;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.influxdb.annotation.Column;
|
||||||
|
import org.influxdb.annotation.Measurement;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Measurement(name = "data_harmphasic_i")
|
||||||
|
public class DataHarmPhasicI {
|
||||||
|
|
||||||
|
@Column(name = "time")
|
||||||
|
@JsonSerialize(using = InstantDateSerializer.class)
|
||||||
|
private Instant time;
|
||||||
|
|
||||||
|
@Column(name = "line_id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@Column(name = "phasic_type")
|
||||||
|
private String phaseType;
|
||||||
|
|
||||||
|
@Column(name = "quality_flag")
|
||||||
|
private String qualityFlag;
|
||||||
|
|
||||||
|
@Column(name = "value_type")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
@Column(name = "i_1")
|
||||||
|
private Double i1;
|
||||||
|
|
||||||
|
@Column(name = "i_2")
|
||||||
|
private Double i2;
|
||||||
|
|
||||||
|
@Column(name = "i_3")
|
||||||
|
private Double i3;
|
||||||
|
|
||||||
|
@Column(name = "i_4")
|
||||||
|
private Double i4;
|
||||||
|
|
||||||
|
@Column(name = "i_5")
|
||||||
|
private Double i5;
|
||||||
|
|
||||||
|
@Column(name = "i_6")
|
||||||
|
private Double i6;
|
||||||
|
|
||||||
|
@Column(name = "i_7")
|
||||||
|
private Double i7;
|
||||||
|
|
||||||
|
@Column(name = "i_8")
|
||||||
|
private Double i8;
|
||||||
|
|
||||||
|
@Column(name = "i_9")
|
||||||
|
private Double i9;
|
||||||
|
|
||||||
|
@Column(name = "i_10")
|
||||||
|
private Double i10;
|
||||||
|
|
||||||
|
@Column(name = "i_11")
|
||||||
|
private Double i11;
|
||||||
|
|
||||||
|
@Column(name = "i_12")
|
||||||
|
private Double i12;
|
||||||
|
|
||||||
|
@Column(name = "i_13")
|
||||||
|
private Double i13;
|
||||||
|
|
||||||
|
@Column(name = "i_14")
|
||||||
|
private Double i14;
|
||||||
|
|
||||||
|
@Column(name = "i_15")
|
||||||
|
private Double i15;
|
||||||
|
|
||||||
|
@Column(name = "i_16")
|
||||||
|
private Double i16;
|
||||||
|
|
||||||
|
@Column(name = "i_17")
|
||||||
|
private Double i17;
|
||||||
|
|
||||||
|
@Column(name = "i_18")
|
||||||
|
private Double i18;
|
||||||
|
|
||||||
|
@Column(name = "i_19")
|
||||||
|
private Double i19;
|
||||||
|
|
||||||
|
@Column(name = "i_20")
|
||||||
|
private Double i20;
|
||||||
|
|
||||||
|
@Column(name = "i_21")
|
||||||
|
private Double i21;
|
||||||
|
|
||||||
|
@Column(name = "i_22")
|
||||||
|
private Double i22;
|
||||||
|
|
||||||
|
@Column(name = "i_23")
|
||||||
|
private Double i23;
|
||||||
|
|
||||||
|
@Column(name = "i_24")
|
||||||
|
private Double i24;
|
||||||
|
|
||||||
|
@Column(name = "i_25")
|
||||||
|
private Double i25;
|
||||||
|
|
||||||
|
@Column(name = "i_26")
|
||||||
|
private Double i26;
|
||||||
|
|
||||||
|
@Column(name = "i_27")
|
||||||
|
private Double i27;
|
||||||
|
|
||||||
|
@Column(name = "i_28")
|
||||||
|
private Double i28;
|
||||||
|
|
||||||
|
@Column(name = "i_29")
|
||||||
|
private Double i29;
|
||||||
|
|
||||||
|
@Column(name = "i_30")
|
||||||
|
private Double i30;
|
||||||
|
|
||||||
|
@Column(name = "i_31")
|
||||||
|
private Double i31;
|
||||||
|
|
||||||
|
@Column(name = "i_32")
|
||||||
|
private Double i32;
|
||||||
|
|
||||||
|
@Column(name = "i_33")
|
||||||
|
private Double i33;
|
||||||
|
|
||||||
|
@Column(name = "i_34")
|
||||||
|
private Double i34;
|
||||||
|
|
||||||
|
@Column(name = "i_35")
|
||||||
|
private Double i35;
|
||||||
|
|
||||||
|
@Column(name = "i_36")
|
||||||
|
private Double i36;
|
||||||
|
|
||||||
|
@Column(name = "i_37")
|
||||||
|
private Double i37;
|
||||||
|
|
||||||
|
@Column(name = "i_38")
|
||||||
|
private Double i38;
|
||||||
|
|
||||||
|
@Column(name = "i_39")
|
||||||
|
private Double i39;
|
||||||
|
|
||||||
|
@Column(name = "i_40")
|
||||||
|
private Double i40;
|
||||||
|
|
||||||
|
@Column(name = "i_41")
|
||||||
|
private Double i41;
|
||||||
|
|
||||||
|
@Column(name = "i_42")
|
||||||
|
private Double i42;
|
||||||
|
|
||||||
|
@Column(name = "i_43")
|
||||||
|
private Double i43;
|
||||||
|
|
||||||
|
@Column(name = "i_44")
|
||||||
|
private Double i44;
|
||||||
|
|
||||||
|
@Column(name = "i_45")
|
||||||
|
private Double i45;
|
||||||
|
|
||||||
|
@Column(name = "i_46")
|
||||||
|
private Double i46;
|
||||||
|
|
||||||
|
@Column(name = "i_47")
|
||||||
|
private Double i47;
|
||||||
|
|
||||||
|
@Column(name = "i_48")
|
||||||
|
private Double i48;
|
||||||
|
|
||||||
|
@Column(name = "i_49")
|
||||||
|
private Double i49;
|
||||||
|
|
||||||
|
@Column(name = "i_50")
|
||||||
|
private Double i50;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,188 @@
|
|||||||
|
package com.njcn.influx.pojo.po;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.njcn.common.utils.serializer.InstantDateSerializer;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.influxdb.annotation.Column;
|
||||||
|
import org.influxdb.annotation.Measurement;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/5/12 9:13
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Measurement(name = "data_harmphasic_v")
|
||||||
|
public class DataHarmPhasicV {
|
||||||
|
|
||||||
|
@Column(name = "time")
|
||||||
|
@JsonSerialize(using = InstantDateSerializer.class)
|
||||||
|
private Instant time;
|
||||||
|
|
||||||
|
@Column(name = "line_id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@Column(name = "phasic_type")
|
||||||
|
private String phaseType;
|
||||||
|
|
||||||
|
@Column(name = "quality_flag")
|
||||||
|
private String qualityFlag;
|
||||||
|
|
||||||
|
@Column(name = "value_type")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
@Column(name = "v_1")
|
||||||
|
private Double v1;
|
||||||
|
|
||||||
|
@Column(name = "v_2")
|
||||||
|
private Double v2;
|
||||||
|
|
||||||
|
@Column(name = "v_3")
|
||||||
|
private Double v3;
|
||||||
|
|
||||||
|
@Column(name = "v_4")
|
||||||
|
private Double v4;
|
||||||
|
|
||||||
|
@Column(name = "v_5")
|
||||||
|
private Double v5;
|
||||||
|
|
||||||
|
@Column(name = "v_6")
|
||||||
|
private Double v6;
|
||||||
|
|
||||||
|
@Column(name = "v_7")
|
||||||
|
private Double v7;
|
||||||
|
|
||||||
|
@Column(name = "v_8")
|
||||||
|
private Double v8;
|
||||||
|
|
||||||
|
@Column(name = "v_9")
|
||||||
|
private Double v9;
|
||||||
|
|
||||||
|
@Column(name = "v_10")
|
||||||
|
private Double v10;
|
||||||
|
|
||||||
|
@Column(name = "v_11")
|
||||||
|
private Double v11;
|
||||||
|
|
||||||
|
@Column(name = "v_12")
|
||||||
|
private Double v12;
|
||||||
|
|
||||||
|
@Column(name = "v_13")
|
||||||
|
private Double v13;
|
||||||
|
|
||||||
|
@Column(name = "v_14")
|
||||||
|
private Double v14;
|
||||||
|
|
||||||
|
@Column(name = "v_15")
|
||||||
|
private Double v15;
|
||||||
|
|
||||||
|
@Column(name = "v_16")
|
||||||
|
private Double v16;
|
||||||
|
|
||||||
|
@Column(name = "v_17")
|
||||||
|
private Double v17;
|
||||||
|
|
||||||
|
@Column(name = "v_18")
|
||||||
|
private Double v18;
|
||||||
|
|
||||||
|
@Column(name = "v_19")
|
||||||
|
private Double v19;
|
||||||
|
|
||||||
|
@Column(name = "v_20")
|
||||||
|
private Double v20;
|
||||||
|
|
||||||
|
@Column(name = "v_21")
|
||||||
|
private Double v21;
|
||||||
|
|
||||||
|
@Column(name = "v_22")
|
||||||
|
private Double v22;
|
||||||
|
|
||||||
|
@Column(name = "v_23")
|
||||||
|
private Double v23;
|
||||||
|
|
||||||
|
@Column(name = "v_24")
|
||||||
|
private Double v24;
|
||||||
|
|
||||||
|
@Column(name = "v_25")
|
||||||
|
private Double v25;
|
||||||
|
|
||||||
|
@Column(name = "v_26")
|
||||||
|
private Double v26;
|
||||||
|
|
||||||
|
@Column(name = "v_27")
|
||||||
|
private Double v27;
|
||||||
|
|
||||||
|
@Column(name = "v_28")
|
||||||
|
private Double v28;
|
||||||
|
|
||||||
|
@Column(name = "v_29")
|
||||||
|
private Double v29;
|
||||||
|
|
||||||
|
@Column(name = "v_30")
|
||||||
|
private Double v30;
|
||||||
|
|
||||||
|
@Column(name = "v_31")
|
||||||
|
private Double v31;
|
||||||
|
|
||||||
|
@Column(name = "v_32")
|
||||||
|
private Double v32;
|
||||||
|
|
||||||
|
@Column(name = "v_33")
|
||||||
|
private Double v33;
|
||||||
|
|
||||||
|
@Column(name = "v_34")
|
||||||
|
private Double v34;
|
||||||
|
|
||||||
|
@Column(name = "v_35")
|
||||||
|
private Double v35;
|
||||||
|
|
||||||
|
@Column(name = "v_36")
|
||||||
|
private Double v36;
|
||||||
|
|
||||||
|
@Column(name = "v_37")
|
||||||
|
private Double v37;
|
||||||
|
|
||||||
|
@Column(name = "v_38")
|
||||||
|
private Double v38;
|
||||||
|
|
||||||
|
@Column(name = "v_39")
|
||||||
|
private Double v39;
|
||||||
|
|
||||||
|
@Column(name = "v_40")
|
||||||
|
private Double v40;
|
||||||
|
|
||||||
|
@Column(name = "v_41")
|
||||||
|
private Double v41;
|
||||||
|
|
||||||
|
@Column(name = "v_42")
|
||||||
|
private Double v42;
|
||||||
|
|
||||||
|
@Column(name = "v_43")
|
||||||
|
private Double v43;
|
||||||
|
|
||||||
|
@Column(name = "v_44")
|
||||||
|
private Double v44;
|
||||||
|
|
||||||
|
@Column(name = "v_45")
|
||||||
|
private Double v45;
|
||||||
|
|
||||||
|
@Column(name = "v_46")
|
||||||
|
private Double v46;
|
||||||
|
|
||||||
|
@Column(name = "v_47")
|
||||||
|
private Double v47;
|
||||||
|
|
||||||
|
@Column(name = "v_48")
|
||||||
|
private Double v48;
|
||||||
|
|
||||||
|
@Column(name = "v_49")
|
||||||
|
private Double v49;
|
||||||
|
|
||||||
|
@Column(name = "v_50")
|
||||||
|
private Double v50;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,196 @@
|
|||||||
|
package com.njcn.influx.pojo.po;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.njcn.common.utils.serializer.InstantDateSerializer;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.influxdb.annotation.Column;
|
||||||
|
import org.influxdb.annotation.Measurement;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/5/12 9:13
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Measurement(name = "data_harmpower_p")
|
||||||
|
public class DataHarmPowerP {
|
||||||
|
|
||||||
|
@Column(name = "time")
|
||||||
|
@JsonSerialize(using = InstantDateSerializer.class)
|
||||||
|
private Instant time;
|
||||||
|
|
||||||
|
@Column(name = "line_id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@Column(name = "phasic_type")
|
||||||
|
private String phaseType;
|
||||||
|
|
||||||
|
@Column(name = "quality_flag")
|
||||||
|
private String qualityFlag;
|
||||||
|
|
||||||
|
@Column(name = "value_type")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
@Column(name = "df")
|
||||||
|
private Double df;
|
||||||
|
|
||||||
|
@Column(name = "pf")
|
||||||
|
private Double pf;
|
||||||
|
|
||||||
|
@Column(name = "p")
|
||||||
|
private Double p;
|
||||||
|
|
||||||
|
@Column(name = "p_1")
|
||||||
|
private Double p1;
|
||||||
|
|
||||||
|
@Column(name = "p_2")
|
||||||
|
private Double p2;
|
||||||
|
|
||||||
|
@Column(name = "p_3")
|
||||||
|
private Double p3;
|
||||||
|
|
||||||
|
@Column(name = "p_4")
|
||||||
|
private Double p4;
|
||||||
|
|
||||||
|
@Column(name = "p_5")
|
||||||
|
private Double p5;
|
||||||
|
|
||||||
|
@Column(name = "p_6")
|
||||||
|
private Double p6;
|
||||||
|
|
||||||
|
@Column(name = "p_7")
|
||||||
|
private Double p7;
|
||||||
|
|
||||||
|
@Column(name = "p_8")
|
||||||
|
private Double p8;
|
||||||
|
|
||||||
|
@Column(name = "p_9")
|
||||||
|
private Double p9;
|
||||||
|
|
||||||
|
@Column(name = "p_10")
|
||||||
|
private Double p10;
|
||||||
|
|
||||||
|
@Column(name = "p_11")
|
||||||
|
private Double p11;
|
||||||
|
|
||||||
|
@Column(name = "p_12")
|
||||||
|
private Double p12;
|
||||||
|
|
||||||
|
@Column(name = "p_13")
|
||||||
|
private Double p13;
|
||||||
|
|
||||||
|
@Column(name = "p_14")
|
||||||
|
private Double p14;
|
||||||
|
|
||||||
|
@Column(name = "p_15")
|
||||||
|
private Double p15;
|
||||||
|
|
||||||
|
@Column(name = "p_16")
|
||||||
|
private Double p16;
|
||||||
|
|
||||||
|
@Column(name = "p_17")
|
||||||
|
private Double p17;
|
||||||
|
|
||||||
|
@Column(name = "p_18")
|
||||||
|
private Double p18;
|
||||||
|
|
||||||
|
@Column(name = "p_19")
|
||||||
|
private Double p19;
|
||||||
|
|
||||||
|
@Column(name = "p_20")
|
||||||
|
private Double p20;
|
||||||
|
|
||||||
|
@Column(name = "p_21")
|
||||||
|
private Double p21;
|
||||||
|
|
||||||
|
@Column(name = "p_22")
|
||||||
|
private Double p22;
|
||||||
|
|
||||||
|
@Column(name = "p_23")
|
||||||
|
private Double p23;
|
||||||
|
|
||||||
|
@Column(name = "p_24")
|
||||||
|
private Double p24;
|
||||||
|
|
||||||
|
@Column(name = "p_25")
|
||||||
|
private Double p25;
|
||||||
|
|
||||||
|
@Column(name = "p_26")
|
||||||
|
private Double p26;
|
||||||
|
|
||||||
|
@Column(name = "p_27")
|
||||||
|
private Double p27;
|
||||||
|
|
||||||
|
@Column(name = "p_28")
|
||||||
|
private Double p28;
|
||||||
|
|
||||||
|
@Column(name = "p_29")
|
||||||
|
private Double p29;
|
||||||
|
|
||||||
|
@Column(name = "p_30")
|
||||||
|
private Double p30;
|
||||||
|
|
||||||
|
@Column(name = "p_31")
|
||||||
|
private Double p31;
|
||||||
|
|
||||||
|
@Column(name = "p_32")
|
||||||
|
private Double p32;
|
||||||
|
|
||||||
|
@Column(name = "p_33")
|
||||||
|
private Double p33;
|
||||||
|
|
||||||
|
@Column(name = "p_34")
|
||||||
|
private Double p34;
|
||||||
|
|
||||||
|
@Column(name = "p_35")
|
||||||
|
private Double p35;
|
||||||
|
|
||||||
|
@Column(name = "p_36")
|
||||||
|
private Double p36;
|
||||||
|
|
||||||
|
@Column(name = "p_37")
|
||||||
|
private Double p37;
|
||||||
|
|
||||||
|
@Column(name = "p_38")
|
||||||
|
private Double p38;
|
||||||
|
|
||||||
|
@Column(name = "p_39")
|
||||||
|
private Double p39;
|
||||||
|
|
||||||
|
@Column(name = "p_40")
|
||||||
|
private Double p40;
|
||||||
|
|
||||||
|
@Column(name = "p_41")
|
||||||
|
private Double p41;
|
||||||
|
|
||||||
|
@Column(name = "p_42")
|
||||||
|
private Double p42;
|
||||||
|
|
||||||
|
@Column(name = "p_43")
|
||||||
|
private Double p43;
|
||||||
|
|
||||||
|
@Column(name = "p_44")
|
||||||
|
private Double p44;
|
||||||
|
|
||||||
|
@Column(name = "p_45")
|
||||||
|
private Double p45;
|
||||||
|
|
||||||
|
@Column(name = "p_46")
|
||||||
|
private Double p46;
|
||||||
|
|
||||||
|
@Column(name = "p_47")
|
||||||
|
private Double p47;
|
||||||
|
|
||||||
|
@Column(name = "p_48")
|
||||||
|
private Double p48;
|
||||||
|
|
||||||
|
@Column(name = "p_49")
|
||||||
|
private Double p49;
|
||||||
|
|
||||||
|
@Column(name = "p_50")
|
||||||
|
private Double p50;
|
||||||
|
}
|
||||||
@@ -0,0 +1,191 @@
|
|||||||
|
package com.njcn.influx.pojo.po;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.njcn.common.utils.serializer.InstantDateSerializer;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.influxdb.annotation.Column;
|
||||||
|
import org.influxdb.annotation.Measurement;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/5/12 9:13
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Measurement(name = "data_harmpower_q")
|
||||||
|
public class DataHarmPowerQ {
|
||||||
|
|
||||||
|
@Column(name = "time")
|
||||||
|
@JsonSerialize(using = InstantDateSerializer.class)
|
||||||
|
private Instant time;
|
||||||
|
|
||||||
|
@Column(name = "line_id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@Column(name = "phasic_type")
|
||||||
|
private String phaseType;
|
||||||
|
|
||||||
|
@Column(name = "quality_flag")
|
||||||
|
private String qualityFlag;
|
||||||
|
|
||||||
|
@Column(name = "value_type")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
@Column(name = "q")
|
||||||
|
private Double q;
|
||||||
|
|
||||||
|
@Column(name = "q_1")
|
||||||
|
private Double q1;
|
||||||
|
|
||||||
|
@Column(name = "q_2")
|
||||||
|
private Double q2;
|
||||||
|
|
||||||
|
@Column(name = "q_3")
|
||||||
|
private Double q3;
|
||||||
|
|
||||||
|
@Column(name = "q_4")
|
||||||
|
private Double q4;
|
||||||
|
|
||||||
|
@Column(name = "q_5")
|
||||||
|
private Double q5;
|
||||||
|
|
||||||
|
@Column(name = "q_6")
|
||||||
|
private Double q6;
|
||||||
|
|
||||||
|
@Column(name = "q_7")
|
||||||
|
private Double q7;
|
||||||
|
|
||||||
|
@Column(name = "q_8")
|
||||||
|
private Double q8;
|
||||||
|
|
||||||
|
@Column(name = "q_9")
|
||||||
|
private Double q9;
|
||||||
|
|
||||||
|
@Column(name = "q_10")
|
||||||
|
private Double q10;
|
||||||
|
|
||||||
|
@Column(name = "q_11")
|
||||||
|
private Double q11;
|
||||||
|
|
||||||
|
@Column(name = "q_12")
|
||||||
|
private Double q12;
|
||||||
|
|
||||||
|
@Column(name = "q_13")
|
||||||
|
private Double q13;
|
||||||
|
|
||||||
|
@Column(name = "q_14")
|
||||||
|
private Double q14;
|
||||||
|
|
||||||
|
@Column(name = "q_15")
|
||||||
|
private Double q15;
|
||||||
|
|
||||||
|
@Column(name = "q_16")
|
||||||
|
private Double q16;
|
||||||
|
|
||||||
|
@Column(name = "q_17")
|
||||||
|
private Double q17;
|
||||||
|
|
||||||
|
@Column(name = "q_18")
|
||||||
|
private Double q18;
|
||||||
|
|
||||||
|
@Column(name = "q_19")
|
||||||
|
private Double q19;
|
||||||
|
|
||||||
|
@Column(name = "q_20")
|
||||||
|
private Double q20;
|
||||||
|
|
||||||
|
@Column(name = "q_21")
|
||||||
|
private Double q21;
|
||||||
|
|
||||||
|
@Column(name = "q_22")
|
||||||
|
private Double q22;
|
||||||
|
|
||||||
|
@Column(name = "q_23")
|
||||||
|
private Double q23;
|
||||||
|
|
||||||
|
@Column(name = "q_24")
|
||||||
|
private Double q24;
|
||||||
|
|
||||||
|
@Column(name = "q_25")
|
||||||
|
private Double q25;
|
||||||
|
|
||||||
|
@Column(name = "q_26")
|
||||||
|
private Double q26;
|
||||||
|
|
||||||
|
@Column(name = "q_27")
|
||||||
|
private Double q27;
|
||||||
|
|
||||||
|
@Column(name = "q_28")
|
||||||
|
private Double q28;
|
||||||
|
|
||||||
|
@Column(name = "q_29")
|
||||||
|
private Double q29;
|
||||||
|
|
||||||
|
@Column(name = "q_30")
|
||||||
|
private Double q30;
|
||||||
|
|
||||||
|
@Column(name = "q_31")
|
||||||
|
private Double q31;
|
||||||
|
|
||||||
|
@Column(name = "q_32")
|
||||||
|
private Double q32;
|
||||||
|
|
||||||
|
@Column(name = "q_33")
|
||||||
|
private Double q33;
|
||||||
|
|
||||||
|
@Column(name = "q_34")
|
||||||
|
private Double q34;
|
||||||
|
|
||||||
|
@Column(name = "q_35")
|
||||||
|
private Double q35;
|
||||||
|
|
||||||
|
@Column(name = "q_36")
|
||||||
|
private Double q36;
|
||||||
|
|
||||||
|
@Column(name = "q_37")
|
||||||
|
private Double q37;
|
||||||
|
|
||||||
|
@Column(name = "q_38")
|
||||||
|
private Double q38;
|
||||||
|
|
||||||
|
@Column(name = "q_39")
|
||||||
|
private Double q39;
|
||||||
|
|
||||||
|
@Column(name = "q_40")
|
||||||
|
private Double q40;
|
||||||
|
|
||||||
|
@Column(name = "q_41")
|
||||||
|
private Double q41;
|
||||||
|
|
||||||
|
@Column(name = "q_42")
|
||||||
|
private Double q42;
|
||||||
|
|
||||||
|
@Column(name = "q_43")
|
||||||
|
private Double q43;
|
||||||
|
|
||||||
|
@Column(name = "q_44")
|
||||||
|
private Double q44;
|
||||||
|
|
||||||
|
@Column(name = "q_45")
|
||||||
|
private Double q45;
|
||||||
|
|
||||||
|
@Column(name = "q_46")
|
||||||
|
private Double q46;
|
||||||
|
|
||||||
|
@Column(name = "q_47")
|
||||||
|
private Double q47;
|
||||||
|
|
||||||
|
@Column(name = "q_48")
|
||||||
|
private Double q48;
|
||||||
|
|
||||||
|
@Column(name = "q_49")
|
||||||
|
private Double q49;
|
||||||
|
|
||||||
|
@Column(name = "q_50")
|
||||||
|
private Double q50;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,191 @@
|
|||||||
|
package com.njcn.influx.pojo.po;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.njcn.common.utils.serializer.InstantDateSerializer;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.influxdb.annotation.Column;
|
||||||
|
import org.influxdb.annotation.Measurement;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/5/12 9:13
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Measurement(name = "data_harmpower_s")
|
||||||
|
public class DataHarmPowerS {
|
||||||
|
|
||||||
|
@Column(name = "time")
|
||||||
|
@JsonSerialize(using = InstantDateSerializer.class)
|
||||||
|
private Instant time;
|
||||||
|
|
||||||
|
@Column(name = "line_id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@Column(name = "phasic_type")
|
||||||
|
private String phaseType;
|
||||||
|
|
||||||
|
@Column(name = "quality_flag")
|
||||||
|
private String qualityFlag;
|
||||||
|
|
||||||
|
@Column(name = "value_type")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
@Column(name = "s")
|
||||||
|
private Double s;
|
||||||
|
|
||||||
|
@Column(name = "s_1")
|
||||||
|
private Double s1;
|
||||||
|
|
||||||
|
@Column(name = "s_2")
|
||||||
|
private Double s2;
|
||||||
|
|
||||||
|
@Column(name = "s_3")
|
||||||
|
private Double s3;
|
||||||
|
|
||||||
|
@Column(name = "s_4")
|
||||||
|
private Double s4;
|
||||||
|
|
||||||
|
@Column(name = "s_5")
|
||||||
|
private Double s5;
|
||||||
|
|
||||||
|
@Column(name = "s_6")
|
||||||
|
private Double s6;
|
||||||
|
|
||||||
|
@Column(name = "s_7")
|
||||||
|
private Double s7;
|
||||||
|
|
||||||
|
@Column(name = "s_8")
|
||||||
|
private Double s8;
|
||||||
|
|
||||||
|
@Column(name = "s_9")
|
||||||
|
private Double s9;
|
||||||
|
|
||||||
|
@Column(name = "s_10")
|
||||||
|
private Double s10;
|
||||||
|
|
||||||
|
@Column(name = "s_11")
|
||||||
|
private Double s11;
|
||||||
|
|
||||||
|
@Column(name = "s_12")
|
||||||
|
private Double s12;
|
||||||
|
|
||||||
|
@Column(name = "s_13")
|
||||||
|
private Double s13;
|
||||||
|
|
||||||
|
@Column(name = "s_14")
|
||||||
|
private Double s14;
|
||||||
|
|
||||||
|
@Column(name = "s_15")
|
||||||
|
private Double s15;
|
||||||
|
|
||||||
|
@Column(name = "s_16")
|
||||||
|
private Double s16;
|
||||||
|
|
||||||
|
@Column(name = "s_17")
|
||||||
|
private Double s17;
|
||||||
|
|
||||||
|
@Column(name = "s_18")
|
||||||
|
private Double s18;
|
||||||
|
|
||||||
|
@Column(name = "s_19")
|
||||||
|
private Double s19;
|
||||||
|
|
||||||
|
@Column(name = "s_20")
|
||||||
|
private Double s20;
|
||||||
|
|
||||||
|
@Column(name = "s_21")
|
||||||
|
private Double s21;
|
||||||
|
|
||||||
|
@Column(name = "s_22")
|
||||||
|
private Double s22;
|
||||||
|
|
||||||
|
@Column(name = "s_23")
|
||||||
|
private Double s23;
|
||||||
|
|
||||||
|
@Column(name = "s_24")
|
||||||
|
private Double s24;
|
||||||
|
|
||||||
|
@Column(name = "s_25")
|
||||||
|
private Double s25;
|
||||||
|
|
||||||
|
@Column(name = "s_26")
|
||||||
|
private Double s26;
|
||||||
|
|
||||||
|
@Column(name = "s_27")
|
||||||
|
private Double s27;
|
||||||
|
|
||||||
|
@Column(name = "s_28")
|
||||||
|
private Double s28;
|
||||||
|
|
||||||
|
@Column(name = "s_29")
|
||||||
|
private Double s29;
|
||||||
|
|
||||||
|
@Column(name = "s_30")
|
||||||
|
private Double s30;
|
||||||
|
|
||||||
|
@Column(name = "s_31")
|
||||||
|
private Double s31;
|
||||||
|
|
||||||
|
@Column(name = "s_32")
|
||||||
|
private Double s32;
|
||||||
|
|
||||||
|
@Column(name = "s_33")
|
||||||
|
private Double s33;
|
||||||
|
|
||||||
|
@Column(name = "s_34")
|
||||||
|
private Double s34;
|
||||||
|
|
||||||
|
@Column(name = "s_35")
|
||||||
|
private Double s35;
|
||||||
|
|
||||||
|
@Column(name = "s_36")
|
||||||
|
private Double s36;
|
||||||
|
|
||||||
|
@Column(name = "s_37")
|
||||||
|
private Double s37;
|
||||||
|
|
||||||
|
@Column(name = "s_38")
|
||||||
|
private Double s38;
|
||||||
|
|
||||||
|
@Column(name = "s_39")
|
||||||
|
private Double s39;
|
||||||
|
|
||||||
|
@Column(name = "s_40")
|
||||||
|
private Double s40;
|
||||||
|
|
||||||
|
@Column(name = "s_41")
|
||||||
|
private Double s41;
|
||||||
|
|
||||||
|
@Column(name = "s_42")
|
||||||
|
private Double s42;
|
||||||
|
|
||||||
|
@Column(name = "s_43")
|
||||||
|
private Double s43;
|
||||||
|
|
||||||
|
@Column(name = "s_44")
|
||||||
|
private Double s44;
|
||||||
|
|
||||||
|
@Column(name = "s_45")
|
||||||
|
private Double s45;
|
||||||
|
|
||||||
|
@Column(name = "s_46")
|
||||||
|
private Double s46;
|
||||||
|
|
||||||
|
@Column(name = "s_47")
|
||||||
|
private Double s47;
|
||||||
|
|
||||||
|
@Column(name = "s_48")
|
||||||
|
private Double s48;
|
||||||
|
|
||||||
|
@Column(name = "s_49")
|
||||||
|
private Double s49;
|
||||||
|
|
||||||
|
@Column(name = "s_50")
|
||||||
|
private Double s50;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.njcn.influx.pojo.po;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.influxdb.annotation.Measurement;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/5/12 11:27
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@Measurement(name = "data_harmrate_i")
|
||||||
|
public class DataHarmRateI extends DataHarmPhasicI{
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.njcn.influx.pojo.po;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.influxdb.annotation.Measurement;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/5/12 11:27
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@Measurement(name = "data_harmrate_v")
|
||||||
|
public class DataHarmRateV extends DataHarmPhasicV{
|
||||||
|
}
|
||||||
206
pqs-influx/src/main/java/com/njcn/influx/pojo/po/DataI.java
Normal file
206
pqs-influx/src/main/java/com/njcn/influx/pojo/po/DataI.java
Normal file
@@ -0,0 +1,206 @@
|
|||||||
|
package com.njcn.influx.pojo.po;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.njcn.common.utils.serializer.InstantDateSerializer;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.influxdb.annotation.Column;
|
||||||
|
import org.influxdb.annotation.Measurement;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/5/11 15:13
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Measurement(name = "data_i")
|
||||||
|
public class DataI {
|
||||||
|
|
||||||
|
@Column(name = "time")
|
||||||
|
@JsonSerialize(using = InstantDateSerializer.class)
|
||||||
|
private Instant time;
|
||||||
|
|
||||||
|
@Column(name = "line_id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@Column(name = "phasic_type")
|
||||||
|
private String phaseType;
|
||||||
|
|
||||||
|
@Column(name = "quality_flag")
|
||||||
|
private String qualityFlag;
|
||||||
|
|
||||||
|
@Column(name = "value_type")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
@Column(name = "i_neg")
|
||||||
|
private Double iNeg;
|
||||||
|
|
||||||
|
@Column(name = "i_pos")
|
||||||
|
private Double iPos;
|
||||||
|
|
||||||
|
@Column(name = "i_thd")
|
||||||
|
private Double iThd;
|
||||||
|
|
||||||
|
@Column(name = "i_unbalance")
|
||||||
|
private Double iUnbalance;
|
||||||
|
|
||||||
|
@Column(name = "i_zero")
|
||||||
|
private Double iZero;
|
||||||
|
|
||||||
|
@Column(name = "rms")
|
||||||
|
private Double rms;
|
||||||
|
|
||||||
|
@Column(name = "i_1")
|
||||||
|
private Double i1;
|
||||||
|
|
||||||
|
@Column(name = "i_2")
|
||||||
|
private Double i2;
|
||||||
|
|
||||||
|
@Column(name = "i_3")
|
||||||
|
private Double i3;
|
||||||
|
|
||||||
|
@Column(name = "i_4")
|
||||||
|
private Double i4;
|
||||||
|
|
||||||
|
@Column(name = "i_5")
|
||||||
|
private Double i5;
|
||||||
|
|
||||||
|
@Column(name = "i_6")
|
||||||
|
private Double i6;
|
||||||
|
|
||||||
|
@Column(name = "i_7")
|
||||||
|
private Double i7;
|
||||||
|
|
||||||
|
@Column(name = "i_8")
|
||||||
|
private Double i8;
|
||||||
|
|
||||||
|
@Column(name = "i_9")
|
||||||
|
private Double i9;
|
||||||
|
|
||||||
|
@Column(name = "i_10")
|
||||||
|
private Double i10;
|
||||||
|
|
||||||
|
@Column(name = "i_11")
|
||||||
|
private Double i11;
|
||||||
|
|
||||||
|
@Column(name = "i_12")
|
||||||
|
private Double i12;
|
||||||
|
|
||||||
|
@Column(name = "i_13")
|
||||||
|
private Double i13;
|
||||||
|
|
||||||
|
@Column(name = "i_14")
|
||||||
|
private Double i14;
|
||||||
|
|
||||||
|
@Column(name = "i_15")
|
||||||
|
private Double i15;
|
||||||
|
|
||||||
|
@Column(name = "i_16")
|
||||||
|
private Double i16;
|
||||||
|
|
||||||
|
@Column(name = "i_17")
|
||||||
|
private Double i17;
|
||||||
|
|
||||||
|
@Column(name = "i_18")
|
||||||
|
private Double i18;
|
||||||
|
|
||||||
|
@Column(name = "i_19")
|
||||||
|
private Double i19;
|
||||||
|
|
||||||
|
@Column(name = "i_20")
|
||||||
|
private Double i20;
|
||||||
|
|
||||||
|
@Column(name = "i_21")
|
||||||
|
private Double i21;
|
||||||
|
|
||||||
|
@Column(name = "i_22")
|
||||||
|
private Double i22;
|
||||||
|
|
||||||
|
@Column(name = "i_23")
|
||||||
|
private Double i23;
|
||||||
|
|
||||||
|
@Column(name = "i_24")
|
||||||
|
private Double i24;
|
||||||
|
|
||||||
|
@Column(name = "i_25")
|
||||||
|
private Double i25;
|
||||||
|
|
||||||
|
@Column(name = "i_26")
|
||||||
|
private Double i26;
|
||||||
|
|
||||||
|
@Column(name = "i_27")
|
||||||
|
private Double i27;
|
||||||
|
|
||||||
|
@Column(name = "i_28")
|
||||||
|
private Double i28;
|
||||||
|
|
||||||
|
@Column(name = "i_29")
|
||||||
|
private Double i29;
|
||||||
|
|
||||||
|
@Column(name = "i_30")
|
||||||
|
private Double i30;
|
||||||
|
|
||||||
|
@Column(name = "i_31")
|
||||||
|
private Double i31;
|
||||||
|
|
||||||
|
@Column(name = "i_32")
|
||||||
|
private Double i32;
|
||||||
|
|
||||||
|
@Column(name = "i_33")
|
||||||
|
private Double i33;
|
||||||
|
|
||||||
|
@Column(name = "i_34")
|
||||||
|
private Double i34;
|
||||||
|
|
||||||
|
@Column(name = "i_35")
|
||||||
|
private Double i35;
|
||||||
|
|
||||||
|
@Column(name = "i_36")
|
||||||
|
private Double i36;
|
||||||
|
|
||||||
|
@Column(name = "i_37")
|
||||||
|
private Double i37;
|
||||||
|
|
||||||
|
@Column(name = "i_38")
|
||||||
|
private Double i38;
|
||||||
|
|
||||||
|
@Column(name = "i_39")
|
||||||
|
private Double i39;
|
||||||
|
|
||||||
|
@Column(name = "i_40")
|
||||||
|
private Double i40;
|
||||||
|
|
||||||
|
@Column(name = "i_41")
|
||||||
|
private Double i41;
|
||||||
|
|
||||||
|
@Column(name = "i_42")
|
||||||
|
private Double i42;
|
||||||
|
|
||||||
|
@Column(name = "i_43")
|
||||||
|
private Double i43;
|
||||||
|
|
||||||
|
@Column(name = "i_44")
|
||||||
|
private Double i44;
|
||||||
|
|
||||||
|
@Column(name = "i_45")
|
||||||
|
private Double i45;
|
||||||
|
|
||||||
|
@Column(name = "i_46")
|
||||||
|
private Double i46;
|
||||||
|
|
||||||
|
@Column(name = "i_47")
|
||||||
|
private Double i47;
|
||||||
|
|
||||||
|
@Column(name = "i_48")
|
||||||
|
private Double i48;
|
||||||
|
|
||||||
|
@Column(name = "i_49")
|
||||||
|
private Double i49;
|
||||||
|
|
||||||
|
@Column(name = "i_50")
|
||||||
|
private Double i50;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.njcn.influx.pojo.po;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.influxdb.annotation.Measurement;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/5/12 11:27
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@Measurement(name = "data_inharm_i")
|
||||||
|
public class DataInHarmI extends DataHarmPhasicI{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,185 @@
|
|||||||
|
package com.njcn.influx.pojo.po;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.influxdb.annotation.Column;
|
||||||
|
import org.influxdb.annotation.Measurement;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/5/12 11:27
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Measurement(name = "data_inharm_v")
|
||||||
|
public class DataInHarmV {
|
||||||
|
|
||||||
|
@Column(name = "time")
|
||||||
|
private Instant time;
|
||||||
|
|
||||||
|
@Column(name = "line_id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@Column(name = "phasic_type")
|
||||||
|
private String phaseType;
|
||||||
|
|
||||||
|
@Column(name = "quality_flag")
|
||||||
|
private String qualityFlag;
|
||||||
|
|
||||||
|
@Column(name = "value_type")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
@Column(name = "v_1")
|
||||||
|
private Double v1;
|
||||||
|
|
||||||
|
@Column(name = "v_2")
|
||||||
|
private Double v2;
|
||||||
|
|
||||||
|
@Column(name = "v_3")
|
||||||
|
private Double v3;
|
||||||
|
|
||||||
|
@Column(name = "v_4")
|
||||||
|
private Double v4;
|
||||||
|
|
||||||
|
@Column(name = "v_5")
|
||||||
|
private Double v5;
|
||||||
|
|
||||||
|
@Column(name = "v_6")
|
||||||
|
private Double v6;
|
||||||
|
|
||||||
|
@Column(name = "v_7")
|
||||||
|
private Double v7;
|
||||||
|
|
||||||
|
@Column(name = "v_8")
|
||||||
|
private Double v8;
|
||||||
|
|
||||||
|
@Column(name = "v_9")
|
||||||
|
private Double v9;
|
||||||
|
|
||||||
|
@Column(name = "v_10")
|
||||||
|
private Double v10;
|
||||||
|
|
||||||
|
@Column(name = "v_11")
|
||||||
|
private Double v11;
|
||||||
|
|
||||||
|
@Column(name = "v_12")
|
||||||
|
private Double v12;
|
||||||
|
|
||||||
|
@Column(name = "v_13")
|
||||||
|
private Double v13;
|
||||||
|
|
||||||
|
@Column(name = "v_14")
|
||||||
|
private Double v14;
|
||||||
|
|
||||||
|
@Column(name = "v_15")
|
||||||
|
private Double v15;
|
||||||
|
|
||||||
|
@Column(name = "v_16")
|
||||||
|
private Double v16;
|
||||||
|
|
||||||
|
@Column(name = "v_17")
|
||||||
|
private Double v17;
|
||||||
|
|
||||||
|
@Column(name = "v_18")
|
||||||
|
private Double v18;
|
||||||
|
|
||||||
|
@Column(name = "v_19")
|
||||||
|
private Double v19;
|
||||||
|
|
||||||
|
@Column(name = "v_20")
|
||||||
|
private Double v20;
|
||||||
|
|
||||||
|
@Column(name = "v_21")
|
||||||
|
private Double v21;
|
||||||
|
|
||||||
|
@Column(name = "v_22")
|
||||||
|
private Double v22;
|
||||||
|
|
||||||
|
@Column(name = "v_23")
|
||||||
|
private Double v23;
|
||||||
|
|
||||||
|
@Column(name = "v_24")
|
||||||
|
private Double v24;
|
||||||
|
|
||||||
|
@Column(name = "v_25")
|
||||||
|
private Double v25;
|
||||||
|
|
||||||
|
@Column(name = "v_26")
|
||||||
|
private Double v26;
|
||||||
|
|
||||||
|
@Column(name = "v_27")
|
||||||
|
private Double v27;
|
||||||
|
|
||||||
|
@Column(name = "v_28")
|
||||||
|
private Double v28;
|
||||||
|
|
||||||
|
@Column(name = "v_29")
|
||||||
|
private Double v29;
|
||||||
|
|
||||||
|
@Column(name = "v_30")
|
||||||
|
private Double v30;
|
||||||
|
|
||||||
|
@Column(name = "v_31")
|
||||||
|
private Double v31;
|
||||||
|
|
||||||
|
@Column(name = "v_32")
|
||||||
|
private Double v32;
|
||||||
|
|
||||||
|
@Column(name = "v_33")
|
||||||
|
private Double v33;
|
||||||
|
|
||||||
|
@Column(name = "v_34")
|
||||||
|
private Double v34;
|
||||||
|
|
||||||
|
@Column(name = "v_35")
|
||||||
|
private Double v35;
|
||||||
|
|
||||||
|
@Column(name = "v_36")
|
||||||
|
private Double v36;
|
||||||
|
|
||||||
|
@Column(name = "v_37")
|
||||||
|
private Double v37;
|
||||||
|
|
||||||
|
@Column(name = "v_38")
|
||||||
|
private Double v38;
|
||||||
|
|
||||||
|
@Column(name = "v_39")
|
||||||
|
private Double v39;
|
||||||
|
|
||||||
|
@Column(name = "v_40")
|
||||||
|
private Double v40;
|
||||||
|
|
||||||
|
@Column(name = "v_41")
|
||||||
|
private Double v41;
|
||||||
|
|
||||||
|
@Column(name = "v_42")
|
||||||
|
private Double v42;
|
||||||
|
|
||||||
|
@Column(name = "v_43")
|
||||||
|
private Double v43;
|
||||||
|
|
||||||
|
@Column(name = "v_44")
|
||||||
|
private Double v44;
|
||||||
|
|
||||||
|
@Column(name = "v_45")
|
||||||
|
private Double v45;
|
||||||
|
|
||||||
|
@Column(name = "v_46")
|
||||||
|
private Double v46;
|
||||||
|
|
||||||
|
@Column(name = "v_47")
|
||||||
|
private Double v47;
|
||||||
|
|
||||||
|
@Column(name = "v_48")
|
||||||
|
private Double v48;
|
||||||
|
|
||||||
|
@Column(name = "v_49")
|
||||||
|
private Double v49;
|
||||||
|
|
||||||
|
@Column(name = "v_50")
|
||||||
|
private Double v50;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.njcn.influx.pojo.po;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.njcn.common.utils.serializer.InstantDateSerializer;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.influxdb.annotation.Column;
|
||||||
|
import org.influxdb.annotation.Measurement;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/4/12 16:01
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Measurement(name = "data_plt")
|
||||||
|
public class DataPlt {
|
||||||
|
|
||||||
|
@Column(name = "time")
|
||||||
|
@JsonSerialize(using = InstantDateSerializer.class)
|
||||||
|
private Instant time;
|
||||||
|
|
||||||
|
@Column(name = "line_id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@Column(name = "phasic_type")
|
||||||
|
private String phaseType;
|
||||||
|
|
||||||
|
@Column(name = "value_type")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
@Column(name = "quality_flag")
|
||||||
|
private String qualityFlag;
|
||||||
|
|
||||||
|
@Column(name = "plt")
|
||||||
|
private Double plt;
|
||||||
|
|
||||||
|
//自定义字段-闪变总计算次数
|
||||||
|
@Column(name = "flicker_all_time")
|
||||||
|
private Integer flickerAllTime;
|
||||||
|
|
||||||
|
}
|
||||||
224
pqs-influx/src/main/java/com/njcn/influx/pojo/po/DataV.java
Normal file
224
pqs-influx/src/main/java/com/njcn/influx/pojo/po/DataV.java
Normal file
@@ -0,0 +1,224 @@
|
|||||||
|
package com.njcn.influx.pojo.po;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.njcn.common.utils.serializer.InstantDateSerializer;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.influxdb.annotation.Column;
|
||||||
|
import org.influxdb.annotation.Measurement;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/4/7 10:00
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Measurement(name = "data_v")
|
||||||
|
public class DataV{
|
||||||
|
|
||||||
|
@Column(name = "time")
|
||||||
|
@JsonSerialize(using = InstantDateSerializer.class)
|
||||||
|
private Instant time;
|
||||||
|
|
||||||
|
@Column(name = "freq")
|
||||||
|
private Double freq;
|
||||||
|
|
||||||
|
@Column(name = "freq_dev")
|
||||||
|
private Double freqDev;
|
||||||
|
|
||||||
|
@Column(name = "quality_flag")
|
||||||
|
private String qualityFlag;
|
||||||
|
|
||||||
|
@Column(name = "rms")
|
||||||
|
private Double rms;
|
||||||
|
|
||||||
|
@Column(name = "rms_lvr")
|
||||||
|
private Double rmsLvr;
|
||||||
|
|
||||||
|
@Column(name = "vl_dev")
|
||||||
|
private Double vlDev;
|
||||||
|
|
||||||
|
@Column(name = "vu_dev")
|
||||||
|
private Double vuDev;
|
||||||
|
|
||||||
|
@Column(name = "v_1")
|
||||||
|
private Double v1;
|
||||||
|
|
||||||
|
@Column(name = "v_2")
|
||||||
|
private Double v2;
|
||||||
|
|
||||||
|
@Column(name = "v_3")
|
||||||
|
private Double v3;
|
||||||
|
|
||||||
|
@Column(name = "v_4")
|
||||||
|
private Double v4;
|
||||||
|
|
||||||
|
@Column(name = "v_5")
|
||||||
|
private Double v5;
|
||||||
|
|
||||||
|
@Column(name = "v_6")
|
||||||
|
private Double v6;
|
||||||
|
|
||||||
|
@Column(name = "v_7")
|
||||||
|
private Double v7;
|
||||||
|
|
||||||
|
@Column(name = "v_8")
|
||||||
|
private Double v8;
|
||||||
|
|
||||||
|
@Column(name = "v_9")
|
||||||
|
private Double v9;
|
||||||
|
|
||||||
|
@Column(name = "v_10")
|
||||||
|
private Double v10;
|
||||||
|
|
||||||
|
@Column(name = "v_11")
|
||||||
|
private Double v11;
|
||||||
|
|
||||||
|
@Column(name = "v_12")
|
||||||
|
private Double v12;
|
||||||
|
|
||||||
|
@Column(name = "v_13")
|
||||||
|
private Double v13;
|
||||||
|
|
||||||
|
@Column(name = "v_14")
|
||||||
|
private Double v14;
|
||||||
|
|
||||||
|
@Column(name = "v_15")
|
||||||
|
private Double v15;
|
||||||
|
|
||||||
|
@Column(name = "v_16")
|
||||||
|
private Double v16;
|
||||||
|
|
||||||
|
@Column(name = "v_17")
|
||||||
|
private Double v17;
|
||||||
|
|
||||||
|
@Column(name = "v_18")
|
||||||
|
private Double v18;
|
||||||
|
|
||||||
|
@Column(name = "v_19")
|
||||||
|
private Double v19;
|
||||||
|
|
||||||
|
@Column(name = "v_20")
|
||||||
|
private Double v20;
|
||||||
|
|
||||||
|
@Column(name = "v_21")
|
||||||
|
private Double v21;
|
||||||
|
|
||||||
|
@Column(name = "v_22")
|
||||||
|
private Double v22;
|
||||||
|
|
||||||
|
@Column(name = "v_23")
|
||||||
|
private Double v23;
|
||||||
|
|
||||||
|
@Column(name = "v_24")
|
||||||
|
private Double v24;
|
||||||
|
|
||||||
|
@Column(name = "v_25")
|
||||||
|
private Double v25;
|
||||||
|
|
||||||
|
@Column(name = "v_26")
|
||||||
|
private Double v26;
|
||||||
|
|
||||||
|
@Column(name = "v_27")
|
||||||
|
private Double v27;
|
||||||
|
|
||||||
|
@Column(name = "v_28")
|
||||||
|
private Double v28;
|
||||||
|
|
||||||
|
@Column(name = "v_29")
|
||||||
|
private Double v29;
|
||||||
|
|
||||||
|
@Column(name = "v_30")
|
||||||
|
private Double v30;
|
||||||
|
|
||||||
|
@Column(name = "v_31")
|
||||||
|
private Double v31;
|
||||||
|
|
||||||
|
@Column(name = "v_32")
|
||||||
|
private Double v32;
|
||||||
|
|
||||||
|
@Column(name = "v_33")
|
||||||
|
private Double v33;
|
||||||
|
|
||||||
|
@Column(name = "v_34")
|
||||||
|
private Double v34;
|
||||||
|
|
||||||
|
@Column(name = "v_35")
|
||||||
|
private Double v35;
|
||||||
|
|
||||||
|
@Column(name = "v_36")
|
||||||
|
private Double v36;
|
||||||
|
|
||||||
|
@Column(name = "v_37")
|
||||||
|
private Double v37;
|
||||||
|
|
||||||
|
@Column(name = "v_38")
|
||||||
|
private Double v38;
|
||||||
|
|
||||||
|
@Column(name = "v_39")
|
||||||
|
private Double v39;
|
||||||
|
|
||||||
|
@Column(name = "v_40")
|
||||||
|
private Double v40;
|
||||||
|
|
||||||
|
@Column(name = "v_41")
|
||||||
|
private Double v41;
|
||||||
|
|
||||||
|
@Column(name = "v_42")
|
||||||
|
private Double v42;
|
||||||
|
|
||||||
|
@Column(name = "v_43")
|
||||||
|
private Double v43;
|
||||||
|
|
||||||
|
@Column(name = "v_44")
|
||||||
|
private Double v44;
|
||||||
|
|
||||||
|
@Column(name = "v_45")
|
||||||
|
private Double v45;
|
||||||
|
|
||||||
|
@Column(name = "v_46")
|
||||||
|
private Double v46;
|
||||||
|
|
||||||
|
@Column(name = "v_47")
|
||||||
|
private Double v47;
|
||||||
|
|
||||||
|
@Column(name = "v_48")
|
||||||
|
private Double v48;
|
||||||
|
|
||||||
|
@Column(name = "v_49")
|
||||||
|
private Double v49;
|
||||||
|
|
||||||
|
@Column(name = "v_50")
|
||||||
|
private Double v50;
|
||||||
|
|
||||||
|
@Column(name = "v_neg")
|
||||||
|
private Double vNeg;
|
||||||
|
|
||||||
|
@Column(name = "v_pos")
|
||||||
|
private Double vPos;
|
||||||
|
|
||||||
|
@Column(name = "v_thd")
|
||||||
|
private Double vThd;
|
||||||
|
|
||||||
|
@Column(name = "v_unbalance")
|
||||||
|
private Double vUnbalance;
|
||||||
|
|
||||||
|
@Column(name = "v_zero")
|
||||||
|
private Double vZero;
|
||||||
|
|
||||||
|
@Column(name = "line_id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@Column(name = "phasic_type")
|
||||||
|
private String phaseType;
|
||||||
|
|
||||||
|
@Column(name = "value_type")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
//自定义字段-总计算次数
|
||||||
|
@Column(name = "all_time")
|
||||||
|
private Integer allTime;
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.njcn.influx.pojo.po;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.njcn.common.utils.serializer.InstantDateSerializer;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.influxdb.annotation.Column;
|
||||||
|
import org.influxdb.annotation.Measurement;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/7/12 9:55
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Measurement(name = "pqs_communicate")
|
||||||
|
public class PqsCommunicate {
|
||||||
|
|
||||||
|
@Column(name = "time")
|
||||||
|
@JsonSerialize(using = InstantDateSerializer.class)
|
||||||
|
private Instant time;
|
||||||
|
|
||||||
|
@Column(name = "dev_id")
|
||||||
|
private String devId;
|
||||||
|
|
||||||
|
@Column(name = "description")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@Column(name = "type")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.njcn.influx.service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2023年05月05日 09:00
|
||||||
|
*/
|
||||||
|
public interface CldStatisticsFlowService {
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.njcn.influx.service;
|
||||||
|
|
||||||
|
import com.njcn.influx.pojo.dto.DataFlickerDTO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2023年05月05日 09:04
|
||||||
|
*/
|
||||||
|
public interface DataFlickerService {
|
||||||
|
|
||||||
|
List<DataFlickerDTO> getDataFlicker(String lineIndex, String startTime, String endTime);
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.njcn.influx.service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2023年05月05日 09:10
|
||||||
|
*/
|
||||||
|
public interface DataFlucService {
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.njcn.influx.service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2023年05月05日 09:46
|
||||||
|
*/
|
||||||
|
public interface DataHarmPhasicIService {
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.njcn.influx.service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2023年05月05日 09:50
|
||||||
|
*/
|
||||||
|
public interface DataHarmPhasicVService {
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.njcn.influx.service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2023年05月05日 09:51
|
||||||
|
*/
|
||||||
|
public interface DataHarmPowerPService {
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.njcn.influx.service.impl;
|
||||||
|
|
||||||
|
import com.njcn.influx.service.CldStatisticsFlowService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2023年05月05日 09:00
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CldStatisticsFlowServiceImpl implements CldStatisticsFlowService {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,143 @@
|
|||||||
|
package com.njcn.influx.service.impl;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.njcn.influx.mapper.DataFlickerMapper;
|
||||||
|
import com.njcn.influx.pojo.dto.DataFlickerDTO;
|
||||||
|
import com.njcn.influx.pojo.po.DataFlicker;
|
||||||
|
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||||
|
import com.njcn.influx.service.DataFlickerService;
|
||||||
|
import com.njcn.influx.utils.InfluxDbUtil;
|
||||||
|
import org.influxdb.dto.QueryResult;
|
||||||
|
import org.influxdb.impl.InfluxDBResultMapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2023年05月05日 09:05
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class DataFlickerServiceImpl implements DataFlickerService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private DataFlickerMapper dataFlickerMapper;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DataFlickerDTO> getDataFlicker(String lineIndex, String startTime, String endTime) {
|
||||||
|
InfluxDbUtil influxDbUtils = new InfluxDbUtil("admin", "123456", "http://192.168.1.16:8086", "pqsbase_sjzx", "autogen");
|
||||||
|
|
||||||
|
List<DataFlickerDTO> result = new ArrayList<>();
|
||||||
|
// StringBuilder stringBuilder = new StringBuilder();
|
||||||
|
// stringBuilder.append("line_id='").append(lineIndex).append("' and ");
|
||||||
|
// //最小值
|
||||||
|
// String sql1 = "select min(fluc) AS fluc,min(plt) AS plt,min(pst) AS pst from data_flicker where " + stringBuilder + " time >= '" + startTime + "' and time <= '" + endTime + "' group by line_id,phasic_type,quality_flag tz('Asia/Shanghai')";
|
||||||
|
// QueryResult sqlResult1 = influxDbUtils.query(sql1);
|
||||||
|
// InfluxDBResultMapper resultMapper1 = new InfluxDBResultMapper();
|
||||||
|
// List<DataFlickerDTO> list1 = resultMapper1.toPOJO(sqlResult1, DataFlickerDTO.class);
|
||||||
|
// list1.forEach(item -> {
|
||||||
|
// item.setValueType("MIN");
|
||||||
|
// });
|
||||||
|
// //最大值
|
||||||
|
// String sql2 = "select max(fluc) AS fluc,max(plt) AS plt,max(pst) AS pst from data_flicker where " + stringBuilder + " time >= '" + startTime + "' and time <= '" + endTime + "' group by line_id,phasic_type,quality_flag tz('Asia/Shanghai')";
|
||||||
|
// QueryResult sqlResult2 = influxDbUtils.query(sql2);
|
||||||
|
// InfluxDBResultMapper resultMapper2 = new InfluxDBResultMapper();
|
||||||
|
// List<DataFlickerDTO> list2 = resultMapper2.toPOJO(sqlResult2, DataFlickerDTO.class);
|
||||||
|
// list2.forEach(item -> {
|
||||||
|
// item.setValueType("MAX");
|
||||||
|
// });
|
||||||
|
// //平均值
|
||||||
|
// String sql3 = "select mean(fluc) AS fluc,mean(plt) AS plt,mean(pst) AS pst from data_flicker where " + stringBuilder + " time >= '" + startTime + "' and time <= '" + endTime + "' group by line_id,phasic_type,quality_flag tz('Asia/Shanghai')";
|
||||||
|
// QueryResult sqlResult3 = influxDbUtils.query(sql3);
|
||||||
|
// InfluxDBResultMapper resultMapper3 = new InfluxDBResultMapper();
|
||||||
|
// List<DataFlickerDTO> list3 = resultMapper3.toPOJO(sqlResult3, DataFlickerDTO.class);
|
||||||
|
// list3.forEach(item -> {
|
||||||
|
// item.setValueType("AVG");
|
||||||
|
// });
|
||||||
|
// //CP95值
|
||||||
|
// String sql4 = "select percentile(fluc,95) AS fluc,percentile(plt,95) AS plt,percentile(pst,95) AS pst from data_flicker where " + stringBuilder + " time >= '" + startTime + "' and time <= '" + endTime + "' group by line_id,phasic_type,quality_flag tz('Asia/Shanghai')";
|
||||||
|
// QueryResult sqlResult4 = influxDbUtils.query(sql4);
|
||||||
|
// InfluxDBResultMapper resultMapper4 = new InfluxDBResultMapper();
|
||||||
|
// List<DataFlickerDTO> list4 = resultMapper4.toPOJO(sqlResult4, DataFlickerDTO.class);
|
||||||
|
// list4.forEach(item -> {
|
||||||
|
// item.setValueType("CP95");
|
||||||
|
// });
|
||||||
|
// result.addAll(list1);
|
||||||
|
// result.addAll(list2);
|
||||||
|
// result.addAll(list3);
|
||||||
|
// result.addAll(list4);
|
||||||
|
|
||||||
|
/////改造前↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑改造后↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
|
||||||
|
//最小值
|
||||||
|
List<DataFlickerDTO> result1 ;
|
||||||
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataFlicker.class, DataFlickerDTO.class);
|
||||||
|
influxQueryWrapper.eq(DataFlicker::getLineId, lineIndex)
|
||||||
|
.min(DataFlicker::getFluc)
|
||||||
|
.min(DataFlicker::getPlt)
|
||||||
|
.min(DataFlicker::getPst)
|
||||||
|
.groupBy(DataFlicker::getLineId,DataFlicker::getPhaseType,DataFlicker::getQualityFlag)
|
||||||
|
.between(DataFlicker::getTime, startTime, endTime);
|
||||||
|
result1 = dataFlickerMapper.getStatisticsByWraper(influxQueryWrapper);
|
||||||
|
result1.forEach(item -> {
|
||||||
|
item.setValueType("MIN");
|
||||||
|
});
|
||||||
|
//最大值
|
||||||
|
List<DataFlickerDTO> result2 ;
|
||||||
|
influxQueryWrapper.initSql();
|
||||||
|
influxQueryWrapper.eq(DataFlicker::getLineId, lineIndex)
|
||||||
|
.max(DataFlicker::getFluc)
|
||||||
|
.max(DataFlicker::getPlt)
|
||||||
|
.max(DataFlicker::getPst)
|
||||||
|
.groupBy(DataFlicker::getLineId,DataFlicker::getPhaseType,DataFlicker::getQualityFlag)
|
||||||
|
.between(DataFlicker::getTime, startTime, endTime);
|
||||||
|
result2 = dataFlickerMapper.getStatisticsByWraper(influxQueryWrapper);
|
||||||
|
result2.forEach(item -> {
|
||||||
|
item.setValueType("MAX");
|
||||||
|
});
|
||||||
|
//平均值
|
||||||
|
List<DataFlickerDTO> result3 ;
|
||||||
|
influxQueryWrapper.initSql();
|
||||||
|
influxQueryWrapper.eq(DataFlicker::getLineId, lineIndex)
|
||||||
|
.mean(DataFlicker::getFluc)
|
||||||
|
.mean(DataFlicker::getPlt)
|
||||||
|
.mean(DataFlicker::getPst)
|
||||||
|
.groupBy(DataFlicker::getLineId,DataFlicker::getPhaseType,DataFlicker::getQualityFlag)
|
||||||
|
.between(DataFlicker::getTime, startTime, endTime);
|
||||||
|
result3 = dataFlickerMapper.getStatisticsByWraper(influxQueryWrapper);
|
||||||
|
result3.forEach(item -> {
|
||||||
|
item.setValueType("AVG");
|
||||||
|
});
|
||||||
|
List<DataFlickerDTO> result4 ;
|
||||||
|
influxQueryWrapper.initSql();
|
||||||
|
influxQueryWrapper.eq(DataFlicker::getLineId, lineIndex)
|
||||||
|
.percentile(DataFlicker::getFluc, 95)
|
||||||
|
.percentile(DataFlicker::getPlt, 95)
|
||||||
|
.percentile(DataFlicker::getPst, 95)
|
||||||
|
.groupBy(DataFlicker::getLineId,DataFlicker::getPhaseType,DataFlicker::getQualityFlag)
|
||||||
|
.between(DataFlicker::getTime, startTime, endTime);
|
||||||
|
//CP95值
|
||||||
|
result4 = dataFlickerMapper.getStatisticsByWraper(influxQueryWrapper);
|
||||||
|
result4.forEach(item -> {
|
||||||
|
item.setValueType("CP95");
|
||||||
|
});
|
||||||
|
List<DataFlickerDTO> result5 = new ArrayList<>();
|
||||||
|
result5.addAll(result1);
|
||||||
|
result5.addAll(result2);
|
||||||
|
result5.addAll(result3);
|
||||||
|
result5.addAll(result4);
|
||||||
|
|
||||||
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
try {
|
||||||
|
System.out.println(objectMapper.writeValueAsString(result));
|
||||||
|
System.out.println(objectMapper.writeValueAsString(result5));
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.njcn.influx.service.impl;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2023年05月05日 09:10
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class DataFlucServiceImpl {
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.njcn.influx.service.impl;
|
||||||
|
|
||||||
|
import com.njcn.influx.service.DataHarmPhasicIService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2023年05月05日 09:46
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class DataHarmPhasicIServiceImpl implements DataHarmPhasicIService {
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.njcn.influx.service.impl;
|
||||||
|
|
||||||
|
import com.njcn.influx.service.DataHarmPhasicVService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2023年05月05日 09:50
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class DataHarmPhasicVServiceImpl implements DataHarmPhasicVService {
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.njcn.influx.service.impl;
|
||||||
|
|
||||||
|
import com.njcn.influx.service.DataHarmPowerPService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2023年05月05日 09:51
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class DataHarmPowerPServiceImpl implements DataHarmPowerPService {
|
||||||
|
}
|
||||||
376
pqs-influx/src/main/java/com/njcn/influx/utils/InfluxDbUtil.java
Normal file
376
pqs-influx/src/main/java/com/njcn/influx/utils/InfluxDbUtil.java
Normal file
@@ -0,0 +1,376 @@
|
|||||||
|
package com.njcn.influx.utils;
|
||||||
|
|
||||||
|
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
|
||||||
|
public class InfluxDbUtil {
|
||||||
|
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 InfluxDbUtil(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<String, String> tags, Map<String, Object> 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<String> 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<String> 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<String, String> tags,
|
||||||
|
Map<String, Object> fields) {
|
||||||
|
Point point = Point.measurement(measurement).time(time, timeUnit).tag(tags).fields(fields).build();
|
||||||
|
return point;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//单条查询语句封装
|
||||||
|
/**
|
||||||
|
* 查询结果封装到map
|
||||||
|
* @param commond 单条sql语句
|
||||||
|
* @return 查询结果
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
public List<Map<String, Object>> getResult(String commond){
|
||||||
|
List<Map<String, Object>> retList = new ArrayList<>();
|
||||||
|
QueryResult queryResult = influxDB.query(new Query(commond,dbName));
|
||||||
|
List<QueryResult.Result> results = queryResult.getResults();
|
||||||
|
if (results==null||results.isEmpty()){
|
||||||
|
return retList;
|
||||||
|
}
|
||||||
|
QueryResult.Result result = results.get(0);
|
||||||
|
List<QueryResult.Series> seriess = result.getSeries();
|
||||||
|
if (seriess==null||seriess.isEmpty()){
|
||||||
|
return retList;
|
||||||
|
}
|
||||||
|
QueryResult.Series series = seriess.get(0);
|
||||||
|
List<String> columns = series.getColumns();
|
||||||
|
List<List<Object>> values = series.getValues();
|
||||||
|
for (List<Object> columnValue :values){
|
||||||
|
Map<String, Object> map = new HashMap<>(1);
|
||||||
|
for (int i=0;i<columnValue.size();i++){
|
||||||
|
if(columns.get(i).equals("time")){
|
||||||
|
long aa = Instant.parse(columnValue.get(i).toString()).minusMillis(TimeUnit.HOURS.toMillis(8)).getEpochSecond();
|
||||||
|
map.put(columns.get(i), aa);
|
||||||
|
}else {
|
||||||
|
map.put(columns.get(i),columnValue.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
retList.add(map);
|
||||||
|
}
|
||||||
|
return retList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
public List<Map<String, Object>> getResult(String commond, String type){
|
||||||
|
|
||||||
|
List<Map<String, Object>> retList = new ArrayList<>();
|
||||||
|
QueryResult queryResult = influxDB.query(new Query(commond,dbName));
|
||||||
|
List<QueryResult.Result> results = queryResult.getResults();
|
||||||
|
if (results==null||results.isEmpty()){
|
||||||
|
return retList;
|
||||||
|
}
|
||||||
|
QueryResult.Result result = results.get(0);
|
||||||
|
List<QueryResult.Series> seriess = result.getSeries();
|
||||||
|
if (seriess==null||seriess.isEmpty()){
|
||||||
|
return retList;
|
||||||
|
}
|
||||||
|
QueryResult.Series series = seriess.get(0);
|
||||||
|
List<String> columns = series.getColumns();
|
||||||
|
List<List<Object>> values = series.getValues();
|
||||||
|
for (List<Object> columnValue :values){
|
||||||
|
Map<String, Object> map = new HashMap<>(1);
|
||||||
|
for (int i=0;i<columnValue.size();i++){
|
||||||
|
if(columns.get(i).equals("time")){
|
||||||
|
Instant aa = Instant.parse(columnValue.get(i).toString()).minusMillis(TimeUnit.HOURS.toMillis(8));
|
||||||
|
LocalDateTime localDateTime =LocalDateTime.ofInstant(aa,ZoneId.systemDefault());
|
||||||
|
String time = localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||||
|
map.put(columns.get(i), time);
|
||||||
|
}else {
|
||||||
|
map.put(columns.get(i),columnValue.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
retList.add(map);
|
||||||
|
}
|
||||||
|
return retList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<Map<String, Object>> getMapResult(String commond){
|
||||||
|
|
||||||
|
List<Map<String, Object>> retList = new ArrayList<>();
|
||||||
|
QueryResult queryResult = influxDB.query(new Query(commond,dbName));
|
||||||
|
List<QueryResult.Result> results = queryResult.getResults();
|
||||||
|
if (results==null||results.isEmpty()){
|
||||||
|
return retList;
|
||||||
|
}
|
||||||
|
QueryResult.Result result = results.get(0);
|
||||||
|
List<QueryResult.Series> seriess = result.getSeries();
|
||||||
|
if (seriess==null||seriess.isEmpty()){
|
||||||
|
return retList;
|
||||||
|
}
|
||||||
|
QueryResult.Series series = seriess.get(0);
|
||||||
|
List<String> columns = series.getColumns();
|
||||||
|
List<List<Object>> values = series.getValues();
|
||||||
|
for (List<Object> columnValue :values){
|
||||||
|
Map<String, Object> map = new HashMap<>(1);
|
||||||
|
for (int i=0;i<columnValue.size();i++){
|
||||||
|
if(columns.get(i).equals("time")){
|
||||||
|
Instant instant = Instant.from(RFC3339_FORMATTER.parse(String.valueOf(columnValue.get(i))));
|
||||||
|
LocalDateTime localDateTime =LocalDateTime.ofInstant(instant,ZoneId.systemDefault());
|
||||||
|
String time = localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||||
|
map.put(columns.get(i), time);
|
||||||
|
}else {
|
||||||
|
map.put(columns.get(i),columnValue.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
retList.add(map);
|
||||||
|
}
|
||||||
|
return retList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
7
pqs-influx/src/main/resources/application.yml
Normal file
7
pqs-influx/src/main/resources/application.yml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
spring:
|
||||||
|
influx:
|
||||||
|
url: http://192.168.1.16:8086
|
||||||
|
user: admin
|
||||||
|
password: 123456
|
||||||
|
database: pqsbase_sjzx
|
||||||
|
mapper-location: com.njcn.influx.mapper
|
||||||
18
pqs-influx/src/test/java/com/njcn/influx/BaseJunitTest.java
Normal file
18
pqs-influx/src/test/java/com/njcn/influx/BaseJunitTest.java
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
package com.njcn.influx;
|
||||||
|
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
import org.springframework.test.context.web.WebAppConfiguration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2021年12月10日 15:05
|
||||||
|
*/
|
||||||
|
@RunWith(SpringRunner.class)
|
||||||
|
@WebAppConfiguration
|
||||||
|
@SpringBootTest(classes = PqsInfluxApplication.class)
|
||||||
|
public class BaseJunitTest {
|
||||||
|
|
||||||
|
}
|
||||||
38
pqs-influx/src/test/java/com/njcn/influx/DemoTest.java
Normal file
38
pqs-influx/src/test/java/com/njcn/influx/DemoTest.java
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
package com.njcn.influx;
|
||||||
|
|
||||||
|
import com.njcn.influx.mapper.CldStatisticsFlowMapper;
|
||||||
|
import com.njcn.influx.pojo.po.CldStatisFlow;
|
||||||
|
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||||
|
import com.njcn.influx.service.DataFlickerService;
|
||||||
|
import lombok.SneakyThrows;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2021年12月14日 12:55
|
||||||
|
*/
|
||||||
|
public class DemoTest extends BaseJunitTest {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CldStatisticsFlowMapper cldStatisticsFlowMapper;
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DataFlickerService dataFlickerService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@SneakyThrows
|
||||||
|
@Test
|
||||||
|
public void test() {
|
||||||
|
dataFlickerService.getDataFlicker("ff2d9674c1f1ecce7f33a5bf17fc4f2d","2023-05-02 00:00:00","2023-05-02 23:59:59");
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -5,8 +5,6 @@ import org.influxdb.annotation.Column;
|
|||||||
import org.influxdb.annotation.Measurement;
|
import org.influxdb.annotation.Measurement;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import java.time.Instant;
|
|||||||
*
|
*
|
||||||
* @author xuyang
|
* @author xuyang
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
* @createTime 2022/5/11 16:08
|
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Measurement(name = "data_flicker")
|
@Measurement(name = "data_flicker")
|
||||||
@@ -20,27 +19,29 @@ public class DataFlickerPO {
|
|||||||
@Column(name = "time")
|
@Column(name = "time")
|
||||||
private Instant time;
|
private Instant time;
|
||||||
|
|
||||||
|
@Column(name = "fluc")
|
||||||
|
private Double fluc;
|
||||||
|
|
||||||
@Column(name = "line_id")
|
@Column(name = "line_id")
|
||||||
private String lineId;
|
private String lineId;
|
||||||
|
|
||||||
@Column(name = "phasic_type")
|
@Column(name = "phasic_type")
|
||||||
private String phaseType;
|
private String phaseType;
|
||||||
|
|
||||||
@Column(name = "quality_flag")
|
|
||||||
private String qualityFlag;
|
|
||||||
|
|
||||||
@Column(name = "value_type")
|
|
||||||
private String valueType;
|
|
||||||
|
|
||||||
@Column(name = "fluc")
|
|
||||||
private Double fluc;
|
|
||||||
|
|
||||||
@Column(name = "plt")
|
@Column(name = "plt")
|
||||||
private Double plt;
|
private Double plt;
|
||||||
|
|
||||||
@Column(name = "pst")
|
@Column(name = "pst")
|
||||||
private Double pst;
|
private Double pst;
|
||||||
|
|
||||||
|
@Column(name = "quality_flag")
|
||||||
|
private String qualityFlag;
|
||||||
|
|
||||||
|
@Column(name = "value_type")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//自定义字段
|
//自定义字段
|
||||||
@Column(name = "count")
|
@Column(name = "count")
|
||||||
private Integer count;
|
private Integer count;
|
||||||
|
|||||||
Reference in New Issue
Block a user