dev
This commit is contained in:
parent
f0c4966f00
commit
4010dc24b4
|
|
@ -65,9 +65,17 @@ public class ManagerUserService extends BaseService {
|
|||
QueryWrapper<ManagerUser> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("username", user.getUsername());
|
||||
queryWrapper.last("limit 1");
|
||||
if (user.getUsername() == null || user.getUsername().isEmpty()){
|
||||
throw new MessageException("用户名不能为空");
|
||||
}
|
||||
if (user.getPassword() == null || user.getPassword().isEmpty()){
|
||||
throw new MessageException("密码不能为空");
|
||||
}
|
||||
if(managerUserMapper.selectOne(queryWrapper) != null){
|
||||
throw new MessageException("用户名已存在");
|
||||
}
|
||||
|
||||
|
||||
managerUserMapper.insert(user);
|
||||
return user;
|
||||
}
|
||||
|
|
@ -77,9 +85,21 @@ public class ManagerUserService extends BaseService {
|
|||
if(dbUser == null){
|
||||
throw new MessageException("用户不存在");
|
||||
}
|
||||
if (user.getUsername() == null || user.getUsername().isEmpty()){
|
||||
throw new MessageException("用户名不能为空");
|
||||
}
|
||||
if (user.getPassword() == null || user.getPassword().isEmpty()){
|
||||
throw new MessageException("密码不能为空");
|
||||
}
|
||||
if (!dbUser.getOrganizationMemberId().equals(user.getOrganizationMemberId())){
|
||||
throw new MessageException("当前账号已经绑定了其他成员");
|
||||
}
|
||||
QueryWrapper<ManagerUser> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("username", user.getUsername());
|
||||
queryWrapper.last("limit 1");
|
||||
if(managerUserMapper.selectOne(queryWrapper) != null){
|
||||
throw new MessageException("用户名已存在");
|
||||
}
|
||||
managerUserMapper.updateById(user);
|
||||
return user;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue