yanghb
2023-04-06 e4874ff3af0c59b6b9a1ee1ae39a332829253cd7
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
package com.stylefeng.guns.modular.api;
 
 
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.system.model.OrderCrossCity;
import com.stylefeng.guns.modular.system.model.OrderPosition;
import com.stylefeng.guns.modular.system.model.OrderTaxi;
import com.stylefeng.guns.modular.system.service.*;
import com.stylefeng.guns.modular.system.util.ICBCPayUtil;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import com.stylefeng.guns.modular.system.util.SystemException;
import com.stylefeng.guns.modular.system.warpper.*;
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.*;
 
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
 
/**
 * 订单相关
 */
@Api
@RestController
@RequestMapping("")
public class OrderController {
 
    @Autowired
    private IOrderCrossCityService orderCrossCityService;
 
    @Autowired
    private IOrderPrivateCarService orderPrivateCarService;
 
    @Autowired
    private IDispatchService dispatchService;
 
    @Autowired
    private IOrderPositionService orderPositionService;
 
    @Autowired
    private ICBCPayUtil icbcPayUtil;
 
    @Autowired
    private IOrderTaxiService orderTaxiService;
 
    @Autowired
    private IOpenCityService openCityService;
 
    @Autowired
    private IServerCarModelService serverCarModelService;
 
    @Autowired
    private IDriverService driverService;
 
 
 
