12-11-权限修改,排除SuperAdmin

This commit is contained in:
2025-12-11 16:38:31 +08:00
parent 6d9b5a727d
commit 4d6a225f96
3 changed files with 35 additions and 29 deletions

View File

@ -74,17 +74,19 @@ public class XzdProjectManagerApprovalServiceImpl extends ServiceImpl<XzdProject
@Override @Override
public TableDataInfo<XzdProjectManagerApprovalVo> queryPageList(XzdProjectManagerApprovalBo bo, PageQuery pageQuery) { public TableDataInfo<XzdProjectManagerApprovalVo> queryPageList(XzdProjectManagerApprovalBo bo, PageQuery pageQuery) {
// 获取当前用户部门 // 获取当前用户部门
Long deptId = LoginHelper.getDeptId(); if (!LoginHelper.isSuperAdmin()) {
SysDeptVo deptVo = iSysDeptService.selectDeptById(deptId); Long deptId = LoginHelper.getDeptId();
if (LoginHelper.isSuperAdmin()) { SysDeptVo deptVo = iSysDeptService.selectDeptById(deptId);
bo.setSsgs(deptVo.getDeptId()); if (LoginHelper.isSuperAdmin()) {
}else {
String ancestors = deptVo.getAncestors();
List<Long> ids = StringUtils.splitTo(ancestors, Convert::toLong);
if (ids.size() == 2) {
bo.setSsgs(deptVo.getDeptId()); bo.setSsgs(deptVo.getDeptId());
}else { } else {
bo.setSsgs(iSysDeptService.selectDeptById(ids.get(2)).getDeptId()); String ancestors = deptVo.getAncestors();
List<Long> ids = StringUtils.splitTo(ancestors, Convert::toLong);
if (ids.size() == 2) {
bo.setSsgs(deptVo.getDeptId());
} else {
bo.setSsgs(iSysDeptService.selectDeptById(ids.get(2)).getDeptId());
}
} }
} }
LambdaQueryWrapper<XzdProjectManagerApproval> lqw = buildQueryWrapper(bo); LambdaQueryWrapper<XzdProjectManagerApproval> lqw = buildQueryWrapper(bo);

View File

@ -115,17 +115,19 @@ public class XzdProjectServiceImpl extends ServiceImpl<XzdProjectMapper, XzdProj
bo.setPageSize(10); bo.setPageSize(10);
} }
// 获取当前用户部门 // 获取当前用户部门
Long deptId = LoginHelper.getDeptId(); if (!LoginHelper.isSuperAdmin()) {
SysDeptVo deptVo = iSysDeptService.selectDeptById(deptId); Long deptId = LoginHelper.getDeptId();
if (LoginHelper.isSuperAdmin()) { SysDeptVo deptVo = iSysDeptService.selectDeptById(deptId);
bo.setSsgs(deptVo.getDeptId()); if (LoginHelper.isSuperAdmin()) {
} else {
String ancestors = deptVo.getAncestors();
List<Long> ids = StringUtils.splitTo(ancestors, Convert::toLong);
if (ids.size() == 2) {
bo.setSsgs(deptVo.getDeptId()); bo.setSsgs(deptVo.getDeptId());
} else { } else {
bo.setSsgs(iSysDeptService.selectDeptById(ids.get(2)).getDeptId()); String ancestors = deptVo.getAncestors();
List<Long> ids = StringUtils.splitTo(ancestors, Convert::toLong);
if (ids.size() == 2) {
bo.setSsgs(deptVo.getDeptId());
} else {
bo.setSsgs(iSysDeptService.selectDeptById(ids.get(2)).getDeptId());
}
} }
} }

View File

@ -136,17 +136,19 @@ public class XzdSupplierInfoServiceImpl extends ServiceImpl<XzdSupplierInfoMappe
} }
// 获取当前用户部门 // 获取当前用户部门
Long deptId = LoginHelper.getDeptId(); if (!LoginHelper.isSuperAdmin()) {
SysDeptVo deptVo = iSysDeptService.selectDeptById(deptId); Long deptId = LoginHelper.getDeptId();
if (LoginHelper.isSuperAdmin()) { SysDeptVo deptVo = iSysDeptService.selectDeptById(deptId);
bo.setSsgs(deptVo.getDeptId()); if (LoginHelper.isSuperAdmin()) {
}else {
String ancestors = deptVo.getAncestors();
List<Long> ids = StringUtils.splitTo(ancestors, Convert::toLong);
if (ids.size() == 2) {
bo.setSsgs(deptVo.getDeptId()); bo.setSsgs(deptVo.getDeptId());
}else { } else {
bo.setSsgs(iSysDeptService.selectDeptById(ids.get(2)).getDeptId()); String ancestors = deptVo.getAncestors();
List<Long> ids = StringUtils.splitTo(ancestors, Convert::toLong);
if (ids.size() == 2) {
bo.setSsgs(deptVo.getDeptId());
} else {
bo.setSsgs(iSysDeptService.selectDeptById(ids.get(2)).getDeptId());
}
} }
} }