|
|
@ -11,6 +11,7 @@ import com.shxy.xymanager_common.entity.TbPermissionExample;
|
|
|
|
import com.shxy.xymanager_common.entity.TbRole;
|
|
|
|
import com.shxy.xymanager_common.entity.TbRole;
|
|
|
|
import com.shxy.xymanager_common.entity.TbRoleExample;
|
|
|
|
import com.shxy.xymanager_common.entity.TbRoleExample;
|
|
|
|
import com.shxy.xymanager_common.enums.PermissionDetailEnum;
|
|
|
|
import com.shxy.xymanager_common.enums.PermissionDetailEnum;
|
|
|
|
|
|
|
|
import com.shxy.xymanager_common.exception.ApiException;
|
|
|
|
import com.shxy.xymanager_common.exception.Asserts;
|
|
|
|
import com.shxy.xymanager_common.exception.Asserts;
|
|
|
|
import com.shxy.xymanager_common.model.PermissionDyLineTreeListModel;
|
|
|
|
import com.shxy.xymanager_common.model.PermissionDyLineTreeListModel;
|
|
|
|
import com.shxy.xymanager_dao.dao.DyLevelDao;
|
|
|
|
import com.shxy.xymanager_dao.dao.DyLevelDao;
|
|
|
@ -59,7 +60,7 @@ public class RoleServiceImpl implements RoleService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void update(TbRole item) throws Exception {
|
|
|
|
public void update(TbRole item) throws Exception {
|
|
|
|
if (item.getId() == SUPER_ADMIN) {
|
|
|
|
if (item.getId() == SUPER_ADMIN) {
|
|
|
|
throw new Exception("不能修改超级管理员");
|
|
|
|
throw new ApiException("不能修改超级管理员");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
roleMapper.updateByPrimaryKey(item);
|
|
|
|
roleMapper.updateByPrimaryKey(item);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -67,7 +68,7 @@ public class RoleServiceImpl implements RoleService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void delete(Integer id) throws Exception {
|
|
|
|
public void delete(Integer id) throws Exception {
|
|
|
|
if (id == SUPER_ADMIN) {
|
|
|
|
if (id == SUPER_ADMIN) {
|
|
|
|
throw new Exception("不能删除超级管理员");
|
|
|
|
throw new ApiException("不能删除超级管理员");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
roleMapper.deleteByPrimaryKey(id);
|
|
|
|
roleMapper.deleteByPrimaryKey(id);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -111,7 +112,7 @@ public class RoleServiceImpl implements RoleService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void changePermission(Integer roleId, List<TbPermission> list) throws Exception {
|
|
|
|
public void changePermission(Integer roleId, List<TbPermission> list) throws Exception {
|
|
|
|
if (roleId == SUPER_ADMIN) {
|
|
|
|
if (roleId == SUPER_ADMIN) {
|
|
|
|
throw new Exception("不能修改超级管理员的权限");
|
|
|
|
throw new ApiException("不能修改超级管理员的权限");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
TbPermissionExample example = new TbPermissionExample();
|
|
|
|
TbPermissionExample example = new TbPermissionExample();
|
|
|
|
TbPermissionExample.Criteria criteria = example.createCriteria();
|
|
|
|
TbPermissionExample.Criteria criteria = example.createCriteria();
|
|
|
|