xiatian 2 년 전
부모
커밋
a8dd1200ef
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      src/main/java/cn/com/qmth/mps/service/impl/UserServiceImpl.java

+ 4 - 1
src/main/java/cn/com/qmth/mps/service/impl/UserServiceImpl.java

@@ -85,7 +85,7 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
 			throw new StatusException("角色不能为空");
 		}
 		if (domain.getRole().equals(Role.SUPER_ADMIN)) {
-			throw new StatusException("不能新增编辑超管");
+			throw new StatusException("不能新增超管");
 		}
 		if (!domain.getRole().equals(Role.SECTION_LEADER) && CollectionUtils.isNotEmpty(domain.getCourse())) {
 			throw new StatusException("只有科组长可关联科目");
@@ -96,6 +96,9 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
 			if (ue == null) {
 				throw new StatusException("未找到用户");
 			}
+			if (ue.getRoleId().equals(Role.SUPER_ADMIN.getId())) {
+				throw new StatusException("不能编辑超管");
+			}
 		} else {
 			if (getByLoginName(domain.getLoginName()) != null) {
 				throw new StatusException("登录名已存在");