fix:部门查询禁用不显示问题

This commit is contained in:
zhangzhiqiang
2022-12-03 19:12:21 +08:00
parent 2f1a3ffb68
commit 6694a12507

View File

@@ -92,7 +92,11 @@ public class DeptServiceImpl implements DeptService {
}
}
}
List<DeptDto> list = deptMapper.toDto(deptRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder), sort));
if (Boolean.FALSE.equals(criteria.getEnabled())){
criteria.setPidIsNull(null);
}
List<Dept> all = deptRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder), sort);
List<DeptDto> list = deptMapper.toDto(all);
// 如果为空,就代表为自定义权限或者本级权限,就需要去重,不理解可以注释掉,看查询结果
if (StrUtil.isEmpty(dataScopeType)) {
return deduplication(list);