更新了商品类别

This commit is contained in:
chen-xin-zhi 2024-12-20 15:25:59 +08:00
parent f2032c2073
commit 04a727d66f
3 changed files with 9 additions and 7 deletions

View File

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

View File

@ -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<Order> 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<OrderVO> getOrderById(@RequestBody CommonRequest commonRequest, HttpServletRequest request) {
if (commonRequest == null || commonRequest.getId() <= 0) {
throw new BusinessException(ErrorCode.PARAMS_ERROR);

View File

@ -20,8 +20,8 @@ public class OrderUpdateRequest implements Serializable {
/**
* 订单状态
*/
@Schema(description = "订单状态", example = "待支付")
private String orderStatus;
@Schema(description = "快递单号", example = "2343243482843888")
private String trackingNumber;