| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.stylefeng.guns.core.common.exception.BizExceptionEnum; |
| | | import com.stylefeng.guns.core.exception.GunsException; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.account.service.ITEnterpriseWithdrawalService; |
| | | import com.stylefeng.guns.modular.account.service.UserWithdrawalService; |
| | |
| | | import java.io.PrintWriter; |
| | | import java.math.BigDecimal; |
| | | import java.security.SecureRandom; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Map; |
| | | import java.util.UUID; |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * 司机响应改派申请 |
| | | * @param reassignIds |
| | | * @param responseType |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/orderCrossCity/respondReassign") |
| | | @ApiOperation(value = "司机响应改派申请(跨城)", tags = {"司机端-改派"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "改派ID列表(逗号分隔)", name = "reassignIds", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "响应类型(1=同意,2=拒绝)", name = "responseType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil respondReassign(String reassignIds, Integer responseType, HttpServletRequest request) { |
| | | try { |
| | | Integer driverId = driverService.getUserIdFormRedis(request); |
| | | if (null == driverId) { |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | if (ToolUtil.isEmpty(reassignIds)) { |
| | | return ResultUtil.success("改派ID不能为空", false); |
| | | } |
| | | if (responseType == null) { |
| | | return ResultUtil.success("响应类型不能为空", false); |
| | | } |
| | | return reassignService.respondReassignBatch(reassignIds, driverId, responseType); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ResultUtil.success("操作失败", false); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询待确认的改派申请 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/orderCrossCity/queryPendingReassigns") |
| | | @ApiOperation(value = "查询待确认的改派申请(跨城)", tags = {"司机端-改派"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil queryPendingReassigns(HttpServletRequest request) { |
| | | try { |
| | | Integer driverId = driverService.getUserIdFormRedis(request); |
| | | if (null == driverId) { |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | List<Map<String, Object>> list = reassignService.queryPendingReassigns(driverId); |
| | | return ResultUtil.success(list); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ResultUtil.error("查询失败"); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取已完成订单明细 |
| | | * @param orderId |
| | | * @return |