|
|
|
@ -1557,7 +1557,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
checkOrgPermission(manager, client);
|
|
|
|
|
checkPhoneAndWechatExist(account);
|
|
|
|
|
if (StringUtils.isNotBlank(account.getContactPhone())) {
|
|
|
|
|
checkPhoneAndWechatExist(account);
|
|
|
|
|
}
|
|
|
|
|
JSONObject accountJson = account.toJson();
|
|
|
|
|
JSONObject accountCheck = clientAccountMapper.findByUsernameForDuplicate(accountJson.getString("username"));
|
|
|
|
|
if (accountCheck != null) {
|
|
|
|
@ -1579,7 +1581,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void checkPhoneAndWechatExist(NewAccountBean account) {
|
|
|
|
|
if (clientAccountMapper.findByPhone(account.getContactPhone(), "+" + account.getNation_code()) != null) {
|
|
|
|
|
if (clientAccountMapper.findByPhone(account.getContactPhone(), account.getNation_code().startsWith("+")?account.getNation_code():"+"+account.getNation_code()) != null) {
|
|
|
|
|
throw new BadRequestException("Mobile phone number has been bound to other accounts");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|