This commit is contained in:
van
2026-06-10 19:35:54 +08:00
parent e890039dea
commit 546cd8eb04
5 changed files with 35 additions and 23 deletions

View File

@@ -20,6 +20,10 @@ public class PromoterOrderInfoVO {
private String cosPrice;
private String orderTime;
private String finishTime;
/** 价保/赔付金额 */
private String proPriceAmount;
/** 价保/赔付更新时间(有金额时取订单 modify_time */
private String proPriceTime;
public String getShopName() {
return shopName;
@@ -140,4 +144,20 @@ public class PromoterOrderInfoVO {
public void setFinishTime(String finishTime) {
this.finishTime = finishTime;
}
public String getProPriceAmount() {
return proPriceAmount;
}
public void setProPriceAmount(String proPriceAmount) {
this.proPriceAmount = proPriceAmount;
}
public String getProPriceTime() {
return proPriceTime;
}
public void setProPriceTime(String proPriceTime) {
this.proPriceTime = proPriceTime;
}
}

View File

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

View File

@@ -46,25 +46,9 @@ public class JDOrderProfitServiceImpl implements IJDOrderProfitService {
if ("H-TF".equals(mark)) {
if (!profitLocked) {
// 与 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("凡-");
double base = fan ? 65.0 : 15.0;
order.setProfit(BigDecimal.valueOf(base - extraCostOrZero(order))
.setScale(2, RoundingMode.HALF_UP).doubleValue());
}
// H-TF 固定利润 15再扣额外成本不走 F 单售价公式)
order.setProfit(BigDecimal.valueOf(15.0 - extraCostOrZero(order))
.setScale(2, RoundingMode.HALF_UP).doubleValue());
}
return;
}