fix findAccountByPhone查到多条记录

master
luoyang 5 years ago
parent 6006720ada
commit 3e9d5827f4

@ -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.69</version> <version>1.2.70</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>

@ -2195,7 +2195,7 @@ public class RetailAppServiceImp implements RetailAppService {
if (!StringUtils.equals(captcha, params.getString("captcha"))) { if (!StringUtils.equals(captcha, params.getString("captcha"))) {
throw new BadRequestException("Verification code is wrong"); throw new BadRequestException("Verification code is wrong");
} }
JSONObject account = clientAccountMapper.findByPhone(contactPhone, "+" + nationCode); List<JSONObject> account = clientAccountMapper.findByPhone(contactPhone, "+" + nationCode);
if (account != null) { if (account != null) {
throw new BadRequestException("Mobile phone number has been bound to other users, please unbind it before binding"); throw new BadRequestException("Mobile phone number has been bound to other users, please unbind it before binding");
} }

@ -280,7 +280,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
if (!nation_code.startsWith("+")) { if (!nation_code.startsWith("+")) {
nation_code = "+" + nation_code; nation_code = "+" + nation_code;
} }
JSONObject account = clientAccountMapper.findByPhone(contact_phone, nation_code); List<JSONObject> account = clientAccountMapper.findByPhone(contact_phone, nation_code);
if (account != null) { if (account != null) {
throw new ForbiddenException("用户名已被注册"); throw new ForbiddenException("用户名已被注册");
} }
@ -598,7 +598,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
} }
JSONObject apply = sysClientPreMapperMapper.findByUserName(username); JSONObject apply = sysClientPreMapperMapper.findByUserName(username);
JSONObject account = clientAccountMapper.findByPhone(apply.getString("contact_phone"), "+61"); List<JSONObject> account = clientAccountMapper.findByPhone(apply.getString("contact_phone"), "+61");
if (account != null) { if (account != null) {
throw new ForbiddenException("The user name has been registered"); throw new ForbiddenException("The user name has been registered");
} }

@ -28,7 +28,7 @@ public interface ClientAccountMapper {
@AutoSql(type = SqlType.SELECT) @AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid=1") @AdvanceSelect(addonWhereClause = "is_valid=1")
JSONObject findByPhone(@Param("contact_phone") String contact_phone,@Param("nation_code")String nation_code); List<JSONObject> findByPhone(@Param("contact_phone") String contact_phone,@Param("nation_code")String nation_code);
@AutoSql(type = SqlType.SELECT) @AutoSql(type = SqlType.SELECT)
JSONObject findDetail(@Param("account_id") String accountId); JSONObject findDetail(@Param("account_id") String accountId);

@ -1582,7 +1582,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (clientAccountMapper.findByPhone(account.getContactPhone(), "+" + account.getNation_code()) != null) { if (clientAccountMapper.findByPhone(account.getContactPhone(), "+" + 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");
} }
;
} }
@Override @Override

Loading…
Cancel
Save