| | |
| | | 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<>(); |
| | |
| | | }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); |
| | | |