| | |
| | | package com.supersavedriving.driver.modular.system.api; |
| | | |
| | | import com.supersavedriving.driver.modular.system.warpper.*; |
| | | import com.supersavedriving.driver.core.common.annotion.ServiceLog; |
| | | import com.supersavedriving.driver.core.util.ToolUtil; |
| | | import com.supersavedriving.driver.modular.system.service.IDriverService; |
| | | import com.supersavedriving.driver.modular.system.service.IOrderService; |
| | | import com.supersavedriving.driver.modular.system.util.ResultUtil; |
| | | import com.supersavedriving.driver.modular.system.warpper.*; |
| | | import com.supersavedriving.driver.modular.system.warpper.AddOrderWarpper; |
| | | import com.supersavedriving.driver.modular.system.warpper.HallOrderList; |
| | | import com.supersavedriving.driver.modular.system.warpper.OrderInfoWarpper; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/queryDriverServerOrder") |
| | | @ServiceLog(name = "获取司机服务中的订单id", url = "/api/order/queryDriverServerOrder") |
| | | // @ServiceLog(name = "获取司机服务中的订单id", url = "/api/order/queryDriverServerOrder") |
| | | @ApiOperation(value = "获取司机服务中的订单id", tags = {"司机端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper<Long> queryDriverServerOrder(HttpServletRequest request){ |
| | | public ResponseWarpper<Long> queryDriverServerOrder(){ |
| | | try { |
| | | Integer uid = driverService.getUserByRequset(request); |
| | | Integer uid = driverService.getUserByRequest(); |
| | | if(null == uid){ |
| | | return ResponseWarpper.success(ResultUtil.tokenErr()); |
| | | return ResponseWarpper.tokenErr(); |
| | | } |
| | | Long id = orderService.queryDriverServerOrder(uid); |
| | | return ResponseWarpper.success(id); |
| | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/driverAddOrder") |
| | | @ServiceLog(name = "司机代客下单", url = "/api/order/driverAddOrder") |
| | | // @ServiceLog(name = "司机代客下单", url = "/api/order/driverAddOrder") |
| | | @ApiOperation(value = "司机代客下单", tags = {"司机端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper driverAddOrder(AddOrderWarpper addOrderWarpper, HttpServletRequest request){ |
| | | public ResponseWarpper driverAddOrder(AddOrderWarpper addOrderWarpper){ |
| | | try { |
| | | Integer uid = driverService.getUserByRequset(request); |
| | | Integer uid = driverService.getUserByRequest(); |
| | | if(null == uid){ |
| | | return ResponseWarpper.success(ResultUtil.tokenErr()); |
| | | return ResponseWarpper.tokenErr(); |
| | | } |
| | | ResultUtil resultUtil = orderService.driverAddOrder(uid, addOrderWarpper); |
| | | return ResponseWarpper.success(resultUtil); |
| | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/queryOrderHall") |
| | | @ServiceLog(name = "司机获取大厅订单列表", url = "/api/order/queryOrderHall") |
| | | // @ServiceLog(name = "司机获取大厅订单列表", url = "/api/order/queryOrderHall") |
| | | @ApiOperation(value = "司机获取大厅订单列表", tags = {"司机端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "页码,首页1", name = "pageNum", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "页条数", name = "pageSize", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper<List<HallOrderList>> queryOrderHall(Integer pageNum, Integer pageSize, HttpServletRequest request){ |
| | | public ResponseWarpper<List<HallOrderList>> queryOrderHall(Integer pageNum, Integer pageSize){ |
| | | if(null == pageNum){ |
| | | return ResponseWarpper.success(ResultUtil.paranErr("pageNum")); |
| | | } |
| | |
| | | return ResponseWarpper.success(ResultUtil.paranErr("pageSize")); |
| | | } |
| | | try { |
| | | Integer uid = driverService.getUserByRequset(request); |
| | | Integer uid = driverService.getUserByRequest(); |
| | | if(null == uid){ |
| | | return ResponseWarpper.success(ResultUtil.tokenErr()); |
| | | return ResponseWarpper.tokenErr(); |
| | | } |
| | | List<HallOrderList> hallOrderLists = orderService.queryOrderHall(uid, pageNum, pageSize); |
| | | return ResponseWarpper.success(hallOrderLists); |
| | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/rejectionOrder") |
| | | @ServiceLog(name = "司机拒绝接单", url = "/api/order/rejectionOrder") |
| | | // @ServiceLog(name = "司机拒绝接单", url = "/api/order/rejectionOrder") |
| | | @ApiOperation(value = "司机拒绝接单", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "long"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper rejectionOrder(Long orderId, HttpServletRequest request){ |
| | | public ResponseWarpper rejectionOrder(Long orderId){ |
| | | if(null == orderId){ |
| | | return ResponseWarpper.success(ResultUtil.paranErr("orderId")); |
| | | } |
| | | try { |
| | | Integer uid = driverService.getUserByRequset(request); |
| | | Integer uid = driverService.getUserByRequest(); |
| | | if(null == uid){ |
| | | return ResponseWarpper.success(ResultUtil.tokenErr()); |
| | | return ResponseWarpper.tokenErr(); |
| | | } |
| | | ResultUtil resultUtil = orderService.rejectionOrder(uid, orderId); |
| | | return ResponseWarpper.success(resultUtil); |
| | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/receiveOrder") |
| | | @ServiceLog(name = "司机接单操作", url = "/api/order/receiveOrder") |
| | | // @ServiceLog(name = "司机接单操作", url = "/api/order/receiveOrder") |
| | | @ApiOperation(value = "司机接单操作", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "long"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper receiveOrder(Long orderId, HttpServletRequest request){ |
| | | public ResponseWarpper receiveOrder(Long orderId){ |
| | | if(null == orderId){ |
| | | return ResponseWarpper.success(ResultUtil.paranErr("orderId")); |
| | | } |
| | | try { |
| | | Integer uid = driverService.getUserByRequset(request); |
| | | Integer uid = driverService.getUserByRequest(); |
| | | if(null == uid){ |
| | | return ResponseWarpper.success(ResultUtil.tokenErr()); |
| | | return ResponseWarpper.tokenErr(); |
| | | } |
| | | ResultUtil resultUtil = orderService.receiveOrder(uid, orderId); |
| | | return ResponseWarpper.success(resultUtil); |
| | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/queryOrderInfo") |
| | | @ServiceLog(name = "获取订单详情", url = "/api/order/queryOrderInfo") |
| | | // @ServiceLog(name = "获取订单详情", url = "/api/order/queryOrderInfo") |
| | | @ApiOperation(value = "获取订单详情", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "long"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper<OrderInfoWarpper> queryOrderInfo(Long orderId, HttpServletRequest request){ |
| | | public ResponseWarpper<OrderInfoWarpper> queryOrderInfo(Long orderId){ |
| | | if(null == orderId){ |
| | | return ResponseWarpper.success(ResultUtil.paranErr("orderId")); |
| | | } |
| | | try { |
| | | Integer uid = driverService.getUserByRequset(request); |
| | | Integer uid = driverService.getUserByRequest(); |
| | | if(null == uid){ |
| | | return ResponseWarpper.success(ResultUtil.tokenErr()); |
| | | return ResponseWarpper.tokenErr(); |
| | | } |
| | | OrderInfoWarpper orderInfoWarpper = orderService.queryOrderInfo(uid, orderId); |
| | | return ResponseWarpper.success(orderInfoWarpper); |
| | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/driverProcessOperations") |
| | | @ServiceLog(name = "司机走订单流程", url = "/api/order/driverProcessOperations") |
| | | // @ServiceLog(name = "司机走订单流程", url = "/api/order/driverProcessOperations") |
| | | @ApiOperation(value = "司机走订单流程", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper driverProcessOperations(ProcessOperationsWarpper processOperationsWarpper, HttpServletRequest request){ |
| | | public ResponseWarpper driverProcessOperations(ProcessOperationsWarpper processOperationsWarpper){ |
| | | try { |
| | | Integer uid = driverService.getUserByRequset(request); |
| | | Integer uid = driverService.getUserByRequest(); |
| | | if(null == uid){ |
| | | return ResponseWarpper.success(ResultUtil.tokenErr()); |
| | | return ResponseWarpper.tokenErr(); |
| | | } |
| | | ResultUtil resultUtil = orderService.driverProcessOperations(uid, processOperationsWarpper); |
| | | return ResponseWarpper.success(resultUtil); |
| | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/transferOrder") |
| | | @ServiceLog(name = "司机转单操作", url = "/api/order/transferOrder") |
| | | // @ServiceLog(name = "司机转单操作", url = "/api/order/transferOrder") |
| | | @ApiOperation(value = "司机转单操作", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "long"), |
| | | @ApiImplicitParam(value = "原因", name = "cause", required = true, dataType = "string"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper transferOrder(Long orderId, String cause, HttpServletRequest request){ |
| | | public ResponseWarpper transferOrder(Long orderId, String cause){ |
| | | if(ToolUtil.isEmpty(orderId)){ |
| | | return ResponseWarpper.success(ResultUtil.paranErr("orderId")); |
| | | } |
| | |
| | | return ResponseWarpper.success(ResultUtil.paranErr("cause")); |
| | | } |
| | | try { |
| | | Integer uid = driverService.getUserByRequset(request); |
| | | Integer uid = driverService.getUserByRequest(); |
| | | if(null == uid){ |
| | | return ResponseWarpper.success(ResultUtil.tokenErr()); |
| | | return ResponseWarpper.tokenErr(); |
| | | } |
| | | ResultUtil resultUtil = orderService.transferOrder(uid, orderId, cause); |
| | | return ResponseWarpper.success(resultUtil); |
| | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/setOrderEndAddress") |
| | | @ServiceLog(name = "司机修改订单终点", url = "/api/order/setOrderEndAddress") |
| | | // @ServiceLog(name = "司机修改订单终点", url = "/api/order/setOrderEndAddress") |
| | | @ApiOperation(value = "司机修改订单终点", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper setOrderEndAddress(OrderEndAddressWarpper orderEndAddressWarpper, HttpServletRequest request){ |
| | | public ResponseWarpper setOrderEndAddress(OrderEndAddressWarpper orderEndAddressWarpper){ |
| | | try { |
| | | Integer uid = driverService.getUserByRequset(request); |
| | | Integer uid = driverService.getUserByRequest(); |
| | | if(null == uid){ |
| | | return ResponseWarpper.success(ResultUtil.tokenErr()); |
| | | return ResponseWarpper.tokenErr(); |
| | | } |
| | | ResultUtil resultUtil = orderService.setOrderEndAddress(uid, orderEndAddressWarpper); |
| | | return ResponseWarpper.success(resultUtil); |
| | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/cancelTransferOrder") |
| | | @ServiceLog(name = "司机取消转单操作", url = "/api/order/cancelTransferOrder") |
| | | @ApiOperation(value = "司机取消转单操作", tags = {"司机端-我的订单"}, notes = "") |
| | | // @ServiceLog(name = "司机取消转单操作", url = "/api/order/cancelTransferOrder") |
| | | @ApiOperation(value = "司机取消转单操作", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "long"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper cancelTransferOrder(Long orderId, HttpServletRequest request){ |
| | | public ResponseWarpper cancelTransferOrder(Long orderId){ |
| | | if(ToolUtil.isEmpty(orderId)){ |
| | | return ResponseWarpper.success(ResultUtil.paranErr("orderId")); |
| | | } |
| | | try { |
| | | Integer uid = driverService.getUserByRequset(request); |
| | | Integer uid = driverService.getUserByRequest(); |
| | | if(null == uid){ |
| | | return ResponseWarpper.success(ResultUtil.tokenErr()); |
| | | return ResponseWarpper.tokenErr(); |
| | | } |
| | | ResultUtil resultUtil = orderService.cancelTransferOrder(uid, orderId); |
| | | return ResponseWarpper.success(resultUtil); |
| | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/driverCancelOrder") |
| | | @ServiceLog(name = "司机取消订单操作", url = "/api/order/driverCancelOrder") |
| | | // @ServiceLog(name = "司机取消订单操作", url = "/api/order/driverCancelOrder") |
| | | @ApiOperation(value = "司机取消订单操作", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "long"), |
| | | @ApiImplicitParam(value = "原因", name = "cause", required = true, dataType = "string"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper driverCancelOrder(Long orderId, String cause, HttpServletRequest request){ |
| | | public ResponseWarpper driverCancelOrder(Long orderId, String cause){ |
| | | if(ToolUtil.isEmpty(orderId)){ |
| | | return ResponseWarpper.success(ResultUtil.paranErr("orderId")); |
| | | } |
| | |
| | | return ResponseWarpper.success(ResultUtil.paranErr("cause")); |
| | | } |
| | | try { |
| | | Integer uid = driverService.getUserByRequset(request); |
| | | Integer uid = driverService.getUserByRequest(); |
| | | if(null == uid){ |
| | | return ResponseWarpper.success(ResultUtil.tokenErr()); |
| | | return ResponseWarpper.tokenErr(); |
| | | } |
| | | ResultUtil resultUtil = orderService.driverCancelOrder(uid, orderId, cause); |
| | | return ResponseWarpper.success(resultUtil); |
| | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/queryOrderPrice") |
| | | @ServiceLog(name = "获取订单费用明细", url = "/api/order/queryOrderPrice") |
| | | // @ServiceLog(name = "获取订单费用明细", url = "/api/order/queryOrderPrice") |
| | | @ApiOperation(value = "获取订单费用明细", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "long"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper<OrderPriceWarpper> queryOrderPrice(Long orderId, HttpServletRequest request){ |
| | | public ResponseWarpper<OrderPriceWarpper> queryOrderPrice(Long orderId){ |
| | | if(ToolUtil.isEmpty(orderId)){ |
| | | return ResponseWarpper.success(ResultUtil.paranErr("orderId")); |
| | | } |
| | | try { |
| | | Integer uid = driverService.getUserByRequset(request); |
| | | Integer uid = driverService.getUserByRequest(); |
| | | if(null == uid){ |
| | | return ResponseWarpper.success(ResultUtil.tokenErr()); |
| | | return ResponseWarpper.tokenErr(); |
| | | } |
| | | OrderPriceWarpper orderPriceWarpper = orderService.queryOrderPrice(uid, orderId); |
| | | return ResponseWarpper.success(orderPriceWarpper); |
| | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/setOrderStatus") |
| | | @ServiceLog(name = "服务完成后修改订单状态", url = "/api/order/setOrderStatus") |
| | | // @ServiceLog(name = "服务完成后修改订单状态", url = "/api/order/setOrderStatus") |
| | | @ApiOperation(value = "服务完成后修改订单状态", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "long"), |
| | | @ApiImplicitParam(value = "107(线上支付),108(完成线下支付)", name = "state", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper setOrderStatus(Long orderId, Integer state, HttpServletRequest request){ |
| | | public ResponseWarpper setOrderStatus(Long orderId, Integer state){ |
| | | if(ToolUtil.isEmpty(orderId)){ |
| | | return ResponseWarpper.success(ResultUtil.paranErr("orderId")); |
| | | } |
| | |
| | | return ResponseWarpper.success(ResultUtil.paranErr("state")); |
| | | } |
| | | try { |
| | | Integer uid = driverService.getUserByRequset(request); |
| | | Integer uid = driverService.getUserByRequest(); |
| | | if(null == uid){ |
| | | return ResponseWarpper.success(ResultUtil.tokenErr()); |
| | | return ResponseWarpper.tokenErr(); |
| | | } |
| | | ResultUtil resultUtil = orderService.setOrderStatus(uid, orderId, state); |
| | | return ResponseWarpper.success(resultUtil); |
| | |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/queryDriverOrderList") |
| | | // @ServiceLog(name = "获取司机订单列表", url = "/api/order/queryDriverOrderList") |
| | | @ApiOperation(value = "获取司机订单列表", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单状态(107=未支付,109=已完成,301=已取消)", name = "state", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "页码,首页1", name = "pageNum", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "页条数", name = "pageSize", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper<List<DriverOrderListWarpper>> queryDriverOrderList(Integer state, Integer pageNum, Integer pageSize){ |
| | | if(null == pageNum){ |
| | | return ResponseWarpper.success(ResultUtil.paranErr("pageNum")); |
| | | } |
| | | if(null == pageSize){ |
| | | return ResponseWarpper.success(ResultUtil.paranErr("pageSize")); |
| | | } |
| | | try { |
| | | Integer uid = driverService.getUserByRequest(); |
| | | if(null == uid){ |
| | | return ResponseWarpper.tokenErr(); |
| | | } |
| | | List<DriverOrderListWarpper> driverOrderListWarppers = orderService.queryDriverOrderList(uid, state, pageNum, pageSize); |
| | | return ResponseWarpper.success(driverOrderListWarppers); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | | } |
| | | } |
| | | } |