|
@@ -67,14 +67,19 @@ public class DipperAstPosAsyncTaskServiceImpl implements IDipperAstPosAsyncTaskS |
|
|
dataMap.put("ip", ipAddress); |
|
|
dataMap.put("ip", ipAddress); |
|
|
dataMap.put("key", ipPositionRequestKey); |
|
|
dataMap.put("key", ipPositionRequestKey); |
|
|
StringBuffer buffer = okHttpUtil.getQueryString(ipPositionRequestPath, dataMap); |
|
|
StringBuffer buffer = okHttpUtil.getQueryString(ipPositionRequestPath, dataMap); |
|
|
if (ObjectUtils.isNotEmpty(buffer)) { |
|
|
|
|
|
String provinceBuffer = buffer.toString(); |
|
|
|
|
|
if (StringUtils.isEmpty(provinceBuffer)) { |
|
|
|
|
|
|
|
|
JSONObject paramObject = new JSONObject(); |
|
|
|
|
|
String result = okHttpUtil.postJsonParams(buffer.toString(), paramObject.toJSONString()); |
|
|
|
|
|
if (ObjectUtils.isNotEmpty(result)) { |
|
|
|
|
|
if (StringUtils.isEmpty(result)) { |
|
|
log.debug("IP省份获取错误,结果为空"); |
|
|
log.debug("IP省份获取错误,结果为空"); |
|
|
return null; |
|
|
return null; |
|
|
} else { |
|
|
} else { |
|
|
log.debug("IP省份获取错误,结果为:" + provinceBuffer); |
|
|
|
|
|
JSONObject provinceJson = JSONObject.parseObject(provinceBuffer); |
|
|
|
|
|
|
|
|
if (result.equals("FAIL")) { |
|
|
|
|
|
log.debug("IP省份获取错误,结果为FAIL"); |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
log.debug("IP省份获取错误,结果为:" + result); |
|
|
|
|
|
JSONObject provinceJson = JSONObject.parseObject(result); |
|
|
String province = (String)provinceJson.get("province"); |
|
|
String province = (String)provinceJson.get("province"); |
|
|
if (ObjectUtils.isEmpty(province)) { |
|
|
if (ObjectUtils.isEmpty(province)) { |
|
|
log.debug("json is :" + buffer.toString()); |
|
|
log.debug("json is :" + buffer.toString()); |
|
|