| | |
| | | placeEntity.setSource(1); |
| | | // 设置经纬度及地址 |
| | | DoorplateAddressEntity doorplateAddressEntity |
| | | = doorplateAddressService.getOne(Wrappers.<DoorplateAddressEntity>lambdaQuery().eq(DoorplateAddressEntity::getAddressCode, placeExcel.getHouseCode())); |
| | | = doorplateAddressService.getOne(Wrappers.<DoorplateAddressEntity>lambdaQuery() |
| | | .eq(DoorplateAddressEntity::getAddressCode, placeExcel.getHouseCode()).last("limit 1")); |
| | | if (null!=doorplateAddressEntity){ |
| | | placeEntity.setLng(doorplateAddressEntity.getX()); |
| | | placeEntity.setLat(doorplateAddressEntity.getY()); |
| | |
| | | * @param placeEntity |
| | | */ |
| | | private void importGridHandle(ImportPlaceExcel placeExcel, PlaceEntity placeEntity) { |
| | | if (!Strings.isBlank(placeExcel.getCommunityName()) && |
| | | !Strings.isBlank(placeExcel.getGridName())) { |
| | | if (Strings.isNotBlank(placeExcel.getCommunityName()) && Strings.isNotBlank(placeExcel.getGridName())) { |
| | | // 查询对应的网格信息 |
| | | GridEntity gridEntity = gridService.getGridInfoByParam(placeExcel.getCommunityName(), placeExcel.getGridName()); |
| | | if (null != gridEntity) { |
| | |
| | | updateWrapper.eq("house_code", placeEntity.getHouseCode()); |
| | | gridRangeService.update(gridRangeEntity, updateWrapper); |
| | | } |
| | | } else if (StringUtils.isNotBlank(placeEntity.getLat()) && StringUtils.isNotBlank(placeEntity.getLng())) { |
| | | // 点落面 |
| | | setGridInfo(placeEntity); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 设置警格网格信息 |
| | | * |
| | | * @param placeEntity |
| | | */ |
| | | public void setGridInfo(PlaceEntity placeEntity) { |
| | | // 根据位置设置网格,警格编号 |
| | | IGridService gridService = SpringUtils.getBean(IGridService.class); |
| | | IPoliceAffairsGridService policeAffairsGridService = SpringUtils.getBean(IPoliceAffairsGridService.class); |
| | | String point = "'POINT(" + placeEntity.getLng() + " " + placeEntity.getLat() + ")'"; |
| | | // 点坐标解析网格 |
| | | List<GridEntity> gridEntityList = gridService.spatialAnalysis(point); |
| | | if (gridEntityList.size() > 0) { |
| | | GridEntity gridEntity = gridEntityList.get(0); |
| | | // 设置场所范围 |
| | | placeEntity.setGridId(gridEntity.getId()); |
| | | placeEntity.setGridCode(gridEntity.getGridCode()); |
| | | // 更新网格范围绑定 |
| | | GridRangeEntity gridRangeEntity = new GridRangeEntity(); |
| | | gridRangeEntity.setGridId(gridEntity.getId()); |
| | | gridRangeEntity.setGridCode(gridEntity.getGridCode()); |
| | | gridRangeEntity.setHouseCode(placeEntity.getHouseCode()); |
| | | UpdateWrapper<GridRangeEntity> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.eq("house_code", placeEntity.getHouseCode()); |
| | | gridRangeService.update(gridRangeEntity, updateWrapper); |
| | | } |
| | | // 点坐标解析警格 |
| | | List<PoliceAffairsGridEntity> policeAffairsGridEntityList = policeAffairsGridService.spatialAnalysis(point); |
| | | if (policeAffairsGridEntityList.size() > 0) { |
| | | PoliceAffairsGridEntity policeAffairsGridEntity = policeAffairsGridEntityList.get(0); |
| | | placeEntity.setJwGridCode(policeAffairsGridEntity.getJwGridCode()); |
| | | } |
| | | } |
| | | |
| | |
| | | commonParamSet.getIsAdministrator() |
| | | ); |
| | | } |
| | | |
| | | /** |
| | | * 查询附近场所 |
| | | * @param lat |
| | | * @param lng |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<PlaceVO> getNearbyPlaceList(String lat, String lng) { |
| | | return baseMapper.getNearbyPlaceList(lat, lng); |
| | | } |
| | | } |