取消订单优化

This commit is contained in:
2025-08-23 00:34:48 +08:00
parent 876e6e33d9
commit 7ebe482e69

View File

@ -364,6 +364,10 @@ public class OrderServiceImpl implements OrderService {
log.info("开始取消订单");
OrderMainPO orderMainPO = queryOrderMainPoByOrderNo(payOrderReq.getOrderNo(), "0");
if(Objects.nonNull(orderMainPO)){
if(!OrderStatusEnum.WAIT_PAY.getCode().equalsIgnoreCase(orderMainPO.getOrderStatus())&&OrderStatusEnum.RERENT_WAIT_PAY.getCode().equalsIgnoreCase(orderMainPO.getOrderStatus())){
throw new BizException("订单非待支付状态,不能取消");
}
LambdaQueryWrapper<OrderSubPO> orderSubQueryWrapper = new LambdaQueryWrapper<>();
orderSubQueryWrapper.eq(OrderSubPO::getOrderId, orderMainPO.getOrderId());
orderSubQueryWrapper.eq(OrderSubPO::getPayStatus, PayStatusEnum.USERPAYING.getCode());