| | |
| | | if (null != gridId) { |
| | | // 判断关联关系表是否存在 |
| | | QueryWrapper<GridRangeEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("grid_id", gridId).eq("house_code", placeVO.getHouseCode()); |
| | | wrapper.eq("house_code", placeVO.getHouseCode()); |
| | | GridRangeEntity one = gridRangeService.getOne(wrapper); |
| | | if (null == one) { |
| | | // 新增 |
| | |
| | | gridRangeService.save(gridRangeEntity); |
| | | }else { |
| | | // 修改绑定 |
| | | one.setGridId(placeVO.getGridId()); |
| | | one.setGridId(gridId); |
| | | // 修改 |
| | | gridRangeService.updateById(one); |
| | | } |
| | |
| | | //点坐标解析 |
| | | String point = "'POINT(" + placeVO.getLng() + " " + placeVO.getLat() +")'"; |
| | | // String point = "'POINT(" + villageInfoExcel.getLatitude() + " " + villageInfoExcel.getLongitude() +")'"; |
| | | GridEntity gridEntity = gridMapper.spatialAnalysis(point); |
| | | if (null != gridEntity) { |
| | | List<GridEntity> gridEntityList = gridMapper.spatialAnalysis(point); |
| | | if (gridEntityList.size()>0) { |
| | | GridEntity gridEntity = gridEntityList.get(0); |
| | | // 判断关联关系表是否存在 |
| | | QueryWrapper<GridRangeEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("grid_id", gridEntity.getId()).eq("house_code", placeVO.getHouseCode()); |
| | | wrapper.eq("house_code", placeVO.getHouseCode()); |
| | | GridRangeEntity one = gridRangeService.getOne(wrapper); |
| | | if (null == one) { |
| | | // 新增 |
| | |
| | | gridRangeService.save(gridRangeEntity); |
| | | }else { |
| | | // 修改绑定 |
| | | one.setGridId(placeVO.getGridId()); |
| | | one.setGridId(gridEntity.getId()); |
| | | // 修改 |
| | | gridRangeService.updateById(one); |
| | | } |
| | |
| | | //点坐标解析 |
| | | String point = "'POINT(" + placeVO.getLng() + " " + placeVO.getLat() +")'"; |
| | | // String point = "'POINT(" + villageInfoExcel.getLatitude() + " " + villageInfoExcel.getLongitude() +")'"; |
| | | GridEntity gridEntity = gridMapper.spatialAnalysis(point); |
| | | List<GridEntity> gridEntityList = gridMapper.spatialAnalysis(point); |
| | | if (gridEntityList.size()>0) { |
| | | GridEntity gridEntity = gridEntityList.get(0); |
| | | if (null != gridEntity && !Strings.isBlank(gridEntity.getGridCode())) { |
| | | // 场所编号绑定 |
| | | placeVO.setGridCode(gridEntity.getGridCode()); |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 场所标签信息绑定入库 |