feat: 提交后端代码

This commit is contained in:
Shu Guang 2025-05-23 18:03:12 +08:00
parent a232ee0af7
commit 9048a177e7
2 changed files with 5 additions and 6 deletions

View File

@ -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();
// 返回内部服务器错误

View File

@ -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);