diff --git a/ruoyi-system/src/main/java/com/ruoyi/jarvis/service/IJDOrderProfitService.java b/ruoyi-system/src/main/java/com/ruoyi/jarvis/service/IJDOrderProfitService.java index f0dfd39..876330b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/jarvis/service/IJDOrderProfitService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/jarvis/service/IJDOrderProfitService.java @@ -9,7 +9,8 @@ public interface IJDOrderProfitService { /** * 根据分销标识、型号配置、手动标记等,填充售价(自动时)并计算利润。 - * F 单:利润 = 对客实收(直款=售价,闲鱼=扣点后的到账)-(下单付款 - 后返金额)。 + * F / H-TF:利润 = 对客实收(直款=售价,闲鱼=扣点后的到账)-(下单付款 - 后返金额); + * H-TF 未配置型号直款价时回退为固定 15 / 凡- 开头 65。 * 会修改传入的 {@code order}。 */ void recalculate(JDOrder order); diff --git a/ruoyi-system/src/main/java/com/ruoyi/jarvis/service/impl/JDOrderProfitServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/jarvis/service/impl/JDOrderProfitServiceImpl.java index f0ff391..d68a15a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/jarvis/service/impl/JDOrderProfitServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/jarvis/service/impl/JDOrderProfitServiceImpl.java @@ -28,12 +28,24 @@ public class JDOrderProfitServiceImpl implements IJDOrderProfitService { boolean sellingLocked = order.getSellingPriceManual() != null && order.getSellingPriceManual() == 1; if ("H-TF".equals(mark)) { - order.setSellingPriceType(null); - order.setSellingPrice(null); if (!profitLocked) { - String buyer = order.getBuyer(); - boolean fan = buyer != null && buyer.trim().startsWith("凡-"); - order.setProfit(fan ? 65.0 : 15.0); + // 与 F 单一致:利润 = 对客实收 − (下单付款 − 后返)。列表未填售价时默认直款并从型号配置取价。 + String type = order.getSellingPriceType(); + if (type == null || type.isEmpty()) { + order.setSellingPriceType("direct"); + } + if (!sellingLocked && order.getSellingPrice() == null) { + fillSellingPriceFromConfig(order); + } + String effType = order.getSellingPriceType(); + Double sp = order.getSellingPrice(); + if (effType != null && !effType.isEmpty() && sp != null) { + computeProfitForF(order); + } else { + String buyer = order.getBuyer(); + boolean fan = buyer != null && buyer.trim().startsWith("凡-"); + order.setProfit(fan ? 65.0 : 15.0); + } } return; }