From ff7acb1b739b834768d3a048a83574f8f2249cbb Mon Sep 17 00:00:00 2001 From: Jack <46790855@qq.com> Date: Thu, 13 Nov 2025 15:40:25 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E6=94=B6=E8=B4=A7=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=20url=20=E6=96=B9=E6=B3=95=E6=94=B9=E6=88=90=E5=BC=82?= =?UTF-8?q?=E6=AD=A5=E6=93=8D=E4=BD=9C=EF=BC=8C=E9=98=B2=E6=AD=A2=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E7=9A=84api=E6=97=B6=E9=95=BF=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/LklReceiveNotifyLogServiceImpl.java | 1 - .../impl/ShopOrderBaseServiceImpl.java | 41 ++++++++++++++++++- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklReceiveNotifyLogServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklReceiveNotifyLogServiceImpl.java index d24d806f..9b0e27f5 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklReceiveNotifyLogServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklReceiveNotifyLogServiceImpl.java @@ -86,7 +86,6 @@ public class LklReceiveNotifyLogServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); queryWrapper.eq("order_id", orderId); diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderBaseServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderBaseServiceImpl.java index 94f5b898..7d6e77e4 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderBaseServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderBaseServiceImpl.java @@ -385,8 +385,10 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl jumpPathOrderIds = new ArrayList<>(); // 处理符合条件的订单 for (ShopOrderBase order_row : order_rows) { // 只处理符合条件的订单 @@ -5076,7 +5080,8 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl receive_id_row.contains(order.getOrder_id())) @@ -5176,10 +5186,39 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl orderIds) { + if (CollectionUtils.isEmpty(orderIds)) { + return; + } + + CompletableFuture.runAsync(() -> { + for (String orderId : orderIds) { + try { + // 控制API调用频率 + Thread.sleep(300); // 根据实际API限制调整 + wxOrderShippingService.setMsgJumpPath(orderId); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + log.warn("[异步处理] 线程中断,订单ID: {}", orderId); + break; + } catch (Exception e) { + log.warn("[异步处理] 消息跳转路径设置失败,订单ID: {}, 错误: {}", orderId, e.getMessage()); + // 继续处理下一个订单 + } + } + }, executor); + } + /** * 订单确认收货(定时任务用途)