| | |
| | | } |
| | | |
| | | /** |
| | | * 数据处理 |
| | | * 房屋数据处理 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object dataHandle() { |
| | | // 处理户室数据 |
| | | public Object houseDataHandle() { |
| | | // 处理房屋数据 |
| | | handleHouseData(); |
| | | |
| | | return null; |
| | |
| | | * 处理房屋数据 |
| | | */ |
| | | private void handleHouseData() { |
| | | // 查询所有户室数据 |
| | | // 查询所有户室数据(未入库的) |
| | | List<DoorplateAddressEntity> list = baseMapper.getHouseList(); |
| | | // 需要新增的房屋 list |
| | | List<HouseEntity> houseList = new ArrayList<>(); |
| | |
| | | houseEntity.setCreateTime(new Date()); |
| | | houseEntity.setUpdateUser(AuthUtil.getUserId().toString()); |
| | | houseEntity.setUpdateTime(new Date()); |
| | | // 设置来源 1:地址总表 2:国控采集 |
| | | houseEntity.setSource(1); |
| | | // 加入集合 |
| | | houseList.add(houseEntity); |
| | | } |
| | |
| | | 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); |
| | | // 查询小区是否已存在,不存在则插入,否则不新增 |
| | | QueryWrapper<DistrictEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("aoi_code",addressEntity.getAoiCode()) |
| | | .eq("is_deleted",0); |
| | | DistrictEntity one = districtService.getOne(wrapper); |
| | | if (null==one) { |
| | | 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()); |
| | | // 加入集合 |
| | | districtService.save(districtEntity); |
| | | // aoiList.add(districtEntity); |
| | | } |
| | | } |
| | | // 批量插入 |
| | | districtService.saveBatch(aoiList); |
| | | // districtService.saveBatch(aoiList); |
| | | // 返回 |
| | | return null; |
| | | } |
| | |
| | | List<DoorplateAddressEntity> list = baseMapper.getPlaceList(); |
| | | // 创建场所集合对象 |
| | | List<PlaceEntity> placeList = new ArrayList<>(); |
| | | // 将小区数据保存到小区表中 |
| | | // 将场所数据保存到场所表中 |
| | | for (DoorplateAddressEntity addressEntity : list) { |
| | | PlaceEntity placeEntity = new PlaceEntity(); |
| | | placeEntity.setHouseCode(addressEntity.getAddressCode()); |
| | |
| | | placeEntity.setLng(addressEntity.getX()); |
| | | placeEntity.setLat(addressEntity.getY()); |
| | | placeEntity.setLocaltion(addressEntity.getAddressName()); |
| | | placeEntity.setLat(addressEntity.getY()); |
| | | // 设置来源( 1:地址总表 2:国控采集) |
| | | placeEntity.setSource(1); |
| | | // 加入集合 |
| | | placeList.add(placeEntity); |
| | | } |