| | |
| | | |
| | | try { |
| | | String message = responseBody.string(); |
| | | System.out.println("////////////"); |
| | | System.out.println(message); |
| | | Map<String,Object> result = (Map<String, Object>) JSON.parse(message); |
| | | return result; |
| | |
| | | } |
| | | } |
| | | |
| | | public static Map<String,Object> GetPartsAlertLeve(String url,String token){//获取单台油井信息和测点 |
| | | public static Map<String,Object> GetPartsAlertLeve(String url,String token,Integer id){ |
| | | OkHttpClient okHttpClient = new OkHttpClient(); |
| | | RequestBody formBody = new FormBody.Builder() |
| | | // MediaType mediaType = MediaType.parse("application/json; charset=utf-8"); |
| | | // RequestBody formBody = RequestBody.create(mediaType, ""); |
| | | RequestBody formBody = new Builder() |
| | | .add("equipId", String.valueOf(id)) |
| | | .build(); |
| | | |
| | | Request request = new Request.Builder().url(url).post(formBody).addHeader("roadflow-token",token).build(); |
| | | |
| | | Response response = null; |
| | | try { |
| | | response = okHttpClient.newCall(request).execute(); |
| | |
| | | |
| | | try { |
| | | String message = responseBody.string(); |
| | | System.out.println("////////////"); |
| | | System.out.println(message); |
| | | Map<String,Object> result = (Map<String, Object>) JSON.parse(message); |
| | | return result; |