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

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

View File

@ -51,6 +51,32 @@ public class ApiCuMemberAuthenticationController extends BaseController {
@DubboReference
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接口
*
@ -116,47 +142,35 @@ public class ApiCuMemberAuthenticationController extends BaseController {
Long pkMember = SecurityUtils.getUserId();
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();
if (StringUtils.isEmpty(verificationCode)) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.VERIFICATION_CODE_CANNOT_EMPTY));
}
//真实姓名
// 真实姓名
String accountName = authenticationVO.getAccountName();
if (StringUtils.isEmpty(accountName)) {
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())) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.ID_FRONT_CANNOT_EMPTY));
}
if (StringUtils.isEmpty(authenticationVO.getIdBack())) {
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);
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 入参
* @return Boolean
@ -60,7 +60,7 @@ public class CuMemberAuthenticationServiceImpl extends ServiceImpl<CuMemberAuthe
LambdaUpdateWrapper<CuMember> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(CuMember::getIsRealName, EYesNo.YES.getIntValue());
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::getPkModified, pkMember);
updateWrapper.eq(CuMember::getPkId, pkMember);