|
|
@@ -4319,11 +4319,19 @@ public class KwtWaybillOrderV1Service {
|
|
|
|
|
|
// 等待所有并行查询完成
|
|
|
log.debug("等待所有并行查询完成");
|
|
|
- CompletableFuture.allOf(
|
|
|
- truckFuture, fleetFuture, addressFuture, ticketFuture, userFuture,
|
|
|
- goodsFuture, orderDetailFuture, unitFuture, nodeFuture, waybillSubtaskFuture,
|
|
|
- contractFuture
|
|
|
- ).join();
|
|
|
+ try {
|
|
|
+ CompletableFuture.allOf(
|
|
|
+ truckFuture, fleetFuture, addressFuture, ticketFuture, userFuture,
|
|
|
+ goodsFuture, orderDetailFuture, unitFuture, nodeFuture, waybillSubtaskFuture,
|
|
|
+ contractFuture
|
|
|
+ ).get(30, TimeUnit.SECONDS);
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ // 超时会抛出 TimeoutException
|
|
|
+ // 任意任务失败会抛出 ExecutionException
|
|
|
+ // 中断会抛出 InterruptedException
|
|
|
+ throw new RuntimeException("批量异步任务执行失败/超时", e);
|
|
|
+ }
|
|
|
log.debug("所有并行查询完成");
|
|
|
|
|
|
// 获取查询结果
|