修改报表
This commit is contained in:
@@ -46,11 +46,11 @@
|
|||||||
<artifactId>pqs-influx</artifactId>
|
<artifactId>pqs-influx</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<!-- <dependency>-->
|
||||||
<groupId>com.baomidou</groupId>
|
<!-- <groupId>com.baomidou</groupId>-->
|
||||||
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
|
<!-- <artifactId>dynamic-datasource-spring-boot-starter</artifactId>-->
|
||||||
<version>3.5.1</version>
|
<!-- <version>3.5.1</version>-->
|
||||||
</dependency>
|
<!-- </dependency>-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.squareup.okhttp3</groupId>
|
<groupId>com.squareup.okhttp3</groupId>
|
||||||
<artifactId>okhttp</artifactId>
|
<artifactId>okhttp</artifactId>
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
@@ -71,10 +72,12 @@ public class TestController {
|
|||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@GetMapping("/test")
|
@GetMapping("/test")
|
||||||
@ApiOperation("报表测试")
|
@ApiOperation("报表测试")
|
||||||
public HttpResult<Integer> queryEvent() throws ClassNotFoundException {
|
public HttpResult<Integer> test(@RequestParam("dateTime") String dateTime) throws ClassNotFoundException {
|
||||||
|
DateTimeFormatter formatter1 = DateTimeFormatter.ISO_DATE;
|
||||||
// 获取当前日期
|
// 获取当前日期
|
||||||
LocalDate today = LocalDate.now().minusDays(3);
|
LocalDate today = LocalDate.parse(dateTime, formatter1);
|
||||||
|
|
||||||
|
|
||||||
// 计算前一天的日期
|
// 计算前一天的日期
|
||||||
LocalDate yesterday = today.minusDays(1);
|
LocalDate yesterday = today.minusDays(1);
|
||||||
// 获取前一天的开始时间(00:00:00)
|
// 获取前一天的开始时间(00:00:00)
|
||||||
@@ -122,7 +125,9 @@ public class TestController {
|
|||||||
collect.forEach((tempPhase,byNameMap)->{
|
collect.forEach((tempPhase,byNameMap)->{
|
||||||
//最小值
|
//最小值
|
||||||
InfluxQueryWrapper influxQueryWrapperMin = new InfluxQueryWrapper(PqdData.class, clazz);
|
InfluxQueryWrapper influxQueryWrapperMin = new InfluxQueryWrapper(PqdData.class, clazz);
|
||||||
influxQueryWrapperMin.regular(PqdData::getLineId, lineIndex).eq(InfluxDBTableConstant.VALUE_TYPE, "min").eq(InfluxDBTableConstant.PHASIC_TYPE,tempPhase).eq(InfluxDBTableConstant.IS_ABNORMAL, 0);
|
influxQueryWrapperMin.regular(PqdData::getLineId, lineIndex).eq(InfluxDBTableConstant.VALUE_TYPE, "min")
|
||||||
|
.eq(InfluxDBTableConstant.PHASIC_TYPE,tempPhase);
|
||||||
|
// .eq(InfluxDBTableConstant.IS_ABNORMAL, 0);
|
||||||
|
|
||||||
|
|
||||||
byNameMap.forEach((name, eleEpdPqdList) -> {
|
byNameMap.forEach((name, eleEpdPqdList) -> {
|
||||||
@@ -151,7 +156,9 @@ public class TestController {
|
|||||||
|
|
||||||
//最大值
|
//最大值
|
||||||
InfluxQueryWrapper influxQueryWrapperMax = new InfluxQueryWrapper(PqdData.class, clazz);
|
InfluxQueryWrapper influxQueryWrapperMax = new InfluxQueryWrapper(PqdData.class, clazz);
|
||||||
influxQueryWrapperMax.regular(PqdData::getLineId, lineIndex).eq(InfluxDBTableConstant.VALUE_TYPE, "max").eq(InfluxDBTableConstant.PHASIC_TYPE,tempPhase).eq(InfluxDBTableConstant.IS_ABNORMAL, 0);
|
influxQueryWrapperMax.regular(PqdData::getLineId, lineIndex).eq(InfluxDBTableConstant.VALUE_TYPE, "max")
|
||||||
|
.eq(InfluxDBTableConstant.PHASIC_TYPE,tempPhase);
|
||||||
|
// .eq(InfluxDBTableConstant.IS_ABNORMAL, 0);
|
||||||
|
|
||||||
|
|
||||||
byNameMap.forEach((name, eleEpdPqdList) -> {
|
byNameMap.forEach((name, eleEpdPqdList) -> {
|
||||||
@@ -179,7 +186,9 @@ public class TestController {
|
|||||||
|
|
||||||
//平均值
|
//平均值
|
||||||
InfluxQueryWrapper influxQueryWrapperAvg = new InfluxQueryWrapper(PqdData.class, clazz);
|
InfluxQueryWrapper influxQueryWrapperAvg = new InfluxQueryWrapper(PqdData.class, clazz);
|
||||||
influxQueryWrapperAvg.regular(PqdData::getLineId, lineIndex).eq(InfluxDBTableConstant.VALUE_TYPE, "avg").eq(InfluxDBTableConstant.PHASIC_TYPE,tempPhase).eq(InfluxDBTableConstant.IS_ABNORMAL, 0);
|
influxQueryWrapperAvg.regular(PqdData::getLineId, lineIndex).eq(InfluxDBTableConstant.VALUE_TYPE, "avg")
|
||||||
|
.eq(InfluxDBTableConstant.PHASIC_TYPE,tempPhase);
|
||||||
|
// .eq(InfluxDBTableConstant.IS_ABNORMAL, 0);
|
||||||
|
|
||||||
byNameMap.forEach((name, eleEpdPqdList) -> {
|
byNameMap.forEach((name, eleEpdPqdList) -> {
|
||||||
EleEpdPqd tempEleEpdPqd = eleEpdPqdList.get(0);
|
EleEpdPqd tempEleEpdPqd = eleEpdPqdList.get(0);
|
||||||
@@ -207,7 +216,9 @@ public class TestController {
|
|||||||
|
|
||||||
//CP95
|
//CP95
|
||||||
InfluxQueryWrapper influxQueryWrapperCp95 = new InfluxQueryWrapper(PqdData.class, clazz);
|
InfluxQueryWrapper influxQueryWrapperCp95 = new InfluxQueryWrapper(PqdData.class, clazz);
|
||||||
influxQueryWrapperCp95.regular(PqdData::getLineId, lineIndex).eq(InfluxDBTableConstant.VALUE_TYPE, "avg").eq(InfluxDBTableConstant.PHASIC_TYPE,tempPhase).eq(InfluxDBTableConstant.IS_ABNORMAL, 0);
|
influxQueryWrapperCp95.regular(PqdData::getLineId, lineIndex).eq(InfluxDBTableConstant.VALUE_TYPE, "avg")
|
||||||
|
.eq(InfluxDBTableConstant.PHASIC_TYPE,tempPhase);
|
||||||
|
// .eq(InfluxDBTableConstant.IS_ABNORMAL, 0);
|
||||||
|
|
||||||
byNameMap.forEach((name, eleEpdPqdList) -> {
|
byNameMap.forEach((name, eleEpdPqdList) -> {
|
||||||
EleEpdPqd tempEleEpdPqd = eleEpdPqdList.get(0);
|
EleEpdPqd tempEleEpdPqd = eleEpdPqdList.get(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user