| | |
| | | private String adminUrl; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取服务中页面订单详情 |
| | | * @param orderId |
| | |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<OrderWarpper> queryOrderInfo(Integer orderId){ |
| | | public ResultUtil<OrderWarpper> queryOrderInfo(Integer orderId) { |
| | | try { |
| | | Map<String, Object> map = orderCrossCityService.queryOrderInfo(orderId); |
| | | return ResultUtil.success(OrderWarpper.getOrderWarpper(map)); |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | |
| | | @ApiImplicitParam(value = "备注", name = "remark", required = false, dataType = "string"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil reassignOrderCrossCityReassign(Reassign reassign, String orderIds, HttpServletRequest request){ |
| | | public ResultUtil reassignOrderCrossCityReassign(Reassign reassign, String orderIds, HttpServletRequest request) { |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | if (null == uid) { |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return reassignService.saveData_(reassign, orderIds, uid, null); |
| | | }catch (SystemException s){ |
| | | } catch (SystemException s) { |
| | | return ResultUtil.error(s.getMsg()); |
| | | } catch (Exception e){ |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | |
| | | @ApiImplicitParam(value = "跨城订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<OrderCrossCityInfoWrapper> queryOrderCrossCityInfo(Integer orderId){ |
| | | public ResultUtil<OrderCrossCityInfoWrapper> queryOrderCrossCityInfo(Integer orderId) { |
| | | try { |
| | | Map<String, Object> map = orderCrossCityService.queryOrderCrossCityInfo(orderId); |
| | | return ResultUtil.success(OrderCrossCityInfoWrapper.getOrderInfoWarpper(map)); |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | |
| | | @ApiImplicitParam(value = "跨城订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil setOrderCrossCitySort(Integer orderId){ |
| | | public ResultUtil setOrderCrossCitySort(Integer orderId) { |
| | | try { |
| | | orderCrossCityService.setOrderCrossCitySort(orderId); |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<BaseWarpper> orderCrossCity(OrderCrossCityWarpper orderCrossCityWarpper, HttpServletRequest request){ |
| | | public ResultUtil<BaseWarpper> orderCrossCity(OrderCrossCityWarpper orderCrossCityWarpper, HttpServletRequest request) { |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | if (null == uid) { |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return orderCrossCityService.orderCrossCity(orderCrossCityWarpper, uid); |
| | | }catch (SystemException se){ |
| | | } catch (SystemException se) { |
| | | return ResultUtil.error(se.getMessage()); |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/order/generatePay") |
| | | public void generatePay(HttpServletRequest request, HttpServletResponse response){ |
| | | public void generatePay(HttpServletRequest request, HttpServletResponse response) { |
| | | try { |
| | | // Map<String, String> map = icbcPayUtil.generatePayCallback(request); |
| | | // if(null != map){ |
| | |
| | | // } |
| | | // } |
| | | // } |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParam(value = "支付端(1=用户APP端,2=司机APP端,3=用户小程序端)", name = "type", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil payTaxiOrder(Integer payType, Integer orderId, Integer orderType, Integer couponId, Integer type, HttpServletRequest request){ |
| | | public ResultUtil payTaxiOrder(Integer payType, Integer orderId, Integer orderType, Integer couponId, Integer type, HttpServletRequest request) { |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | if (null == uid) { |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | switch (orderType){ |
| | | switch (orderType) { |
| | | case 3: |
| | | return orderCrossCityService.payCrossCityOrder(payType, orderId, couponId, type); |
| | | } |
| | | return ResultUtil.success(new Object()); |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/wxPayCrossCity") |
| | | public void wxPayCrossCity(HttpServletRequest request, HttpServletResponse response){ |
| | | public void wxPayCrossCity(HttpServletRequest request, HttpServletResponse response) { |
| | | try { |
| | | Map<String, String> map = payMoneyUtil.weixinpayCallback(request); |
| | | if(null != map){ |
| | | if (null != map) { |
| | | System.err.println(JSON.toJSONString(map)); |
| | | String out_trade_no = map.get("out_trade_no"); |
| | | String transaction_id = map.get("transaction_id"); |
| | | String result = map.get("result"); |
| | | if(ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(transaction_id)){ |
| | | System.out.println("完成订单微信支付回调"+map); |
| | | if (ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(transaction_id)) { |
| | | System.out.println("完成订单微信支付回调" + map); |
| | | PrintWriter out = response.getWriter(); |
| | | out.write(result); |
| | | out.flush(); |
| | |
| | | // throw new RuntimeException("该订单不存在"); |
| | | // } |
| | | // cloudPay(orderCrossCity.getDriverId(),map.get("total_fee"),map.get("transaction_id"),1); |
| | | switch (type){ |
| | | switch (type) { |
| | | case 3: |
| | | orderCrossCityService.payOrderCrossCityCallback(id, transaction_id, 1); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/aliPayCrossCity") |
| | | public void aliPayCrossCity(HttpServletRequest request, HttpServletResponse response){ |
| | | public void aliPayCrossCity(HttpServletRequest request, HttpServletResponse response) { |
| | | try { |
| | | System.err.println("支付宝回调----->"); |
| | | Map<String, String> map = payMoneyUtil.alipayCallback(request); |
| | | System.err.println(JSON.toJSONString(map)); |
| | | if(null != map){ |
| | | if (null != map) { |
| | | String out_trade_no = map.get("out_trade_no"); |
| | | String trade_no = map.get("trade_no"); |
| | | if(ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(trade_no)){ |
| | | if (ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(trade_no)) { |
| | | String[] split = out_trade_no.split("_"); |
| | | Integer id = Integer.valueOf(split[0]); |
| | | Integer type = Integer.valueOf(split[1]); |
| | | switch (type){ |
| | | switch (type) { |
| | | case 3: |
| | | orderCrossCityService.payOrderCrossCityCallback(id, trade_no, 2); |
| | | break; |
| | | } |
| | | String uid = map.get("passback_params"); |
| | | System.out.println("完成订单支付宝支付回调"+map); |
| | | System.out.println("完成订单支付宝支付回调" + map); |
| | | // TODO 司机云闪付 跨城出行支付宝回调支付充值 |
| | | // OrderCrossCity orderCrossCity = orderCrossCityService.selectById(id); |
| | | // if(Objects.isNull(orderCrossCity)){ |
| | |
| | | out.close(); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | |
| | | post.form("file", file); |
| | | HttpResponse execute = post.execute(); |
| | | int status = execute.getStatus(); |
| | | if(200 != status){ |
| | | if (200 != status) { |
| | | throw new RuntimeException("上传图片异常"); |
| | | } |
| | | // 6. 返回结果 |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 代客下单支付 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/orderCrossCity/orderOnBehalfPay") |
| | | @ApiOperation(value = "【202601】代客下单支付", tags = {"司机端-服务中"}, notes = "代客下单支付") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(value = "crossCityOrderId", name = "crossCityOrderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "1微信支付 2乘客 3线下", name = "type", required = true, dataType = "int") |
| | | }) |
| | | public ResultUtil orderOnBehalfPay(int crossCityOrderId,int type, HttpServletRequest request) { |
| | | try { |
| | | // 1. 验证Token获取司机ID |
| | | Integer driverId = driverService.getUserIdFormRedis(request); |
| | | if (null == driverId) { |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return orderCrossCityService.orderOnBehalfPay(crossCityOrderId,type,driverId); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |