...
|
...
|
@@ -18,10 +18,7 @@ import com.yoho.unions.common.enums.ShareOrdersStatusEnum; |
|
|
import com.yoho.unions.common.redis.RedisHashCache;
|
|
|
import com.yoho.unions.common.redis.RedisValueCache;
|
|
|
import com.yoho.unions.common.service.IBusinessExportService;
|
|
|
import com.yoho.unions.common.utils.BankUtils;
|
|
|
import com.yoho.unions.common.utils.DateUtil;
|
|
|
import com.yoho.unions.common.utils.IDCardUtil;
|
|
|
import com.yoho.unions.common.utils.RandomUtil;
|
|
|
import com.yoho.unions.common.utils.*;
|
|
|
import com.yoho.unions.convert.BeanConvert;
|
|
|
import com.yoho.unions.convert.Convert;
|
|
|
import com.yoho.unions.dal.*;
|
...
|
...
|
@@ -306,11 +303,19 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
*/
|
|
|
@Override
|
|
|
public int bindBankCard(UnionShareUserBankBo bo){
|
|
|
logger.info("bindBankCard,uid is {}",bo);
|
|
|
logger.info("bindBankCard,bo is {}",bo);
|
|
|
if (null == bo||bo.getUid()<0) {
|
|
|
return 0;
|
|
|
}
|
|
|
//信息格式校验
|
|
|
checkAndBuildBankCard(bo);
|
|
|
//查询该用户是否为特邀用户
|
|
|
int count = unionShareUserMapper.selectCountByUid(bo.getUid());
|
|
|
if (count == 0) {
|
|
|
//不是特邀用户
|
|
|
logger.info("bindBankCard end,can not find unionType,bo is {}",bo);
|
|
|
throw new ServiceException(ServiceError.USER_ID_ERROR);
|
|
|
}
|
|
|
UnionShareUserBank insertReq = new UnionShareUserBank();
|
|
|
BeanUtils.copyProperties(bo, insertReq);
|
|
|
insertReq.setStatus((byte)1);
|
...
|
...
|
@@ -345,8 +350,8 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
return null;
|
|
|
}
|
|
|
UnionShareUserBankBo result = new UnionShareUserBankBo();
|
|
|
result.setName(list.get(0).getName());
|
|
|
result.setBankCardNo(list.get(0).getBankCardNo());
|
|
|
result.setName(StringHideUtils.hideString(list.get(0).getName(),1,1));
|
|
|
result.setBankCardNo(StringHideUtils.hideSubString(list.get(0).getBankCardNo(),11));
|
|
|
result.setBankName(list.get(0).getBankName());
|
|
|
result.setIdCardNo(list.get(0).getIdCardNo());
|
|
|
addToRedis(ShareOrdersKeyEnum.USER_SETTLEMENT,uid,result,USER_SETTLEMENT_BANKCARD);
|
...
|
...
|
@@ -354,7 +359,13 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
return result;
|
|
|
}
|
|
|
|
|
|
private void checkAndBuildBankCard(UnionShareUserBankBo bo) {
|
|
|
@Override
|
|
|
public int checkAndBuildBankCard(UnionShareUserBankBo bo) {
|
|
|
// 校验姓名
|
|
|
if (!ChineseNameUtils.checkName(bo.getName())) {
|
|
|
throw new ServiceException(ServiceError.UNION_CHINESE_NAME_ERROR);
|
|
|
}
|
|
|
|
|
|
// 校验是否已绑定银行卡
|
|
|
if (hasBankCard(bo.getUid())) {
|
|
|
throw new ServiceException(ServiceError.UNION_HAS_AVAILABLE_CARD);
|
...
|
...
|
@@ -372,6 +383,7 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
if (null == bo.getBankName()) {
|
|
|
throw new ServiceException(ServiceError.UNION_BANK_CODE_ERROR);
|
|
|
}
|
|
|
return 200;
|
|
|
}
|
|
|
|
|
|
private boolean checkIdCard(String idcard) {
|
...
|
...
|
|