| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | Page page = new Page<>(); |
| | | page.setCurrent(query.getPageNum()); |
| | | page.setSize(query.getPageSize()); |
| | | IPage<SystemUserListVo> list = this.baseMapper.list(page, user, query); |
| | | return list; |
| | | if(query.getDeptId()!=null || user.getAccountLevel()==2){ |
| | | IPage<SystemUserListVo> list = this.baseMapper.list(page, user, query); |
| | | return list; |
| | | }else { |
| | | List<Integer> deptIds=new ArrayList<>(); |
| | | if(user.getAccountLevel()==3){ |
| | | List<Long> ids = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId, user.getStreetId())).stream().map(ComAct::getCommunityId).collect(Collectors.toList()); |
| | | List<Department> list = departmentService.list(new LambdaQueryWrapper<Department>().eq(Department::getTier, 3).eq(Department::getStreetId, user.getStreetId()) |
| | | .or(department -> department.and(department1 -> department1.eq(Department::getTier, 4).in(Department::getCommunityId, ids)))); |
| | | if(list.isEmpty()){ |
| | | return new Page<>(); |
| | | } |
| | | deptIds= list.stream().map(Department::getId).collect(Collectors.toList()); |
| | | }else if(user.getAccountLevel()==4){ |
| | | List<Department> list = departmentService.list(new LambdaQueryWrapper<Department>().eq(Department::getTier, 4).eq(Department::getCommunityId, user.getCommunityId())); |
| | | if(list.isEmpty()){ |
| | | return new Page<>(); |
| | | } |
| | | deptIds= list.stream().map(Department::getId).collect(Collectors.toList()); |
| | | } |
| | | IPage<SystemUserListVo> list = this.baseMapper.list1(page, user, query,deptIds); |
| | | return list; |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |