From a7068053e1e2857e9a87b02de9aa589dc3fed0c4 Mon Sep 17 00:00:00 2001 From: van Date: Wed, 22 Apr 2026 00:57:24 +0800 Subject: [PATCH] 1 --- .../service/impl/LogisticsServiceImpl.java | 48 +++++++++++++------ 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/jarvis/service/impl/LogisticsServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/jarvis/service/impl/LogisticsServiceImpl.java index 76a36b6..ad273d9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/jarvis/service/impl/LogisticsServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/jarvis/service/impl/LogisticsServiceImpl.java @@ -834,23 +834,41 @@ public class LogisticsServiceImpl implements ILogisticsService { goofishOrderNo = "无"; } - if (logisticsLinkUpdated && newLogisticsLink != null && !newLogisticsLink.trim().isEmpty()) { - logger.info("物流链接已更新(正文仅发闲鱼自动发货块) - 订单ID: {}, 新链接: {}", - order.getId(), newLogisticsLink.trim()); - } - - // 企微正文仅「闲鱼自动发货」固定版式;title 置空,整段写入 text - StringBuilder pushContent = new StringBuilder(); - pushContent.append("闲鱼自动发货:").append("\n"); - pushContent.append("单号:").append(goofishOrderNo).append("\n"); - pushContent.append("型号:").append(modelStr).append("\n"); - pushContent.append("收货地址:").append(addressStr).append("\n"); - pushContent.append("运单号:").append(waybillNo).append("\n"); - - String fullText = pushContent.toString(); - boolean useGoofishWecom = erpGoofishOrderService.hasLinkedGoofishOrder(order.getId()) || (distributionMark != null && distributionMark.contains("闲鱼")); + + String fullText; + if (useGoofishWecom) { + // 闲鱼:仅「闲鱼自动发货」块,便于复制到平台 + StringBuilder goofish = new StringBuilder(); + goofish.append("闲鱼自动发货:").append("\n"); + goofish.append("单号:").append(goofishOrderNo).append("\n"); + goofish.append("型号:").append(modelStr).append("\n"); + goofish.append("收货地址:").append(addressStr).append("\n"); + goofish.append("运单号:").append(waybillNo).append("\n"); + fullText = goofish.toString(); + } else { + // 非闲鱼:沿用京东物流信息完整版式(与历史 PDD 通道一致),不出现「闲鱼自动发货」 + StringBuilder std = new StringBuilder(); + std.append("JD物流信息推送").append("\n"); + std.append(distributionMark).append("\n"); + if (thirdPartyOrderNo != null && !thirdPartyOrderNo.trim().isEmpty()) { + std.append("第三方单号:").append(thirdPartyOrderNo.trim()).append("\n"); + } + std.append("型号:").append(modelStr).append("\n"); + std.append("收货地址:").append(addressStr).append("\n"); + if (logisticsLinkUpdated && newLogisticsLink != null && !newLogisticsLink.trim().isEmpty()) { + std.append("【物流链接已更新】").append("\n"); + std.append("新物流链接:").append(newLogisticsLink.trim()).append("\n"); + if (oldLogisticsLink != null && !oldLogisticsLink.trim().isEmpty()) { + std.append("旧物流链接:").append(oldLogisticsLink.trim()).append("\n"); + } + std.append("\n"); + } + std.append("运单号:").append("\n").append("\n").append("\n").append("\n").append(waybillNo).append("\n"); + fullText = std.toString(); + } + if (useGoofishWecom) { String touserGoofish = getTouserByDistributionMark(distributionMark); logger.info("闲鱼关联或分销含「闲鱼」:尝试企微闲鱼自建应用 - 订单ID: {}, 分销标识: {}, 接收人: {}",