fix findAccountByPhone

master
luoyang 5 years ago
parent 3e9d5827f4
commit 059c9f8917

@ -9,7 +9,7 @@
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId> <artifactId>manage</artifactId>
<version>1.2.70</version> <version>1.2.71</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>1.6.1</jib-maven-plugin.version> <jib-maven-plugin.version>1.6.1</jib-maven-plugin.version>

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

Loading…
Cancel
Save