diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/util/GaoDeUtils.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/util/GaoDeUtils.groovy index 9a3bc83d4..4d7cee9f2 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/util/GaoDeUtils.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/util/GaoDeUtils.groovy @@ -3,6 +3,7 @@ package com.fangjia.script.temp.shenjian.util import com.alibaba.fastjson.JSONArray import com.alibaba.fastjson.JSONObject import com.fangjia.core.util.DataUtil +import com.fangjia.core.util.HttpRequest import com.fangjia.script.statistics.poi.AmapPoi import com.fangjia.script.util.GeoHelper import com.fangjia.script.util.HttpRequestUtil @@ -175,7 +176,17 @@ class GaoDeUtils { * 获取地址经纬度 */ static def parserByGaode(def city, def address) { - JSONObject json = GaoDeApiUtils.geo(city, address) + Map params = new HashMap() + params.put("key", GAO_DE_AK[keyUsed.intValue()]) + params.put("city", city) + params.put("address", address) + String content + try { + content = new HttpRequest().get("https://restapi.amap.com/v3/geocode/geo", params, "utf-8") + } catch (Exception e) { + content = new HttpRequest().get("https://restapi.amap.com/v3/geocode/geo", params, "utf-8") + } + net.sf.json.JSONObject json = net.sf.json.JSONObject.fromObject(content) if (json && json.info && json.info == "OK") { def ret = json.geocodes if (ret) {