fix 修复 没有权限的用户编辑部门缺少数据

This commit is contained in:
疯狂的狮子li
2022-09-13 14:15:12 +08:00
parent 1350140b9a
commit ca18a1f767
2 changed files with 345 additions and 337 deletions

View File

@@ -107,7 +107,11 @@ public class SysDeptServiceImpl implements ISysDeptService {
*/
@Override
public SysDept selectDeptById(Long deptId) {
return baseMapper.selectById(deptId);
SysDept dept = baseMapper.selectById(deptId);
SysDept parentDept = baseMapper.selectOne(new LambdaQueryWrapper<SysDept>()
.select(SysDept::getDeptName).eq(SysDept::getDeptId, dept.getParentId()));
dept.setParentName(ObjectUtil.isNotNull(parentDept) ? parentDept.getDeptName() : null);
return dept;
}
/**