Merge remote-tracking branch 'origin/cc_20230520_partner'

This commit is contained in:
zhangchenbiao
2023-07-06 15:57:11 +08:00

View File

@@ -45,14 +45,18 @@ public class HyPhoneLocationServiceImpl implements HyPhoneLocationService {
}
HyPhoneLocationDO hyPhoneLocationDO = hyPhoneLocationDAO.selectByPhoneNumber(phoneNumber);
if (hyPhoneLocationDO==null){
DescribePhoneNumberDTO phoneNumberAttribute = aliyunService.getPhoneNumberAttribute(phoneNumber);
HyPhoneLocationDO hy = new HyPhoneLocationDO();
hy.setPhoneNumber(phoneNumber);
hy.setPhoneAddress(String.format("%s %s", phoneNumberAttribute.getProvince(), phoneNumberAttribute.getCity()));
hyPhoneLocationDAO.insertSelective(hy);
//redis一周时间
redisUtilPool.setString(redisConstantUtil.getPhoneNumber(phoneNumber),JSONObject.toJSONString(phoneNumberAttribute),7*24*60*60);
return hy.getPhoneAddress();
try {
DescribePhoneNumberDTO phoneNumberAttribute = aliyunService.getPhoneNumberAttribute(phoneNumber);
HyPhoneLocationDO hy = new HyPhoneLocationDO();
hy.setPhoneNumber(phoneNumber);
hy.setPhoneAddress(String.format("%s %s", phoneNumberAttribute.getProvince(), phoneNumberAttribute.getCity()));
hyPhoneLocationDAO.insertSelective(hy);
//redis一周时间
redisUtilPool.setString(redisConstantUtil.getPhoneNumber(phoneNumber),JSONObject.toJSONString(phoneNumberAttribute),7*24*60*60);
return hy.getPhoneAddress();
}catch (Exception e){
return "未知";
}
}
return hyPhoneLocationDO.getPhoneAddress();
}