| | |
| | | public boolean register(AdminParam param) { |
| | | Admin admin = findByUserName(param.getUsername()); |
| | | if (admin != null) { |
| | | throw new BusinessException("当前账号" + param.getUsername() + "已经存在"); |
| | | throw new BusinessException("当前账号" + param.getUsername() + "已经在管理员中存在"); |
| | | } |
| | | Client one = SpringContextHolder.getBean(ClientService.class).getOne(Wrappers.lambdaQuery(Client.class).eq(Client::getClientName, param.getUsername())); |
| | | if (one != null) { |
| | | throw new BusinessException("当前账号" + param.getUsername() + "已经在客户中存在"); |
| | | } |
| | | Admin save = new Admin(); |
| | | save.setId(snowflake.nextId()); |