手机号
This commit is contained in:
@@ -13,11 +13,14 @@ import com.cool.store.enums.IDCardSideEnum;
|
||||
import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.service.AliyunService;
|
||||
import com.cool.store.utils.RedisConstantUtil;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.cool.store.vo.cuser.IdentityCardInfoVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.MalformedURLException;
|
||||
@@ -37,9 +40,18 @@ import java.util.Optional;
|
||||
@Service
|
||||
public class AliyunServiceImpl implements AliyunService {
|
||||
|
||||
@Resource
|
||||
RedisUtilPool redisUtilPool;
|
||||
@Resource
|
||||
RedisConstantUtil redisConstantUtil;
|
||||
|
||||
@Override
|
||||
public DescribePhoneNumberDTO getPhoneNumberAttribute(String phoneNumber) {
|
||||
try {
|
||||
String phone = redisUtilPool.getString(redisConstantUtil.getPhoneNumber(phoneNumber));
|
||||
if (StringUtils.isNotEmpty(phone)){
|
||||
return JSONObject.parseObject(phone, DescribePhoneNumberDTO.class);
|
||||
}
|
||||
Config config = new Config();
|
||||
//todo zcb ak sk替换
|
||||
config.accessKeyId = "LTAI5t9RaXvABZbHvoXjDFJ1";
|
||||
@@ -55,6 +67,8 @@ public class AliyunServiceImpl implements AliyunService {
|
||||
log.error("错误信息:" , response.body.message + "");
|
||||
throw new ServiceException(ErrorCodeEnum.GET_PHONENUMBER_INFO_ERROR);
|
||||
}
|
||||
//保存到redis
|
||||
redisUtilPool.setString(redisConstantUtil.getPhoneNumber(phoneNumber),JSONObject.toJSONString(response.body.data));
|
||||
return JSONObject.parseObject(JSONObject.toJSONString(response.body.data), DescribePhoneNumberDTO.class);
|
||||
} catch (Exception e) {
|
||||
log.error("获取手机号异常:", e);
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.request.CloseFollowRequest;
|
||||
import com.cool.store.request.LineRequest;
|
||||
import com.cool.store.request.PrivateSeaLineListRequest;
|
||||
import com.cool.store.service.AliyunService;
|
||||
import com.cool.store.service.EnterpriseUserService;
|
||||
import com.cool.store.service.HyPartnerLineInfoService;
|
||||
import com.cool.store.utils.CoolDateUtils;
|
||||
@@ -58,6 +59,8 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
HyOpenAreaInfoDAO hyOpenAreaInfoDAO;
|
||||
@Resource
|
||||
EnterpriseUserService enterpriseUserService;
|
||||
@Resource
|
||||
AliyunService aliyunService;
|
||||
|
||||
@Override
|
||||
public StageCountVO selectStagePendingCount(String userId) {
|
||||
@@ -286,8 +289,8 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
publicSeaLineListVo.setCreateTime(x.getCreateTime());
|
||||
publicSeaLineListVo.setPartnerUserName(x.getUserName());
|
||||
publicSeaLineListVo.setPartnerUserPhone(x.getMobile());
|
||||
// TODO: 2023/6/15 手机号归属地
|
||||
publicSeaLineListVo.setPhoneAddress("");
|
||||
DescribePhoneNumberDTO phoneNumberAttribute = aliyunService.getPhoneNumberAttribute(x.getMobile());
|
||||
publicSeaLineListVo.setPhoneAddress(phoneNumberAttribute.getCity());
|
||||
publicSeaLineListVo.setWantShopArea(x.getWantShopArea());
|
||||
publicSeaLineListVo.setId(x.getLineId());
|
||||
publicSeaLineListVo.setAcceptAdjustType(x.getAcceptAdjustType());
|
||||
@@ -445,7 +448,7 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
public BlackListVO convertPartnerBlackListDTOToVo(PartnerBlackListDTO partnerBlackListDTO){
|
||||
BlackListVO blackListVO = new BlackListVO();
|
||||
blackListVO.setId(partnerBlackListDTO.getLineId());
|
||||
blackListVO.setPartnerUserId(partnerBlackListDTO.getPartnerId());
|
||||
blackListVO.setPartnerId(partnerBlackListDTO.getPartnerId());
|
||||
blackListVO.setPartnerUserName(partnerBlackListDTO.getPartnerUserName());
|
||||
blackListVO.setPartnerUserPhone(partnerBlackListDTO.getMobile());
|
||||
blackListVO.setCreateTime(partnerBlackListDTO.getCreateTime());
|
||||
|
||||
Reference in New Issue
Block a user