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; } /**