|
|
@@ -40,27 +40,31 @@ public class RegisterNoCodeManager extends AbstractLoginManager implements LogMa |
|
|
|
if (accountInfo != null) |
|
|
|
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("该账号名:\"" + request.getMobile() + "\",已经被注册过了!"); |
|
|
|
if (hasText(request.getIdNum()) && request.getIdType() != null) { |
|
|
|
//20250905修改,若身份证已绑定,做更新操作 |
|
|
|
accountInfo = accountInfoRepo.findByIdNumAndIdType(request.getIdNum(), request.getIdType()); |
|
|
|
if (accountInfo != null) |
|
|
|
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("证件号已绑定"+accountInfo.getMobile()); |
|
|
|
// if (accountInfo != null) |
|
|
|
// throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("证件号已绑定"+accountInfo.getMobile()); |
|
|
|
} |
|
|
|
accountInfo = from(request); |
|
|
|
accountInfoRepo.persist(accountInfo); |
|
|
|
accountInfo = from(request,accountInfo); |
|
|
|
accountInfoRepo.save(accountInfo); |
|
|
|
return onSuccess(request, new RegisterNoCodeResponse(), IasInterfaceLog.class, System.currentTimeMillis() - begin); |
|
|
|
} catch (Exception e) { |
|
|
|
throw exception(request, IasInterfaceLog.class, e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private AccountInfo from(RegisterNoCodeRequest request) { |
|
|
|
AccountInfo accountInfo = new AccountInfo(); |
|
|
|
private AccountInfo from(RegisterNoCodeRequest request,AccountInfo accountInfo) { |
|
|
|
if (accountInfo == null){ |
|
|
|
accountInfo = new AccountInfo(); |
|
|
|
accountInfo.setCreateTime(LocalDateTime.now()); |
|
|
|
accountInfo.setLoginPass(hasText(request.getLoginPass()) ? request.getLoginPass() : createPassword(10)); |
|
|
|
accountInfo.setNeedChangePasswordNow("0"); // 该用户主动修改密码后,设置其登录后不用提示去自行修改密码 |
|
|
|
} |
|
|
|
// AccountInfo accountInfo = new AccountInfo(); |
|
|
|
accountInfo.setAppId(appId); |
|
|
|
accountInfo.setLoginPass(hasText(request.getLoginPass()) ? request.getLoginPass() : createPassword(10)); |
|
|
|
accountInfo.setMobile(request.getMobile()); |
|
|
|
accountInfo.setAccount(request.getMobile()); |
|
|
|
accountInfo.setNickName(request.getNickName()); |
|
|
|
accountInfo.setCreateTime(LocalDateTime.now()); |
|
|
|
accountInfo.setNeedChangePasswordNow("0"); // 该用户主动修改密码后,设置其登录后不用提示去自行修改密码 |
|
|
|
String openId = UUID.randomUUID().toString().replaceAll("-", ""); |
|
|
|
accountInfo.setOpenId(openId); |
|
|
|
accountInfo.setIdType(request.getIdType()); |