手机号

This commit is contained in:
苏竹红
2023-06-20 15:43:56 +08:00
parent 5731e874f1
commit 80336c5ce0
6 changed files with 31 additions and 6 deletions

View File

@@ -220,4 +220,6 @@ public class RedisConstant {
public static final String DEVICE_OPEN_TOKEN = "device_open_token:{0}:{1}:{2}";
public static final String PHONE_NUMBER= "phone_number_";
}

View File

@@ -90,4 +90,9 @@ public class RedisConstantUtil {
public String getRegionNameListKey(String eid, String regionId) {
return active + "_" + RedisConstant.REGION_ALL_NAME_CACHE + eid + ":" + regionId;
}
public String getPhoneNumber(String phoneNumber) {
return active + "_" + RedisConstant.PHONE_NUMBER + phoneNumber;
}
}

View File

@@ -401,6 +401,7 @@
<select id="getPublicSeaLineList" resultType="com.cool.store.dto.partner.PublicSeaLineDTO">
select
a.id as lineId,
a.create_time as createTime,
b.partner_id as partner_id,
b.mobile as mobile,
@@ -408,7 +409,7 @@
b.want_shop_area as wantShopArea,
b.accept_adjust_type as acceptAdjustType
FROM hy_partner_line_info a inner JOIN hy_partner_user_info b on a.partner_id = b.partner_id
where a.line_status = 1
where a.line_status = 0
<if test="userNameKeyword!=null and userNameKeyword!=''">
and b.username like concat('%',#{userNameKeyword},'%')
</if>
@@ -519,7 +520,7 @@
</select>
<select id="getFollowCountList" resultType="com.cool.store.dto.partner.LineCountDTO">
SELECT partner_id, COUNT(1) AS num_of_leads
SELECT partner_id, IFNULL(COUNT(1), 0) AS followCount
FROM hy_partner_line_info
GROUP BY partner_id;
</select>

View File

@@ -19,7 +19,7 @@ public class BlackListVO {
private Long id;
@ApiModelProperty("加盟商用户ID")
private String partnerUserId;
private String partnerId;
@ApiModelProperty("加盟商用户名称")
private String partnerUserName;

View File

@@ -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);

View File

@@ -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());