| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.PrintWriter; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private IOrderCancelService orderCancelService; |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | |
| | | @Value("${pushMinistryOfTransport}") |
| | | private boolean pushMinistryOfTransport; |
| | |
| | | @PostMapping("/base/wxPayOrderTaxi") |
| | | public void wxPayOrderTaxi(HttpServletRequest request, HttpServletResponse response){ |
| | | try { |
| | | Map<String, String> map = icbcPayUtil.payCallback(request); |
| | | System.out.println("完成订单微信支付回调"); |
| | | Map<String, String> map = payMoneyUtil.weixinpayCallback(request); |
| | | System.out.println("wx支付信息:"+map); |
| | | |
| | | |
| | | if(null != map){ |
| | | String order_id = map.get("transaction_id"); |
| | | String out_trade_no = map.get("out_trade_no"); |
| | | String order_id = map.get("order_id"); |
| | | String s = icbcPayUtil.queryTransaction("", 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(","); |
| | | String result = map.get("result"); |
| | | String total_fee = map.get("total_fee"); |
| | | String transaction_id = map.get("transaction_id"); |
| | | |
| | | 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 1: |
| | | orderPrivateCarService.payOrderPrivateCarCallback(id, order_id, 1); |
| | | break; |
| | | case 2: |
| | | orderTaxiService.payOrderTaxiCallback(id, order_id, 1); |
| | | orderTaxiService.payOrderTaxiCallback(id, order_id, 2); |
| | | break; |
| | | case 3: |
| | | orderCrossCityService.payOrderCrossCityCallback(id, order_id, 1); |
| | | break; |
| | | case 4: |
| | | orderLogisticsService.payOrderLogisticsCallback(id, order_id, 1); |
| | | break; |
| | | case 5: |
| | | orderLogisticsService.payOrderLogisticsCallback(id, order_id, 1); |
| | | break; |
| | | } |
| | | } |