Commit 1fec7d86 authored by tangwei's avatar tangwei

增加配置

parent e751690f
...@@ -13,10 +13,12 @@ import org.influxdb.dto.QueryResult; ...@@ -13,10 +13,12 @@ import org.influxdb.dto.QueryResult;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@Service
public class StationDataTaskImpl implements IStationDataTask { public class StationDataTaskImpl implements IStationDataTask {
@Autowired @Autowired
StationBasicServiceImpl stationBasicServiceImpl; StationBasicServiceImpl stationBasicServiceImpl;
...@@ -35,6 +37,10 @@ public class StationDataTaskImpl implements IStationDataTask { ...@@ -35,6 +37,10 @@ public class StationDataTaskImpl implements IStationDataTask {
@Value("${station.section}") @Value("${station.section}")
private int stationSection; private int stationSection;
@Value("${station.isok}")
private boolean isok;
@Override @Override
public List<StationTaksDto> getListStationBasic() { public List<StationTaksDto> getListStationBasic() {
List<StationTaksDto> stationTaksDtoList = new ArrayList<>(); List<StationTaksDto> stationTaksDtoList = new ArrayList<>();
...@@ -70,7 +76,7 @@ public class StationDataTaskImpl implements IStationDataTask { ...@@ -70,7 +76,7 @@ public class StationDataTaskImpl implements IStationDataTask {
//每个分机的指标数据 //每个分机的指标数据
List<IndexDto> list = null; List<IndexDto> list = null;
QueryResult query = influxDbConnection.query("SELECT * FROM iot_data where \"equipmentSpecificName\" =~/.*" + deviceDto.getNumberName() + ".*/ and \"gatewayId\" =~/" + deviceDto.getGateway() + "/ group by \"equipmentsIdx\" limit 1"); QueryResult query = influxDbConnection.query("SELECT * FROM iot_data where \"equipmentSpecificName\" =~/.*"+ deviceDto.getNumberName()+".*/ and \"gatewayId\" =~/" + deviceDto.getGateway() + "/ group by \"equipmentsIdx\" limit 1");
List<QueryResult.Result> queryResults = query.getResults(); List<QueryResult.Result> queryResults = query.getResults();
for (int i = 0; i < queryResults.size(); i++) { for (int i = 0; i < queryResults.size(); i++) {
QueryResult.Result result = queryResults.get(i); QueryResult.Result result = queryResults.get(i);
...@@ -84,10 +90,9 @@ public class StationDataTaskImpl implements IStationDataTask { ...@@ -84,10 +90,9 @@ public class StationDataTaskImpl implements IStationDataTask {
} }
} }
if(list!=null&&list.size()>0){ if(list!=null&&list.size()>0){
//对数据切片处理 默认创建 //对数据切片处理 默认创建
if(stationSection>list.size()){ if(stationSection>list.size()||!isok){
monitorFanIndicatorImpl.UpdateMonitorFanIndicator(list); monitorFanIndicatorImpl.UpdateMonitorFanIndicator(list);
}else{ }else{
//进行分片处理 //进行分片处理
......
...@@ -67,5 +67,7 @@ feign.client.config.default.connect-timeout=20000 ...@@ -67,5 +67,7 @@ feign.client.config.default.connect-timeout=20000
feign.client.config.default.read-timeout=20000 feign.client.config.default.read-timeout=20000
#场站实时数据 #场站实时数据
station.task.cron= station.task.cron=
#是否切片
station.isok=true
#风机更新数据切片量 #风机更新数据切片量
station.section=10 station.section=10
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment