ManagementZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GDMapElectricFenceUtil.java
@@ -51,11 +51,12 @@ /** * 创建电子围栏 * * @param id * @param points * @return */ public List<String> createFence(String id, String points){ public List<String> createFence(String id, String points) { Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); calendar.set(Calendar.DAY_OF_MONTH, calendar.get(Calendar.DAY_OF_MONTH) + 35); @@ -66,14 +67,14 @@ //开始调用高德接口创建围栏 String[] s = points.split("_"); List<String> resoult = new ArrayList<>(); for(int i = 0; i < s.length; i++){ for (int i = 0; i < s.length; i++) { String[] split = s[i].split(";"); JSONObject json = new JSONObject(); json.put("name", "location_" + id); if(split.length == 2){ if (split.length == 2) { json.put("center", split[0]); json.put("radius", split[1]); }else{ } else { json.put("points", s[i]); } json.put("enable", "true"); @@ -96,7 +97,7 @@ gdInterfaceService.saveData("https://restapi.amap.com/v4/geofence/meta", "创建电子围栏"); if(status.equals("0")){//创建成功 if (status.equals("0")) {//创建成功 resoult.add(data.getString("gid")); } } @@ -104,21 +105,20 @@ } /** * 创建电子围栏 * @param id 围栏名称----绘制的数据id值 * @param points 多边形围栏坐标 * * @param id 围栏名称----绘制的数据id值 * @param points 多边形围栏坐标 */ public List<String> createElectricFenc(String id, String points){ public List<String> createElectricFenc(String id, String points) { List<String> fence = this.createFence(id, points); List<String> gids = new ArrayList<>(); for(String f : fence){ for (String f : fence) { JSONObject jsonObject = JSON.parseObject(f); JSONObject data = jsonObject.getJSONObject("data"); String status = data.getString("status"); if(status.equals("0")){ if (status.equals("0")) { gids.add(data.getString("gid")); } } @@ -128,27 +128,27 @@ /** * 查询 * * @param gid * @return */ public String findElectricFenc(String gid){ public String findElectricFenc(String gid) { String url = "https://restapi.amap.com/v4/geofence/meta?key=" + key + "&gid=" + gid; String forObject = restTemplate.getForObject(url, String.class); JSONObject jsonObject = JSON.parseObject(forObject); JSONObject data = jsonObject.getJSONObject("data"); JSONArray rs_list = data.getJSONArray("rs_list"); if(rs_list.size() > 0){ if (rs_list.size() > 0) { return rs_list.getJSONObject(0).getString("gid"); } return ""; } /** * 查询以创建的所有电子围栏 */ public String findElectricFenc(String center, String radius, String points){ public String findElectricFenc(String center, String radius, String points) { String url = "https://restapi.amap.com/v4/geofence/meta?key=" + key; String forObject = restTemplate.getForObject(url, String.class); JSONObject jsonObject = JSON.parseObject(forObject); @@ -156,20 +156,20 @@ gdInterfaceService.saveData("https://restapi.amap.com/v4/geofence/meta", "查询电子围栏"); if(ToolUtil.isNotEmpty(center)){//圆形电子围栏 if (ToolUtil.isNotEmpty(center)) {//圆形电子围栏 JSONArray rs_list = data.getJSONArray("rs_list"); for(int i = 0; i < rs_list.size(); i++){ for (int i = 0; i < rs_list.size(); i++) { String c = rs_list.getJSONObject(i).getString("center"); Double r = rs_list.getJSONObject(i).getDouble("radius"); if(c.equals(center) && radius.equals(String.valueOf(r))){ if (c.equals(center) && radius.equals(String.valueOf(r))) { return rs_list.getJSONObject(i).getString("gid"); } } }else{ } else { JSONArray rs_list = data.getJSONArray("rs_list"); for(int i = 0; i < rs_list.size(); i++){ for (int i = 0; i < rs_list.size(); i++) { String p = rs_list.getJSONObject(i).getString("points"); if(points.equals(p)){ if (points.equals(p)) { return rs_list.getJSONObject(i).getString("gid"); } } @@ -180,10 +180,11 @@ /** * 查询所有绘制好的电子围栏 * * @return */ public JSONArray findAllElectricFenc(int page){ if(page == 1){ public JSONArray findAllElectricFenc(int page) { if (page == 1) { jsonArray = new JSONArray(); } String url = "https://restapi.amap.com/v4/geofence/meta?key=" + key + "&page_no=" + page + "&page_size=" + 30; @@ -197,7 +198,7 @@ //判断是否有分页 int total_record = data.getIntValue("total_record"); if(total_record > jsonArray.size()){ if (total_record > jsonArray.size()) { //有分页,递归调用自己 page++; this.findAllElectricFenc(page); @@ -208,13 +209,14 @@ /** * 批量更新电子围栏(失效的数据) * * @param jsonArray * @throws ParseException */ public void updateElectricFenc(JSONArray jsonArray) throws ParseException{ public void updateElectricFenc(JSONArray jsonArray) throws ParseException { //批量更新查询出的失效的电子围栏,围栏失效日期在当前日期之后的数据 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); for(int i = 0; i < jsonArray.size(); i++){ for (int i = 0; i < jsonArray.size(); i++) { JSONObject jsonObject = jsonArray.getJSONObject(i); Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); @@ -233,7 +235,7 @@ cale.set(Calendar.SECOND, 0); cale.set(Calendar.MILLISECOND, 0); long timeInMillis = cale.getTimeInMillis(); if(timeInMillis1 >= timeInMillis){ if (timeInMillis1 >= timeInMillis) { String gid = jsonObject.getString("gid"); String id = jsonObject.getString("name"); String center = jsonObject.getString("center"); @@ -251,9 +253,9 @@ } /** * 更新电子围栏 * * @param gid * @param id * @param center @@ -264,10 +266,10 @@ //开始调用高德接口创建围栏 JSONObject json = new JSONObject(); json.put("name", id); if(ToolUtil.isNotEmpty(center)){ if (ToolUtil.isNotEmpty(center)) { json.put("center", center); json.put("radius", radius); }else{ } else { json.put("points", points); } json.put("valid_time", valid_time); @@ -291,6 +293,7 @@ /** * 电子围栏监控 * * @param diu 设备唯一标识符,作为记录依据,不影响判断结果。Android设备一般使用imei号码,iOS一般使用idfv号,其余设备可根据业务自定义。 * @param locations 数据为坐标数据和坐标产生的时间戳数据,至少包含一个坐标对和时间戳。 * 1、传入1个点时,直接判断交互关系。 @@ -299,8 +302,8 @@ * 动态交互判断方法:第一个点作为当前时间的点,然后从其余点中选出在当前点之前10s~1小时范围内的最早点,用这两个时间点的位置判断设备与围栏的动态交互关系。若数据无效交互关系默认返回leave。 * @return */ public List<String> monitorElectricFenc(String diu, String locations){ if(ToolUtil.isEmpty(diu)){ public List<String> monitorElectricFenc(String diu, String locations) { if (ToolUtil.isEmpty(diu)) { diu = "B78F99DD-2496-4A43-843B-172CDA2D9798"; } locations = locations + "," + (new Date().getTime() / 1000); @@ -310,11 +313,11 @@ List<String> ids = new ArrayList<>(); JSONObject data = jsonObject.getJSONObject("data"); int status = data.getIntValue("status"); if(0 == status){ if (0 == status) { JSONArray fencingEventList = data.getJSONArray("fencing_event_list"); for(int i = 0; i < fencingEventList.size(); i++){ for (int i = 0; i < fencingEventList.size(); i++) { String clientStatus = fencingEventList.getJSONObject(i).getString("client_status"); if(clientStatus.equals("in")){//包含给定坐标的电子围栏 if (clientStatus.equals("in")) {//包含给定坐标的电子围栏 JSONObject fence_info = fencingEventList.getJSONObject(i).getJSONObject("fence_info");//获取电子围栏信息 String gid = fence_info.getString("fence_gid"); ids.add(gid); @@ -330,12 +333,13 @@ /** * 删除电子围栏 * * @param gid * @return */ public boolean deleteElectricFenc(String gid){ public boolean deleteElectricFenc(String gid) { restTemplate.delete("https://restapi.amap.com/v4/geofence/meta?key={1}&gid={2}", key, gid); System.out.println("删除:" ); System.out.println("删除:"); gdInterfaceService.saveData("https://restapi.amap.com/v4/geofence/meta", "删除电子围栏"); @@ -345,12 +349,13 @@ /** * 获取两点的距离 * @param origins 起点坐标 * @param destination 终点坐标 * @param type 计算类型:0:直线距离 1:驾车导航距离(仅支持国内坐标)。 * * @param origins 起点坐标 * @param destination 终点坐标 * @param type 计算类型:0:直线距离 1:驾车导航距离(仅支持国内坐标)。 * @return */ public Map<String, String> getDistance(String origins, String destination, Integer type){ public Map<String, String> getDistance(String origins, String destination, Integer type) { String url = "https://restapi.amap.com/v3/distance?key=" + key + "&origins=" + origins + "&destination=" + destination + "&type=" + type; String forObject = restTemplate.getForObject(url, String.class); @@ -359,14 +364,14 @@ gdInterfaceService.saveData("https://restapi.amap.com/v3/distance", "查询两点间的距离"); if(status.equals("1")){ if (status.equals("1")) { JSONArray results = jsonObject.getJSONArray("results"); JSONObject jsonObject1 = results.getJSONObject(0); Map<String, String> map = new HashMap<>(); map.put("distance", jsonObject1.getString("distance"));//距离(米) map.put("duration", jsonObject1.getString("duration"));//预计时间(秒) return map; }else{ } else { System.err.println(forObject); } return null; @@ -375,12 +380,13 @@ /** * 获取路径规划 * @param origins 起点坐标 * @param destination 终点坐标 * @param waypoints 途经点 * * @param origins 起点坐标 * @param destination 终点坐标 * @param waypoints 途经点 * @return */ public Map<String, String> getDriving(String origins, String destination, String waypoints){ public Map<String, String> getDriving(String origins, String destination, String waypoints) { String url = "https://restapi.amap.com/v3/direction/driving?key=" + key + "&origin=" + origins + "&destination=" + destination + "&waypoints=" + waypoints + "&extensions=base&strategy=0"; String forObject = restTemplate.getForObject(url, String.class); @@ -389,7 +395,7 @@ gdInterfaceService.saveData("https://restapi.amap.com/v3/direction/driving", "获取路径规划"); if(status.equals("1")){ if (status.equals("1")) { JSONObject route = jsonObject.getJSONObject("route"); JSONArray results = route.getJSONArray("paths"); JSONObject jsonObject1 = results.getJSONObject(0); MinistryOfTransport/src/main/java/com/sinata/ministryoftransport/util/MinistryOfTransport.java
@@ -40,6 +40,7 @@ * 上传企业基础信息 */ public String baseInfoCompany(BaseInfoCompany baseInfoCompany) throws Exception{ System.err.println("公司信息"+baseInfoCompany); String IPCType = "baseInfoCompany"; String path = url + "/baseinfo/company"; Map<String, Object> data = new HashMap<>(); @@ -84,6 +85,8 @@ * 网约车平台公司营运规模信息接口 */ public String baseInfoCompanyStat(BaseInfoCompanyStat baseInfoCompanyStat) throws Exception{ System.err.println("网约车平台公司营运规模信息接口"+baseInfoCompanyStat); String IPCType = "baseInfoCompanyStat"; String path = url + "/baseinfo/companystat"; Map<String, Object> data = new HashMap<>(); @@ -118,6 +121,7 @@ * 网约车平台公司支付信息 */ public String baseInfoCompanyPay(BaseInfoCompanyPay baseInfoCompanyPay) throws Exception{ System.err.println("网约车平台公司支付信息"+baseInfoCompanyPay); String IPCType = "baseInfoCompanyPay"; String path = url + "/baseinfo/companypay"; Map<String, Object> data = new HashMap<>(); @@ -158,6 +162,7 @@ * 网约车平台公司服务机构 */ public String baseInfoCompanyService(BaseInfoCompanyService baseInfoCompanyService) throws Exception{ System.err.println("网约车平台公司服务机构"+baseInfoCompanyService); String IPCType = "baseInfoCompanyService"; String path = url + "/baseinfo/companyservice"; Map<String, Object> data = new HashMap<>(); @@ -203,6 +208,8 @@ * 网约车平台公司经营许可 */ public String baseInfoCompanyPermit(BaseInfoCompanyPermit baseInfoCompanyPermit) throws Exception{ System.err.println("网约车平台公司经营许可"+baseInfoCompanyPermit); String IPCType = "baseInfoCompanyPermit"; String path = url + "/baseinfo/companypermit"; Map<String, Object> data = new HashMap<>(); @@ -245,6 +252,8 @@ * 网约车平台公司运价信息 */ public String baseInfoCompanyFare(BaseInfoCompanyFare baseInfoCompanyFare) throws Exception{ System.err.println("网约车平台公司运价信息"+baseInfoCompanyFare); String IPCType = "baseInfoCompanyFare"; String path = url + "/baseinfo/companyfare"; Map<String, Object> data = new HashMap<>(); @@ -303,6 +312,8 @@ * 车辆基本信息 */ public String baseInfoVehicle(BaseInfoVehicle baseInfoVehicle) throws Exception{ System.err.println("车辆基本信息"+baseInfoVehicle); String IPCType = "baseInfoVehicle"; String path = url + "/baseinfo/vehicle"; Map<String, Object> data = new HashMap<>(); @@ -370,6 +381,8 @@ * 车辆保险信息 */ public String baseInfoVehicleInsurance(BaseInfoVehicleInsurance baseInfoVehicleInsurance) throws Exception{ System.err.println("车辆保险信息"+baseInfoVehicleInsurance); String IPCType = "baseInfoVehicleInsurance"; String path = url + "/baseinfo/vehicleinsurance"; Map<String, Object> data = new HashMap<>(); @@ -411,6 +424,8 @@ * 网约车车辆里程信息 */ public String baseInfoVehicleTotalMile(BaseInfoVehicleTotalMile baseInfoVehicleTotalMile) throws Exception{ System.err.println("网约车车辆里程信息"+baseInfoVehicleTotalMile); String IPCType = "baseInfoVehicleTotalMile"; String path = url + "/baseinfo/vehicletotalmile"; Map<String, Object> data = new HashMap<>(); @@ -448,6 +463,8 @@ * 驾驶员基本信息 */ public String baseInfoDriver(BaseInfoDriver baseInfoDriver) throws Exception{ System.err.println("驾驶员基本信息"+baseInfoDriver); String IPCType = "baseInfoDriver"; String path = url + "/baseinfo/driver"; Map<String, Object> data = new HashMap<>(); @@ -515,6 +532,8 @@ * 网约车驾驶员培训信息 */ public String baseInfoDriverEducate(BaseInfoDriverEducate baseInfoDriverEducate) throws Exception{ System.err.println("网约车驾驶员培训信息"+baseInfoDriverEducate); String IPCType = "baseInfoDriverEducate"; String path = url + "/baseinfo/drivereducate"; Map<String, Object> data = new HashMap<>(); @@ -556,6 +575,8 @@ * 驾驶员移动终端信息 */ public String baseInfoDriverApp(BaseInfoDriverApp baseInfoDriverApp) throws Exception{ System.err.println("驾驶员移动终端信息"+baseInfoDriverApp); String IPCType = "baseInfoDriverApp"; String path = url + "/baseinfo/driverapp"; Map<String, Object> data = new HashMap<>(); @@ -597,6 +618,8 @@ * 驾驶员统计信息 */ public String baseInfoDriverStat(BaseInfoDriverStat baseInfoDriverStat) throws Exception{ System.err.println("驾驶员统计信息"+baseInfoDriverStat); String IPCType = "baseInfoDriverStat"; String path = url + "/baseinfo/driverstat"; Map<String, Object> data = new HashMap<>(); @@ -637,6 +660,8 @@ * 乘客基本信息 */ public String baseInfoPassenger(BaseInfoPassenger baseInfoPassenger) throws Exception{ System.err.println("乘客基本信息"+baseInfoPassenger); String IPCType = "baseInfoPassenger"; String path = url + "/baseinfo/passenger"; Map<String, Object> data = new HashMap<>(); @@ -676,6 +701,8 @@ * 订单发起接口 */ public String orderCreate(OrderCreate orderCreate) throws Exception{ System.err.println("订单发起接口"+orderCreate); String IPCType = "orderCreate"; String path = url + "/order/create"; Map<String, Object> data = new HashMap<>(); @@ -720,6 +747,8 @@ * 订单成功接口 */ public String orderMatch(OrderMatch orderMatch) throws Exception{ System.err.println("订单成功接口"+orderMatch); String IPCType = "orderMatch"; String path = url + "/order/match"; Map<String, Object> data = new HashMap<>(); @@ -760,6 +789,8 @@ * 订单撤销接口 */ public String orderCancel(OrderCancel orderCancel) throws Exception{ System.err.println("订单撤销接口"+orderCancel); String IPCType = "orderCancel"; String path = url + "/order/cancel"; Map<String, Object> data = new HashMap<>(); @@ -798,6 +829,8 @@ * 车辆经营上线接口 */ public String operateLogin(OperateLogin operateLogin) throws Exception{ System.err.println("车辆经营上线接口"+operateLogin); String IPCType = "operateLogin"; String path = url + "/operate/login"; Map<String, Object> data = new HashMap<>(); @@ -835,6 +868,8 @@ * 车辆经营下线接口 */ public String operateLogout(OperateLogout operateLogout) throws Exception{ System.err.println("车辆经营下线接口"+operateLogout); String IPCType = "operateLogout"; String path = url + "/operate/logout"; Map<String, Object> data = new HashMap<>(); @@ -872,6 +907,8 @@ * 经营出发接口 */ public String operateDepart(OperateDepart operateDepart) throws Exception{ System.err.println("经营出发接口"+operateDepart); String IPCType = "operateDepart"; String path = url + "/operate/depart"; Map<String, Object> data = new HashMap<>(); @@ -913,6 +950,8 @@ * 经营到达接口 */ public String operateArrive(OperateArrive operateArrive) throws Exception{ System.err.println("经营到达接口"+operateArrive); String IPCType = "operateArrive"; String path = url + "/operate/arrive"; Map<String, Object> data = new HashMap<>(); @@ -951,6 +990,8 @@ * 经营支付接口 */ public String operatePay(OperatePay operatePay) throws Exception{ System.err.println("经营支付接口"+operatePay); String IPCType = "operatePay"; String path = url + "/operate/pay"; Map<String, Object> data = new HashMap<>(); @@ -1021,6 +1062,8 @@ * 驾驶员定位信息 */ public String positionDriver(PositionDriver positionDriver) throws Exception{ System.err.println("驾驶员定位信息"+positionDriver); String IPCType = "positionDriver"; String path = url + "/position/driver"; Map<String, Object> data = new HashMap<>(); @@ -1051,7 +1094,7 @@ header.put("accept-encoding", "gzip"); header.put("accept-charset", "utf-8"); HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json"); System.err.println("响应结果"+httpResult.getData()); if(httpResult.getCode() == 200){ analysisResult(httpResult.getData()); @@ -1064,6 +1107,8 @@ * 车辆定位信息 */ public String positionVehicle(PositionVehicle positionVehicle) throws Exception{ System.err.println("车辆定位信息"+positionVehicle); String IPCType = "positionVehicle"; String path = url + "/position/vehicle"; Map<String, Object> data = new HashMap<>(); @@ -1109,6 +1154,8 @@ * 乘客评价信息 */ public String ratedPassenger(RatedPassenger ratedPassenger) throws Exception{ System.err.println("乘客评价信息"+ratedPassenger); String IPCType = "ratedPassenger"; String path = url + "/rated/passenger"; Map<String, Object> data = new HashMap<>(); @@ -1146,6 +1193,8 @@ * 乘客投诉信息 */ public String ratedPassengerComplaint(RatedPassengerComplaint ratedPassengerComplaint) throws Exception{ System.err.println("乘客投诉信息"+ratedPassengerComplaint); String IPCType = "ratedPassengerComplaint"; String path = url + "/rated/passengercomplaint"; Map<String, Object> data = new HashMap<>(); @@ -1180,6 +1229,8 @@ * 驾驶员处罚信息 */ public String ratedDriverPunish(RatedDriverPunish ratedDriverPunish) throws Exception{ System.err.println("驾驶员处罚信息"+ratedDriverPunish); String IPCType = "ratedDriverPunish"; String path = url + "/rated/driverpunish"; Map<String, Object> data = new HashMap<>(); @@ -1215,6 +1266,8 @@ * 驾驶员信誉信息 */ public String ratedDriver(RatedDriver ratedDriver) throws Exception{ System.err.println("驾驶员信誉信息"+ratedDriver); String IPCType = "ratedDriver"; String path = url + "/rated/driver"; Map<String, Object> data = new HashMap<>(); @@ -1250,6 +1303,8 @@ * 私人小客车合乘信息服务平台基本信息 */ public String shareCompany(ShareCompany shareCompany) throws Exception{ System.err.println("私人小客车合乘信息服务平台基本信息"+shareCompany); String IPCType = "shareCompany"; String path = url + "/share/company"; Map<String, Object> data = new HashMap<>(); @@ -1290,6 +1345,8 @@ * 私人小客车合乘驾驶员行程发布接口 */ public String shareRoute(ShareRoute shareRoute) throws Exception{ System.err.println("私人小客车合乘驾驶员行程发布接口"+shareRoute); String IPCType = "shareRoute"; String path = url + "/share/route"; Map<String, Object> data = new HashMap<>(); @@ -1337,6 +1394,8 @@ * 私人小客车合乘订单接口 */ public String shareOrder(ShareOrder shareOrder) throws Exception{ System.err.println("私人小客车合乘订单接口"+shareOrder); String IPCType = "shareOrder"; String path = url + "/share/order"; Map<String, Object> data = new HashMap<>(); @@ -1382,6 +1441,8 @@ * 私人小客车合乘订单支付接口 */ public String sharePay(SharePay sharePay) throws Exception{ System.err.println("私人小客车合乘订单支付接口"+sharePay); String IPCType = "sharePay"; String path = url + "/share/pay"; Map<String, Object> data = new HashMap<>(); @@ -1433,6 +1494,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()); } MinistryOfTransport/src/main/java/com/sinata/ministryoftransport/util/TaskUtil.java
@@ -43,27 +43,27 @@ /** * 每隔一分钟去处理的定时任务 */ @Scheduled(fixedRate = 1000 * 60) public void taskMinute(){ try { String baseInfoCompany = "{\"CompanyName\":\"昭通市睿邦科技有限公司\",\"Identifier\":\"91530600MA6K70Q50D\",\"Address\":530602,\"BusinessScope\":\"网络预约出租汽车客运\"," + "\"ContactAddress\":\"云南省昭通市昭阳区龙泉路501号\",\"EconomicType\":\"150\",\"RegCapital\":\"一千万元\",\"LegalName\":\"虎尊国\",\"LegalID\":\"53210119760928201X\"," + "\"LegalPhone\":\"13118708883\",\"State\":0,\"Flag\":2,\"UpdateTime\":\"" +System.currentTimeMillis() + "\"}"; String result = ministryOfTransportService.baseInfoCompany(baseInfoCompany); HttpResult httpResult = JSON.parseObject(result, HttpResult.class); if(httpResult.getCode() == 200 || httpResult.getCode() == 201){ counter = 0; } if(null == httpResult){ sendSms(); System.err.println("请求接口出错!"); return; } } catch (Exception e) { sendSms(); e.printStackTrace(); } } // @Scheduled(fixedRate = 1000 * 60) // public void taskMinute(){ // try { // String baseInfoCompany = "{\"CompanyName\":\"昭通市睿邦科技有限公司\",\"Identifier\":\"91530600MA6K70Q50D\",\"Address\":530602,\"BusinessScope\":\"网络预约出租汽车客运\"," + // "\"ContactAddress\":\"云南省昭通市昭阳区龙泉路501号\",\"EconomicType\":\"150\",\"RegCapital\":\"一千万元\",\"LegalName\":\"虎尊国\",\"LegalID\":\"53210119760928201X\"," + // "\"LegalPhone\":\"13118708883\",\"State\":0,\"Flag\":2,\"UpdateTime\":\"" +System.currentTimeMillis() + "\"}"; // String result = ministryOfTransportService.baseInfoCompany(baseInfoCompany); // HttpResult httpResult = JSON.parseObject(result, HttpResult.class); // if(httpResult.getCode() == 200 || httpResult.getCode() == 201){ // counter = 0; // } // if(null == httpResult){ // sendSms(); // System.err.println("请求接口出错!"); // return; // } // } catch (Exception e) { // sendSms(); // e.printStackTrace(); // } // } /** MinistryOfTransport/src/main/java/com/sinata/ministryoftransport/util/httpClinet/HttpClientUtil.java
@@ -149,6 +149,7 @@ httpResponse = setPostHttpRequset(url, params, header, contentType); break; } System.err.println("HTTP请求响应体"+httpResponse); int statusCode = httpResponse.getStatusLine().getStatusCode(); String content = EntityUtils.toString(httpResponse.getEntity(), "UTF-8"); System.err.println(sdf.format(new Date()) + "----(" + randome + ")返回结果:(" + statusCode + ")" + content);