| | |
| | | package com.ruoyi.client; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.squareup.okhttp.OkHttpClient; |
| | | import com.squareup.okhttp.Request; |
| | | import com.squareup.okhttp.Response; |
| | | import com.squareup.okhttp.ResponseBody; |
| | | import com.alibaba.fastjson2.JSON; |
| | | import okhttp3.OkHttpClient; |
| | | import okhttp3.Request; |
| | | import okhttp3.Response; |
| | | import okhttp3.ResponseBody; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | |
| | | return new HashMap(); |
| | | } |
| | | } |
| | | |
| | | //根据车队id获得下属全部车辆 --车辆列表 |
| | | public static Map<String,Object> getCarListByTeamId(String syURL,String teamId,String userId,String sessionId){ |
| | | OkHttpClient okHttpClient = new OkHttpClient(); |
| | | |
| | | /*Request request = new Request.Builder() |
| | | .url("http://106.14.186.44:9999/gps-web/api/get_car_list.jsp?teamId="+teamId+"&detail=true&userId="+userId+"&loginType=user&loginWay=interface&loginLang=zh_CN&appDevId=&appId=android&sessionId="+sessionId) |
| | | .build();*/ |
| | | /*Request request = new Request.Builder() |
| | | .url("http://116.182.15.14:9999/gps-web/api/get_car_list.jsp?teamId="+teamId+"&detail=true&userId="+userId+"&loginType=user&loginWay=interface&loginLang=zh_CN&appDevId=&appId=android&sessionId="+sessionId) |
| | | .build();*/ |
| | | Request request = new Request.Builder() |
| | | .url(syURL + "/gps-web/api/get_car_list.jsp?teamId="+teamId+"&detail=true&userId="+userId+"&loginType=user&loginWay=interface&loginLang=zh_CN&appDevId=&appId=android&sessionId="+sessionId) |
| | | .build(); |
| | | |
| | | Response response = null; |
| | | try { |
| | | response = okHttpClient.newCall(request).execute(); |
| | | } catch (IOException e1) { |
| | | // TODO Auto-generated catch block |
| | | e1.printStackTrace(); |
| | | } |
| | | |
| | | response.headers(); //响应头 |
| | | |
| | | ResponseBody responseBody = response.body(); |
| | | |
| | | try { |
| | | String message = responseBody.string();// 响应体 |
| | | Map<String,Object> map = (Map<String, Object>) JSON.parse(message); |
| | | //System.out.println(message); |
| | | return map; |
| | | } catch (IOException e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | return new HashMap(); |
| | | } |
| | | } |
| | | |
| | | //根据车队id获得下属全部车辆 --车辆列表(车队下所有层级车辆) |
| | | public static Map<String,Object> getCarListSubByTeamId(String syURL,String teamId,String userId,String sessionId){ |
| | | OkHttpClient okHttpClient = new OkHttpClient(); |
| | | |
| | | /*Request request = new Request.Builder() |
| | | .url("http://106.14.186.44:9999/gps-web/api/get_car_list_recur.jsp?teamId="+teamId+"&userId="+userId+"&loginType=user&loginWay=android&loginLang=zh_CN&appDevId=&sessionId="+sessionId) |
| | | .build();*/ |
| | | /*Request request = new Request.Builder() |
| | | .url("http://116.182.15.14:9999/gps-web/api/get_car_list_recur.jsp?teamId="+teamId+"&userId="+userId+"&loginType=user&loginWay=android&loginLang=zh_CN&appDevId=&sessionId="+sessionId) |
| | | .build();*/ |
| | | Request request = new Request.Builder() |
| | | .url(syURL + "/gps-web/api/get_car_list_recur.jsp?teamId="+teamId+"&userId="+userId+"&loginType=user&loginWay=android&loginLang=zh_CN&appDevId=&sessionId="+sessionId) |
| | | .build(); |
| | | |
| | | Response response = null; |
| | | try { |
| | | response = okHttpClient.newCall(request).execute(); |
| | | } catch (IOException e1) { |
| | | // TODO Auto-generated catch block |
| | | e1.printStackTrace(); |
| | | } |
| | | |
| | | response.headers(); //响应头 |
| | | |
| | | ResponseBody responseBody = response.body(); |
| | | |
| | | try { |
| | | String message = responseBody.string();// 响应体 |
| | | Map<String,Object> map = (Map<String, Object>) JSON.parse(message); |
| | | //System.out.println(message); |
| | | return map; |
| | | } catch (IOException e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | return new HashMap(); |
| | | } |
| | | } |
| | | } |