fix 修复 解决部门id无法查询到部门的空指针异常

feature/model
疯狂的狮子li 2 years ago
parent f8bb302fef
commit 3baad24912

@ -127,6 +127,9 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService {
@Override
public SysDeptVo selectDeptById(Long deptId) {
SysDeptVo dept = baseMapper.selectVoById(deptId);
if (ObjectUtil.isNull(dept)) {
return null;
}
SysDeptVo parentDept = baseMapper.selectVoOne(new LambdaQueryWrapper<SysDept>()
.select(SysDept::getDeptName).eq(SysDept::getDeptId, dept.getParentId()));
dept.setParentName(ObjectUtil.isNotNull(parentDept) ? parentDept.getDeptName() : null);

Loading…
Cancel
Save