Kaynağa Gözat

fix(order): 特价单定价固定为特价,修复服务者价覆盖特价的问题

createSpecialDealOrder 从普通 create() 复制的 fv.unitPrice 覆盖逻辑,
会在配送方式=4(线上-可选人)时用服务者价格顶替特价,违反规格 §5.2
'unitPrice = specialPrice(覆盖会员价)'。移除该覆盖,使特价单始终按特价结算。
Sisyphus 1 ay önce
ebeveyn
işleme
52523050a3

+ 3 - 7
cfc-backend/src/main/java/com/etotem/cfc/service/ProductOrderService.java

@@ -450,13 +450,9 @@ public class ProductOrderService {
         }
         order.setDeliveryMethod(fv.deliveryMethod != null ? fv.deliveryMethod
                 : (dto.getDeliveryMethod() != null ? dto.getDeliveryMethod() : 1));
-        // 履约扩展校验结果(与 create 一致)
-        if (fv.unitPrice != null) {
-            order.setUnitPrice(fv.unitPrice);
-            order.setTotalAmount(fv.unitPrice * quantity);
-            int ma = order.getTotalAmount() - order.getPointsCost() - discountAmount;
-            order.setMoneyAmount(ma > 0 ? ma : 0);
-        }
+        // 履约扩展校验结果:特价单定价固定为特价(规格 §5.2 unitPrice = specialPrice,覆盖会员价),
+        // 不复用 create() 的 fv.unitPrice 覆盖——线上可选人(服务者)等履约扩展价不适用于特价单,
+        // 否则会顶替特价破坏扫码闪购定价。fv.unitPrice 为空时不做任何覆盖,保持上方特价结算。
         if (fv.pickupLocationId != null) order.setPickupLocationId(fv.pickupLocationId);
         if (fv.pickupLocationSnapshot != null) order.setPickupLocationSnapshot(fv.pickupLocationSnapshot);
         if (fv.timeSlotId != null) order.setTimeSlotId(fv.timeSlotId);