12-11-权限修改,排除SuperAdmin
This commit is contained in:
@ -74,17 +74,19 @@ public class XzdProjectManagerApprovalServiceImpl extends ServiceImpl<XzdProject
|
||||
@Override
|
||||
public TableDataInfo<XzdProjectManagerApprovalVo> queryPageList(XzdProjectManagerApprovalBo bo, PageQuery pageQuery) {
|
||||
// 获取当前用户部门
|
||||
Long deptId = LoginHelper.getDeptId();
|
||||
SysDeptVo deptVo = iSysDeptService.selectDeptById(deptId);
|
||||
if (LoginHelper.isSuperAdmin()) {
|
||||
bo.setSsgs(deptVo.getDeptId());
|
||||
}else {
|
||||
String ancestors = deptVo.getAncestors();
|
||||
List<Long> ids = StringUtils.splitTo(ancestors, Convert::toLong);
|
||||
if (ids.size() == 2) {
|
||||
if (!LoginHelper.isSuperAdmin()) {
|
||||
Long deptId = LoginHelper.getDeptId();
|
||||
SysDeptVo deptVo = iSysDeptService.selectDeptById(deptId);
|
||||
if (LoginHelper.isSuperAdmin()) {
|
||||
bo.setSsgs(deptVo.getDeptId());
|
||||
}else {
|
||||
bo.setSsgs(iSysDeptService.selectDeptById(ids.get(2)).getDeptId());
|
||||
} else {
|
||||
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);
|
||||
|
||||
@ -115,17 +115,19 @@ public class XzdProjectServiceImpl extends ServiceImpl<XzdProjectMapper, XzdProj
|
||||
bo.setPageSize(10);
|
||||
}
|
||||
// 获取当前用户部门
|
||||
Long deptId = LoginHelper.getDeptId();
|
||||
SysDeptVo deptVo = iSysDeptService.selectDeptById(deptId);
|
||||
if (LoginHelper.isSuperAdmin()) {
|
||||
bo.setSsgs(deptVo.getDeptId());
|
||||
} else {
|
||||
String ancestors = deptVo.getAncestors();
|
||||
List<Long> ids = StringUtils.splitTo(ancestors, Convert::toLong);
|
||||
if (ids.size() == 2) {
|
||||
if (!LoginHelper.isSuperAdmin()) {
|
||||
Long deptId = LoginHelper.getDeptId();
|
||||
SysDeptVo deptVo = iSysDeptService.selectDeptById(deptId);
|
||||
if (LoginHelper.isSuperAdmin()) {
|
||||
bo.setSsgs(deptVo.getDeptId());
|
||||
} 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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -136,17 +136,19 @@ public class XzdSupplierInfoServiceImpl extends ServiceImpl<XzdSupplierInfoMappe
|
||||
}
|
||||
|
||||
// 获取当前用户部门
|
||||
Long deptId = LoginHelper.getDeptId();
|
||||
SysDeptVo deptVo = iSysDeptService.selectDeptById(deptId);
|
||||
if (LoginHelper.isSuperAdmin()) {
|
||||
bo.setSsgs(deptVo.getDeptId());
|
||||
}else {
|
||||
String ancestors = deptVo.getAncestors();
|
||||
List<Long> ids = StringUtils.splitTo(ancestors, Convert::toLong);
|
||||
if (ids.size() == 2) {
|
||||
if (!LoginHelper.isSuperAdmin()) {
|
||||
Long deptId = LoginHelper.getDeptId();
|
||||
SysDeptVo deptVo = iSysDeptService.selectDeptById(deptId);
|
||||
if (LoginHelper.isSuperAdmin()) {
|
||||
bo.setSsgs(deptVo.getDeptId());
|
||||
}else {
|
||||
bo.setSsgs(iSysDeptService.selectDeptById(ids.get(2)).getDeptId());
|
||||
} else {
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user