Authored by qinchao

完善绑卡查询逻辑

... ... @@ -16,7 +16,7 @@ public class UserAuthorizeInfo {
private Integer validStatus;
//支付宝账号、姓名
private String alipayMaskAccount;
//private String alipayMaskAccount;
private String alipayAccount;
private String certName;
... ...
... ... @@ -4,6 +4,7 @@ package com.yohoufo.user.controller.passport;
import com.yoho.tools.common.beans.ApiResponse;
import com.yohoufo.common.exception.GatewayException;
import com.yohoufo.dal.user.model.UserAuthorizeInfo;
import com.yohoufo.user.helper.HideDataUtil;
import com.yohoufo.user.requestVO.RealNameAuthorizeReqVO;
import com.yohoufo.user.responseVO.AuthorizeResultRespVO;
import com.yohoufo.user.service.IRealNameAuthorizeService;
... ... @@ -44,9 +45,24 @@ public class RealNameAuthorizeController {
if(null!=info){
result.setAuthorizeFlag(true);
result.setAlipayAccount(info.getAlipayAccount());
result.setAlipayMaskAccount(info.getAlipayMaskAccount());
//result.setAlipayMaskAccount(info.getAlipayMaskAccount());
result.setCertName(info.getCertName());
result.setCreateTime(info.getCreateTime());
//把账号部分信息隐藏
if(HideDataUtil.isEmail(info.getAlipayAccount())){
result.setAlipayMaskAccount(HideDataUtil.hideEmail(info.getAlipayAccount()));
}else if(HideDataUtil.isPhone(info.getAlipayAccount())){
result.setAlipayMaskAccount(HideDataUtil.hidePhoneNo(info.getAlipayAccount()));
}else if(info.getAlipayAccount().length()>2){
//即不是手机,又不是邮箱,只显示首末位
result.setAlipayMaskAccount(info.getAlipayAccount().substring(0,1)
+"****"
+info.getAlipayAccount().substring(info.getAlipayAccount().length()-1));
}else{
result.setAlipayMaskAccount(info.getAlipayAccount());
}
}else{
result.setAuthorizeFlag(false);
}
... ...
... ... @@ -61,21 +61,6 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService {
authorizeInfo= userAuthorizeInfoDao.selectValidAuthorizeInfoByUid(uid);
logger.info("RealNameAuthorizeServiceImpl getValidAuthorizeInfo uid is {} ,database info is {} ",uid,authorizeInfo);
if(authorizeInfo!=null){
//把账号部分信息隐藏
if(HideDataUtil.isEmail(authorizeInfo.getAlipayAccount())){
authorizeInfo.setAlipayMaskAccount(HideDataUtil.hideEmail(authorizeInfo.getAlipayAccount()));
}else if(HideDataUtil.isPhone(authorizeInfo.getAlipayAccount())){
authorizeInfo.setAlipayMaskAccount(HideDataUtil.hidePhoneNo(authorizeInfo.getAlipayAccount()));
}else if(authorizeInfo.getAlipayAccount().length()>2){
//即不是手机,又不是邮箱,只显示首末位
authorizeInfo.setAlipayMaskAccount(authorizeInfo.getAlipayAccount().substring(0,1)
+"****"
+authorizeInfo.getAlipayAccount().substring(authorizeInfo.getAlipayAccount().length()-1));
}else{
authorizeInfo.setAlipayMaskAccount(authorizeInfo.getAlipayAccount());
}
//保存到redis
cacheService.setUserAuthorizeInfo( authorizeInfo);
}
... ... @@ -102,8 +87,7 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService {
logger.info("real name saveAuthorizeInfo end UserAuthorizeInfo {}", userAuthorizeInfo);
//保存之后放redis
//保存到redis
//此处设置redis有bug, 如果要设置redis,必须把对象的maskAliAccount也设置一下,不如不写redis了 modify by craig.qin 2018-10-12
//cacheService.setUserAuthorizeInfo( userAuthorizeInfo);
cacheService.setUserAuthorizeInfo( userAuthorizeInfo);
}
... ...