From 04a727d66fe9190137074230c51430912e5050ce Mon Sep 17 00:00:00 2001 From: chen-xin-zhi <3588068430@qq.com> Date: Fri, 20 Dec 2024 15:25:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BA=86=E5=95=86=E5=93=81?= =?UTF-8?q?=E7=B1=BB=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../heritage/controller/book/AdvanceOrderController.java | 6 ++++-- .../cultural/heritage/controller/order/OrderController.java | 6 +++--- .../heritage/model/dto/order/OrderUpdateRequest.java | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/cultural/heritage/controller/book/AdvanceOrderController.java b/src/main/java/com/cultural/heritage/controller/book/AdvanceOrderController.java index 43ae5a8..672907d 100644 --- a/src/main/java/com/cultural/heritage/controller/book/AdvanceOrderController.java +++ b/src/main/java/com/cultural/heritage/controller/book/AdvanceOrderController.java @@ -8,6 +8,7 @@ import com.cultural.heritage.annotation.AuthCheck; import com.cultural.heritage.common.BaseResponse; import com.cultural.heritage.common.ErrorCode; import com.cultural.heritage.common.ResultUtils; +import com.cultural.heritage.constant.OrderStatusConstant; import com.cultural.heritage.constant.UserConstant; import com.cultural.heritage.exception.BusinessException; import com.cultural.heritage.exception.ThrowUtils; @@ -157,10 +158,11 @@ public class AdvanceOrderController { throw new BusinessException(ErrorCode.PARAMS_ERROR); } Long id = orderUpdateRequest.getId(); - String orderStatus = orderUpdateRequest.getOrderStatus(); + String trackingNumber = orderUpdateRequest.getTrackingNumber(); UpdateWrapper updateWrapper = new UpdateWrapper<>(); updateWrapper.eq("id", id); - updateWrapper.set("orderStatus", orderStatus); + updateWrapper.set("trackingNumber", trackingNumber); + updateWrapper.set("orderStatus", OrderStatusConstant.PENDING_DELIVERY); boolean result = advanceOrderService.update(updateWrapper); ThrowUtils.throwIf(!result, ErrorCode.OPERATION_ERROR); return ResultUtils.success(true); diff --git a/src/main/java/com/cultural/heritage/controller/order/OrderController.java b/src/main/java/com/cultural/heritage/controller/order/OrderController.java index 9475c39..1deeb98 100644 --- a/src/main/java/com/cultural/heritage/controller/order/OrderController.java +++ b/src/main/java/com/cultural/heritage/controller/order/OrderController.java @@ -242,10 +242,11 @@ public class OrderController { throw new BusinessException(ErrorCode.PARAMS_ERROR); } Long id = orderUpdateRequest.getId(); - String orderStatus = orderUpdateRequest.getOrderStatus(); + String trackingNumber = orderUpdateRequest.getTrackingNumber(); UpdateWrapper updateWrapper = new UpdateWrapper<>(); updateWrapper.eq("id", id); - updateWrapper.set("orderStatus", orderStatus); + updateWrapper.set("trackingNumber", trackingNumber); + updateWrapper.set("orderStatus", OrderStatusConstant.PENDING_DELIVERY); boolean result = orderService.update(updateWrapper); ThrowUtils.throwIf(!result, ErrorCode.OPERATION_ERROR); return ResultUtils.success(true); @@ -259,7 +260,6 @@ public class OrderController { */ @PostMapping ("/get/id") @Operation(summary = "小程序端用户根据id查询订单", description = "参数:根据id查询请求体,权限:所有人,方法名:getOrderById") - @AuthCheck(mustRole = UserConstant.ADMIN_ROLE) public BaseResponse getOrderById(@RequestBody CommonRequest commonRequest, HttpServletRequest request) { if (commonRequest == null || commonRequest.getId() <= 0) { throw new BusinessException(ErrorCode.PARAMS_ERROR); diff --git a/src/main/java/com/cultural/heritage/model/dto/order/OrderUpdateRequest.java b/src/main/java/com/cultural/heritage/model/dto/order/OrderUpdateRequest.java index bbcb831..ea9d928 100644 --- a/src/main/java/com/cultural/heritage/model/dto/order/OrderUpdateRequest.java +++ b/src/main/java/com/cultural/heritage/model/dto/order/OrderUpdateRequest.java @@ -20,8 +20,8 @@ public class OrderUpdateRequest implements Serializable { /** * 订单状态 */ - @Schema(description = "订单状态", example = "待支付") - private String orderStatus; + @Schema(description = "快递单号", example = "2343243482843888") + private String trackingNumber;