## 乐学实名认证校验调整;

This commit is contained in:
cabbage 2025-08-09 11:15:13 +08:00
parent d6f3320030
commit e6670f112e
2 changed files with 43 additions and 56 deletions

View File

@ -51,6 +51,32 @@ public class ApiCuMemberAuthenticationController extends BaseController {
@DubboReference @DubboReference
IdCardServiceApi idCardServiceApi; IdCardServiceApi idCardServiceApi;
/**
* 是否需要实名认证
*
* @param businessModule 1:提现 2:转账 (来源枚举EBusinessModule)
* @return AjaxResult
*/
@GetMapping("/is-auth")
public AjaxResult isAuth(Integer businessModule) {
String flag = EYesNo.YES.getValue();
Long pkMember = SecurityUtils.getUserId();
Integer pkCountry = SecurityUtils.getPkCountry();
//查询配置实名认证白名证
BdTradeWhiteConfig bdTradeWhiteConfig = iCuMemberBaseService.selectConfigWhite(pkMember, pkCountry, businessModule);
if (null == bdTradeWhiteConfig) {
//查询配置是否实名认证
BdTradeConfig bdTradeConfig = iCuMemberBaseService.selectConfigTrade(pkMember, pkCountry, businessModule, EVerificationModule.REAL_NAME);
//配置后才进行验证
if (null != bdTradeConfig) {
//查询是否已实名认证
CuMemberAuthenticationVO authenticationVO = iCuMemberAuthenticationService.selectCuMemberAuthenticationByPkMember(CuMemberAuthenticationVO.builder().pkMember(pkMember).pkCountry(pkCountry).build());
flag = null == authenticationVO ? EYesNo.NO.getValue() : EYesNo.YES.getValue();
}
}
return AjaxResult.success().put("flag", flag);
}
/** /**
* 调用身份证OCR接口 * 调用身份证OCR接口
* *
@ -116,12 +142,7 @@ public class ApiCuMemberAuthenticationController extends BaseController {
Long pkMember = SecurityUtils.getUserId(); Long pkMember = SecurityUtils.getUserId();
Integer pkCountry = SecurityUtils.getPkCountry(); Integer pkCountry = SecurityUtils.getPkCountry();
//查询是否已实名 // 验证码是否为空
CuMemberAuthenticationVO queryAuthenticationVO = iCuMemberAuthenticationService.selectCuMemberAuthenticationByPkMember(CuMemberAuthenticationVO.builder().pkMember(pkMember).pkCountry(pkCountry).build());
if (null != queryAuthenticationVO) {
return AjaxResult.error(FinanceMsgConstants.MEMBER_REAL_NAME);
}
String verificationCode = authenticationVO.getVerificationCode(); String verificationCode = authenticationVO.getVerificationCode();
if (StringUtils.isEmpty(verificationCode)) { if (StringUtils.isEmpty(verificationCode)) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.VERIFICATION_CODE_CANNOT_EMPTY)); return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.VERIFICATION_CODE_CANNOT_EMPTY));
@ -131,32 +152,25 @@ public class ApiCuMemberAuthenticationController extends BaseController {
if (StringUtils.isEmpty(accountName)) { if (StringUtils.isEmpty(accountName)) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.REAL_NAME_CANNOT_EMPTY)); return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.REAL_NAME_CANNOT_EMPTY));
} }
//真实姓名与注册的会员姓名不一致
CuMember member = iCuMemberService.getMember(pkMember);
if (!member.getMemberName().equals(accountName)) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.REAL_NAME_MEMBER_NOT_DIFFERENT));
}
//支行名称
String subBankName = authenticationVO.getSubBankName();
if (StringUtils.isEmpty(subBankName)) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.OPENING_BRANCH_CANNOT_EMPTY));
}
if (null == authenticationVO.getPkProvince()) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.PROVINCE_CANNOT_EMPTY));
}
if (null == authenticationVO.getPkCity()) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.CITY_CANNOT_EMPTY));
}
if (StringUtils.isEmpty(authenticationVO.getAddress())) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.ADDRESS_CANNOT_EMPTY));
}
if (StringUtils.isEmpty(authenticationVO.getIdFront())) { if (StringUtils.isEmpty(authenticationVO.getIdFront())) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.ID_FRONT_CANNOT_EMPTY)); return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.ID_FRONT_CANNOT_EMPTY));
} }
if (StringUtils.isEmpty(authenticationVO.getIdBack())) { if (StringUtils.isEmpty(authenticationVO.getIdBack())) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.ID_BACK_CANNOT_EMPTY)); return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.ID_BACK_CANNOT_EMPTY));
} }
if (StringUtils.isEmpty(authenticationVO.getAddress())) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.ADDRESS_CANNOT_EMPTY));
}
// 查询是否已实名
CuMemberAuthenticationVO queryAuthenticationVO = iCuMemberAuthenticationService.selectCuMemberAuthenticationByPkMember(CuMemberAuthenticationVO.builder().pkMember(pkMember).pkCountry(pkCountry).build());
if (null != queryAuthenticationVO) {
return AjaxResult.error(FinanceMsgConstants.MEMBER_REAL_NAME);
}
// 真实姓名与注册的会员姓名不一致
CuMember member = iCuMemberService.getMember(pkMember);
if (!member.getMemberName().equals(accountName)) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.REAL_NAME_MEMBER_NOT_DIFFERENT));
}
String message = iApiAliSmsService.checkCode(null, verificationCode, null, pkMember); String message = iApiAliSmsService.checkCode(null, verificationCode, null, pkMember);
if (null != message) { if (null != message) {
@ -171,33 +185,6 @@ public class ApiCuMemberAuthenticationController extends BaseController {
} }
/**
* 是否需要实名认证
*
* @param businessModule 1:提现 2:转账 (来源枚举EBusinessModule)
* @return AjaxResult
*/
@GetMapping("/is-auth")
public AjaxResult isAuth(Integer businessModule) {
String flag = EYesNo.YES.getValue();
Long pkMember = SecurityUtils.getUserId();
Integer pkCountry = SecurityUtils.getPkCountry();
//查询配置实名认证白名证
BdTradeWhiteConfig bdTradeWhiteConfig = iCuMemberBaseService.selectConfigWhite(pkMember, pkCountry, businessModule);
if (null == bdTradeWhiteConfig) {
//查询配置是否实名认证
BdTradeConfig bdTradeConfig = iCuMemberBaseService.selectConfigTrade(pkMember, pkCountry, businessModule, EVerificationModule.REAL_NAME);
//配置后才进行验证
if (null != bdTradeConfig) {
//查询是否已实名认证
CuMemberAuthenticationVO authenticationVO = iCuMemberAuthenticationService.selectCuMemberAuthenticationByPkMember(CuMemberAuthenticationVO.builder().pkMember(pkMember).pkCountry(pkCountry).build());
flag = null == authenticationVO ? EYesNo.NO.getValue() : EYesNo.YES.getValue();
}
}
return AjaxResult.success().put("flag", flag);
}
/** /**
* 查看详情 * 查看详情
* *

View File

@ -50,7 +50,7 @@ public class CuMemberAuthenticationServiceImpl extends ServiceImpl<CuMemberAuthe
} }
/** /**
* |更新用户表中的实名状态 * 更新用户表中的实名状态
* *
* @param authenticationVO 入参 * @param authenticationVO 入参
* @return Boolean * @return Boolean
@ -60,7 +60,7 @@ public class CuMemberAuthenticationServiceImpl extends ServiceImpl<CuMemberAuthe
LambdaUpdateWrapper<CuMember> updateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<CuMember> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(CuMember::getIsRealName, EYesNo.YES.getIntValue()); updateWrapper.set(CuMember::getIsRealName, EYesNo.YES.getIntValue());
updateWrapper.set(CuMember::getIdCard, authenticationVO.getIdCard()); updateWrapper.set(CuMember::getIdCard, authenticationVO.getIdCard());
updateWrapper.set(CuMember::getServiceAgreement, EServiceStatus.UNSIGNED.getValue()); updateWrapper.set(CuMember::getBirthDate, authenticationVO.getBirthDate());
updateWrapper.set(CuMember::getModifiedTime, new Date()); updateWrapper.set(CuMember::getModifiedTime, new Date());
updateWrapper.set(CuMember::getPkModified, pkMember); updateWrapper.set(CuMember::getPkModified, pkMember);
updateWrapper.eq(CuMember::getPkId, pkMember); updateWrapper.eq(CuMember::getPkId, pkMember);