소스 검색

乘车记录详情

fllmoyu 4 년 전
부모
커밋
0a96d427bc

+ 16 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/dto/LonLatDTO.java

@@ -0,0 +1,16 @@
+package com.jpsoft.bus.modules.bus.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2021-4-27 10:34
+ */
+@Data
+public class LonLatDTO {
+
+    private Double longitude;
+
+    private Double latitude;
+}

+ 8 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/dto/PassengerRecordDetailDTO.java

@@ -3,9 +3,11 @@ package com.jpsoft.bus.modules.bus.dto;
 import com.jpsoft.bus.modules.bus.entity.DriverInfo;
 import com.jpsoft.bus.modules.bus.entity.RouteInfo;
 import com.jpsoft.bus.modules.bus.entity.ShiftInfo;
+import com.jpsoft.bus.modules.bus.entity.VehicleInfo;
 import lombok.Data;
 
 import java.math.BigDecimal;
+import java.util.List;
 
 /**
  * @author 墨鱼_mo
@@ -18,8 +20,14 @@ public class PassengerRecordDetailDTO {
 
     private ShiftInfo shiftInfo;
 
+    private VehicleInfo vehicleInfo;
+
     private RouteInfo routeInfo;
 
+    private List<LonLatDTO> routeStationLonLat;
+
+    private List<LonLatDTO> ticketUpDownLonLat;
+
     private String tripName;
 
     private String ticketDes;

+ 28 - 0
web/src/main/java/com/jpsoft/bus/modules/mobile/controller/PassengerApiController.java

@@ -1564,8 +1564,19 @@ public class PassengerApiController {
             ShiftInfo shiftInfo = shiftInfoService.get(passengerInfo.getVehicleShiftId());
             //开始站
             StationInfo startStation = stationInfoService.get(shiftInfo.getStartStationId());
+            LonLatDTO lonLatDTO1 = new LonLatDTO();
+            lonLatDTO1.setLatitude(startStation.getLatitude());
+            lonLatDTO1.setLongitude(startStation.getLongitude());
             //终点站
             StationInfo endStation = stationInfoService.get(shiftInfo.getEndStationId());
+            LonLatDTO lonLatDTO2 = new LonLatDTO();
+            lonLatDTO2.setLatitude(endStation.getLatitude());
+            lonLatDTO2.setLongitude(endStation.getLongitude());
+
+            List<LonLatDTO> routeStationLonLat = new ArrayList<>();
+            routeStationLonLat.add(lonLatDTO1);
+            routeStationLonLat.add(lonLatDTO2);
+
 
             shiftInfo.setStartStationName(startStation.getName());
             shiftInfo.setEndStationName(endStation.getName());
@@ -1573,13 +1584,27 @@ public class PassengerApiController {
             //线路
             RouteInfo routeInfo = routeInfoService.get(shiftInfo.getRouteId());
 
+            //车辆
+            VehicleInfo vehicleInfo = vehicleInfoService.get(shiftInfo.getVehicleId());
+
             //司机
             DriverInfo driverInfo = driverInfoService.get(shiftInfo.getDriverId());
 
             //购票上车站点
             StationInfo ticketUpStation = stationInfoService.get(orderInfo.getTicketUpStationId());
+            LonLatDTO lonLatDTO3 = new LonLatDTO();
+            lonLatDTO3.setLatitude(ticketUpStation.getLatitude());
+            lonLatDTO3.setLongitude(ticketUpStation.getLongitude());
+
             //购票下次站点
             StationInfo ticketDownStation = stationInfoService.get(orderInfo.getTicketDownStationId());
+            LonLatDTO lonLatDTO4 = new LonLatDTO();
+            lonLatDTO4.setLatitude(ticketDownStation.getLatitude());
+            lonLatDTO4.setLongitude(ticketDownStation.getLongitude());
+
+            List<LonLatDTO> ticketUpDownLonLat = new ArrayList<>();
+            ticketUpDownLonLat.add(lonLatDTO3);
+            ticketUpDownLonLat.add(lonLatDTO4);
 
             //购票类型
             String ticketTypeName = "成人票";
@@ -1600,6 +1625,9 @@ public class PassengerApiController {
             passengerRecordDetailDTO.setTicketStatus(passengerInfo.getStatus());
             passengerRecordDetailDTO.setTicketStatusName(passengerRecordDetailDTO.getTicketStatusName(passengerRecordDetailDTO.getTicketStatus()));
             passengerRecordDetailDTO.setShiftInfo(shiftInfo);
+            passengerRecordDetailDTO.setVehicleInfo(vehicleInfo);
+            passengerRecordDetailDTO.setRouteStationLonLat(routeStationLonLat);
+            passengerRecordDetailDTO.setTicketUpDownLonLat(ticketUpDownLonLat);
 
             messageResult.setData(passengerRecordDetailDTO);
             messageResult.setCode(200);