1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
| package com.stylefeng.guns.modular.transfer.controller;
|
|
| import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService;
| import com.stylefeng.guns.modular.system.service.IOrderService;
| import com.stylefeng.guns.modular.system.service.IUserInfoService;
| import com.stylefeng.guns.modular.system.util.ResultUtil;
| import com.stylefeng.guns.modular.system.warpper.BaseWarpper;
| import com.stylefeng.guns.modular.transfer.server.IOrderTransferService;
| import io.swagger.annotations.Api;
| import io.swagger.annotations.ApiImplicitParam;
| import io.swagger.annotations.ApiImplicitParams;
| import io.swagger.annotations.ApiOperation;
| import org.springframework.beans.factory.annotation.Autowired;
| import org.springframework.web.bind.annotation.PostMapping;
| import org.springframework.web.bind.annotation.RequestMapping;
| import org.springframework.web.bind.annotation.ResponseBody;
| import org.springframework.web.bind.annotation.RestController;
|
| import javax.servlet.http.HttpServletRequest;
| import java.util.Date;
|
| @Api
| @RestController
| @RequestMapping("")
| public class OrderTransferController {
|
| @Autowired
| private IOrderTransferService orderPrivateCarService;
|
| @Autowired
| private IUserInfoService userInfoService;
|
|
|
| /**
| * 专车下单
| * @param serverCarModelId
| * @param travelTime
| * @param orderType
| * @param substitute
| * @param placementLon
| * @param placementLat
| * @param startLon
| * @param startLat
| * @param startAddress
| * @param endLon
| * @param endLat
| * @param endAddress
| * @param passengers
| * @param passengersPhone
| * @param orderSource
| * @param driverId
| * @param request
| * @return
| */
| @ResponseBody
| @PostMapping("/api/transfer/saveTransferCar")
| @ApiOperation(value = "接送机下单/扫码下单", tags = {"用户端-接送机"}, notes = "")
| @ApiImplicitParams({
| @ApiImplicitParam(value = "订单类型(1=普通订单,2=摆渡订单)", name = "type", required = true, dataType = "int"),
| @ApiImplicitParam(value = "服务车型id(扫码下单不用上传)", name = "serverCarModelId", required = false, dataType = "int"),
| @ApiImplicitParam(value = "出行时间(2020-08-20 10:10)", name = "travelTime", required = true, dataType = "string"),
| @ApiImplicitParam(value = "是否预约(1=否,2=是)", name = "orderType", required = true, dataType = "int"),
| @ApiImplicitParam(value = "是否代下单(0=否,1=是)", name = "substitute", required = true, dataType = "int"),
| @ApiImplicitParam(value = "下单地点经度", name = "placementLon", required = true, dataType = "string"),
| @ApiImplicitParam(value = "下单地点纬度", name = "placementLat", required = true, dataType = "string"),
| @ApiImplicitParam(value = "起点经度", name = "startLon", required = true, dataType = "string"),
| @ApiImplicitParam(value = "起点纬度", name = "startLat", required = true, dataType = "string"),
| @ApiImplicitParam(value = "起点地址", name = "startAddress", required = true, dataType = "string"),
| @ApiImplicitParam(value = "终点经度", name = "endLon", required = true, dataType = "string"),
| @ApiImplicitParam(value = "终点纬度", name = "endLat", required = true, dataType = "string"),
| @ApiImplicitParam(value = "终点地址", name = "endAddress", required = true, dataType = "string"),
| @ApiImplicitParam(value = "订单来源(1:APP下单,2:扫码下单,3:小程序下单,4:司机下单,5:调度下单)", name = "orderSource", required = true, dataType = "int"),
| @ApiImplicitParam(value = "司机id(扫码下单必传)", name = "driverId", required = false, dataType = "int"),
| @ApiImplicitParam(value = "乘客姓名(代下单必传)", name = "passengers", required = false, dataType = "string"),
| @ApiImplicitParam(value = "乘客电话(代下单必传)", name = "passengersPhone", required = false, dataType = "string"),
| @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
| })
| public ResultUtil<BaseWarpper> saveOrderPrivateCar(Integer serverCarModelId, Date travelTime, Integer orderType, Integer substitute, String placementLon, String placementLat, String startLon, String startLat,
| String startAddress, String endLon, String endLat, String endAddress, String passengers, String passengersPhone, Integer orderSource, Integer driverId,
| Integer type, HttpServletRequest request){
| try {
| Integer uid = userInfoService.getUserIdFormRedis(request);
| if(null == uid){
| return ResultUtil.tokenErr();
| }
| return orderPrivateCarService.saveOrderPrivateCar(serverCarModelId, travelTime, orderType, substitute, placementLon, placementLat,
| startLon, startLat, startAddress, endLon, endLat, endAddress, passengers, passengersPhone, orderSource, driverId, type, uid);
| }catch (Exception e){
| e.printStackTrace();
| return ResultUtil.runErr();
| }
| }
|
| /**
| * 专车下单
| * @param serverCarModelId
| * @param travelTime
| * @param orderType
| * @param substitute
| * @param placementLon
| * @param placementLat
| * @param startLon
| * @param startLat
| * @param startAddress
| * @param endLon
| * @param endLat
| * @param endAddress
| * @param passengers
| * @param passengersPhone
| * @param orderSource
| * @param driverId
| * @param request
| * @return
| */
| @ResponseBody
| @PostMapping("/api/transferCar/saveTransferCars")
| @ApiOperation(value = "接送机下单/扫码下单[2024.05.11]", tags = {"用户端-接送机"}, notes = "")
| @ApiImplicitParams({
| @ApiImplicitParam(value = "订单类型(1=普通订单,2=摆渡订单)", name = "type", required = true, dataType = "int"),
| @ApiImplicitParam(value = "服务车型id(扫码下单不用上传)", name = "serverCarModelId", required = false, dataType = "int"),
| @ApiImplicitParam(value = "出行时间(2020-08-20 10:10)", name = "travelTime", required = true, dataType = "string"),
| @ApiImplicitParam(value = "是否预约(1=否,2=是)", name = "orderType", required = true, dataType = "int"),
| @ApiImplicitParam(value = "是否代下单(0=否,1=是)", name = "substitute", required = true, dataType = "int"),
| @ApiImplicitParam(value = "下单地点经度", name = "placementLon", required = true, dataType = "string"),
| @ApiImplicitParam(value = "下单地点纬度", name = "placementLat", required = true, dataType = "string"),
| @ApiImplicitParam(value = "起点经度", name = "startLon", required = true, dataType = "string"),
| @ApiImplicitParam(value = "起点纬度", name = "startLat", required = true, dataType = "string"),
| @ApiImplicitParam(value = "起点地址", name = "startAddress", required = true, dataType = "string"),
| @ApiImplicitParam(value = "终点经度", name = "endLon", required = false, dataType = "string"),
| @ApiImplicitParam(value = "终点纬度", name = "endLat", required = false, dataType = "string"),
| @ApiImplicitParam(value = "终点地址", name = "endAddress", required = false, dataType = "string"),
| @ApiImplicitParam(value = "订单来源(1:APP下单,2:扫码下单,3:小程序下单,4:司机下单,5:调度下单)", name = "orderSource", required = true, dataType = "int"),
| @ApiImplicitParam(value = "司机id(扫码下单必传)", name = "driverId", required = false, dataType = "int"),
| @ApiImplicitParam(value = "乘客姓名(代下单必传)", name = "passengers", required = false, dataType = "string"),
| @ApiImplicitParam(value = "乘客电话(代下单必传)", name = "passengersPhone", required = false, dataType = "string"),
| @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
| })
| public ResultUtil<BaseWarpper> saveOrderPrivateCars(Integer serverCarModelId, Date travelTime, Integer orderType, Integer substitute, String placementLon, String placementLat, String startLon, String startLat,
| String startAddress, String endLon, String endLat, String endAddress, String passengers, String passengersPhone, Integer orderSource, Integer driverId,
| Integer type, HttpServletRequest request){
| try {
| Integer uid = userInfoService.getUserIdFormRedis(request);
| if(null == uid){
| return ResultUtil.tokenErr();
| }
| return orderPrivateCarService.saveOrderPrivateCars(serverCarModelId, travelTime, orderType, substitute, placementLon, placementLat,
| startLon, startLat, startAddress, endLon, endLat, endAddress, passengers, passengersPhone, orderSource, driverId, type, uid);
| }catch (Exception e){
| e.printStackTrace();
| return ResultUtil.runErr();
| }
| }
|
| }
|
|