This commit is contained in:
wangliwen 2022-05-25 13:49:37 +08:00
parent 3444868612
commit 9ff764fd9d
1 changed files with 3 additions and 3 deletions

View File

@ -276,8 +276,8 @@ public class CensusController {
});
});
return task;
}).collect(Collectors.toList());
CompletableFuture.allOf(completableFutures.toArray(new CompletableFuture[completableFutures.size()])).join();
}).collect(Collectors.toList()); // 所有topN部门全异步查出应用领域
CompletableFuture.allOf(completableFutures.toArray(new CompletableFuture[completableFutures.size()])).join(); // 等待所有异步任务完成
result.sort(Comparator.comparing(x ->
{
ObjectMapper mapper = new ObjectMapper();
@ -288,7 +288,7 @@ public class CensusController {
throw new RuntimeException(e);
}
}).reversed().thenComparing(i -> i.toString())
);
); // 按应用领域数目逆序排序
return new Result<List<Map<String, Object>>>().ok(result);
}