| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.springblade.common.cache.SysCache; |
| | | import org.springblade.common.constant.CommonConstant; |
| | | import org.springblade.common.constant.DictConstant; |
| | | import org.springblade.common.node.TreeStringNode; |
| | | import org.springblade.common.param.CommonParamSet; |
| | |
| | | import org.springblade.common.utils.NodeTreeUtil; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.modules.backblast.entity.BackblastPubRecordEntity; |
| | | import org.springblade.core.tool.utils.ObjectUtil; |
| | | import org.springblade.modules.category.dto.CategoryDTO; |
| | | import org.springblade.modules.category.service.ICategoryService; |
| | | import org.springblade.modules.community.entity.CommunityEntity; |
| | |
| | | import org.springblade.modules.doorplateAddress.vo.FuncNode; |
| | | import org.springblade.modules.grid.entity.GridEntity; |
| | | import org.springblade.modules.grid.entity.GridRangeEntity; |
| | | import org.springblade.modules.grid.entity.GridmanEntity; |
| | | import org.springblade.modules.grid.service.IGridRangeService; |
| | | import org.springblade.modules.grid.service.IGridService; |
| | | import org.springblade.modules.grid.service.IGridmanService; |
| | |
| | | import org.springblade.modules.house.vo.HouseholdVO; |
| | | import org.springblade.modules.place.entity.PlaceEntity; |
| | | import org.springblade.modules.place.entity.PlaceExtEntity; |
| | | import org.springblade.modules.place.entity.PlacePoiLabel; |
| | | import org.springblade.modules.place.service.IPlaceExtService; |
| | | import org.springblade.modules.place.service.IPlacePoiLabelService; |
| | | import org.springblade.modules.place.service.IPlaceService; |
| | | import org.springblade.modules.place.vo.PlaceVO; |
| | | import org.springblade.modules.police.entity.PoliceAffairsGridEntity; |
| | | import org.springblade.modules.police.service.IPoliceAffairsGridService; |
| | | import org.springblade.modules.system.entity.Region; |
| | | import org.springblade.modules.system.service.IRegionService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | /** |
| | | * 根据角色获取功能集合数据 |
| | | * |
| | | * @param type 1:查社区 2:查房屋和场所(居民角色)--2024/04/10 弃用 |
| | | * @param type 1:查社区 2:查房屋和场所(居民角色)--2024/04/10 弃用 |
| | | * @param roleNames --2024/04/10 弃用 |
| | | * @return |
| | | */ |
| | |
| | | List<TreeStringNode> list = new ArrayList<>(); |
| | | // 获取请求头中的角色别名 |
| | | String roleName = SpringUtils.getRequestParam("roleName"); |
| | | // 如果是网格管理员,系统管理员,民警,无诈场所采集 |
| | | if (roleName.equals("admin") || |
| | | roleName.equals("wzcj") || |
| | | roleName.equals("wgy") || |
| | | roleName.equals("mj")) |
| | | { |
| | | houseParam.setRoleName(roleName); |
| | | if ((roleName.equals("wgy") || roleName.equals("wzcj")) |
| | | && !userId.equals("1726859808689696770")) { |
| | | // 查询对应的网格code |
| | | if (!Strings.isBlank(roleName)) { |
| | | // 如果是网格管理员,系统管理员,民警,无诈场所采集 |
| | | if (roleName.equals("admin") || roleName.equals("wzcj") || |
| | | roleName.equals("wgy") || roleName.equals("mj")) { |
| | | houseParam.setRoleName(roleName); |
| | | if ((roleName.equals("wgy") || roleName.equals("wzcj")) |
| | | && !userId.equals("1726859808689696770")) { |
| | | // 查询对应的网格code |
| | | // stringList = gridService.getGridListByUserId(AuthUtil.getUserId()); |
| | | stringList = SysCache.getGridRegionChildCodesByDeptId(AuthUtil.getDeptId(),null,roleName); |
| | | } |
| | | if (roleName.equals("mj")) { |
| | | // 查询对应的社区编号 |
| | | communityList = SysCache.getGridRegionChildCodesByDeptId(AuthUtil.getDeptId(),null,roleName); |
| | | } |
| | | // 查询街道 |
| | | List<TreeStringNode> townList = baseMapper.getRegionListByGroupTwon(houseParam, stringList, communityList); |
| | | // 查询社区 |
| | | List<TreeStringNode> neiList = baseMapper.getRegionListByGroupNei(houseParam, stringList, communityList); |
| | | // 遍历 |
| | | for (TreeStringNode treeNode : townList) { |
| | | stringList = SysCache.getGridRegionChildCodesByDeptId(AuthUtil.getDeptId(), null, roleName); |
| | | } |
| | | if (roleName.equals("mj")) { |
| | | // 查询对应的社区编号 |
| | | communityList = SysCache.getGridRegionChildCodesByDeptId(AuthUtil.getDeptId(), null, roleName); |
| | | } |
| | | // 查询街道 |
| | | List<TreeStringNode> townList = baseMapper.getRegionListByGroupTwon(houseParam, stringList, communityList); |
| | | // 查询社区 |
| | | List<TreeStringNode> neiList = baseMapper.getRegionListByGroupNei(houseParam, stringList, communityList); |
| | | // 查询网格 |
| | | if (stringList.size() > 0) { |
| | | List<GridEntity> list1 = gridService.list(Wrappers.<GridEntity>lambdaQuery().in(GridEntity::getGridCode, stringList)); |
| | | } |
| | | // 遍历 |
| | | for (TreeStringNode node : neiList) { |
| | | if (treeNode.getId().equals(node.getParentId())) { |
| | | node.setHasChildren(false); |
| | | treeNode.getChildren().add(node); |
| | | for (TreeStringNode treeNode : townList) { |
| | | // 遍历 |
| | | for (TreeStringNode node : neiList) { |
| | | if (treeNode.getId().equals(node.getParentId())) { |
| | | node.setHasChildren(false); |
| | | treeNode.getChildren().add(node); |
| | | } |
| | | } |
| | | } |
| | | // 查询区域数据 |
| | | return townList; |
| | | } |
| | | // 查询区域数据 |
| | | return townList; |
| | | } |
| | | // 如果是居民 |
| | | if (roleName.equals("inhabitant")) { |
| | | return getInhabitantInfo(list); |
| | | // 如果是居民 |
| | | if (roleName.equals("inhabitant") || roleName.equals("xyzt") || roleName.equals("xyty")) { |
| | | return getInhabitantInfo(list); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | |
| | | List<TreeStringNode> list = new ArrayList<>(); |
| | | Map<String, Object> map = new HashMap<>(2); |
| | | String roleName = SpringUtils.getRequestParam("roleName"); |
| | | if (!Strings.isBlank(roleName)){ |
| | | if (!Strings.isBlank(roleName)) { |
| | | houseParam.setRoleName(roleName); |
| | | } |
| | | // 获取网格员对应的地址编号集合 |
| | |
| | | } |
| | | // 查楼栋,街路巷 |
| | | if (houseParam.getType() == 2) { |
| | | return getBuildLevelData(houseParam,addressCodeList, map); |
| | | return getBuildLevelData(houseParam, addressCodeList, map); |
| | | } |
| | | // 查户室 |
| | | if (houseParam.getType() == 3) { |
| | | return getHouseLevelData(houseParam,addressCodeList, map); |
| | | return getHouseLevelData(houseParam, addressCodeList, map); |
| | | } |
| | | return list; |
| | | } |
| | |
| | | */ |
| | | private void getGridInfoByGridman(HouseParam houseParam) { |
| | | if (houseParam.getRoleName().equals("wgy")) { |
| | | if (Strings.isBlank(houseParam.getRoleName())){ |
| | | if (Strings.isBlank(houseParam.getRoleName())) { |
| | | houseParam.setRoleName(SpringUtils.getRequestParam("roleName")); |
| | | } |
| | | // 查询网格员的网格编号集合 |
| | | List<String> gridCodeList |
| | | = SysCache.getGridRegionChildCodesByDeptId(AuthUtil.getDeptId(), null, houseParam.getRoleName()); |
| | | String communityCode = SpringUtils.getRequestParam("communityCode"); |
| | | List<GridVO> list = gridService.getGridListByComAndList(communityCode,gridCodeList); |
| | | if (list.size()>0){ |
| | | List<GridVO> list = gridService.getGridListByComAndList(communityCode, gridCodeList); |
| | | if (list.size() > 0) { |
| | | GridVO grid = list.get(0); |
| | | houseParam.setCommunityName(grid.getCommunityName()); |
| | | houseParam.setGridName(grid.getGridName()); |
| | |
| | | * @param map |
| | | * @return |
| | | */ |
| | | private Map<String, Object> getHouseLevelData(HouseParam houseParam, List<String> stringList,Map<String, Object> map) { |
| | | private Map<String, Object> getHouseLevelData(HouseParam houseParam, List<String> stringList, Map<String, Object> map) { |
| | | // 判断地址类型 |
| | | if (houseParam.getAddressType() == 1) { |
| | | List<FuncNode> aoiList = new ArrayList<>(); |
| | |
| | | * @param map |
| | | * @return |
| | | */ |
| | | private Object getBuildLevelData(HouseParam houseParam,List<String> stringList, Map<String, Object> map) { |
| | | private Object getBuildLevelData(HouseParam houseParam, List<String> stringList, Map<String, Object> map) { |
| | | if (houseParam.getAddressType() == 4) { |
| | | // 获取网格员对应的网格信息 |
| | | getGridInfoByGridman(houseParam); |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object getHouseRentInfo(String code,Long houseId) { |
| | | public Object getHouseRentInfo(String code, Long houseId) { |
| | | DoorplateAddressVO doorplateAddressDetailVO = new DoorplateAddressVO(); |
| | | if (Strings.isBlank(code) && null!=houseId) { |
| | | if (Strings.isBlank(code) && null != houseId) { |
| | | // 先查询门牌信息 |
| | | doorplateAddressDetailVO = baseMapper.getDoorplateAddressDetailByHouseId(houseId); |
| | | }else { |
| | | } else { |
| | | // 先查询门牌信息 |
| | | doorplateAddressDetailVO = baseMapper.getDoorplateAddressDetailByCode(code); |
| | | } |
| | | if (null != doorplateAddressDetailVO) { |
| | | // 查询房屋出租情况 |
| | | List<HouseRentalVO> houseRentalVOS = houseRentalService.getHouseRentalListByCode(code); |
| | | List<HouseRentalVO> houseRentalVOS = houseRentalService.getHouseRentalListByCode(doorplateAddressDetailVO.getAddressCode()); |
| | | // 查询房屋人员情况 |
| | | List<HouseholdVO> householdVOS = householdService.getHouseholdListByCode(code); |
| | | List<HouseholdVO> householdVOS = householdService.getHouseholdListByCode(doorplateAddressDetailVO.getAddressCode()); |
| | | // 设置数据 |
| | | doorplateAddressDetailVO.setHouseRentalList(houseRentalVOS); |
| | | doorplateAddressDetailVO.setHouseholdList(householdVOS); |
| | |
| | | @Override |
| | | public List<DoorplateAddressVOTree> getHouseTree(HouseParam houseParam) { |
| | | String roleName = SpringUtils.getRequestParam("roleName"); |
| | | if (!Strings.isBlank(roleName)){ |
| | | if (!Strings.isBlank(roleName)) { |
| | | houseParam.setRoleName(roleName); |
| | | } |
| | | List<String> stringList = getHouseCodeList(houseParam); |
| | |
| | | // 查询对应的房屋地址code |
| | | // addressCodeList = gridService.getAddressCodeListByUserId(AuthUtil.getUserId(),null); |
| | | addressCodeList = |
| | | gridService.getAddressCodeListByGridCodeList(SpringUtils.getRequestParam("communityCode"),gridCodeList); |
| | | gridService.getAddressCodeListByGridCodeList(SpringUtils.getRequestParam("communityCode"), gridCodeList); |
| | | } |
| | | } |
| | | return addressCodeList; |
| | |
| | | if (null != houseParam.getRoleName() && !houseParam.getRoleName().equals("")) { |
| | | if (houseParam.getRoleName().equals("mj") && !userId.equals("1726859808689696770")) { |
| | | // 查询对应社区编号集合 |
| | | stringList = SysCache.getGridRegionChildCodesByDeptId(AuthUtil.getDeptId(),null,houseParam.getRoleName()); |
| | | stringList = SysCache.getGridRegionChildCodesByDeptId(AuthUtil.getDeptId(), null, houseParam.getRoleName()); |
| | | } |
| | | } |
| | | return stringList; |
| | |
| | | String point = "'POINT(" + doorplateAddressEntity.getX() + " " + doorplateAddressEntity.getY() + ")'"; |
| | | //点坐标解析网格 |
| | | List<GridEntity> gridEntityList = gridService.spatialAnalysis(point); |
| | | if (gridEntityList.size()>0){ |
| | | 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){ |
| | | if (policeAffairsGridEntityList.size() > 0) { |
| | | PoliceAffairsGridEntity policeAffairsGridEntity = policeAffairsGridEntityList.get(0); |
| | | houseEntity.setJwGridCode(policeAffairsGridEntity.getJwGridCode()); |
| | | } |
| | |
| | | // 加入集合 |
| | | districtService.save(districtEntity); |
| | | // aoiList.add(districtEntity); |
| | | } else { |
| | | // 更新 |
| | | one.setCommunityCode(addressEntity.getNeiCode()); |
| | | one.setAoiCode(addressEntity.getAoiCode()); |
| | | one.setName(addressEntity.getAoiName()); |
| | | one.setAddress(addressEntity.getAddressName()); |
| | | one.setLng(addressEntity.getX()); |
| | | one.setLat(addressEntity.getY()); |
| | | // 加入集合 |
| | | districtService.updateById(one); |
| | | } |
| | | // else { |
| | | // // 更新 |
| | | // one.setCommunityCode(addressEntity.getNeiCode()); |
| | | // one.setAoiCode(addressEntity.getAoiCode()); |
| | | // one.setName(addressEntity.getAoiName()); |
| | | // one.setAddress(addressEntity.getAddressName()); |
| | | // one.setLng(addressEntity.getX()); |
| | | // one.setLat(addressEntity.getY()); |
| | | // // 加入集合 |
| | | // districtService.updateById(one); |
| | | // } |
| | | } |
| | | // 批量插入 |
| | | // districtService.saveBatch(aoiList); |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Object placeDataHandle(String townName) { |
| | | // 查询所有的地址表和场所表差集集合 |
| | | List<DoorplateAddressEntity> list = baseMapper.getNotInPlaceList(townName); |
| | | // 创建场所集合对象 |
| | | List<PlaceEntity> placeList = new ArrayList<>(); |
| | | if (list.size() > 0) { |
| | | // 将场所数据保存到场所表中 |
| | | for (DoorplateAddressEntity addressEntity : list) { |
| | | // pio 名称不为空的进行插入操作 |
| | | // if (!Strings.isBlank(addressEntity.getPoi())) { |
| | | PlaceEntity placeEntity = new PlaceEntity(); |
| | | placeEntity.setHouseCode(addressEntity.getAddressCode()); |
| | | placeEntity.setPlaceName(addressEntity.getPoi()); |
| | | placeEntity.setLng(addressEntity.getX()); |
| | | placeEntity.setLat(addressEntity.getY()); |
| | | placeEntity.setLocation(addressEntity.getAddressName()); |
| | | // 设置来源( 1:地址总表 2:国控采集 3:商超) |
| | | placeEntity.setSource(1); |
| | | // 待完善 |
| | | placeEntity.setStatus(1); |
| | | // 默认为非九小场所 |
| | | 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()); |
| | | // 查询总数 |
| | | Integer count = baseMapper.getNotPlaceListCount(townName); |
| | | if (count > 0) { |
| | | int num = count / 1000; |
| | | for (int i = 0; i <= num + 1; i++) { |
| | | // 查询所有的地址表和场所表差集集合 |
| | | List<DoorplateAddressEntity> list = baseMapper.getNotInPlaceList(townName); |
| | | if (list.size() > 0) { |
| | | // 将场所数据保存到场所表中 |
| | | for (DoorplateAddressEntity addressEntity : list) { |
| | | // pio 名称不为空的进行插入操作 |
| | | PlaceEntity placeEntity = new PlaceEntity(); |
| | | placeEntity.setHouseCode(addressEntity.getAddressCode()); |
| | | placeEntity.setPlaceName(addressEntity.getPoi()); |
| | | placeEntity.setLng(addressEntity.getX()); |
| | | placeEntity.setLat(addressEntity.getY()); |
| | | placeEntity.setLocation(addressEntity.getAddressName()); |
| | | // 设置来源( 1:地址总表 2:国控采集 3:商超) |
| | | placeEntity.setSource(1); |
| | | // 待完善 |
| | | placeEntity.setStatus(1); |
| | | // 默认为非九小场所 |
| | | 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()); |
| | | } |
| | | // 保存 |
| | | placeService.save(placeEntity); |
| | | // 新增场所详情 |
| | | savePlaceExtAndTaskInfo(placeEntity); |
| | | } |
| | | } |
| | | //点坐标解析警格 |
| | | List<PoliceAffairsGridEntity> policeAffairsGridEntityList = policeAffairsGridService.spatialAnalysis(point); |
| | | if (policeAffairsGridEntityList.size()>0){ |
| | | PoliceAffairsGridEntity policeAffairsGridEntity = policeAffairsGridEntityList.get(0); |
| | | placeEntity.setJwGridCode(policeAffairsGridEntity.getJwGridCode()); |
| | | } |
| | | // 加入集合 |
| | | // placeList.add(placeEntity); |
| | | // 保存 |
| | | placeService.save(placeEntity); |
| | | // 新增场所详情 |
| | | savePlaceExtAndTaskInfo(placeEntity); |
| | | // } |
| | | } |
| | | // 批量插入 |
| | | // savePlaceExtAndTaskInfo(placeList); |
| | | } |
| | | // 返回 |
| | | return null; |
| | |
| | | List<String> list = new ArrayList<>(); |
| | | // 扫码时调用,需判断是否有权限查看 |
| | | DoorplateAddressVO doorplateAddressVO = baseMapper.getDoorplateAddressVODetail(doorplateAddress); |
| | | // 创建数组 |
| | | String[] schoolName = {"幼儿园", "小学", "中学", "高中", "大专", "学校"}; |
| | | List<String> stringList = new ArrayList<>(Arrays.asList(schoolName)); |
| | | if (null != doorplateAddressVO) { |
| | | if (Strings.isNotBlank(doorplateAddressVO.getAoiName()) && stringList.stream() |
| | | .anyMatch(doorplateAddressVO.getAoiName()::contains)) { |
| | | doorplateAddressVO.setAddressLevel(1); |
| | | doorplateAddressVO.setDoorplateType(DictConstant.centre_DOORPLATE); |
| | | } |
| | | if (Strings.isNotBlank(doorplateAddressVO.getPoi()) && stringList.stream() |
| | | .anyMatch(doorplateAddressVO.getPoi()::contains)) { |
| | | doorplateAddressVO.setAddressLevel(1); |
| | | doorplateAddressVO.setDoorplateType(DictConstant.centre_DOORPLATE); |
| | | } |
| | | |
| | | // 不限制 |
| | | doorplateAddressVO.setIsJur(1); |
| | | String roleName = SpringUtils.getRequestParam("roleName"); |
| | |
| | | // 无权限 |
| | | doorplateAddressVO.setIsJur(2); |
| | | // list = gridService.getAddressCodeListByUserId(AuthUtil.getUserId(),doorplateAddress.getAddressCode()); |
| | | list = SysCache.getGridRegionChildCodesByDeptId(AuthUtil.getDeptId(),null,roleName); |
| | | list = SysCache.getGridRegionChildCodesByDeptId(AuthUtil.getDeptId(), null, roleName); |
| | | if (null != list && list.size() > 0) { |
| | | List<String> arrayList = new ArrayList<>(); |
| | | for (String gridCode : list) { |
| | | if (gridCode.length()>12) { |
| | | if (gridCode.length() > 12) { |
| | | arrayList.add(gridCode.substring(0, gridCode.length() - 2)); |
| | | }else { |
| | | } else { |
| | | arrayList.add(gridCode); |
| | | } |
| | | } |
| | |
| | | doorplateAddressVO.setIsJur(1); |
| | | } |
| | | } |
| | | }else if (roleName.equals("mj")) { |
| | | } else if (roleName.equals("mj")) { |
| | | // 无权限 |
| | | doorplateAddressVO.setIsJur(2); |
| | | // 查询对应的社区code |
| | | list = SysCache.getGridRegionChildCodesByDeptId(AuthUtil.getDeptId(),null,roleName); |
| | | list = SysCache.getGridRegionChildCodesByDeptId(AuthUtil.getDeptId(), null, roleName); |
| | | if (null != list && list.size() > 0) { |
| | | boolean contains = list.contains(doorplateAddressVO.getNeiCode()); |
| | | if (contains) { |
| | |
| | | doorplateAddressVO.setIsJur(1); |
| | | } |
| | | } |
| | | if(doorplateAddressVO != null ){ |
| | | if (doorplateAddressVO != null) { |
| | | // 获取房屋标签 |
| | | IUserHouseLabelService userHouseLabelService = SpringUtils.getBean(IUserHouseLabelService.class); |
| | | List<UserHouseLabelEntity> houseLabelEntityList = userHouseLabelService.list(Wrappers.<UserHouseLabelEntity>lambdaQuery() |
| | | .eq(UserHouseLabelEntity::getHouseCode, doorplateAddressVO.getAddressCode()) |
| | | .eq(UserHouseLabelEntity::getLableType, 2)); |
| | | doorplateAddressVO.setUserHouseLabelVOList(houseLabelEntityList); |
| | | // 查询房屋类别 |
| | | IPlacePoiLabelService poiLabelService = SpringUtils.getBean(IPlacePoiLabelService.class); |
| | | PlacePoiLabel placePoiLabel = poiLabelService.getOne(Wrappers.<PlacePoiLabel>lambdaQuery() |
| | | .eq(PlacePoiLabel::getPlaceId, doorplateAddressVO.getPid()) |
| | | .eq(PlacePoiLabel::getType, CommonConstant.NUMBER_THREE)); |
| | | if (ObjectUtil.isNotEmpty(placePoiLabel)) { |
| | | doorplateAddressVO.setLableCode(placePoiLabel.getPoiCode()); |
| | | } |
| | | } |
| | | return doorplateAddressVO; |
| | | } |
| | |
| | | |
| | | /** |
| | | * 网格范围数据处理 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean gridRangeDataHandle(String townName,String communityName) { |
| | | public boolean gridRangeDataHandle(String townName, String communityName) { |
| | | // 查询未匹配的网格范围地址信息 |
| | | // 查询总数 |
| | | Integer count = baseMapper.getNotBindGridRangeDoorListCount(townName,communityName); |
| | | Integer count = baseMapper.getNotBindGridRangeDoorListCount(townName, communityName); |
| | | if (count > 0) { |
| | | IGridRangeService gridRangeService = SpringUtils.getBean(IGridRangeService.class); |
| | | int num = count / 1000; |
| | | for (int i = 0; i <= num + 1; i++) { |
| | | // 查询所有未匹配的网格范围地址数据 |
| | | List<DoorplateAddressEntity> list = baseMapper.getNotBindGridRangeDoorList(townName,communityName); |
| | | List<DoorplateAddressEntity> list = baseMapper.getNotBindGridRangeDoorList(townName, communityName); |
| | | // 需要新增的网格范围 list |
| | | List<GridRangeEntity> gridRangeEntityList = new ArrayList<>(); |
| | | // 处理户室数据 |
| | |
| | | String point = "'POINT(" + doorplateAddressEntity.getX() + " " + doorplateAddressEntity.getY() + ")'"; |
| | | //点坐标解析网格 |
| | | List<GridEntity> gridEntityList = gridService.spatialAnalysis(point); |
| | | if (gridEntityList.size()>0){ |
| | | if (gridEntityList.size() > 0) { |
| | | GridRangeEntity gridRangeEntity = new GridRangeEntity(); |
| | | gridRangeEntity.setHouseCode(doorplateAddressEntity.getAddressCode()); |
| | | gridRangeEntity.setDistrictCode(doorplateAddressEntity.getAoiCode()); |
| | |
| | | |
| | | /** |
| | | * 设置警格网格信息 |
| | | * |
| | | * @param doorplateAddressEntity |
| | | */ |
| | | public void setGridInfo(DoorplateAddressEntity doorplateAddressEntity,GridRangeEntity gridRangeEntity) { |
| | | public void setGridInfo(DoorplateAddressEntity doorplateAddressEntity, GridRangeEntity gridRangeEntity) { |
| | | // 根据位置设置网格,警格编号 |
| | | // IPoliceAffairsGridService policeAffairsGridService = SpringUtils.getBean(IPoliceAffairsGridService.class); |
| | | String point = "'POINT(" + doorplateAddressEntity.getX() + " " + doorplateAddressEntity.getY() + ")'"; |
| | | //点坐标解析网格 |
| | | List<GridEntity> gridEntityList = gridService.spatialAnalysis(point); |
| | | if (gridEntityList.size()>0){ |
| | | if (gridEntityList.size() > 0) { |
| | | GridEntity gridEntity = gridEntityList.get(0); |
| | | gridRangeEntity.setGridId(gridEntity.getId()); |
| | | gridRangeEntity.setGridCode(gridEntity.getGridCode()); |