Commit a388b8f2 authored by tangwei's avatar tangwei

增加分片

parent 9c1f0f39
...@@ -9,6 +9,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.service.IStationDataTask; ...@@ -9,6 +9,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.service.IStationDataTask;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.SjglZsjZsbtz; import com.yeejoin.amos.boot.module.jxiop.biz.entity.SjglZsjZsbtz;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.TpriDmpDatabook; import com.yeejoin.amos.boot.module.jxiop.biz.entity.TpriDmpDatabook;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -27,6 +28,9 @@ public class StationDataTaskImpl implements IStationDataTask { ...@@ -27,6 +28,9 @@ public class StationDataTaskImpl implements IStationDataTask {
MonitorFanIndicatorImpl monitorFanIndicatorImpl; MonitorFanIndicatorImpl monitorFanIndicatorImpl;
@Value("${station.section}")
private int stationSection;
@Override @Override
public List<StationTaksDto> getListStationBasic() { public List<StationTaksDto> getListStationBasic() {
List<StationTaksDto> stationTaksDtoList = new ArrayList<>(); List<StationTaksDto> stationTaksDtoList = new ArrayList<>();
...@@ -57,21 +61,30 @@ public class StationDataTaskImpl implements IStationDataTask { ...@@ -57,21 +61,30 @@ public class StationDataTaskImpl implements IStationDataTask {
@Async("jxiopAsyncExecutor") @Async("jxiopAsyncExecutor")
@Override @Override
public void getIndexDto(DeviceDto deviceDto) { public void getIndexDto(DeviceDto deviceDto) {
//每个分机的指标数据 //每个分机的指标数据
List<IndexDto> list=null; List<IndexDto> list=null;
if(list!=null&&list.size()>0){ if(list!=null&&list.size()>0){
//对数据切片处理 //对数据切片处理 默认创建
List<List<IndexDto>> listfp= Lists.partition(list,100); if(stationSection>list.size()){
for (List<IndexDto> indexDtos : listfp) { monitorFanIndicatorImpl.UpdateMonitorFanIndicator(list);
//每个分级信息处理 }else{
monitorFanIndicatorImpl.UpdateMonitorFanIndicator(indexDtos); //进行分片处理
} List<List<IndexDto>> listfp= Lists.partition(list,list.size()%stationSection);
for (List<IndexDto> indexDtos : listfp) {
//每个分级信息处理
monitorFanIndicatorImpl.UpdateMonitorFanIndicator(indexDtos);
}
}
} }
} }
} }
...@@ -65,3 +65,7 @@ spring.http.encoding.force=true ...@@ -65,3 +65,7 @@ spring.http.encoding.force=true
privilege.fegin.name=AMOS-API-PRIVILEGE privilege.fegin.name=AMOS-API-PRIVILEGE
feign.client.config.default.connect-timeout=20000 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.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