Browse Source

fix: 可开票范围,改为只查询当前企业下的积分包

李学松 2 years ago
parent
commit
d089dbcc81

+ 32 - 32
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/recharge/service/impl/SysDeptInvoiceServiceImpl.java

@@ -95,20 +95,20 @@ public class SysDeptInvoiceServiceImpl extends ServiceImpl<SysDeptInvoiceMapper,
         queryDeptIds.add(deptId);
 
         // 查询关联的下级企业
-        List<SysDeptRelation> deptRelations = deptRelationService.list(Wrappers.<SysDeptRelation>lambdaQuery()
-                .eq(SysDeptRelation::getAncestor, deptId)
-                .ne(SysDeptRelation::getDescendant, deptId));
-        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);
-            }
-        }
+//        List<SysDeptRelation> deptRelations = deptRelationService.list(Wrappers.<SysDeptRelation>lambdaQuery()
+//                .eq(SysDeptRelation::getAncestor, deptId)
+//                .ne(SysDeptRelation::getDescendant, deptId));
+//        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);
+//            }
+//        }
 
         // 企业名称查询过滤
         if (StrUtil.isNotEmpty(toScorePackagePage.getDeptName())) {
@@ -361,24 +361,24 @@ public class SysDeptInvoiceServiceImpl extends ServiceImpl<SysDeptInvoiceMapper,
         List<SysDeptRelation> deptRelations = deptRelationService.list(Wrappers.<SysDeptRelation>lambdaQuery()
                 .eq(SysDeptRelation::getAncestor, deptId)
                 .ne(SysDeptRelation::getDescendant, deptId));
-        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);
-                // 查询下下级企业的信息
-                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);
+//                // 查询下下级企业的信息
+//                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);
+//                }
+//            }
+//        }
 
         SysDeptInvoiceRequest.ToScorePackagePage toScorePackagePage = new SysDeptInvoiceRequest.ToScorePackagePage();
         toScorePackagePage.setInvoiceStatus(InvoiceStatus.NOT_APPLY);