融合服务-数据资源bug修复
This commit is contained in:
parent
0f20088c46
commit
13934c1da9
|
@ -168,10 +168,11 @@ public class TbFuseServiceImpl extends CrudServiceImpl<TbFuseDao, TbFuseEntity,
|
|||
AtomicInteger pageIndex = new AtomicInteger(1);
|
||||
AtomicBoolean end = new AtomicBoolean(true);
|
||||
List<CompletableFuture> completableFutures=new CopyOnWriteArrayList<>();
|
||||
while(end.get()){
|
||||
do {
|
||||
completableFutures.add(CompletableFuture.supplyAsync(()->{
|
||||
Optional<AbstractDataResourceService> factory = DataResourceFactory.build();
|
||||
if (factory.isPresent()) {
|
||||
try {
|
||||
GetDataResourceListDto dto=new GetDataResourceListDto().setPageNum(pageIndex.get()).setPageSize(pageSize);
|
||||
Map<String, Object> dataResource = (Map<String, Object>) factory.get().getDataResource(dto);
|
||||
if(!dataResource.isEmpty()){
|
||||
|
@ -185,14 +186,27 @@ public class TbFuseServiceImpl extends CrudServiceImpl<TbFuseDao, TbFuseEntity,
|
|||
}
|
||||
}), list);}};
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.info("获取数据资源异常:", e);
|
||||
end.set(false);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
return new HashMap<>();
|
||||
}).thenAcceptAsync(map->{
|
||||
if(map != null){
|
||||
if(!map.isEmpty()){
|
||||
result.putAll(map);
|
||||
}else{
|
||||
end.set(false);
|
||||
}
|
||||
}));
|
||||
|
||||
try {
|
||||
Thread.sleep(300); // 防止任务运行过快,无法跳出循环
|
||||
} catch (InterruptedException e) {
|
||||
logger.info("获取数据资源异常", e);
|
||||
}
|
||||
|
||||
} while(end.get());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -204,7 +218,7 @@ public class TbFuseServiceImpl extends CrudServiceImpl<TbFuseDao, TbFuseEntity,
|
|||
List<TbFuseResourceEntity> list = fuseResourceDao.selectList(wrapper);
|
||||
Map<String, List<TbFuseResourceEntity>> resourceMap = list.stream().filter(index -> index.getType() != null).collect(Collectors.groupingBy(TbFuseResourceEntity::getType));
|
||||
if (resourceMap.containsKey("数据资源")) {
|
||||
//dataResourceMap.putAll(getDataResource());
|
||||
dataResourceMap.putAll(getDataResource());
|
||||
}
|
||||
resourceMap.forEach((type, value) -> {
|
||||
if ("组件服务".equals(type)) {
|
||||
|
|
Loading…
Reference in New Issue