CompletableFuture<List<Map<String, Object>>> future01 = CompletableFuture.supplyAsync(() -> { List<Map<String, Object>> list = queryJobMapper.queryjoblog(companyFeignDTO, companyNumList.getData()); return list; }); CompletableFuture<Long> future02 = CompletableFuture.supplyAsync(() -> { long count = queryJobMapper.queryjoblogCount(companyFeignDTO, companyNumList.getData()); return count; }); CompletableFuture.allOf(future01, future02).get();
记录一下,防止忘记