| | |
| | | houseParam.setUserId(userId); |
| | | if (null != houseParam.getRoleName() && !houseParam.getRoleName().equals("")) { |
| | | if (houseParam.getRoleName().equals("民警") && !userId.equals("1726859808689696770")) { |
| | | // 查询对应的房屋地址code |
| | | stringList = policeAffairsGridService.getCommunityCodeListByUserId(AuthUtil.getUserId()); |
| | | // 查询对应社区编号集合 |
| | | stringList = SysCache.getPoliceRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | } |
| | | } |
| | | return stringList; |
| | |
| | | houseEntity.setUpdateTime(new Date()); |
| | | // 设置来源 1:地址总表 2:国控采集 |
| | | houseEntity.setSource(1); |
| | | // 根据位置设置网格,警格编号 |
| | | String point = "'POINT(" + doorplateAddressEntity.getX() + " " + doorplateAddressEntity.getY() + ")'"; |
| | | //点坐标解析网格 |
| | | List<GridEntity> gridEntityList = gridService.spatialAnalysis(point); |
| | | if (gridEntityList.size()>0){ |
| | | GridEntity gridEntity = gridEntityList.get(0); |
| | | houseEntity.setGridId(gridEntity.getId()); |
| | | houseEntity.setGridCode(gridEntity.getGridCode()); |
| | | } |
| | | //点坐标解析警格 |
| | | List<PoliceAffairsGridEntity> policeAffairsGridEntityList = policeAffairsGridService.spatialAnalysis(point); |
| | | if (policeAffairsGridEntityList.size()>0){ |
| | | PoliceAffairsGridEntity policeAffairsGridEntity = policeAffairsGridEntityList.get(0); |
| | | houseEntity.setJwGridCode(policeAffairsGridEntity.getJwGridCode()); |
| | | } |
| | | // 加入集合 |
| | | houseList.add(houseEntity); |
| | | } |
| | |
| | | placeEntity.setIsNine(2); |
| | | // 默认为现场采集 |
| | | placeEntity.setIsScene(1); |
| | | // 根据位置设置网格,警格编号 |
| | | String point = "'POINT(" + addressEntity.getX() + " " + addressEntity.getY() + ")'"; |
| | | //点坐标解析网格 |
| | | List<GridEntity> gridEntityList = gridService.spatialAnalysis(point); |
| | | if (gridEntityList.size()>0){ |
| | | GridEntity gridEntity = gridEntityList.get(0); |
| | | placeEntity.setGridId(gridEntity.getId()); |
| | | placeEntity.setGridCode(gridEntity.getGridCode()); |
| | | } |
| | | //点坐标解析警格 |
| | | List<PoliceAffairsGridEntity> policeAffairsGridEntityList = policeAffairsGridService.spatialAnalysis(point); |
| | | if (policeAffairsGridEntityList.size()>0){ |
| | | PoliceAffairsGridEntity policeAffairsGridEntity = policeAffairsGridEntityList.get(0); |
| | | placeEntity.setJwGridCode(policeAffairsGridEntity.getJwGridCode()); |
| | | } |
| | | // 加入集合 |
| | | // placeList.add(placeEntity); |
| | | // 保存 |
| | |
| | | wrapper.eq("house_code", doorplateAddressEntity.getAddressCode()); |
| | | GridRangeEntity one = gridRangeService.getOne(wrapper); |
| | | if (null == one) { |
| | | GridRangeEntity gridRangeEntity = new GridRangeEntity(); |
| | | gridRangeEntity.setHouseCode(doorplateAddressEntity.getAddressCode()); |
| | | gridRangeEntity.setDistrictCode(doorplateAddressEntity.getAoiCode()); |
| | | gridRangeEntity.setBuilding(doorplateAddressEntity.getBuildingCode()); |
| | | // 设置网格 |
| | | setGridInfo(doorplateAddressEntity,gridRangeEntity); |
| | | // 加入集合 |
| | | gridRangeEntityList.add(gridRangeEntity); |
| | | String point = "'POINT(" + doorplateAddressEntity.getX() + " " + doorplateAddressEntity.getY() + ")'"; |
| | | //点坐标解析网格 |
| | | List<GridEntity> gridEntityList = gridService.spatialAnalysis(point); |
| | | if (gridEntityList.size()>0){ |
| | | GridRangeEntity gridRangeEntity = new GridRangeEntity(); |
| | | gridRangeEntity.setHouseCode(doorplateAddressEntity.getAddressCode()); |
| | | gridRangeEntity.setDistrictCode(doorplateAddressEntity.getAoiCode()); |
| | | gridRangeEntity.setBuilding(doorplateAddressEntity.getBuildingCode()); |
| | | GridEntity gridEntity = gridEntityList.get(0); |
| | | gridRangeEntity.setGridId(gridEntity.getId()); |
| | | gridRangeEntity.setGridCode(gridEntity.getGridCode()); |
| | | // 加入集合 |
| | | gridRangeEntityList.add(gridRangeEntity); |
| | | } |
| | | } |
| | | } |
| | | // 批量插入 |