From a9b378f9e7b1a72f9e50227ca445d5135c71020a Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期三, 25 二月 2026 17:46:37 +0800
Subject: [PATCH] 处理多语言

---
 xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpOrderServiceImpl.java |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpOrderServiceImpl.java b/xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpOrderServiceImpl.java
index 7107b7b..259a723 100644
--- a/xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpOrderServiceImpl.java
+++ b/xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpOrderServiceImpl.java
@@ -715,13 +715,13 @@
     public void cancelOrder(Long orderId, String uid) {
         XpOrder order = this.getById(orderId);
         if (order == null) {
-            throw new RuntimeException("订单不存在");
+            throw new ServiceException("订单不存在",I18nKeyConstant.ORDER_NOT_EXISTS);
         }
         if (!order.getAppUserId().toString().equals(uid)) {
-            throw new RuntimeException("无权限取消该订单");
+            throw new ServiceException("订单不存在",I18nKeyConstant.ORDER_NOT_EXISTS);
         }
         if (order.getStatus() > 5 || order.getStatus() < 1) {
-            throw new RuntimeException("订单状态错误");
+            throw new ServiceException("订单状态错误",I18nKeyConstant.ORDER_STATUS_ERROR);
         }
         order.setStatus(0);
 
@@ -731,7 +731,7 @@
         R<XpVehicle> xpVehicleR = xpVehicleClient.queryById(vehicleId);
         XpVehicle xpVehicle = xpVehicleR.getData();
         if (xpVehicle == null) {
-            throw new RuntimeException("车辆不存在");
+            throw new ServiceException("车辆不存在",I18nKeyConstant.VEHICLE_NOT_EXISTS);
         }
         cancelTaxiPassengerVo.setVin(xpVehicle.getVehicleVin());
         cancelTaxiPassengerVo.setUid(order.getAppUserId().toString());
@@ -779,7 +779,7 @@
     public void cancelOrder(String orderId) {
         XpOrder order = this.getById(orderId);
         if (order == null) {
-            throw new RuntimeException("订单不存在");
+            throw new ServiceException("订单不存在",I18nKeyConstant.ORDER_NOT_EXISTS);
         }
         order.setStatus(0);
         baseMapper.updateById(order);
@@ -833,13 +833,13 @@
     public void comment(XpOrderCommentDto dto, String uid) {
         XpOrder xpOrder = this.getById(dto.getOrderId());
         if (xpOrder == null) {
-            throw new RuntimeException("订单不存在");
+            throw new ServiceException("订单不存在",I18nKeyConstant.ORDER_NOT_EXISTS);
         }
         if (!xpOrder.getAppUserId().toString().equals(uid)) {
-            throw new RuntimeException("无权限评价该订单");
+            throw new ServiceException("订单不存在",I18nKeyConstant.ORDER_NOT_EXISTS);
         }
         if (xpOrder.getStatus() != 9) {
-            throw new RuntimeException("订单状态错误");
+            throw new ServiceException("订单状态错误",I18nKeyConstant.ORDER_STATUS_ERROR);
         }
         xpOrder.setStatus(10);
         baseMapper.updateById(xpOrder);

--
Gitblit v1.7.1