| | |
| | | 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.modules.category.dto.CategoryDTO; |
| | | import org.springblade.modules.category.service.ICategoryService; |
| | | import org.springblade.modules.community.entity.CommunityEntity; |
| | |
| | | import org.springblade.modules.doorplateAddress.vo.DoorplateAddressVOTree; |
| | | 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.entity.HouseEntity; |
| | |
| | | import org.springblade.modules.place.service.IPlaceExtService; |
| | | 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; |
| | |
| | | if (null != houseParam.getRoleName() && !houseParam.getRoleName().equals("")) { |
| | | if (houseParam.getRoleName().equals("网格员") && !userId.equals("1726859808689696770")) { |
| | | // 查询对应的房屋地址code |
| | | stringList = gridService.getAddressCodeListByUserId(AuthUtil.getUserId()); |
| | | stringList = gridService.getAddressCodeListByUserId(AuthUtil.getUserId(),null); |
| | | } |
| | | } |
| | | return stringList; |
| | |
| | | if (!Strings.isBlank(doorplateAddress.getRoleName())) { |
| | | // 判断是否有权限 |
| | | if (doorplateAddress.getRoleName().equals("网格员")) { |
| | | list = gridService.getAddressCodeListByUserId(AuthUtil.getUserId()); |
| | | boolean contains = list.contains(doorplateAddress.getAddressCode()); |
| | | if (list.size() == 0 || !contains) { |
| | | list = gridService.getAddressCodeListByUserId(AuthUtil.getUserId(),doorplateAddress.getAddressCode()); |
| | | if (list.size() == 0) { |
| | | // 无权限 |
| | | doorplateAddressVO.setIsJur(2); |
| | | } else { |
| | |
| | | public List<DoorplateAddressVO> getHouseBuildingCode(String districtId) { |
| | | return baseMapper.getHouseBuildingCode(districtId); |
| | | } |
| | | |
| | | /** |
| | | * 网格范围数据处理 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean gridRangeDataHandle(String townName,String 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 |
| | | List<GridRangeEntity> gridRangeEntityList = new ArrayList<>(); |
| | | // 处理户室数据 |
| | | for (DoorplateAddressEntity doorplateAddressEntity : list) { |
| | | // 查询是否已存在,存在就插入,不存在则插入 |
| | | QueryWrapper<GridRangeEntity> wrapper = new QueryWrapper<>(); |
| | | 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); |
| | | } |
| | | } |
| | | // 批量插入 |
| | | gridRangeService.saveBatch(gridRangeEntityList); |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 设置警格网格信息 |
| | | * @param doorplateAddressEntity |
| | | */ |
| | | 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){ |
| | | GridEntity gridEntity = gridEntityList.get(0); |
| | | gridRangeEntity.setGridId(gridEntity.getId()); |
| | | gridRangeEntity.setGridCode(gridEntity.getGridCode()); |
| | | } |
| | | // //点坐标解析警格 |
| | | // List<PoliceAffairsGridEntity> policeAffairsGridEntityList = policeAffairsGridService.spatialAnalysis(point); |
| | | // if (policeAffairsGridEntityList.size()>0){ |
| | | // PoliceAffairsGridEntity policeAffairsGridEntity = policeAffairsGridEntityList.get(0); |
| | | // backblastPubRecord.setJwGridCode(policeAffairsGridEntity.getJwGridCode()); |
| | | // } |
| | | } |
| | | } |