This commit is contained in:
wangliwen 2022-10-13 14:50:23 +08:00
parent a6733814ae
commit b45316d33b
1 changed files with 5 additions and 0 deletions

View File

@ -176,6 +176,9 @@ public class TbFuseServiceImpl extends CrudServiceImpl<TbFuseDao, TbFuseEntity,
Map<String, Object> dataResource = (Map<String, Object>) factory.get().getDataResource(dto);
if (!dataResource.isEmpty()) {
List<Map<String, Object>> list = (List<Map<String, Object>>) dataResource.get("data");
if (list.size() < pageSize) {
end.set(false);
}
pageIndex.getAndIncrement();
return new HashMap() {{
put(list.stream().map(map -> {
@ -205,9 +208,11 @@ public class TbFuseServiceImpl extends CrudServiceImpl<TbFuseDao, TbFuseEntity,
Thread.sleep(300); // 防止任务运行过快无法跳出循环
} catch (InterruptedException e) {
logger.info("获取数据资源异常", e);
end.set(false);
}
} while (end.get());
CompletableFuture.allOf(completableFutures.toArray(new CompletableFuture[completableFutures.size()])).join();
return result;
}