Răsfoiți Sursa

fix(build): 修复远程 b3e18f84e 引入的 ProductOrderService 编译错误

远程 chore 提交误将未完成的会员价门槛功能混入 ProductOrderService:
- getEligibleMemberPrice 方法被插入到类中错误位置, 提前用 } 闭合类,
  导致原"7.组装返回"代码段孤立在类外 (class/interface/enum expected)
- 方法内引用未定义的 userId, 应为参数 buyerId

修复: 恢复"6.更新订单时间→7.组装返回"方法完整结构,
getEligibleMemberPrice 移到类内末尾, userId 改为 buyerId
Xiaogang Liao 5 zile în urmă
părinte
comite
26d2953081

+ 9 - 11
cfc-backend/src/main/java/com/etotem/cfc/service/ProductOrderService.java

@@ -1559,9 +1559,16 @@ public class ProductOrderService {
             order.setRemark("供应商审核修改: " + changeLog.toString());
         }
 
-        // ===== 7. 组装返回 =====
+        // ===== 6. 更新订单时间 =====
         order.setUpdatedAt(new Date());
         orderMapper.updateById(order);
+
+        // ===== 7. 组装返回 =====
+        ProductOrderDTO dto = ProductOrderDTO.from(order);
+        Map<String, Object> result = new HashMap<>();
+        result.put("order", dto);
+        result.put("changeLog", changeLog.toString());
+        return Result.success(result);
     }
 
     /**
@@ -1584,7 +1591,7 @@ public class ProductOrderService {
         if (buyerId != null) {
             User user = userMapper.selectById(buyerId);
             if (user != null) {
-                userLevel = membershipService.getMemberLevel(userId);
+                userLevel = membershipService.getMemberLevel(buyerId);
             }
         }
         // 比较级别数字:级别数字越小越低
@@ -1597,12 +1604,3 @@ public class ProductOrderService {
         return product.getPrice();
     }
 }
-
-        // ===== 7. 组装返回 =====
-        ProductOrderDTO dto = ProductOrderDTO.from(order);
-        Map<String, Object> result = new HashMap<>();
-        result.put("order", dto);
-        result.put("changeLog", changeLog.toString());
-        return Result.success(result);
-    }
-}