| | |
| | | return departmentIds; |
| | | } |
| | | |
| | | @Override |
| | | public String getStairId(String id) |
| | | { |
| | | OrganizationChartEntity entity= baseMapper.selectConfigById(id); |
| | | if(entity!=null && StringUtils.isEmpty(entity.getParentId())) |
| | | { |
| | | return entity.getId()+""; |
| | | } |
| | | else |
| | | { |
| | | return getParentId(entity.getParentId()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据id 获取一级部门id 递归 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public String getParentId(String id) |
| | | { |
| | | String ultimatelyId; |
| | | OrganizationChartEntity entity= baseMapper.selectConfigById(id); |
| | | if(entity==null) |
| | | { |
| | | return id; |
| | | } |
| | | |
| | | if(!StringUtils.isEmpty(entity.getParentId())) |
| | | { |
| | | ultimatelyId= getParentId(entity.getParentId()); |
| | | return ultimatelyId; |
| | | } |
| | | else |
| | | { |
| | | ultimatelyId=entity.getId()+""; |
| | | return ultimatelyId; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | public String parentId(String id){ |
| | | String parentId=id; |