| | |
| | | import com.panzhihua.service_community.dao.ComMngCityDAO; |
| | | import com.panzhihua.service_community.dao.ComMngDistrictDAO; |
| | | import com.panzhihua.service_community.dao.ComMngProvinceDAO; |
| | | import com.panzhihua.service_community.dao.ComMngStructAreaDAO; |
| | | import com.panzhihua.service_community.model.dos.ComMngCityDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngDistrictDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngProvinceDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngStructAreaDO; |
| | | import com.panzhihua.service_community.service.ComMngProvinceService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Resource |
| | | private ComMngDistrictDAO comMngDistrictDAO; |
| | | |
| | | @Resource |
| | | private ComMngStructAreaDAO comMngStructAreaDAO; |
| | | |
| | | @Override |
| | | public R getProvince() { |
| | |
| | | List<ComMngAreaVO> vos = new ArrayList<>(); |
| | | provinceDOS.forEach(p -> { |
| | | ComMngAreaVO pvo = new ComMngAreaVO(p.getProvinceAdcode(), p.getProvinceName()); |
| | | vos.add(pvo); |
| | | List<ComMngCityDO> citys = cityDOS.stream().filter(city -> city.getProvinceAdcode().equals(p.getProvinceAdcode()) && city.getCityAdcode().equals(510400)).collect(Collectors.toList()); |
| | | citys.forEach(c -> { |
| | | ComMngAreaVO cityVo = new ComMngAreaVO(c.getCityAdcode(), c.getCityName()); |
| | |
| | | cityVo.getChildren().add(districtVo); |
| | | }); |
| | | }); |
| | | vos.add(pvo); |
| | | }); |
| | | return R.ok(vos); |
| | | } |