This commit is contained in:
van
2026-04-05 23:22:21 +08:00
parent 1b4a73cd25
commit 6a43af0a34
2 changed files with 19 additions and 6 deletions

View File

@@ -9,7 +9,8 @@ public interface IJDOrderProfitService {
/**
* 根据分销标识、型号配置、手动标记等,填充售价(自动时)并计算利润。
* F :利润 = 对客实收(直款=售价,闲鱼=扣点后的到账)-(下单付款 - 后返金额)
* F / H-TF:利润 = 对客实收(直款=售价,闲鱼=扣点后的到账)-(下单付款 - 后返金额)
* H-TF 未配置型号直款价时回退为固定 15 / 凡- 开头 65。
* 会修改传入的 {@code order}。
*/
void recalculate(JDOrder order);

View File

@@ -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;
}