|
@@ -16,6 +16,7 @@ import com.ozs.common.core.domain.entity.SysMenu;
|
|
|
import com.ozs.common.core.domain.vo.SysDeptVo;
|
|
|
import com.ozs.common.core.domain.vo.SysRoleRequestVo;
|
|
|
import com.ozs.common.core.domain.vo.SysUserVo;
|
|
|
+import com.ozs.common.exception.ServiceException;
|
|
|
import com.ozs.service.entity.BaseRailwayManagement;
|
|
|
import com.ozs.service.entity.BaseUser;
|
|
|
import com.ozs.service.service.BaseUserService;
|
|
@@ -176,6 +177,11 @@ public class SysRoleController extends BaseController {
|
|
|
}
|
|
|
return error("超级管理员角色不能修改");
|
|
|
} else {
|
|
|
+ if ("2".equals(role.getStatus())) {
|
|
|
+ if (roleService.countUserRoleByRoleId(role.getRoleId()) > 0) {
|
|
|
+ throw new ServiceException(String.format("%1$s已分配,不能禁用", role.getRoleName()));
|
|
|
+ }
|
|
|
+ }
|
|
|
if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) {
|
|
|
return error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
|
|
}
|