| | |
| | | areaCodes.add(organizationChartEntity.getVillage()); |
| | | getAreaCodeIds(areaCodes,organizationChartEntity); |
| | | } |
| | | return baseMapper.selectByIdSet(areaCodes); |
| | | if (areaCodes.size()==0) |
| | | return null; |
| | | else |
| | | return baseMapper.selectByIdSet(areaCodes); |
| | | } |
| | | |
| | | |
| | | public List<String> getAreaCodeIds(List<String> areaCodes, OrganizationChartEntity organizationChartEntity){ |
| | | organizationChartEntity = organizationChartMapper.selectOne(new QueryWrapper<OrganizationChartEntity>().lambda() |
| | | List<OrganizationChartEntity> organizationChartEntitys= organizationChartMapper.selectList(new QueryWrapper<OrganizationChartEntity>().lambda() |
| | | .eq(OrganizationChartEntity::getParentId, organizationChartEntity.getId())); |
| | | if (organizationChartEntity!=null){ |
| | | if (organizationChartEntity.getCity()!=null) |
| | | areaCodes.add(organizationChartEntity.getCity()); |
| | | if (organizationChartEntity.getDistrict()!=null) |
| | | areaCodes.add(organizationChartEntity.getDistrict()); |
| | | if (organizationChartEntity.getVillage()!=null) |
| | | areaCodes.add(organizationChartEntity.getVillage()); |
| | | getAreaCodeIds(areaCodes,organizationChartEntity); |
| | | for (OrganizationChartEntity organizationChart:organizationChartEntitys) { |
| | | if (organizationChart.getCity()!=null) |
| | | areaCodes.add(organizationChart.getCity()); |
| | | if (organizationChart.getDistrict()!=null) |
| | | areaCodes.add(organizationChart.getDistrict()); |
| | | if (organizationChart.getVillage()!=null) |
| | | areaCodes.add(organizationChart.getVillage()); |
| | | getAreaCodeIds(areaCodes,organizationChart); |
| | | } |
| | | return areaCodes; |
| | | } |
| | | |
| | | @Override |
| | | public List<AreaCode2022> getListByPCode(String id){ |
| | | List<AreaCode2022> areaCode2022s = baseMapper.selectList(new QueryWrapper<AreaCode2022>().lambda().eq(AreaCode2022::getPcode, id)); |
| | | for (AreaCode2022 areaCode2022:areaCode2022s) { |
| | | if (areaCode2022.getLevel()!=4) |
| | | areaCode2022.setChild(this.getListByPCode(areaCode2022.getCode().toString())); |
| | | } |
| | | return areaCode2022s; |
| | | } |
| | | |
| | | |
| | | } |