diff --git a/src/db/modify.sql b/src/db/modify.sql index 7b217acd5..18f1aa781 100644 --- a/src/db/modify.sql +++ b/src/db/modify.sql @@ -533,4 +533,7 @@ CREATE TABLE `sys_client_pre_apply` ( `company_phone` varchar(20) DEFAULT NULL, PRIMARY KEY (`client_pre_apply_id`), UNIQUE KEY `username` (`username`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; \ No newline at end of file +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + + +alter table sys_accounts add COLUMN nation_code VARCHAR(5) DEFAULT NULL ; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/application/core/SimpleClientApplyService.java b/src/main/java/au/com/royalpay/payment/manage/application/core/SimpleClientApplyService.java index 458dce958..e47105ef4 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/core/SimpleClientApplyService.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/core/SimpleClientApplyService.java @@ -29,5 +29,5 @@ public interface SimpleClientApplyService { JSONObject getBankInfo(String bsb_no); - void checkAccountName(String acocunt_name); + void checkAccountName(String contact_phone,String nation_code); } diff --git a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java index cf9978445..becdfdc94 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java @@ -217,8 +217,12 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { } @Override - public void checkAccountName(String account_name) { - JSONObject account = clientAccountMapper.findByUsernameForDuplicate(account_name); + public void checkAccountName(String contact_phone,String nation_code) { + nation_code = nation_code.trim(); + if(!nation_code.startsWith("+")){ + nation_code ="+"+nation_code; + } + JSONObject account = clientAccountMapper.findByPhone(contact_phone,nation_code); if (account != null){ throw new ForbiddenException("用户名已被注册"); } diff --git a/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java b/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java index 7cdecc236..c409e3288 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java @@ -29,9 +29,9 @@ public class SimpleClientApplyController { @Resource private SimpleClientApplyService simpleClientApplyService; - @RequestMapping(value = "/account/{account_name}/check", method = RequestMethod.GET) - public void checkAccountName(@PathVariable String account_name) { - simpleClientApplyService.checkAccountName(account_name); + @RequestMapping(value = "/account/check", method = RequestMethod.GET) + public void checkAccountName(@RequestParam String nation_code,@RequestParam String phone) { + simpleClientApplyService.checkAccountName(phone,nation_code); } @RequestMapping(value = "/account/{codeKey}", method = RequestMethod.POST) diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.java index 24586c341..f3e3428d3 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.java @@ -26,6 +26,10 @@ public interface ClientAccountMapper { @AutoSql(type = SqlType.SELECT) JSONObject findByUsernameForDuplicate(@Param("username") String username); + @AutoSql(type = SqlType.SELECT) + @AdvanceSelect(addonWhereClause = "is_valid=1") + JSONObject findByPhone(@Param("contact_phone") String contact_phone,@Param("nation_code")String nation_code); + @AutoSql(type = SqlType.SELECT) JSONObject findDetail(@Param("account_id") String accountId); diff --git a/src/main/ui/merchant_application.html b/src/main/ui/merchant_application.html index 5f1162c0a..092f19555 100644 --- a/src/main/ui/merchant_application.html +++ b/src/main/ui/merchant_application.html @@ -265,7 +265,7 @@