|
@@ -92,28 +92,19 @@ public class SysDeptInvoiceServiceImpl extends ServiceImpl<SysDeptInvoiceMapper,
|
|
|
Set<Integer> queryDeptIds = new HashSet<>();
|
|
|
queryDeptIds.add(deptId);
|
|
|
|
|
|
- // 查询关联的企业
|
|
|
+ // 查询关联的下级企业
|
|
|
List<SysDeptRelation> deptRelations = deptRelationService.list(Wrappers.<SysDeptRelation>lambdaQuery()
|
|
|
.eq(SysDeptRelation::getAncestor, deptId)
|
|
|
.ne(SysDeptRelation::getDescendant, deptId));
|
|
|
- if (CollUtil.isEmpty(deptRelations)) {
|
|
|
- return page;
|
|
|
- }
|
|
|
-
|
|
|
- Set<Integer> subDeptIds = deptRelations.stream().map(SysDeptRelation::getDescendant).collect(Collectors.toSet());
|
|
|
- queryDeptIds.addAll(subDeptIds);
|
|
|
- // 查询下级企业的信息
|
|
|
- List<SysDeptRelation> subRelations = deptRelationService.list(Wrappers.<SysDeptRelation>lambdaQuery()
|
|
|
- .in(SysDeptRelation::getAncestor, subDeptIds));
|
|
|
- if (CollUtil.isNotEmpty(subRelations)) {
|
|
|
- Set<Integer> sub1DeptIds = subRelations.stream().map(SysDeptRelation::getDescendant).collect(Collectors.toSet());
|
|
|
- queryDeptIds.addAll(sub1DeptIds);
|
|
|
- // 查询下下级企业的信息
|
|
|
- List<SysDeptRelation> sub2Relations = deptRelationService.list(Wrappers.<SysDeptRelation>lambdaQuery()
|
|
|
- .in(SysDeptRelation::getAncestor, sub1DeptIds));
|
|
|
- if (CollUtil.isNotEmpty(sub2Relations)) {
|
|
|
- Set<Integer> sub2DeptIds = sub2Relations.stream().map(SysDeptRelation::getDescendant).collect(Collectors.toSet());
|
|
|
- queryDeptIds.addAll(sub2DeptIds);
|
|
|
+ if (CollUtil.isNotEmpty(deptRelations)) {
|
|
|
+ Set<Integer> subDeptIds = deptRelations.stream().map(SysDeptRelation::getDescendant).collect(Collectors.toSet());
|
|
|
+ queryDeptIds.addAll(subDeptIds);
|
|
|
+ // 查询关联的下下级企业的信息
|
|
|
+ List<SysDeptRelation> subRelations = deptRelationService.list(Wrappers.<SysDeptRelation>lambdaQuery()
|
|
|
+ .in(SysDeptRelation::getAncestor, subDeptIds));
|
|
|
+ if (CollUtil.isNotEmpty(subRelations)) {
|
|
|
+ Set<Integer> sub1DeptIds = subRelations.stream().map(SysDeptRelation::getDescendant).collect(Collectors.toSet());
|
|
|
+ queryDeptIds.addAll(sub1DeptIds);
|
|
|
}
|
|
|
}
|
|
|
|