|
|
@ -4,6 +4,7 @@ import com.elink.esua.epdc.commons.tools.exception.RenException; |
|
|
import com.elink.esua.epdc.commons.tools.redis.RedisKeys; |
|
|
import com.elink.esua.epdc.commons.tools.redis.RedisKeys; |
|
|
import com.elink.esua.epdc.commons.tools.redis.RedisUtils; |
|
|
import com.elink.esua.epdc.commons.tools.redis.RedisUtils; |
|
|
import com.elink.esua.httpclient.HttpClientUtils; |
|
|
import com.elink.esua.httpclient.HttpClientUtils; |
|
|
|
|
|
import com.elink.esua.httpclient.ResultDto; |
|
|
import org.mybatis.logging.Logger; |
|
|
import org.mybatis.logging.Logger; |
|
|
import org.mybatis.logging.LoggerFactory; |
|
|
import org.mybatis.logging.LoggerFactory; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
@ -64,14 +65,14 @@ public class HttpUtil { |
|
|
paramsMap.put("geometry", urlParams.get("geometry")); |
|
|
paramsMap.put("geometry", urlParams.get("geometry")); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
String data = httpClientUtils.sendPostAndHeader(GET_GIS_COORDINATE_URL, paramsMap, headerMap).getResult(); |
|
|
ResultDto result = httpClientUtils.sendPostAndHeader(GET_GIS_COORDINATE_URL, paramsMap, headerMap); |
|
|
|
|
|
|
|
|
if (null == data) { |
|
|
if (null == result) { |
|
|
throw new RenException("地理坐标获取失败"); |
|
|
throw new RenException("地理坐标获取失败"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// redisUtils.set(key, data, RedisUtils.DEFAULT_EXPIRE);
|
|
|
// redisUtils.set(key, data, RedisUtils.DEFAULT_EXPIRE);
|
|
|
return data; |
|
|
return result.getResult(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
@ -95,14 +96,14 @@ public class HttpUtil { |
|
|
paramsMap.put("outFields", "网格名称,网格编码"); |
|
|
paramsMap.put("outFields", "网格名称,网格编码"); |
|
|
paramsMap.put("f", "pjson"); |
|
|
paramsMap.put("f", "pjson"); |
|
|
|
|
|
|
|
|
String data = httpClientUtils.sendPostAndHeader(GET_COMPANY_URL, paramsMap, headerMap).getResult(); |
|
|
ResultDto result = httpClientUtils.sendPostAndHeader(GET_COMPANY_URL, paramsMap, headerMap); |
|
|
|
|
|
|
|
|
if (null == data) { |
|
|
if (null == result) { |
|
|
throw new RenException("公司信息获取失败"); |
|
|
throw new RenException("公司信息获取失败"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
redisUtils.set(key, data, RedisUtils.DEFAULT_EXPIRE); |
|
|
redisUtils.set(key, result.getResult(), RedisUtils.DEFAULT_EXPIRE); |
|
|
return data; |
|
|
return result.getResult(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|