//车源信息
CompletableFuture<CarSourceHttpAdapter.CarSourceInfo> carSourceInfoFuture = CompletableFuture.supplyAsync(() -> carSourceHttpAdapter.getCarInfoByClueId(claimCases.getClueId()));
CarSourceHttpAdapter.CarSourceInfo carSourceInfo = getResult(carSourceInfoFuture);
public static <T> T getResult(Future<T> future) {
T result = null;
try {
result = future.get(1000, TimeUnit.MILLISECONDS);
} catch (Exception e) {
log.error("调用第三方接口异常", e);
}
return result;
}
//复检师信息
//复检师id
CompletableFuture<Integer> evaluatorIdFuture = CompletableFuture.supplyAsync(() -> evaluateHttpAdapter.getEvaluatorIdByClueId(clueId));
//根据复检师id获取复检师详情
CompletableFuture<StaffHttpAdapter.StaffInfo> evaluatorFuture = evaluatorIdFuture.thenApplyAsync(evaluatorId -> staffHttpAdapter.getStaffInfoById(evaluatorId));
Map<Integer, Integer> requestMap = orderDetailList.stream().filter(detailParam -> detailParam.getOrderContentDetailId() != null).
collect(Collectors.*groupingBy*(BusinessOrderDetailParam::getOrderContentDetailId, Collectors.*summingInt*(BusinessOrderDetailParam::getUseNum)));
网友评论