From 9048a177e7642b4f3700c74438c20b0f9ea06688 Mon Sep 17 00:00:00 2001 From: Shu Guang <61069967+shuguangnet@users.noreply.github.com> Date: Fri, 23 May 2025 18:03:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8F=90=E4=BA=A4=E5=90=8E=E7=AB=AF?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../luozhihui/project/controller/CarRentController.java | 8 ++++---- .../luozhihui/project/controller/GetCountController.java | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/backend/src/main/com/luozhihui/project/controller/CarRentController.java b/backend/src/main/com/luozhihui/project/controller/CarRentController.java index b79e6a1..002fa2e 100644 --- a/backend/src/main/com/luozhihui/project/controller/CarRentController.java +++ b/backend/src/main/com/luozhihui/project/controller/CarRentController.java @@ -17,10 +17,10 @@ public class CarRentController { try { // 添加订单 carRentMapper.addorder(order); - // 更新车辆状态 + // 更新状态 carRentMapper.updateCarStatus(Integer.valueOf(order.getCarId())); // 返回成功消息 - return new ApiResponse(null, 200, "租车成功"); + return new ApiResponse(null, 200, "租借成功"); } catch (Exception e) { e.printStackTrace(); // 返回内部服务器错误 @@ -35,10 +35,10 @@ public class CarRentController { carRentMapper.carRented(order); // 根据订单号更新订单状态为已完成 carRentMapper.finishOrder(order.getOrderId()); - // 根据车辆号更新车辆状态为可用 + // 根据车辆号更新车位状态为可用 carRentMapper.endCarStatus(order.getCarId(), order.getParking_id()); // 返回成功消息 - return new ApiResponse(null, 200, "还车成功"); + return new ApiResponse(null, 200, "归还成功"); } catch (Exception e) { e.printStackTrace(); // 返回内部服务器错误 diff --git a/backend/src/main/com/luozhihui/project/controller/GetCountController.java b/backend/src/main/com/luozhihui/project/controller/GetCountController.java index 579c6fb..f9ab83b 100644 --- a/backend/src/main/com/luozhihui/project/controller/GetCountController.java +++ b/backend/src/main/com/luozhihui/project/controller/GetCountController.java @@ -57,10 +57,9 @@ public class GetCountController { // 获取用户总数 Double totalUser = jdbcTemplate.queryForObject("SELECT COUNT(UserId) AS total_user FROM `user` ", Double.class); data.put("total_user", totalUser != null ? totalUser : 0); - // 获取车辆总数 + // 获取车位总数 Double totalCar = jdbcTemplate.queryForObject("SELECT COUNT(CarId) AS total_car FROM `car` ", Double.class); data.put("total_car", totalCar != null ? totalCar : 0); - // 获取维修总数 Double totalRepair = jdbcTemplate.queryForObject("SELECT COUNT(RepairId) AS total_repair FROM `repair` ", Double.class); data.put("total_repair", totalRepair != null ? totalRepair : 0);