liujie
2025-07-15 8652e69d17ab0c1a5884c662a9f3f950ddf57948
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/DepartmentController.java
@@ -108,6 +108,15 @@
                return  R.ok(new ArrayList<>());
            }
            level=loginUserInfoWest.getAccountLevel();
         if(level==2){
            code="510403";
         }
         if(level==3){
            code = loginUserInfoWest.getStreetId();
         }
         if(level==4){
            code = loginUserInfoWest.getCommunityId().toString();
         }
            type=2;
        }
         List<Department> list4=new ArrayList<>();
@@ -116,15 +125,15 @@
         }else if(level==2 && type==2){
             list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).ge( Department::getTier, 2));
         }else  if(level==3 && type==1){
            list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq( Department::getTier, 3).eq(Department::getStreetId, loginUserInfoWest.getStreetId()));
            list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq( Department::getTier, 3).eq(Department::getStreetId, code));
         }else if(level==3 && type==2){
                List<Long> ids = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId, loginUserInfoWest.getStreetId())).stream().map(ComAct::getCommunityId).collect(Collectors.toList());
                list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq( Department::getTier, 3).eq(Department::getStreetId, loginUserInfoWest.getStreetId())
                List<Long> ids = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId, code)).stream().map(ComAct::getCommunityId).collect(Collectors.toList());
                list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq( Department::getTier, 3).eq(Department::getStreetId, code)
                        .or(w->w.eq(Department::getTier,4).in(Department::getCommunityId,ids)));
         }else  if(level==4 && type==1){
            list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq( Department::getTier, 4).eq(Department::getCommunityId,loginUserInfoWest.getCommunityId()));
            list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq( Department::getTier, 4).eq(Department::getCommunityId,code));
         }else if(level==4 && type==2){
            list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq(Department::getTier, 4).eq(Department::getCommunityId,loginUserInfoWest.getCommunityId()));
            list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq(Department::getTier, 4).eq(Department::getCommunityId,code));
         }
         return R.ok(list4);