1
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -46,26 +46,10 @@ 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()) {
|
|
||||||
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());
|
.setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user