From e7c991ed9c1044c4f95a9efbf8ecc7d22ec80db6 Mon Sep 17 00:00:00 2001 From: Leo Date: Fri, 21 Nov 2025 23:26:29 +0800 Subject: [PATCH] 1 --- .../system/JDOrderListController.java | 47 +++++++------------ 1 file changed, 17 insertions(+), 30 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/JDOrderListController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/JDOrderListController.java index a4db1b5..8440bd5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/JDOrderListController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/JDOrderListController.java @@ -375,42 +375,29 @@ public class JDOrderListController extends BaseController // 数量(固定为1) String quantity = "1"; - // 姓名(下单人) - String buyer = o.getBuyer() != null ? o.getBuyer() : ""; - // 地址 String address = o.getAddress() != null ? o.getAddress() : ""; - // 售价(京粉实际价格,如果没有则用付款金额-后返金额) - Double sellingPrice = o.getJingfenActualPrice(); - if (sellingPrice == null || sellingPrice == 0) { - Double payment = o.getPaymentAmount() != null ? o.getPaymentAmount() : 0.0; - Double rebate = o.getRebateAmount() != null ? o.getRebateAmount() : 0.0; - sellingPrice = payment - rebate; - } - String sellingPriceStr = sellingPrice != null && sellingPrice > 0 - ? String.format(java.util.Locale.ROOT, "%.2f", sellingPrice) : ""; - - // 成本(售价 - 利润,利润可能是后返金额) - Double cost = null; - Double rebate = o.getRebateAmount() != null ? o.getRebateAmount() : 0.0; - if (sellingPrice != null && sellingPrice > 0 && rebate > 0) { - cost = sellingPrice - rebate; - } - String costStr = cost != null && cost > 0 - ? String.format(java.util.Locale.ROOT, "%.2f", cost) : ""; - - // 利润(后返金额,或者售价-成本) - String profitStr = ""; - if (rebate > 0) { - profitStr = String.format(java.util.Locale.ROOT, "%.2f", rebate); - } else if (sellingPrice != null && sellingPrice > 0 && cost != null && cost > 0) { - double profit = sellingPrice - cost; - if (profit > 0) { - profitStr = String.format(java.util.Locale.ROOT, "%.2f", profit); + // 姓名(从地址中提取,地址格式通常是"姓名 电话 详细地址") + String buyer = ""; + if (address != null && !address.trim().isEmpty()) { + String[] addressParts = address.trim().split("\\s+"); + if (addressParts.length > 0) { + buyer = addressParts[0]; } } + // 售价(固定为0) + String sellingPriceStr = "0"; + + // 成本(售价是0,成本也设为空) + String costStr = ""; + + // 利润(后返金额) + Double rebate = o.getRebateAmount() != null ? o.getRebateAmount() : 0.0; + String profitStr = rebate > 0 + ? String.format(java.util.Locale.ROOT, "%.2f", rebate) : ""; + // 京东单号 String orderId = o.getOrderId() != null ? o.getOrderId() : "";