更新了商品类别
This commit is contained in:
parent
4795c9c454
commit
0822ad590a
|
@ -309,6 +309,7 @@ public class OrderController {
|
||||||
userService.getLoginUser(request);
|
userService.getLoginUser(request);
|
||||||
Order order = orderService.getById(id);
|
Order order = orderService.getById(id);
|
||||||
ThrowUtils.throwIf(order == null, ErrorCode.OPERATION_ERROR, "订单不存在");
|
ThrowUtils.throwIf(order == null, ErrorCode.OPERATION_ERROR, "订单不存在");
|
||||||
|
ThrowUtils.throwIf(!order.getOrderStatus().equals(OrderStatusConstant.PENDING_PAYMENT), ErrorCode.SYSTEM_ERROR, "订单状态错误");
|
||||||
order.setOrderStatus(OrderStatusConstant.TRANSACTION_CLOSED);
|
order.setOrderStatus(OrderStatusConstant.TRANSACTION_CLOSED);
|
||||||
boolean update = orderService.updateById(order);
|
boolean update = orderService.updateById(order);
|
||||||
ThrowUtils.throwIf(!update, ErrorCode.OPERATION_ERROR, "订单状态更新失败");
|
ThrowUtils.throwIf(!update, ErrorCode.OPERATION_ERROR, "订单状态更新失败");
|
||||||
|
@ -350,4 +351,7 @@ public class OrderController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
package com.cultural.heritage.controller.wx;
|
package com.cultural.heritage.controller.wx;
|
||||||
|
|
||||||
|
|
||||||
|
import com.cultural.heritage.annotation.AuthCheck;
|
||||||
import com.cultural.heritage.common.BaseResponse;
|
import com.cultural.heritage.common.BaseResponse;
|
||||||
import com.cultural.heritage.common.ErrorCode;
|
import com.cultural.heritage.common.ErrorCode;
|
||||||
import com.cultural.heritage.common.ResultUtils;
|
import com.cultural.heritage.common.ResultUtils;
|
||||||
import com.cultural.heritage.constant.OrderStatusConstant;
|
import com.cultural.heritage.constant.OrderStatusConstant;
|
||||||
|
import com.cultural.heritage.constant.UserConstant;
|
||||||
import com.cultural.heritage.exception.BusinessException;
|
import com.cultural.heritage.exception.BusinessException;
|
||||||
import com.cultural.heritage.exception.ThrowUtils;
|
import com.cultural.heritage.exception.ThrowUtils;
|
||||||
import com.cultural.heritage.model.dto.CommonRequest;
|
import com.cultural.heritage.model.dto.CommonRequest;
|
||||||
|
@ -80,10 +82,10 @@ public class WeChatPayController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退款(仅管理员和商家)
|
* 退款(仅管理员)
|
||||||
*/
|
*/
|
||||||
@PostMapping("/refund/create")
|
@PostMapping("/refund/create")
|
||||||
// @AuthCheck(mustRole = UserConstant.ADMIN_ROLE)
|
@AuthCheck(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
public BaseResponse<Refund> createRefund(@RequestBody CommonRequest commonRequest) {
|
public BaseResponse<Refund> createRefund(@RequestBody CommonRequest commonRequest) {
|
||||||
Long orderId = commonRequest.getId();
|
Long orderId = commonRequest.getId();
|
||||||
Order order = ordersService.getById(orderId);
|
Order order = ordersService.getById(orderId);
|
||||||
|
|
|
@ -187,7 +187,7 @@ public class WeChatServiceImpl implements WeChatService {
|
||||||
|
|
||||||
// 恢复商品库存
|
// 恢复商品库存
|
||||||
QueryWrapper<OrderItems> orderItemsQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<OrderItems> orderItemsQueryWrapper = new QueryWrapper<>();
|
||||||
orderItemsQueryWrapper.eq("orderId", orderIdByString);
|
orderItemsQueryWrapper.eq("orderId", order.getId());
|
||||||
List<OrderItems> orderItemsList = orderItemService.list(orderItemsQueryWrapper);
|
List<OrderItems> orderItemsList = orderItemService.list(orderItemsQueryWrapper);
|
||||||
// 获取商品id列表
|
// 获取商品id列表
|
||||||
List<Long> goodIds = orderItemsList.stream().map(orderItems -> {
|
List<Long> goodIds = orderItemsList.stream().map(orderItems -> {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user