    /**
     * 获取订单列表
     * @param type
     * @param search
     * @param orderSource
     * @param state
     * @param lineId
     * @param pageNum
     * @param size
     * @param request
     * @return
     */
    @ResponseBody
    @PostMapping("/api/order/queryOrderList")
    @ApiOperation(value = "获取订单列表", tags = {"调度端-订单管理"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "数据类型(1=专车,2=跨城)", name = "type", required = true, dataType = "int"),
            @ApiImplicitParam(value = "搜索条件", name = "search", required = false, dataType = "String"),
            @ApiImplicitParam(value = "订单来源(1:APP下单,2:扫码下单,3:小程序下单,4:司机下单,5:调度下单)多个以逗号分隔", name = "orderSource", required = false, dataType = "string"),
            @ApiImplicitParam(value = "订单状态(1=待接单,2=待出发,3=待到达预约地点,4=待乘客上车,5=服务中,6=完成服务,7=待支付,8=待评价,9=已完成,10=已取消,11=改派中,12=取消待支付)多个以逗号分隔", name = "state", required = false, dataType = "string"),
            @ApiImplicitParam(value = "线路id(多个以逗号分隔)", name = "lineId", required = false, dataType = "string"),
            @ApiImplicitParam(value = "页码,首页1", name = "pageNum", required = true, dataType = "int"),
            @ApiImplicitParam(value = "页条数", name = "size", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil<List<OrderListWarpper>> queryOrderList(Integer type, String search, String orderSource, String state, String lineId, Integer pageNum, Integer size, HttpServletRequest request){
        try {
            Integer uid = dispatchService.getUserIdFormRedis(request);
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            List<Map<String, Object>> list = null;
            if(type == 1){//专车
                list = orderPrivateCarService.queryOrderList(search, orderSource, state, pageNum, size, uid);
            }
            if(type == 2){//跨城
                list = orderCrossCityService.queryOrderList(search, orderSource, state, lineId, pageNum, size, uid);
            }
            return ResultUtil.success(OrderListWarpper.getOrderListWarppers(list));
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
 
 
    @ResponseBody
    @PostMapping("/api/order/queryOrderList1")
    @ApiOperation(value = "1.0-获取订单列表", tags = {"调度端-订单管理"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "数据类型(1=专车,2=出租车,3=跨城)", name = "type", required = true, dataType = "int"),
            @ApiImplicitParam(value = "搜索条件", name = "search", required = false, dataType = "String"),
            @ApiImplicitParam(value = "订单来源(1:APP下单,2:扫码下单,3:小程序下单,4:司机下单,5:调度下单)多个以逗号分隔", name = "orderSource", required = false, dataType = "string"),
            @ApiImplicitParam(value = "订单状态(1=待接单,2=待出发,3=待到达预约地点,4=待乘客上车,5=服务中,6=完成服务,7=待支付,8=待评价,9=已完成,10=已取消,11=改派中,12=取消待支付)多个以逗号分隔", name = "state", required = false, dataType = "string"),
            @ApiImplicitParam(value = "线路id(多个以逗号分隔)", name = "lineId", required = false, dataType = "string"),
            @ApiImplicitParam(value = "页码,首页1", name = "pageNum", required = true, dataType = "int"),
            @ApiImplicitParam(value = "页条数", name = "size", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil<List<OrderListWarpper>> queryOrderList1(Integer type, String search, String orderSource, String state, String lineId, Integer pageNum, Integer size, HttpServletRequest request){
        try {
            Integer uid = dispatchService.getUserIdFormRedis(request);
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            List<Map<String, Object>> list = null;
            if(type == 1){//专车
                list = orderPrivateCarService.queryOrderList(search, orderSource, state, pageNum, size, uid);
            }
            if(type == 2){//出租车
                list = orderTaxiService.queryOrderList(search, orderSource, state, pageNum, size, uid);
            }
            if(type == 3){//跨城
                list = orderCrossCityService.queryOrderList(search, orderSource, state, lineId, pageNum, size, uid);
            }
            return ResultUtil.success(OrderListWarpper.getOrderListWarppers(list));
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
 
 
 
 
    /**
     * 获取订单详情
     * @param orderId
     * @param orderType
     * @return
     */
    @ResponseBody
    @PostMapping("/api/order/queryOrderInfo")
    @ApiOperation(value = "获取订单详情", tags = {"调度端-订单管理"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车,2=跨城)", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil<OrderInfoWarpper> queryOrderInfo(Integer orderId, Integer orderType){
        try {
            Map<String, Object> map = null;
            if(orderType == 1){//专车
                map = orderPrivateCarService.queryOrderInfo(orderId);
            }
            if(orderType == 2){//跨城
                map = orderCrossCityService.queryOrderInfo(orderId);
            }
            return ResultUtil.success(OrderInfoWarpper.getOrderInfoWarpper(map));
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
 
 
 
    @ResponseBody
    @PostMapping("/api/order/queryOrderInfo1")
    @ApiOperation(value = "1.0-获取订单详情", tags = {"调度端-订单管理"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城)", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil<OrderInfoWarpper> queryOrderInfo1(Integer orderId, Integer orderType){
        try {
            Map<String, Object> map = null;
            if(orderType == 1){//专车
                map = orderPrivateCarService.queryOrderInfo(orderId);
            }
            if(orderType == 2){//出租车
                map = orderTaxiService.queryOrderInfo(orderId);
            }
            if(orderType == 3){//跨城
                map = orderCrossCityService.queryOrderInfo(orderId);
            }
            return ResultUtil.success(OrderInfoWarpper.getOrderInfoWarpper(map));
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
 
 
    /**
     * 取消订单
     * @param orderId
     * @param orderType
     * @return
     */
    @ResponseBody
    @PostMapping("/api/order/cancelOrder")
    @ApiOperation(value = "取消订单", tags = {"调度端-订单管理"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车,2=跨城)", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil cancelOrder(Integer orderId, Integer orderType){
        try {
            if(orderType == 1){//专车
                return orderPrivateCarService.cancelOrder(orderId);
            }
            if(orderType == 2){//跨城
                return orderCrossCityService.cancelOrder(orderId);
            }
            return ResultUtil.success();
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
 
 
    @ResponseBody
    @PostMapping("/api/order/cancelOrder1")
    @ApiOperation(value = "1.0-取消订单", tags = {"调度端-订单管理"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城)", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil cancelOrder1(Integer orderId, Integer orderType){
        try {
            if(orderType == 1){//专车
                return orderPrivateCarService.cancelOrder(orderId);
            }
            if(orderType == 2){//出租车
                return orderTaxiService.cancelOrder(orderId);
            }
            if(orderType == 3){//跨城
                return orderCrossCityService.cancelOrder(orderId);
            }
            return ResultUtil.success();
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
 
 
 
    /**
     * 获取订单坐标轨迹数据
     * @param orderId
     * @param orderType
     * @return
     */
    @ResponseBody
    @PostMapping("/api/order/queryOrderPosition")
    @ApiOperation(value = "获取订单坐标", tags = {"调度端-订单管理"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车,3=跨城)", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil<List<BaseWarpper>> queryOrderPosition(Integer orderId, Integer orderType){
        try {
            List<OrderPosition> orderPositions = orderPositionService.queryPosition(orderId, orderType);
            List<BaseWarpper> list = new ArrayList<>();
            for(OrderPosition orderPosition : orderPositions){
                BaseWarpper baseWarpper = new BaseWarpper();
                baseWarpper.setLon(Double.valueOf(orderPosition.getLon()));
                baseWarpper.setLat(Double.valueOf(orderPosition.getLat()));
                list.add(baseWarpper);
            }
            return ResultUtil.success(list);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
 
 
 
    @ResponseBody
    @PostMapping("/api/order/queryOrderPosition1")
    @ApiOperation(value = "1.0-获取订单坐标", tags = {"调度端-订单管理"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城)", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil<List<BaseWarpper>> queryOrderPosition1(Integer orderId, Integer orderType){
        try {
            List<OrderPosition> orderPositions = orderPositionService.queryPosition(orderId, orderType);
            List<BaseWarpper> list = new ArrayList<>();
            for(OrderPosition orderPosition : orderPositions){
                BaseWarpper baseWarpper = new BaseWarpper();
                baseWarpper.setLon(Double.valueOf(orderPosition.getLon()));
                baseWarpper.setLat(Double.valueOf(orderPosition.getLat()));
                list.add(baseWarpper);
            }
            return ResultUtil.success(list);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
 
 
    /**
     * 跨城下单操作
     * @param orderCrossCityWarpper
     * @param request
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/api/order/orderCrossCity", method = RequestMethod.POST)
    @ApiOperation(value = "跨城出行下单操作", tags = {"调度端-添加订单"}, notes = "先进行下单操作,再根据返回数据生成收款二维码")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil<BaseWarpper> orderCrossCity(OrderCrossCityWarpper orderCrossCityWarpper, HttpServletRequest request){
        try {
            Integer uid = dispatchService.getUserIdFormRedis(request);
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            return orderCrossCityService.orderCrossCity(orderCrossCityWarpper, uid);
        }catch (SystemException se){
            return ResultUtil.error(se.getMessage());
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
 
 
    /**
     * 扫码支付成功回调处理
     * @param request
     * @param response
     */
    @ResponseBody
    @PostMapping("/base/order/generatePay")
    public void generatePay(HttpServletRequest request, HttpServletResponse response){
        try {
            Map<String, String> map = icbcPayUtil.generatePayCallback(request);
            if(null != map){
                String out_trade_no = map.get("out_trade_no");
                String order_id = map.get("order_id");
                String s = icbcPayUtil.queryGeneratePayState("", order_id);
                if(s.equals("0")){
                    icbcPayUtil.answer(response);//回调应答
                }
                if(ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(order_id) && s.equals("0")){
                    String[] split = out_trade_no.split(",");
                    Integer id = Integer.valueOf(split[0]);
                    Integer type = Integer.valueOf(split[1]);
                    switch (type){
                        case 1:
                            break;
                        case 2:
                            break;
                        case 3:
                            orderCrossCityService.generatePayCallback(id, order_id);
                            break;
                    }
                }
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
 
 
    @ResponseBody
    @RequestMapping(value = "/api/order/getOpenCityList", method = RequestMethod.POST)
    @ApiOperation(value = "1.0-获取开通城市列表", tags = {"调度端-添加订单"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil<List<BaseWarpper>> getOpenCityList(){
        try {
            List<BaseWarpper> list = openCityService.queryOpenCity();
            return ResultUtil.success(list);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
 
 
 
    @ResponseBody
    @PostMapping("/api/order/openCity")
    @ApiOperation(value = "判断当前是否是开通城市", tags = {"调度端-添加订单"}, notes = "open=1(是),open=2(否)")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "当前定位城市code", name = "code", required = true, dataType = "String"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil openCity(String code){
        try {
            boolean b = openCityService.openCity(code);
            Map<String, Object> map = new HashMap<>();
            map.put("open", b ? 1 : 2);
            return ResultUtil.success(map);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
 
 
    /**
     * 获取车型和预估价格
     * @param startLonLat
     * @param endLonLat
     * @param type
     * @return
     */
    @ResponseBody
    @PostMapping("/api/order/queryServerCarModel")
    @ApiOperation(value = "1.0-选择起点终点后获取车型和预估价格(专车)", tags = {"调度端-添加订单"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "起点经纬度(103.22121,,30.26123)", name = "startLonLat", required = true, dataType = "string"),
            @ApiImplicitParam(value = "终点经纬度(103.22121,,30.26123)", name = "endLonLat", required = true, dataType = "string"),
            @ApiImplicitParam(value = "业务类型(1=专车)", name = "type", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil<List<ServerCarModelWarpper>> queryServerCarModel(String startLonLat, String endLonLat, Integer type){
        try {
            return serverCarModelService.queryServerCarModel(startLonLat, endLonLat, type);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
 
 
    @ResponseBody
    @PostMapping("/api/order/getServerDriverList")
    @ApiOperation(value = "1.0-获取可服务的司机列表", tags = {"调度端-添加订单"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "起点经纬度(103.22121,,30.26123)", name = "startLonLat", required = true, dataType = "string"),
            @ApiImplicitParam(value = "终点经纬度(103.22121,,30.26123)", name = "endLonLat", required = true, dataType = "string"),
            @ApiImplicitParam(value = "业务类型(1=专车,2=出租车)", name = "type", required = true, dataType = "int"),
            @ApiImplicitParam(value = "车型id", name = "carModelId", required = false, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil<List<BaseWarpper>> getServerDriverList(String startLonLat, String endLonLat, Integer type, Integer carModelId, HttpServletRequest request){
        try {
            Integer uid = dispatchService.getUserIdFormRedis(request);
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            List<BaseWarpper> serverDriverList = driverService.getServerDriverList(uid, startLonLat, endLonLat, type, carModelId);
            return ResultUtil.success(serverDriverList);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
 
 
 
    @ResponseBody
    @PostMapping("/api/order/saveOrderPrivateCar")
    @ApiOperation(value = "1.0-专车下单", tags = {"调度端-添加订单"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "服务车型id", name = "serverCarModelId", required = true, 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 = "下单地点经度", 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 = "司机id", name = "driverId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "乘客姓名", name = "passengers", required = true, dataType = "string"),
            @ApiImplicitParam(value = "乘客电话", name = "passengersPhone", required = true, dataType = "string"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil saveOrderPrivateCar(Integer serverCarModelId, Date travelTime, Integer orderType, String placementLon, String placementLat, String startLon, String startLat,
                                    String startAddress, String endLon, String endLat, String endAddress, String passengers, String passengersPhone, Integer driverId, HttpServletRequest request){
        try {
            Integer uid = dispatchService.getUserIdFormRedis(request);
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            return orderPrivateCarService.saveOrderPrivateCar(uid, serverCarModelId, travelTime, orderType, placementLon, placementLat, startLon, startLat, startAddress, endLon, endLat, endAddress, passengers, passengersPhone, driverId);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
 
 
 
 
    @ResponseBody
    @PostMapping("/api/order/taxiOrder")
    @ApiOperation(value = "1.0-出租车下单操作", tags = {"调度端-添加订单"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil<BaseWarpper> taxiOrder(OrderTaxiWarpper orderTaxiWarpper, HttpServletRequest request){
        try {
            OrderTaxi orderTaxi = OrderTaxiWarpper.getOrderTaxi(orderTaxiWarpper);
            Integer uid = dispatchService.getUserIdFormRedis(request);
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            return orderTaxiService.taxiOrder(orderTaxi, uid);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
}