| | |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Object spatialAnalysis() { |
| | | public Object spatialAnalysis(DoorplateAddressEntity addressEntity) { |
| | | // 按社区 |
| | | String name = null; |
| | | // String name = "茶山路社区居民委员会"; |
| | | //查询社区信息 |
| | | List<DoorplateAddressEntity> doorplateAddressEntities = doorplateAddressService.getAllDoorplateAddress(name); |
| | | List<DoorplateAddressEntity> doorplateAddressEntities = doorplateAddressService.getAllDoorplateAddress(addressEntity); |
| | | //遍历 |
| | | for (DoorplateAddressEntity doorplateAddressEntity : doorplateAddressEntities) { |
| | | //点坐标解析 |
| | | String point = "'POINT(" + doorplateAddressEntity.getX84() + " " + doorplateAddressEntity.getY84() +")'"; |
| | | String point = "'POINT(" + doorplateAddressEntity.getX() + " " + doorplateAddressEntity.getY() +")'"; |
| | | // String point = "'POINT(" + villageInfoExcel.getLatitude() + " " + villageInfoExcel.getLongitude() +")'"; |
| | | GridEntity gridEntity = baseMapper.spatialAnalysis(point); |
| | | if (null!=gridEntity){ |
| | | List<GridEntity> gridEntityList = baseMapper.spatialAnalysis(point); |
| | | if (gridEntityList.size()>0) { |
| | | GridEntity gridEntity = gridEntityList.get(0); |
| | | QueryWrapper<GridRangeEntity> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("grid_id",gridEntity.getId()).eq("house_code",doorplateAddressEntity.getAddressCode()); |
| | | GridRangeEntity one = gridRangeService.getOne(queryWrapper); |
| | |
| | | gridRangeEntity.setDistrictName(doorplateAddressEntity.getAoiName()); |
| | | // 保存 |
| | | gridRangeService.save(gridRangeEntity); |
| | | }else { |
| | | one.setGridId(gridEntity.getId()); |
| | | // 更新 |
| | | gridRangeService.updateById(one); |
| | | } |
| | | } |
| | | } |