|
|
@@ -25,6 +25,7 @@ import java.io.UnsupportedEncodingException; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
/** |
|
|
|
* @program: DipperAstPosAsyncTaskServiceImpl |
|
|
@@ -78,7 +79,7 @@ public class DipperAstPosAsyncTaskServiceImpl implements IDipperAstPosAsyncTaskS |
|
|
|
log.debug("IP省份获取错误,结果为FAIL"); |
|
|
|
return null; |
|
|
|
} |
|
|
|
log.debug("IP省份获取错误,结果为:" + result); |
|
|
|
//log.debug("IP省份获取错误,结果为:" + result); |
|
|
|
JSONObject provinceJson = JSONObject.parseObject(result); |
|
|
|
String province = (String)provinceJson.get("province"); |
|
|
|
if (ObjectUtils.isEmpty(province)) { |
|
|
@@ -99,16 +100,17 @@ public class DipperAstPosAsyncTaskServiceImpl implements IDipperAstPosAsyncTaskS |
|
|
|
|
|
|
|
// 将IP对应的省会保存到mongoDB |
|
|
|
public void createIPProvince(String ipAddress, String province) { |
|
|
|
log.debug("异步创建推送失败任务记录!"); |
|
|
|
log.debug("创建IP省份记录!"); |
|
|
|
try { |
|
|
|
IpProvinceEntity ipProvinceEntity = ipProvinceService.getIpProvince(ipAddress); |
|
|
|
if (ipProvinceEntity == null) { |
|
|
|
ipProvinceEntity = new IpProvinceEntity(); |
|
|
|
ipProvinceEntity.setIp(ipAddress); |
|
|
|
ipProvinceEntity.setProvince(province); |
|
|
|
ipProvinceService.saveIpProvince(ipProvinceEntity); |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("创建推送失败记录异常:", e); |
|
|
|
log.error("创建IP省份记录异常:", e); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|