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

@@ -125,6 +125,13 @@ public class PublicPromoterOrderController {
vo.setCosPrice(formatPrice(row)); vo.setCosPrice(formatPrice(row));
vo.setOrderTime(formatDate(row.getOrderTime())); vo.setOrderTime(formatDate(row.getOrderTime()));
vo.setFinishTime(formatDate(row.getFinishTime())); vo.setFinishTime(formatDate(row.getFinishTime()));
Double proPrice = row.getProPriceAmount();
if (proPrice != null && proPrice > 0) {
vo.setProPriceAmount(String.format("%.2f", proPrice));
vo.setProPriceTime(formatDate(row.getModifyTime()));
} else {
vo.setProPriceAmount("0.00");
}
return vo; return vo;
} }

View File

@@ -20,6 +20,10 @@ public class PromoterOrderInfoVO {
private String cosPrice; private String cosPrice;
private String orderTime; private String orderTime;
private String finishTime; private String finishTime;
/** 价保/赔付金额 */
private String proPriceAmount;
/** 价保/赔付更新时间(有金额时取订单 modify_time */
private String proPriceTime;
public String getShopName() { public String getShopName() {
return shopName; return shopName;
@@ -140,4 +144,20 @@ public class PromoterOrderInfoVO {
public void setFinishTime(String finishTime) { public void setFinishTime(String finishTime) {
this.finishTime = 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:利润 = 对客实收(直款=售价,闲鱼=扣点后的到账)-(下单付款 - 后返金额); * F利润 = 对客实收(直款=售价,闲鱼=扣点后的到账)-(下单付款 - 后返金额);
* H-TF 未配置型号直款价时回退为固定 15 / 凡- 开头 65 * H-TF:固定利润 15再扣额外成本
* 会修改传入的 {@code order}。 * 会修改传入的 {@code order}。
*/ */
void recalculate(JDOrder order); void recalculate(JDOrder order);

View File

@@ -46,25 +46,9 @@ public class JDOrderProfitServiceImpl implements IJDOrderProfitService {
if ("H-TF".equals(mark)) { if ("H-TF".equals(mark)) {
if (!profitLocked) { if (!profitLocked) {
// 与 F 单一致:利润 = 对客实收 (下单付款 后返) 额外成本。列表未填售价时默认直款并从型号配置取价。 // H-TF 固定利润 15再扣额外成本不走 F 单售价公式)
String type = order.getSellingPriceType(); order.setProfit(BigDecimal.valueOf(15.0 - extraCostOrZero(order))
if (type == null || type.isEmpty()) { .setScale(2, RoundingMode.HALF_UP).doubleValue());
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());
}
} }
return; return;
} }

View File

@@ -1,7 +1,8 @@
-- 预览:待回填 goods_info 的订单号goods_info_id 为空) -- 预览:待回填 goods_info 的订单号goods_info_id 为空)
SELECT DISTINCT order_id SELECT order_id
FROM order_rows FROM order_rows
WHERE goods_info_id IS NULL WHERE goods_info_id IS NULL
AND order_id IS NOT NULL AND order_id IS NOT NULL
ORDER BY order_time DESC GROUP BY order_id
ORDER BY MAX(order_time) DESC
LIMIT 100; LIMIT 100;