| | |
| | | package com.stylefeng.guns.modular.crossCity.controller; |
| | | |
| | | |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; |
| | | import com.stylefeng.guns.modular.crossCity.warpper.OrderCrossCityInfoWrapper; |
| | | import com.stylefeng.guns.modular.crossCity.warpper.OrderCrossCityWarpper; |
| | |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.service.IReassignService; |
| | | import com.stylefeng.guns.modular.system.util.ICBCPayUtil; |
| | | import com.stylefeng.guns.modular.system.util.PayMoneyUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.util.SystemException; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.PrintWriter; |
| | | import java.util.Map; |
| | | |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private ICBCPayUtil icbcPayUtil; |
| | | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 扫码支付成功回调处理 |
| | | * @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("1")){ |
| | | // icbcPayUtil.answer(response);//回调应答 |
| | | // } |
| | | // if(ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(order_id) && s.equals("1")){ |
| | | // 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(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 完成订单微信支付回调 |
| | | * @param request |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/wxPayCrossCity") |
| | | public void wxPayCrossCity(HttpServletRequest request, HttpServletResponse response){ |
| | | try { |
| | | Map<String, String> map = payMoneyUtil.weixinpayCallback(request); |
| | | if(null != map){ |
| | | String out_trade_no = map.get("out_trade_no"); |
| | | String order_id = map.get("order_id"); |
| | | String result = map.get("result"); |
| | | if(ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(order_id)){ |
| | | PrintWriter out = response.getWriter(); |
| | | out.write(result); |
| | | out.flush(); |
| | | out.close(); |
| | | |
| | | String[] split = out_trade_no.split("_"); |
| | | Integer id = Integer.valueOf(split[0]); |
| | | Integer type = Integer.valueOf(split[1]); |
| | | switch (type){ |
| | | case 3: |
| | | orderCrossCityService.payOrderCrossCityCallback(id, order_id, 1); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/aliPayCrossCity") |
| | | public void aliPayCrossCity(HttpServletRequest request, HttpServletResponse response){ |
| | | try { |
| | | Map<String, String> map = payMoneyUtil.alipayCallback(request); |
| | | if(null != map){ |
| | | String out_trade_no = map.get("out_trade_no"); |
| | | String order_id = map.get("trade_no"); |
| | | if(ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(order_id)){ |
| | | String[] split = out_trade_no.split("_"); |
| | | Integer id = Integer.valueOf(split[0]); |
| | | Integer type = Integer.valueOf(split[1]); |
| | | switch (type){ |
| | | case 3: |
| | | orderCrossCityService.payOrderCrossCityCallback(id, order_id, 2); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |