调整influx

This commit is contained in:
2023-09-25 15:52:42 +08:00
parent a76c98cde6
commit f48ef25666
41 changed files with 105 additions and 521 deletions

View File

@@ -42,11 +42,7 @@
<artifactId>user-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.njcn</groupId>
<artifactId>common-influxDB</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>

View File

@@ -5,6 +5,7 @@ import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.DependsOn;
/**
@@ -14,6 +15,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
* @date 2022-03-07 15:37:00
*/
@Slf4j
@DependsOn("proxyMapperRegister")
@MapperScan("com.njcn.**.mapper")
@EnableFeignClients(basePackages = "com.njcn")
@SpringBootApplication(scanBasePackages = "com.njcn")

View File

@@ -5,9 +5,9 @@ import cn.hutool.core.date.DateTime;
import com.njcn.event.pojo.po.EventDetail;
import com.njcn.event.pojo.po.RmpEventDetailPO;
import com.njcn.event.pojo.vo.EventDetailCount;
import com.njcn.influxdb.config.InfluxDbConfig;
import com.njcn.influxdb.utils.InfluxDbUtils;
import lombok.RequiredArgsConstructor;
import com.njcn.influx.config.InfluxDbConfig;
import com.njcn.influx.deprecated.InfluxDBPublicParam;
import com.njcn.influx.utils.InfluxDbUtils;
import org.apache.commons.lang3.StringUtils;
import org.influxdb.dto.QueryResult;
import org.influxdb.querybuilder.SelectQueryImpl;
@@ -17,7 +17,6 @@ import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.List;
@@ -26,7 +25,6 @@ import java.util.function.Function;
import java.util.stream.Collectors;
import static com.njcn.influxdb.param.InfluxDBPublicParam.PQS_EVENT_DETAIL;
import static org.influxdb.querybuilder.BuiltQuery.QueryBuilder.eq;
/**
@@ -40,7 +38,7 @@ import static org.influxdb.querybuilder.BuiltQuery.QueryBuilder.eq;
public class PqsEventDetailQuery extends QueryBuilder {
@Resource
private InfluxDbConfig influxDbConfig;
private InfluxDbConfig influxDbConfig;
protected PqsEventDetailQuery(InfluxDbUtils influxDbUtils) {
super(influxDbUtils);
@@ -68,7 +66,7 @@ public class PqsEventDetailQuery extends QueryBuilder {
* @see SelectQueryImpl
*/
private SelectQueryImpl fromTable(SelectionQueryImpl column) {
return column.from(influxDbConfig.getDatabase(), PQS_EVENT_DETAIL);
return column.from(influxDbConfig.getDatabase(), InfluxDBPublicParam.PQS_EVENT_DETAIL);
}
/**

View File

@@ -1,8 +1,9 @@
package com.njcn.event.influxdb;
import com.njcn.event.pojo.po.PqsOnlinerate;
import com.njcn.influxdb.config.InfluxDbConfig;
import com.njcn.influxdb.utils.InfluxDbUtils;
import com.njcn.influx.config.InfluxDbConfig;
import com.njcn.influx.deprecated.InfluxDBPublicParam;
import com.njcn.influx.utils.InfluxDbUtils;
import org.influxdb.dto.QueryResult;
import org.influxdb.querybuilder.SelectQueryImpl;
import org.influxdb.querybuilder.SelectionQueryImpl;
@@ -14,7 +15,6 @@ import java.util.ArrayList;
import java.util.List;
import static com.njcn.influxdb.param.InfluxDBPublicParam.PQS_ONLINERATE;
import static org.influxdb.querybuilder.BuiltQuery.QueryBuilder.eq;
@Component
@@ -34,7 +34,7 @@ public class PqsOnlinerateQuery extends QueryBuilder {
* @see SelectQueryImpl
*/
private SelectQueryImpl fromTable(SelectionQueryImpl column) {
return column.from(influxDbConfig.getDatabase(), PQS_ONLINERATE);
return column.from(influxDbConfig.getDatabase(), InfluxDBPublicParam.PQS_ONLINERATE);
}
/**

View File

@@ -3,7 +3,7 @@ package com.njcn.event.influxdb;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.njcn.influxdb.utils.InfluxDbUtils;
import com.njcn.influx.utils.InfluxDbUtils;
import org.influxdb.InfluxDBMapperException;
import org.influxdb.dto.QueryResult;
import org.influxdb.impl.InfluxDBResultMapper;

View File

@@ -6,7 +6,6 @@ import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
import com.njcn.device.pq.api.LineFeignClient;
import com.njcn.device.pq.api.TerminalBaseClient;
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
@@ -15,7 +14,6 @@ import com.njcn.event.pojo.po.RmpEventDetailPO;
import com.njcn.event.pojo.vo.AreaSubLineVO;
import com.njcn.event.service.majornetwork.AreaInfoService;
import com.njcn.event.service.majornetwork.EventDetailService;
import com.njcn.influxdb.utils.InfluxDbUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;

View File

@@ -31,8 +31,8 @@ import com.njcn.event.service.majornetwork.LargeScreenService;
import com.njcn.harmonic.pojo.dto.ComAssessDTO;
import com.njcn.harmonic.pojo.po.PQSComAssesPO;
import com.njcn.harmonic.utils.HarmonicComAssesUtil;
import com.njcn.influxdb.param.InfluxDBPublicParam;
import com.njcn.influxdb.utils.InfluxDbUtils;
import com.njcn.influx.deprecated.InfluxDBPublicParam;
import com.njcn.influx.utils.InfluxDbUtils;
import com.njcn.system.api.DicDataFeignClient;
import com.njcn.system.enums.DicDataEnum;
import com.njcn.system.pojo.enums.StatisticsEnum;

View File

@@ -22,7 +22,7 @@ import com.njcn.event.pojo.po.RmpEventDetailPO;
import com.njcn.event.pojo.vo.*;
import com.njcn.event.service.majornetwork.EventAnalysisService;
import com.njcn.event.service.majornetwork.EventDetailService;
import com.njcn.influxdb.utils.InfluxDbUtils;
import com.njcn.influx.utils.InfluxDbUtils;
import com.njcn.system.api.DicDataFeignClient;
import com.njcn.system.enums.DicDataEnum;
import com.njcn.system.enums.DicDataTypeEnum;

View File

@@ -10,7 +10,7 @@ import com.njcn.event.mapper.majornetwork.EventDetailMapper;
import com.njcn.event.pojo.po.EventDetail;
import com.njcn.event.pojo.po.RmpEventDetailPO;
import com.njcn.event.service.majornetwork.EventDetailService;
import com.njcn.influxdb.utils.InfluxDbUtils;
import com.njcn.influx.utils.InfluxDbUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.influxdb.dto.QueryResult;

View File

@@ -1,18 +1,14 @@
package com.njcn.event.service.majornetwork.Impl;
import com.google.common.collect.Lists;
import cn.hutool.core.date.DateUtil;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.event.pojo.constant.Param;
import com.njcn.event.pojo.param.StatisticsParam;
import com.njcn.event.pojo.po.EventDetail;
import com.njcn.event.pojo.po.EventDetailNew;
import com.njcn.event.pojo.vo.*;
import com.njcn.event.service.majornetwork.EventReportService;
import com.njcn.event.service.majornetwork.ReportService;
import com.njcn.influxdb.utils.InfluxDbUtils;
import com.njcn.system.enums.DicDataTypeEnum;
import com.njcn.influx.utils.InfluxDbUtils;
import com.njcn.system.pojo.po.DictData;
import lombok.RequiredArgsConstructor;
import org.influxdb.dto.QueryResult;

View File

@@ -1,6 +1,5 @@
package com.njcn.event;
import com.njcn.event.enums.EventResponseEnum;
import com.njcn.event.file.component.WaveFileComponent;
import com.njcn.event.file.pojo.dto.EigenvalueDTO;
import com.njcn.event.file.pojo.dto.WaveDataDTO;
@@ -9,8 +8,9 @@ import com.njcn.event.pojo.PqsEventDetail;
import com.njcn.event.pojo.PqsOnlinerateAggregate;
import com.njcn.event.pojo.PqsEventDetailCount;
import com.njcn.huawei.obs.util.OBSUtil;
import com.njcn.influxdb.config.InfluxDbConfig;
import com.njcn.influxdb.utils.InfluxDbUtils;
import com.njcn.influx.config.InfluxDbConfig;
import com.njcn.influx.deprecated.InfluxDBPublicParam;
import com.njcn.influx.utils.InfluxDbUtils;
import com.njcn.oss.constant.OssPath;
import org.influxdb.dto.QueryResult;
import org.influxdb.impl.InfluxDBResultMapper;
@@ -34,7 +34,6 @@ import java.util.List;
import java.util.Objects;
import static com.njcn.influxdb.param.InfluxDBPublicParam.PQS_EVENT_DETAIL;
import static org.influxdb.querybuilder.BuiltQuery.QueryBuilder.*;
import static org.influxdb.querybuilder.FunctionFactory.sum;
@@ -63,7 +62,7 @@ public class EventBootApplicationTest {
// or 条件数据
List<Clause> clauses = getClauses();
SelectQueryImpl selectQuery = select().column("line_id").column("eventass_index").from(influxDbConfig.getDatabase(), PQS_EVENT_DETAIL);
SelectQueryImpl selectQuery = select().column("line_id").column("eventass_index").from(influxDbConfig.getDatabase(), InfluxDBPublicParam.PQS_EVENT_DETAIL);
WhereQueryImpl<SelectQueryImpl> where = selectQuery.where();
// WHERE (line_id = '1' OR line_id = '2' OR line_id = '3') 加上前后()
@@ -84,7 +83,7 @@ public class EventBootApplicationTest {
// or 条件数据
List<Clause> clauses = getClauses();
SelectQueryImpl selectQuery = select().count("eventass_index").from(influxDbConfig.getDatabase(), PQS_EVENT_DETAIL);
SelectQueryImpl selectQuery = select().count("eventass_index").from(influxDbConfig.getDatabase(), InfluxDBPublicParam.PQS_EVENT_DETAIL);
WhereQueryImpl<SelectQueryImpl> where = selectQuery.where();
// WHERE (line_id = '1' OR line_id = '2' OR line_id = '3') 加上前后()

View File

@@ -1,15 +1,15 @@
package com.njcn.event.pojo;
import com.njcn.influx.deprecated.InfluxDBPublicParam;
import lombok.Data;
import org.influxdb.annotation.Column;
import org.influxdb.annotation.Measurement;
import java.time.Instant;
import static com.njcn.influxdb.param.InfluxDBPublicParam.PQS_EVENT_DETAIL;
@Data
@Measurement(name = PQS_EVENT_DETAIL)
@Measurement(name = InfluxDBPublicParam.PQS_EVENT_DETAIL)
public class PqsEventDetail {
@Column(name = "line_id")

View File

@@ -1,15 +1,15 @@
package com.njcn.event.pojo;
import com.njcn.influx.deprecated.InfluxDBPublicParam;
import lombok.Data;
import org.influxdb.annotation.Column;
import org.influxdb.annotation.Measurement;
import java.time.Instant;
import static com.njcn.influxdb.param.InfluxDBPublicParam.PQS_EVENT_DETAIL;
@Data
@Measurement(name = PQS_EVENT_DETAIL)
@Measurement(name = InfluxDBPublicParam.PQS_EVENT_DETAIL)
public class PqsEventDetailCount {
@Column(name = "time")