| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | jsonObject.put("EmergencyContact", baseInfoDriver.getEmergencyContact());//紧急情况联系人 |
| | | jsonObject.put("EmergencyContactPhone", baseInfoDriver.getEmergencyContactPhone());//紧急情况联系人电话 |
| | | jsonObject.put("EmergencyContactAddress", baseInfoDriver.getEmergencyContactAddress());//紧急情况联系人通信地址 |
| | | |
| | | jsonObject.put("State", baseInfoDriver.getState());//状态(0:有效,1:失效) |
| | | jsonObject.put("Flag", baseInfoDriver.getFlag());//操作标识(1:新增,2:更新,3:删除) |
| | | jsonObject.put("UpdateTime", Long.valueOf(sdf.format(baseInfoDriver.getUpdateTime()))); |
| | | |
| | | data.put("CompanyId", CompanyId); |
| | | data.put("Source", Source); |
| | | data.put("IPCType", IPCType); |
| | | data.put(IPCType, jsonObject); |
| | | |
| | | Map<String, String> header = new HashMap<>(); |
| | | header.put("connection", "keep-alive"); |
| | | header.put("content-type", "application/json; charset=UTF-8"); |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | header.put("accept-encoding", "gzip"); |
| | | header.put("accept-charset", "utf-8"); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); |
| | | |
| | | |
| | | if(httpResult.getCode() == 200){ |
| | | analysisResult(httpResult.getData()); |
| | | } |
| | |
| | | return JSON.toJSONString(httpResult); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 处理返回结果 |
| | | * @param result |
| | | */ |
| | | private void analysisResult(String result){ |
| | | JSONObject jsonObject = JSON.parseObject(result); |
| | | if(null == jsonObject){ |
| | | System.err.println("请求接口出错!"); |
| | | return; |
| | | } |
| | | int code = (Integer)jsonObject.get("status"); |
| | | if(code == 200){ |
| | | System.err.println("(成功)服务器已成功处理了请求"); |
| | | } |
| | | if(code == 201){ |
| | | System.err.println("请求已经完成并一个新的返回资源被创建"); |
| | | } |
| | | if(code == 400){ |
| | | System.err.println("(错误请求)服务器不理解请求的语法"); |
| | | System.err.println(jsonObject.getString("error")); |
| | | } |
| | | if(code == 401){ |
| | | System.err.println("(未授权)请求要求身份验证"); |
| | | System.err.println(jsonObject.getString("error")); |
| | | } |
| | | if(code == 403){ |
| | | System.err.println("(禁止)服务器拒绝请求"); |
| | | System.err.println(jsonObject.getString("error")); |
| | | } |
| | | if(code == 404){ |
| | | System.err.println("(未找到)服务器找不到请求的网页"); |
| | | System.err.println(jsonObject.getString("error")); |
| | | } |
| | | if(code == 500){ |
| | | System.err.println("服务器遭遇异常阻止了当前请求的执行"); |
| | | System.err.println(jsonObject.getString("error")); |
| | | } |
| | | if(code == 502){ |
| | | System.err.println("(错误网关)服务器作为网关或代理,从上游服务器收到无效响应"); |
| | | System.err.println(jsonObject.getString("error")); |
| | | } |
| | | if(code == 702){ |
| | | System.err.println("请求文件不存在"); |
| | | System.err.println(jsonObject.getString("error")); |
| | | } |
| | | if(code == 948){ |
| | | System.err.println("请求文件名格式不正确"); |
| | | System.err.println(jsonObject.getString("error")); |
| | | } |
| | | if(code == 949){ |
| | | System.err.println("文件解压失败"); |
| | | System.err.println(jsonObject.getString("error")); |
| | | } |
| | | if(code == 952){ |
| | | System.err.println("格式校验失败"); |
| | | System.err.println(jsonObject.getString("error")); |
| | | } |
| | | if(code == 1000){ |
| | | System.err.println("请求异常"); |
| | | System.err.println(jsonObject.getString("error")); |
| | | } |
| | | // if(null == jsonObject){ |
| | | // System.err.println("请求接口出错!"); |
| | | // return; |
| | | // } |
| | | System.err.println("(成功)服务器已成功处理了请求"); |
| | | |
| | | // int code = (Integer)jsonObject.get("status"); |
| | | // if(code == 200){ |
| | | // System.err.println("(成功)服务器已成功处理了请求"); |
| | | // } |
| | | // if(code == 201){ |
| | | // System.err.println("请求已经完成并一个新的返回资源被创建"); |
| | | // } |
| | | // if(code == 400){ |
| | | // System.err.println("(错误请求)服务器不理解请求的语法"); |
| | | // System.err.println(jsonObject.getString("error")); |
| | | // } |
| | | // if(code == 401){ |
| | | // System.err.println("(未授权)请求要求身份验证"); |
| | | // System.err.println(jsonObject.getString("error")); |
| | | // } |
| | | // if(code == 403){ |
| | | // System.err.println("(禁止)服务器拒绝请求"); |
| | | // System.err.println(jsonObject.getString("error")); |
| | | // } |
| | | // if(code == 404){ |
| | | // System.err.println("(未找到)服务器找不到请求的网页"); |
| | | // System.err.println(jsonObject.getString("error")); |
| | | // } |
| | | // if(code == 500){ |
| | | // System.err.println("服务器遭遇异常阻止了当前请求的执行"); |
| | | // System.err.println(jsonObject.getString("error")); |
| | | // } |
| | | // if(code == 502){ |
| | | // System.err.println("(错误网关)服务器作为网关或代理,从上游服务器收到无效响应"); |
| | | // System.err.println(jsonObject.getString("error")); |
| | | // } |
| | | // if(code == 702){ |
| | | // System.err.println("请求文件不存在"); |
| | | // System.err.println(jsonObject.getString("error")); |
| | | // } |
| | | // if(code == 948){ |
| | | // System.err.println("请求文件名格式不正确"); |
| | | // System.err.println(jsonObject.getString("error")); |
| | | // } |
| | | // if(code == 949){ |
| | | // System.err.println("文件解压失败"); |
| | | // System.err.println(jsonObject.getString("error")); |
| | | // } |
| | | // if(code == 952){ |
| | | // System.err.println("格式校验失败"); |
| | | // System.err.println(jsonObject.getString("error")); |
| | | // } |
| | | // if(code == 1000){ |
| | | // System.err.println("请求异常"); |
| | | // System.err.println(jsonObject.getString("error")); |
| | | // } |
| | | |
| | | } |
| | | |