From 0452fc307130274b6ce10f8bff0301a059494a7b Mon Sep 17 00:00:00 2001 From: wangshuai Date: Sun, 28 Jul 2024 12:29:38 +0800 Subject: [PATCH] =?UTF-8?q?1=EF=BC=9B=E8=8E=B7=E5=8F=96=E5=BA=97=E9=93=BA?= =?UTF-8?q?=E5=90=8D=E6=8E=A5=E5=8F=A3=20=E8=A7=A3=E6=9E=90=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/MeituanServiceImpl.java | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/business/service/impl/MeituanServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/business/service/impl/MeituanServiceImpl.java index f2a2bfe..402b2d4 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/business/service/impl/MeituanServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/business/service/impl/MeituanServiceImpl.java @@ -603,19 +603,19 @@ public class MeituanServiceImpl implements IMeituanService { String result = null; try { result = EntityUtils.toString(client.execute(request).getEntity()); + if (result != null){ + JSONObject jsonObject = JSONObject.parseObject(result); + String code = jsonObject.getString(("code")); + if ("0".equals(code)) { + JSONObject data = jsonObject.getJSONObject("data"); + JSONObject wmPoiData = data.getJSONObject("wmPoiData"); + String wmPoiName = wmPoiData.getString("wmPoiName"); + return wmPoiName; + } + } } catch (Exception e) { System.out.println(e.getMessage()); } - if (result != null){ - JSONObject jsonObject = JSONObject.parseObject(result); - String code = jsonObject.getString(("code")); - if ("0".equals(code)) { - JSONObject data = jsonObject.getJSONObject("data"); - JSONObject wmPoiData = data.getJSONObject("wmPoiData"); - String wmPoiName = wmPoiData.getString("wmPoiName"); - return wmPoiName; - } - } return null; } @@ -637,18 +637,18 @@ public class MeituanServiceImpl implements IMeituanService { String result = null; try { result = EntityUtils.toString(client.execute(request).getEntity()); + if (result != null){ + JSONObject jsonObject = JSONObject.parseObject(result); + String code = jsonObject.getString(("code")); + if ("0".equals(code)) { + JSONObject data = jsonObject.getJSONObject("data"); + String wmPoiName = data.getString("wmPoiName"); + return wmPoiName; + } + } } catch (Exception e) { System.out.println(e.getMessage()); } - if (result != null){ - JSONObject jsonObject = JSONObject.parseObject(result); - String code = jsonObject.getString(("code")); - if ("0".equals(code)) { - JSONObject data = jsonObject.getJSONObject("data"); - String wmPoiName = data.getString("wmPoiName"); - return wmPoiName; - } - } return null; } /**