| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.db.gen.mapper.OrganizationChartMapper; |
| | | import com.dg.core.db.gen.mapper.SysUserMapper; |
| | | import com.dg.core.manager.TokenManager; |
| | | import com.dg.core.service.ISysUserService; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | |
| | | @Autowired |
| | | TokenManager tokenManager; |
| | | |
| | | @Resource |
| | | private OrganizationChartMapper organizationChartMapper; |
| | | |
| | | @Override |
| | | public SysUser getUserById(Long id) { |
| | |
| | | |
| | | @Override |
| | | public List<SysUser> selectListByDepartmentId(String departmentId, String classifyId) { |
| | | return baseMapper.selectListByDepartmentId(departmentId,classifyId); |
| | | List<String> departmentIds=new ArrayList<>(); |
| | | departmentIds.add(departmentId); |
| | | List<OrganizationChartEntity> organizationChartEntities = organizationChartMapper.selectList(new QueryWrapper<OrganizationChartEntity>().lambda() |
| | | .eq(OrganizationChartEntity::getParentId, departmentId)); |
| | | if (organizationChartEntities!=null){ |
| | | for (OrganizationChartEntity organizationChart:organizationChartEntities) { |
| | | departmentIds.add(organizationChart.getId().toString()); |
| | | List<OrganizationChartEntity> organizationChartEntitiesUser = organizationChartMapper.selectList(new QueryWrapper<OrganizationChartEntity>().lambda() |
| | | .eq(OrganizationChartEntity::getParentId, organizationChart.getId().toString())); |
| | | if (organizationChartEntitiesUser!=null) |
| | | departmentIds=this.getDepartmentIds(organizationChartEntitiesUser,departmentIds); |
| | | } |
| | | } |
| | | return baseMapper.selectListByDepartmentId(departmentIds,","+classifyId,classifyId+","); |
| | | } |
| | | |
| | | public List<String> getDepartmentIds( List<OrganizationChartEntity> organizationChartEntities,List<String> departmentIds){ |
| | | for (OrganizationChartEntity organizationChart:organizationChartEntities) { |
| | | departmentIds.add(organizationChart.getId().toString()); |
| | | List<OrganizationChartEntity> organizationChartEntitiesUser = organizationChartMapper.selectList(new QueryWrapper<OrganizationChartEntity>().lambda() |
| | | .eq(OrganizationChartEntity::getParentId, organizationChart.getId().toString())); |
| | | if (organizationChartEntitiesUser!=null) |
| | | departmentIds=this.getDepartmentIds(organizationChartEntitiesUser,departmentIds); |
| | | |
| | | } |
| | | return departmentIds; |
| | | } |
| | | |
| | | @Override |