1
This commit is contained in:
@@ -9,7 +9,8 @@ public interface IJDOrderProfitService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据分销标识、型号配置、手动标记等,填充售价(自动时)并计算利润。
|
* 根据分销标识、型号配置、手动标记等,填充售价(自动时)并计算利润。
|
||||||
* F 单:利润 = 对客实收(直款=售价,闲鱼=扣点后的到账)-(下单付款 - 后返金额)。
|
* F / H-TF:利润 = 对客实收(直款=售价,闲鱼=扣点后的到账)-(下单付款 - 后返金额);
|
||||||
|
* H-TF 未配置型号直款价时回退为固定 15 / 凡- 开头 65。
|
||||||
* 会修改传入的 {@code order}。
|
* 会修改传入的 {@code order}。
|
||||||
*/
|
*/
|
||||||
void recalculate(JDOrder order);
|
void recalculate(JDOrder order);
|
||||||
|
|||||||
@@ -28,12 +28,24 @@ public class JDOrderProfitServiceImpl implements IJDOrderProfitService {
|
|||||||
boolean sellingLocked = order.getSellingPriceManual() != null && order.getSellingPriceManual() == 1;
|
boolean sellingLocked = order.getSellingPriceManual() != null && order.getSellingPriceManual() == 1;
|
||||||
|
|
||||||
if ("H-TF".equals(mark)) {
|
if ("H-TF".equals(mark)) {
|
||||||
order.setSellingPriceType(null);
|
|
||||||
order.setSellingPrice(null);
|
|
||||||
if (!profitLocked) {
|
if (!profitLocked) {
|
||||||
String buyer = order.getBuyer();
|
// 与 F 单一致:利润 = 对客实收 − (下单付款 − 后返)。列表未填售价时默认直款并从型号配置取价。
|
||||||
boolean fan = buyer != null && buyer.trim().startsWith("凡-");
|
String type = order.getSellingPriceType();
|
||||||
order.setProfit(fan ? 65.0 : 15.0);
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user