| | |
| | | import org.springblade.common.node.TreeStringNode; |
| | | import org.springblade.common.utils.NodeTreeUtil; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.modules.category.dto.CategoryLabelDTO; |
| | | import org.springblade.modules.category.service.ICategoryLabelService; |
| | | import org.springblade.modules.district.entity.DistrictEntity; |
| | | import org.springblade.modules.district.service.IDistrictService; |
| | | import org.springblade.modules.doorplateAddress.entity.DoorplateAddressEntity; |
| | | import org.springblade.modules.doorplateAddress.mapper.DoorplateAddressMapper; |
| | | import org.springblade.modules.doorplateAddress.service.IDoorplateAddressService; |
| | |
| | | import org.springblade.modules.house.vo.HouseParam; |
| | | import org.springblade.modules.house.vo.HouseRentalVO; |
| | | import org.springblade.modules.house.vo.HouseholdVO; |
| | | import org.springblade.modules.place.entity.PlaceEntity; |
| | | import org.springblade.modules.place.service.IPlaceService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | |
| | | @Autowired |
| | | private IGridService gridService; |
| | | |
| | | @Autowired |
| | | private IDistrictService districtService; |
| | | |
| | | @Autowired |
| | | private ICategoryLabelService iCategoryLabelService; |
| | | |
| | | |
| | | @Override |
| | |
| | | List<TreeStringNode> placeNodeList = placeService.selectPlaceNodeList(AuthUtil.getUserId()); |
| | | for (TreeStringNode treeNode : placeNodeList) { |
| | | treeNode.setAddressType(2); |
| | | CategoryLabelDTO categoryLabelDTO = new CategoryLabelDTO(); |
| | | categoryLabelDTO.setPlaceId(treeNode.getId()); |
| | | List<CategoryLabelDTO> categoryLabelDTOS = iCategoryLabelService.selectCategoryLabelList(categoryLabelDTO); |
| | | treeNode.setCategoryLabelList(categoryLabelDTOS); |
| | | // if (DictConstant.SMALL_DOORPLATE.equals(treeNode.getDoorplateType()) || |
| | | // (DictConstant.centre_DOORPLATE.equals(treeNode.getDoorplateType()) && |
| | | // treeNode.getAddressLevel().equals(1))) { |
| | |
| | | // 批量插入 |
| | | houseService.saveBatch(houseList); |
| | | } |
| | | |
| | | /** |
| | | * 小区数据处理 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object aoiDataHandle() { |
| | | // 查询所有的地址表id集合 |
| | | List<Long> aoiCodeList = baseMapper.getAoiCodeList(); |
| | | // 查询小区集合 |
| | | List<DoorplateAddressEntity> list = baseMapper.getAoiList(aoiCodeList); |
| | | // 创建小区集合对象 |
| | | List<DistrictEntity> aoiList = new ArrayList<>(); |
| | | // 将小区数据保存到小区表中 |
| | | for (DoorplateAddressEntity addressEntity : list) { |
| | | DistrictEntity districtEntity = new DistrictEntity(); |
| | | districtEntity.setCommunityCode(addressEntity.getNeiCode()); |
| | | districtEntity.setAoiCode(addressEntity.getAoiCode()); |
| | | districtEntity.setName(addressEntity.getAoiName()); |
| | | districtEntity.setAddress(addressEntity.getAddressName()); |
| | | districtEntity.setLng(addressEntity.getX()); |
| | | districtEntity.setLat(addressEntity.getY()); |
| | | // 加入集合 |
| | | aoiList.add(districtEntity); |
| | | } |
| | | // 批量插入 |
| | | districtService.saveBatch(aoiList); |
| | | // 返回 |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 场所数据处理 |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Object placeDataHandle() { |
| | | // 查询所有的地址表和场所表差集集合 |
| | | List<DoorplateAddressEntity> list = baseMapper.getPlaceList(); |
| | | // 创建场所集合对象 |
| | | List<PlaceEntity> placeList = new ArrayList<>(); |
| | | // 将小区数据保存到小区表中 |
| | | for (DoorplateAddressEntity addressEntity : list) { |
| | | PlaceEntity placeEntity = new PlaceEntity(); |
| | | placeEntity.setHouseCode(addressEntity.getAddressCode()); |
| | | placeEntity.setPlaceName(addressEntity.getPoi()); |
| | | placeEntity.setLng(addressEntity.getX()); |
| | | placeEntity.setLat(addressEntity.getY()); |
| | | placeEntity.setLocaltion(addressEntity.getAddressName()); |
| | | placeEntity.setLat(addressEntity.getY()); |
| | | // 加入集合 |
| | | placeList.add(placeEntity); |
| | | } |
| | | // 批量插入 |
| | | placeService.saveBatch(placeList); |
| | | // 返回 |
| | | return null; |
| | | } |
| | | } |