| | |
| | | } |
| | | wrapper.eq(Complaint::getSuperiorId, query.getDistrictCode()); |
| | | } |
| | | if(query.getStreetId()!=null){ |
| | | if(query.getStreetId()!=null && query.getCommunityId()==null){ |
| | | // 获取街道上一级查看是否有上级权限 |
| | | ComStreet comStreet = comStreetService.getById(query.getStreetId()); |
| | | if(comStreet==null){ |
| | | throw new ServiceException("没有该街道权限"); |
| | | } |
| | | // 没有市级 上级区县 本级街道权限 |
| | | if(accountLevel==2 || (accountLevel==3 && systemUser.getDistrictsCode().equals(query.getDistrictCode().toString()))){ |
| | | wrapper.eq(Complaint::getSuperiorId, query.getStreetId()); |
| | | if(accountLevel==2 || (accountLevel==3 && systemUser.getStreetId().equals(query.getStreetId().toString()))){ |
| | | List<Long> collect = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId, comStreet.getStreetId())).stream().map(ComAct::getCommunityId).collect(Collectors.toList()); |
| | | wrapper.eq(Complaint::getSuperiorId, query.getStreetId()).or().eq(Complaint::getLastSuperiorId,query.getStreetId()).or(w->w.in(Complaint::getSuperiorId,collect).eq(Complaint::getNowLevel,4)).or(w->w.in(Complaint::getLastSuperiorId,collect).eq(Complaint::getLastLevel,4)); |
| | | }else { |
| | | throw new ServiceException("没有该街道权限"); |
| | | } |
| | |
| | | } |
| | | |
| | | // 判断是否有上面的4个权限 |
| | | if(accountLevel==2 || (accountLevel==3 && systemUser.getDistrictsCode().equals(comAct.getStreetId().toString()) || accountLevel==4 && systemUser.getCommunityId().equals(comAct.getCommunityId()))){ |
| | | if(accountLevel==2 || (accountLevel==3 && systemUser.getStreetId().equals(comAct.getStreetId().toString()) || accountLevel==4 && systemUser.getCommunityId().equals(comAct.getCommunityId()))){ |
| | | wrapper.eq(Complaint::getSuperiorId, query.getCommunityId()); |
| | | }else { |
| | | throw new ServiceException("没有该社区权限"); |
| | |
| | | if(query.getCityCode()==null && query.getDistrictCode()==null && query.getStreetId()==null && query.getCommunityId()==null){ |
| | | if(systemUser.getSystemRoleId()==1 || systemUser.getSystemRoleId()==2){ |
| | | if(systemUser.getSystemRoleId()==1){ |
| | | wrapper.ne(Complaint::getProblemType,"纪委").or(w->w.isNull(Complaint::getProblemType)); |
| | | wrapper.and(w->w.ne(Complaint::getProblemType,"检举控告").or().isNull(Complaint::getProblemType)); |
| | | } |
| | | if(accountLevel==3){ |
| | | String streetId = systemUser.getStreetId(); |
| | | List<Long> ids = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId, streetId)).stream().map(ComAct::getCommunityId).collect(Collectors.toList()); |
| | | wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel()).or(wrapper1 ->wrapper1.in(Complaint::getSuperiorId,ids).eq(Complaint::getNowLevel,4)); |
| | | wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel()).eq(Complaint::getSuperiorId,streetId).or(wrapper1 ->wrapper1.in(Complaint::getSuperiorId,ids).eq(Complaint::getNowLevel,4)); |
| | | } |
| | | if(accountLevel==4){ |
| | | wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel()); |
| | | wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel()).eq(Complaint::getSuperiorId,systemUser.getCommunityId()); |
| | | } |
| | | }else { |
| | | wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel()) |