修改报表
This commit is contained in:
@@ -32,6 +32,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
@@ -71,10 +72,12 @@ public class TestController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/test")
|
||||
@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);
|
||||
// 获取前一天的开始时间(00:00:00)
|
||||
@@ -122,7 +125,9 @@ public class TestController {
|
||||
collect.forEach((tempPhase,byNameMap)->{
|
||||
//最小值
|
||||
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) -> {
|
||||
@@ -151,7 +156,9 @@ public class TestController {
|
||||
|
||||
//最大值
|
||||
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) -> {
|
||||
@@ -179,7 +186,9 @@ public class TestController {
|
||||
|
||||
//平均值
|
||||
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) -> {
|
||||
EleEpdPqd tempEleEpdPqd = eleEpdPqdList.get(0);
|
||||
@@ -207,7 +216,9 @@ public class TestController {
|
||||
|
||||
//CP95
|
||||
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) -> {
|
||||
EleEpdPqd tempEleEpdPqd = eleEpdPqdList.get(0);
|
||||
|
||||
Reference in New Issue
Block a user