|
@@ -104,15 +104,16 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
|
|
throw new StatusException("不能编辑超管");
|
|
throw new StatusException("不能编辑超管");
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- if (getByLoginName(domain.getLoginName()) != null) {
|
|
|
|
- throw new StatusException("登录名已存在");
|
|
|
|
- }
|
|
|
|
ue = new UserEntity();
|
|
ue = new UserEntity();
|
|
ue.setPassword(ByteUtil.toHexAscii(SHA256.encode(domain.getPasswd())));
|
|
ue.setPassword(ByteUtil.toHexAscii(SHA256.encode(domain.getPasswd())));
|
|
ue.setSchoolId(domain.getSchoolId());
|
|
ue.setSchoolId(domain.getSchoolId());
|
|
ue.setEnable(true);
|
|
ue.setEnable(true);
|
|
- ue.setLoginName(domain.getLoginName());
|
|
|
|
}
|
|
}
|
|
|
|
+ UserEntity lg=getByLoginName(domain.getLoginName());
|
|
|
|
+ if (lg!= null&&(domain.getId()==null||!lg.getId().equals(domain.getId()))) {
|
|
|
|
+ throw new StatusException("登录名已存在");
|
|
|
|
+ }
|
|
|
|
+ ue.setLoginName(domain.getLoginName());
|
|
ue.setName(domain.getName());
|
|
ue.setName(domain.getName());
|
|
ue.setRoleId(domain.getRole().getId());
|
|
ue.setRoleId(domain.getRole().getId());
|
|
this.saveOrUpdate(ue);
|
|
this.saveOrUpdate(ue);
|