From 1130ad3b89e73f9b76292f6da391e0e04b8417dd Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期二, 03 十二月 2024 16:15:04 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- DriverZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushMinistryOfTransportUtil.java | 83 ++++++++++----- MinistryOfTransport/src/main/java/com/sinata/ministryoftransport/util/MinistryOfTransport.java | 174 +++++++++++++++++++++++----------- 2 files changed, 169 insertions(+), 88 deletions(-) diff --git a/DriverZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushMinistryOfTransportUtil.java b/DriverZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushMinistryOfTransportUtil.java index 8a14f3c..5ce2365 100644 --- a/DriverZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushMinistryOfTransportUtil.java +++ b/DriverZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushMinistryOfTransportUtil.java @@ -126,13 +126,14 @@ header.put("Accept", "*/*"); header.put("Accept-Encoding", "gzip"); header.put("Accept-Charset", "utf-8"); + System.err.println("订单发起==============================="+map); String result = null; try { result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/orderCreate", map, header,"form").toString(); } catch (Exception e) { e.printStackTrace(); } - System.err.println("---------------------------订单发起接口----------------------:" + result); + System.err.println("--------------------------订单发起接口------------------------:" + result); } @@ -151,19 +152,24 @@ jsonObject.put("Longitude", Double.valueOf(value.split(",")[0]));//车辆经度 jsonObject.put("Latitude", Double.valueOf(value.split(",")[1]));//车辆纬度 jsonObject.put("Encrypt", 1);//坐标加密标识(1:GCJ-02测绘局标准,2:WGS84 GPS标准,3:BD-09百度标准,4:CGCS2000北斗标准,0:其他) - jsonObject.put("LicenseId", driver.getDriveCard());//机动车驾驶证编号 + if (driver.getIdCard() == null){ + return; + }else if (driver.getIdCard().isEmpty()){ + return; + } + jsonObject.put("LicenseId", driver.getIdCard());//机动车驾驶证编号 jsonObject.put("DriverPhone", driver.getPhone());//驾驶员手机号 jsonObject.put("VehicleNo", car.getCarLicensePlate());//车辆号牌 jsonObject.put("DistributeTime", new Date());//派单成功时间YYYYMMDDhhmmss Map<String, Object> map = new HashMap<>(); map.put("orderMatch", jsonObject.toJSONString()); - Map<String, String> header = new HashMap<>(); header.put("Connection", "keep-alive"); header.put("Content-Type", "application/x-www-form-urlencoded"); header.put("Accept", "*/*"); header.put("Accept-Encoding", "gzip"); header.put("Accept-Charset", "utf-8"); + System.err.println("订单成功==============================="+map); String result = null; try { result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/orderMatch", map, header,"form").toString(); @@ -184,7 +190,12 @@ String value = redisUtil.getValue("DRIVER" + driverId); if(ToolUtil.isNotEmpty(value)){ JSONObject jsonObject = new JSONObject(); - jsonObject.put("LicenseId", driver.getDriveCard());//机动车驾驶证号 + if (driver.getIdCard() == null){ + return; + }else if (driver.getIdCard().isEmpty()){ + return; + } + jsonObject.put("LicenseId", driver.getIdCard());//机动车驾驶证号 jsonObject.put("VehicleNo", car.getCarLicensePlate());//车辆号牌 jsonObject.put("LoginTime", new Date());//车辆经营上线时间YYYYMMDDhhmmss jsonObject.put("Longitude", Double.valueOf(value.split(",")[0]));//上线经度 @@ -219,7 +230,12 @@ String value = redisUtil.getValue("DRIVER" + driverId); if(ToolUtil.isNotEmpty(value)){ JSONObject jsonObject = new JSONObject(); - jsonObject.put("LicenseId", driver.getDriveCard());//机动车驾驶证号 + if (driver.getIdCard() == null){ + return; + }else if (driver.getIdCard().isEmpty()){ + return; + } + jsonObject.put("LicenseId", driver.getIdCard());//机动车驾驶证号 jsonObject.put("VehicleNo", car.getCarLicensePlate());//车辆号牌 jsonObject.put("LogoutTime", new Date());//车辆经营下线时间YYYYMMDDhhmmss jsonObject.put("Longitude", Double.valueOf(value.split(",")[0]));//下线经度 @@ -255,7 +271,12 @@ Car car = carService.selectById(orderPrivateCar.getCarId()); JSONObject jsonObject = new JSONObject(); jsonObject.put("OrderId", orderPrivateCar.getOrderNum());//订单号 - jsonObject.put("LicenseId", driver.getDriveCard());//机动车驾驶证号 + if (driver.getIdCard() == null){ + return; + }else if (driver.getIdCard().isEmpty()){ + return; + } + jsonObject.put("LicenseId", driver.getIdCard());//机动车驾驶证号 jsonObject.put("FareType", query.get("id").toString());//运价类型编码 jsonObject.put("VehicleNo", car.getCarLicensePlate());//车辆号牌 jsonObject.put("DepLongitude", Double.valueOf(orderPrivateCar.getBoardingLon()));//车辆出发经度 @@ -280,7 +301,6 @@ jsonObject.put("WaitTime", orderPrivateCar.getWait() * 60);//等待时间(秒) Map<String, Object> map = new HashMap<>(); map.put("operateDepart", jsonObject.toJSONString()); - Map<String, String> header = new HashMap<>(); header.put("Connection", "keep-alive"); header.put("Content-Type", "application/x-www-form-urlencoded"); @@ -339,12 +359,17 @@ Map<String, Object> query = systemPriceMapper.query(orderPrivateCar.getCompanyId(), 1, orderPrivateCar.getServerCarModelId()); Car car = carService.selectById(orderPrivateCar.getCarId()); ServerCarModel serverCarModel = serverCarModelMapper.selectById(orderPrivateCar.getServerCarModelId()); - TransactionDetails transactionDetails = transactionDetailsService.selectById(new EntityWrapper<TransactionDetails>().eq("orderType", 1).eq("orderId", orderId)); + TransactionDetails transactionDetails = transactionDetailsService.selectOne(new EntityWrapper<TransactionDetails>().eq("orderType", 1).eq("orderId", orderId)); JSONObject jsonObject = new JSONObject(); jsonObject.put("OrderId", orderPrivateCar.getOrderNum());//订单号 jsonObject.put("OnArea", 530602);//上车位置行政区划代码 jsonObject.put("DriverName", driver.getName());//机动车驾驶员 - jsonObject.put("LicenseId", driver.getDriveCard());//机动车驾驶证号 + if (driver.getIdCard() == null){ + return; + }else if (driver.getIdCard().isEmpty()){ + return; + } + jsonObject.put("LicenseId", driver.getIdCard());//机动车驾驶证号 jsonObject.put("FareType", query.get("id").toString());//运价类型编码(由网约车公司定义,与运价信息接口保持一街) jsonObject.put("VehicleNo", car.getCarLicensePlate());//车辆号牌 jsonObject.put("BookDepTime", orderPrivateCar.getTravelTime());//预计上车时间YYYYMMDDhhmmss @@ -440,7 +465,7 @@ Double Speed = 0D; if(orderPositions != null && orderPositions.size() > 1){ Map<String, String> distance = gdMapElectricFenceUtil.getDistance(orderPositions.get(orderPositions.size() - 1).getLon() + "," + orderPositions.get(orderPositions.size() - 1).getLat(), - orderPositions.get(orderPositions.size() - 1).getLon() + "," + orderPositions.get(orderPositions.size() - 1).getLat(), 0); + orderPositions.get(orderPositions.size() - 0).getLon() + "," + orderPositions.get(orderPositions.size() - 0).getLat(), 0); Speed = distance != null ? Double.valueOf(distance.get("distance")) / 1000 : 0D; } Integer state = 4; @@ -459,7 +484,12 @@ } JSONObject jsonObject = new JSONObject(); - jsonObject.put("LicenseId", driver.getDriveCard());//机动车驾驶证号 + if (driver.getIdCard() == null){ + return; + }else if (driver.getIdCard().isEmpty()){ + return; + } + jsonObject.put("LicenseId", driver.getIdCard());//机动车驾驶证号 jsonObject.put("DriverRegionCode", 530602);//行政区划代码 jsonObject.put("VehicleNo", car.getCarLicensePlate());//车辆号牌 jsonObject.put("PositionTime", new Date());//定位时间(时间戳) @@ -473,25 +503,19 @@ jsonObject.put("OrderId", orderNum);//订单编号 Map<String, Object> map = new HashMap<>(); map.put("positionDriver", jsonObject.toJSONString()); - Map<String, String> header = new HashMap<>(); header.put("Connection", "keep-alive"); header.put("Content-Type", "application/x-www-form-urlencoded"); header.put("Accept", "*/*"); header.put("Accept-Encoding", "gzip"); header.put("Accept-Charset", "utf-8"); + String result = null; try { - HttpRequest post = HttpUtil.createPost(path + "ministryOfTransport/positionDriver"); - post.header("Connection", "keep-alive"); - post.header("Content-Type", "application/x-www-form-urlencoded"); - post.header("Accept", "*/*"); - post.header("Accept-Encoding", "gzip"); - post.header("Accept-Charset", "utf-8"); - post.body(JSON.toJSONString(map)); - post.execute(); + result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/positionDriver", map, header,"form").toString(); } catch (Exception e) { e.printStackTrace(); } + System.err.println("-----------------------------驾驶员定位信息------------------------:" + result); } @@ -515,7 +539,7 @@ Double Speed = 0D; if(orderPositions != null && orderPositions.size() > 1){ Map<String, String> distance = gdMapElectricFenceUtil.getDistance(orderPositions.get(orderPositions.size() - 1).getLon() + "," + orderPositions.get(orderPositions.size() - 1).getLat(), - orderPositions.get(orderPositions.size() - 1).getLon() + "," + orderPositions.get(orderPositions.size() - 1).getLat(), 0); + orderPositions.get(orderPositions.size() - 0).getLon() + "," + orderPositions.get(orderPositions.size() - 0).getLat(), 0); Speed = distance != null ? Double.valueOf(distance.get("distance")) / 1000 : 0D; } Integer state = 4; @@ -549,18 +573,19 @@ jsonObject.put("OrderId", orderNum);//订单编号(非营运状态下填"0") Map<String, Object> map = new HashMap<>(); map.put("positionVehicle", jsonObject.toJSONString()); + Map<String, String> header = new HashMap<>(); + header.put("Connection", "keep-alive"); + header.put("Content-Type", "application/x-www-form-urlencoded"); + header.put("Accept", "*/*"); + header.put("Accept-Encoding", "gzip"); + header.put("Accept-Charset", "utf-8"); + String result = null; try { - HttpRequest post = HttpUtil.createPost(path + "ministryOfTransport/positionVehicle"); - post.header("Connection", "keep-alive"); - post.header("Content-Type", "application/x-www-form-urlencoded"); - post.header("Accept", "*/*"); - post.header("Accept-Encoding", "gzip"); - post.header("Accept-Charset", "utf-8"); - post.body(JSON.toJSONString(map)); - post.execute(); + result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/positionVehicle", map, header,"form").toString(); } catch (Exception e) { e.printStackTrace(); } + System.err.println("----------------------------车辆定位信息---------------------------:" + result); } diff --git a/MinistryOfTransport/src/main/java/com/sinata/ministryoftransport/util/MinistryOfTransport.java b/MinistryOfTransport/src/main/java/com/sinata/ministryoftransport/util/MinistryOfTransport.java index a1a2b8d..a669578 100644 --- a/MinistryOfTransport/src/main/java/com/sinata/ministryoftransport/util/MinistryOfTransport.java +++ b/MinistryOfTransport/src/main/java/com/sinata/ministryoftransport/util/MinistryOfTransport.java @@ -72,6 +72,7 @@ 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()); } @@ -105,6 +106,7 @@ 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()); } @@ -143,6 +145,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()); } @@ -186,6 +190,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()); } @@ -226,6 +232,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()); } @@ -282,6 +290,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()); } @@ -347,6 +357,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()); } @@ -386,6 +398,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()); } @@ -421,6 +435,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()); } @@ -474,16 +490,13 @@ 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"); @@ -530,6 +543,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()); } @@ -569,6 +584,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()); } @@ -607,6 +624,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()); } @@ -644,6 +663,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()); } @@ -686,6 +707,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()); } @@ -724,6 +747,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()); } @@ -760,6 +785,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()); } @@ -795,6 +822,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()); } @@ -830,6 +859,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()); } @@ -869,6 +900,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()); } @@ -905,6 +938,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()); } @@ -973,6 +1008,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()); } @@ -1014,6 +1051,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()); } @@ -1057,6 +1096,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()); } @@ -1092,6 +1133,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()); } @@ -1125,6 +1168,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()); } @@ -1157,6 +1202,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()); } @@ -1190,6 +1237,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()); } @@ -1229,6 +1278,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()); } @@ -1273,6 +1324,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()); } @@ -1316,6 +1369,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()); } @@ -1384,68 +1439,69 @@ 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")); +// } } -- Gitblit v1.7.1