liujie
2026-09-09 39f6fca28e3f78abe48f08e474ec011abb990b36
backend/src/main/java/com/tourguide/modules/order/service/MiniTourOrderCommandService.java
@@ -33,6 +33,7 @@
/** 小程序讲解订单创建及状态流转服务。 */
@Service
public class MiniTourOrderCommandService {
    private static final int DEFAULT_UNPAID_CANCEL_MINUTES = 15;
    private final TourOrderMapper orderMapper;
    private final MiniUserService miniUserService;
    private final OperationScenicSpotMapper scenicSpotMapper;
@@ -159,8 +160,12 @@
                        .orderByDesc(ScenicPricing::getId)
                        .last("LIMIT 1"));
        GuideUser guide = order.getGuideId() == null ? null : guideUserMapper.selectById(order.getGuideId());
        int unpaidCancelMinutes = scenicSpot == null || scenicSpot.getUnpaidCancelMinutes() == null
                || scenicSpot.getUnpaidCancelMinutes() < 1
                ? DEFAULT_UNPAID_CANCEL_MINUTES : scenicSpot.getUnpaidCancelMinutes();
        return TourOrderResponse.from(order)
                .enrich(scenicSpot, meetingPoint, pricing, guide)
                .withUnpaidCancelMinutes(unpaidCancelMinutes)
                .withUnacceptedAutoRefundMinutes(
                        platformSettingsService.getSettings().getUnacceptedAutoRefundMinutes());
    }
@@ -181,6 +186,7 @@
            throw new BusinessException(409, "当前订单状态不支持取消");
        }
        order.setStatus(OrderStatus.CANCELLED.getCode());
        order.setCancelledAt(LocalDateTime.now());
        if (order.getPaymentTime() == null) {
            orderMapper.updateById(order);
        } else {