From 31882052fe91dd110e909a63132c4f2d012422fe Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期一, 14 九月 2026 13:50:22 +0800
Subject: [PATCH] update

---
 backend/src/main/java/com/tourguide/modules/order/dto/GuideOrderResponse.java |   35 +++++++++++++++++++++++++++++++----
 1 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/backend/src/main/java/com/tourguide/modules/order/dto/GuideOrderResponse.java b/backend/src/main/java/com/tourguide/modules/order/dto/GuideOrderResponse.java
index e548b17..6c1b3dd 100644
--- a/backend/src/main/java/com/tourguide/modules/order/dto/GuideOrderResponse.java
+++ b/backend/src/main/java/com/tourguide/modules/order/dto/GuideOrderResponse.java
@@ -1,6 +1,7 @@
 package com.tourguide.modules.order.dto;
 
 import com.tourguide.modules.order.entity.TourOrder;
+import com.tourguide.modules.operation.entity.ScenicMeetingPoint;
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
 import java.util.Collections;
@@ -10,9 +11,14 @@
 public class GuideOrderResponse {
     private final Long id;
     private final String orderNo;
+    private final Long scenicSpotId;
     private final String scenicName;
     private final String scenicShortName;
+    private final Long meetingPointId;
     private final String meetingPointName;
+    private final String meetingPointAddress;
+    private final BigDecimal meetingPointLongitude;
+    private final BigDecimal meetingPointLatitude;
     private final String serviceName;
     private final Integer durationMinutes;
     private final Integer quantity;
@@ -26,12 +32,19 @@
     private final String customerPhone;
     private final List<Customer> customers;
 
-    private GuideOrderResponse(TourOrder order, Integer configuredDurationMinutes) {
+    private GuideOrderResponse(TourOrder order, Integer configuredDurationMinutes, ScenicMeetingPoint meetingPoint) {
         this.id = order.getId();
         this.orderNo = order.getOrderNo();
+        this.scenicSpotId = order.getScenicSpotId();
         this.scenicName = order.getScenicName();
         this.scenicShortName = shortScenicName(order.getScenicName());
-        this.meetingPointName = order.getMeetingPointName();
+        this.meetingPointId = order.getMeetingPointId() != null
+                ? order.getMeetingPointId() : meetingPoint == null ? null : meetingPoint.getId();
+        this.meetingPointName = valueOrFallback(order.getMeetingPointName(),
+                meetingPoint == null ? null : meetingPoint.getPointName());
+        this.meetingPointAddress = meetingPoint == null ? null : meetingPoint.getAddress();
+        this.meetingPointLongitude = meetingPoint == null ? null : meetingPoint.getLongitude();
+        this.meetingPointLatitude = meetingPoint == null ? null : meetingPoint.getLatitude();
         this.serviceName = serviceName(order);
         this.durationMinutes = durationMinutes(configuredDurationMinutes, order.getOrderType());
         this.quantity = order.getPeopleCount() == null ? 0 : order.getPeopleCount();
@@ -51,11 +64,16 @@
     }
 
     public static GuideOrderResponse from(TourOrder order) {
-        return from(order, null);
+        return from(order, null, null);
     }
 
     public static GuideOrderResponse from(TourOrder order, Integer configuredDurationMinutes) {
-        return new GuideOrderResponse(order, configuredDurationMinutes);
+        return from(order, configuredDurationMinutes, null);
+    }
+
+    public static GuideOrderResponse from(TourOrder order, Integer configuredDurationMinutes,
+                                          ScenicMeetingPoint meetingPoint) {
+        return new GuideOrderResponse(order, configuredDurationMinutes, meetingPoint);
     }
 
     private static String guideStatus(String orderStatus) {
@@ -92,6 +110,10 @@
         return scenicName.replace("景区", "");
     }
 
+    private static String valueOrFallback(String value, String fallback) {
+        return value == null || value.trim().isEmpty() ? fallback : value;
+    }
+
     private static LocalDateTime firstPresent(LocalDateTime first, LocalDateTime second) {
         return first == null ? second : first;
     }
@@ -102,9 +124,14 @@
 
     public Long getId() { return id; }
     public String getOrderNo() { return orderNo; }
+    public Long getScenicSpotId() { return scenicSpotId; }
     public String getScenicName() { return scenicName; }
     public String getScenicShortName() { return scenicShortName; }
+    public Long getMeetingPointId() { return meetingPointId; }
     public String getMeetingPointName() { return meetingPointName; }
+    public String getMeetingPointAddress() { return meetingPointAddress; }
+    public BigDecimal getMeetingPointLongitude() { return meetingPointLongitude; }
+    public BigDecimal getMeetingPointLatitude() { return meetingPointLatitude; }
     public String getServiceName() { return serviceName; }
     public Integer getDurationMinutes() { return durationMinutes; }
     public Integer getQuantity() { return quantity; }

--
Gitblit v1.7.1