代码调整
This commit is contained in:
@@ -3,8 +3,11 @@ package com.njcn.influxdb.config;
|
|||||||
import com.njcn.influxdb.utils.InfluxDbUtils;
|
import com.njcn.influxdb.utils.InfluxDbUtils;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.core.annotation.Order;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类的介绍:
|
* 类的介绍:
|
||||||
@@ -14,23 +17,20 @@ import org.springframework.context.annotation.Configuration;
|
|||||||
* @createTime 2021/12/10 10:48
|
* @createTime 2021/12/10 10:48
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Configuration
|
@Component
|
||||||
|
@ConfigurationProperties(prefix = "spring.influx")
|
||||||
public class InfluxDbConfig {
|
public class InfluxDbConfig {
|
||||||
|
|
||||||
@Value("${spring.influx.url:''}")
|
private String url;
|
||||||
private String influxDBUrl;
|
|
||||||
|
|
||||||
@Value("${spring.influx.user:''}")
|
private String user;
|
||||||
private String userName;
|
|
||||||
|
|
||||||
@Value("${spring.influx.password:''}")
|
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
@Value("${spring.influx.database:''}")
|
|
||||||
private String database;
|
private String database;
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public InfluxDbUtils influxDbUtils() {
|
public InfluxDbUtils influxDbUtils() {
|
||||||
return new InfluxDbUtils(userName, password, influxDBUrl, database, "autogen");
|
return new InfluxDbUtils(user, password, url, database, "autogen");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -283,7 +283,7 @@ public class OverviewServiceImpl implements OverviewService {
|
|||||||
//获取部门数据
|
//获取部门数据
|
||||||
Dept data = deptFeignClient.getDeptById(id).getData();
|
Dept data = deptFeignClient.getDeptById(id).getData();
|
||||||
if(ObjectUtil.isNotNull(data)){
|
if(ObjectUtil.isNotNull(data)){
|
||||||
return Arrays.asList(data.getCode());
|
return Arrays.asList(data.getCode());
|
||||||
}
|
}
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,14 +25,12 @@ import java.util.Map;
|
|||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
* @createTime 2022/11/28 - 10:09
|
* @createTime 2022/11/28 - 10:09
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Slf4j
|
|
||||||
public class DataExceptionInfluxServiceImpl implements DataExceptionInfluxService {
|
public class DataExceptionInfluxServiceImpl implements DataExceptionInfluxService {
|
||||||
|
|
||||||
// private final InfluxDbUtils influxDbUtils;
|
private final InfluxDbUtils influxDbUtils;
|
||||||
|
|
||||||
private final InfluxDbUtils influxDbUtils = new InfluxDbUtils("admin", "njcnpqs", "http://192.168.1.18:8086", "pqsbase", "");
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 取前四项指标(相别为A)
|
* 取前四项指标(相别为A)
|
||||||
|
|||||||
@@ -31,9 +31,7 @@ import java.util.Map;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class DataIntegrityRateInfluxServiceImpl implements DataIntegrityRateInfluxService {
|
public class DataIntegrityRateInfluxServiceImpl implements DataIntegrityRateInfluxService {
|
||||||
|
|
||||||
// private final InfluxDbUtils influxDbUtils;
|
private final InfluxDbUtils influxDbUtils;
|
||||||
|
|
||||||
private final InfluxDbUtils influxDbUtils = new InfluxDbUtils("admin", "njcnpqs", "http://192.168.1.18:8086", "pqsbase", "");
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取data_v表五项稳态指标日数量
|
* 获取data_v表五项稳态指标日数量
|
||||||
|
|||||||
@@ -43,8 +43,6 @@ import java.util.Objects;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class DataIntegrityRateServiceImpl implements DataIntegrityRateService {
|
public class DataIntegrityRateServiceImpl implements DataIntegrityRateService {
|
||||||
|
|
||||||
private final InfluxDbUtils influxDbUtils;
|
|
||||||
|
|
||||||
private final RMpIntegrityDMapper rMpIntegrityDMapper;
|
private final RMpIntegrityDMapper rMpIntegrityDMapper;
|
||||||
|
|
||||||
private final DistributionMonitorClient distributionMonitorClient;
|
private final DistributionMonitorClient distributionMonitorClient;
|
||||||
|
|||||||
Reference in New Issue
Block a user