| | |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | import com.dg.core.db.gen.mapper.OrganizationChartMapper; |
| | | import com.dg.core.service.IOrganizationChartService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | { |
| | | |
| | | @Override |
| | | public List<OrganizationChartEntity> selectConfigList(String parentId,String grade) |
| | | public List<OrganizationChartEntity> selectConfigList(String parentId,String grade,List<String> ids) |
| | | { |
| | | List<OrganizationChartEntity> ocList=baseMapper.selectConfigList("","1"); |
| | | List<OrganizationChartEntity> ocList=baseMapper.selectConfigList(parentId,"1",ids); |
| | | |
| | | if(ocList==null || ocList.size()<1) |
| | | { |
| | | List<String> id=new ArrayList<>(); |
| | | id.add(parentId); |
| | | ocList=baseMapper.selectConfigList(null,null,id); |
| | | } |
| | | |
| | | for (OrganizationChartEntity entity:ocList) |
| | | { |
| | | entity.setChild(baseMapper.selectConfigList(entity.getId()+"","")); |
| | | entity.setChild(baseMapper.selectConfigList(entity.getId()+"","",null)); |
| | | |
| | | if (entity.getChild()!=null) |
| | | { |
| | |
| | | |
| | | |
| | | public List<OrganizationChartEntity> selectConfigList(String parentsId) { |
| | | List<OrganizationChartEntity> list =baseMapper.selectConfigList(parentsId,""); |
| | | List<OrganizationChartEntity> list =baseMapper.selectConfigList(parentsId,"",null); |
| | | for (OrganizationChartEntity sysStreet:list) { |
| | | sysStreet.setChild(baseMapper.selectConfigList(sysStreet.getId().toString(),"")); |
| | | sysStreet.setChild(baseMapper.selectConfigList(sysStreet.getId().toString(),"",null)); |
| | | if (sysStreet.getChild()!=null) |
| | | { |
| | | sysStreet.setChild(this.selectConfigList(sysStreet.getId().toString())); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<OrganizationChartEntity> queryList(IPage<OrganizationChartEntity> page, Integer state, String organizationName) { |
| | | return baseMapper.queryList(page,state,organizationName); |
| | | public List<OrganizationChartEntity> queryList(IPage<OrganizationChartEntity> page, Integer state, |
| | | String organizationName,List<String> ids) { |
| | | return baseMapper.queryList(page,state,organizationName,ids); |
| | | } |
| | | |
| | | @Override |
| | | public int countList(String organizationName) { |
| | | return baseMapper.countList(organizationName); |
| | | public int countList(String organizationName,List<String> ids) { |
| | | return baseMapper.countList(organizationName,ids); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<OrganizationChartEntity> selectParentList(String parentId, String grade) { |
| | | return baseMapper.selectConfigList(parentId,grade); |
| | | return baseMapper.selectConfigList(parentId,grade,null); |
| | | } |
| | | |
| | | /** |
| | |
| | | public List<String> getIds(String id) |
| | | { |
| | | List<String> ids=new ArrayList<>(); |
| | | List<OrganizationChartEntity> lists = baseMapper.selectConfigList(id,""); |
| | | List<OrganizationChartEntity> lists = baseMapper.selectConfigList(id,"",null); |
| | | if(lists.size()<1) |
| | | { |
| | | lists.add(baseMapper.selectConfigById(id)); |
| | |
| | | { |
| | | if(sysStreet!=null&&sysStreet.getId()!=null) |
| | | { |
| | | ids.add(sysStreet.getId()+""); |
| | | if(sysStreet.getChild()!=null && sysStreet.getChild().size()>0) |
| | | { |
| | | ids.addAll(disposestreetId(sysStreet.getChild())); |