This commit is contained in:
van
2026-04-22 00:57:24 +08:00
parent babe687679
commit a7068053e1

View File

@@ -834,23 +834,41 @@ public class LogisticsServiceImpl implements ILogisticsService {
goofishOrderNo = ""; 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()) boolean useGoofishWecom = erpGoofishOrderService.hasLinkedGoofishOrder(order.getId())
|| (distributionMark != null && distributionMark.contains("闲鱼")); || (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) { if (useGoofishWecom) {
String touserGoofish = getTouserByDistributionMark(distributionMark); String touserGoofish = getTouserByDistributionMark(distributionMark);
logger.info("闲鱼关联或分销含「闲鱼」:尝试企微闲鱼自建应用 - 订单ID: {}, 分销标识: {}, 接收人: {}", logger.info("闲鱼关联或分销含「闲鱼」:尝试企微闲鱼自建应用 - 订单ID: {}, 分销标识: {}, 接收人: {}",