diff --git a/src/main/java/com/cultural/heritage/controller/order/AdvanceOrderController.java b/src/main/java/com/cultural/heritage/controller/order/AdvanceOrderController.java index 74b8f1a..39738b4 100644 --- a/src/main/java/com/cultural/heritage/controller/order/AdvanceOrderController.java +++ b/src/main/java/com/cultural/heritage/controller/order/AdvanceOrderController.java @@ -185,6 +185,30 @@ public class AdvanceOrderController { + /** + * 小程序端用户根据id查询订单 + * @param commonRequest 订单id + * @return 是否取消成功 + */ + @PostMapping ("/get/id") + @Operation(summary = "小程序端用户根据id查询订单", description = "参数:订单id,权限:所有人,方法名:queryOrderById") + public BaseResponse queryOrderById(@RequestBody CommonRequest commonRequest, HttpServletRequest request) { + if (commonRequest == null || commonRequest.getId() <= 0) { + throw new BusinessException(ErrorCode.PARAMS_ERROR); + } + Long id = commonRequest.getId(); + userService.getLoginUser(request); + AdvanceOrder advanceOrder = advanceOrderService.getById(id); + ThrowUtils.throwIf(advanceOrder == null, ErrorCode.OPERATION_ERROR, "订单不存在"); + AdvanceOrderVO advanceOrderVO = commonService.copyProperties(advanceOrder, AdvanceOrderVO.class); + + return ResultUtils.success(advanceOrderVO); + } + + + + + /** diff --git a/src/main/java/com/cultural/heritage/controller/order/ClothesRentOrderController.java b/src/main/java/com/cultural/heritage/controller/order/ClothesRentOrderController.java index 1620f0e..7c305cb 100644 --- a/src/main/java/com/cultural/heritage/controller/order/ClothesRentOrderController.java +++ b/src/main/java/com/cultural/heritage/controller/order/ClothesRentOrderController.java @@ -246,6 +246,28 @@ public class ClothesRentOrderController { + /** + * 小程序端用户根据id查询服装租赁订单 + * @return 是否删除成功 + */ + @PostMapping("/get/id") + @Operation(summary = "小程序端用户根据id查询服装租赁订单", description = "参数:无, 权限:所有人,方法名:queryClothesRentOrderById") + public BaseResponse queryClothesRentOrderById(@RequestBody CommonRequest commonRequest, HttpServletRequest request) { + if (commonRequest == null) { + throw new BusinessException(ErrorCode.PARAMS_ERROR); + } + User loginUser = userService.getLoginUser(request); + Long id = commonRequest.getId(); + ClothesRentOrder clothesRentOrder = clothesRentOrderService.getById(id); + ThrowUtils.throwIf(clothesRentOrder == null, ErrorCode.OPERATION_ERROR, "订单不存在"); + ClothesRentOrderVO clothesRentOrderVO = commonService.copyProperties(clothesRentOrder, ClothesRentOrderVO.class); + clothesRentOrderVO.setUserName(loginUser.getUserName()); + return ResultUtils.success(clothesRentOrderVO); + } + + + + /** * Web端管理员更新服装租赁订单状态