Merge remote-tracking branch 'origin/master'
| | |
| | | |
| | | |
| | | /** |
| | | * 查询综治网格相关的网格,社区编号集合 |
| | | * 查询综治网格/公安相关的网格,社区编号集合 |
| | | * @param deptId |
| | | * @param communityCode |
| | | * @param roleName |
| | |
| | | List<String> list = new ArrayList<>(); |
| | | // 查询对应的区域编号code |
| | | Dept dept = deptService.getById(id); |
| | | // 只取综治的 |
| | | if (dept.getDeptNature() == 2) { |
| | | if (null != dept && !Strings.isBlank(dept.getRegionCode()) && !AuthUtil.isAdministrator()) { |
| | | // list = getGridRegionChildCodes(dept.getRegionCode(),communityCode,roleName); |
| | | if (dept.getRegionCode() == null) { |
| | | return; |
| | | } |
| | | list = CacheUtil.get(SYS_CACHE, REGION_CHILDCODES_CODE, finalKey, List.class); |
| | | if (list == null || list.size()==0) { |
| | | list = new ArrayList<>(); |
| | | List<Region> deptChild = getGridRegionChild(dept.getRegionCode(),communityCode,roleName); |
| | | if (deptChild != null) { |
| | | List<String> collect = deptChild.stream().map(Region::getCode).collect(Collectors.toList()); |
| | | list.addAll(collect); |
| | | if (null != dept) { |
| | | if ( |
| | | (roleName.equals("mj") && dept.getDeptNature()==1) || |
| | | ( |
| | | (roleName.equals("wgy") || roleName.equals("wzcj")) && dept.getDeptNature()==2 |
| | | ) |
| | | ){ |
| | | if (!AuthUtil.isAdministrator()) { |
| | | if (dept.getRegionCode() == null) { |
| | | return; |
| | | } |
| | | // finalRegionCodeList.add(dept.getRegionCode()); |
| | | } |
| | | |
| | | //行政区划不为空添加进集合 |
| | | if (list.size() > 0) { |
| | | finalRegionCodeList.addAll(list); |
| | | list = CacheUtil.get(SYS_CACHE, REGION_CHILDCODES_CODE, finalKey, List.class); |
| | | if (list == null || list.size() == 0) { |
| | | list = new ArrayList<>(); |
| | | List<Region> deptChild = getGridRegionChild(dept.getRegionCode(), communityCode, roleName); |
| | | if (deptChild != null) { |
| | | List<String> collect = deptChild.stream().map(Region::getCode).collect(Collectors.toList()); |
| | | list.addAll(collect); |
| | | } |
| | | } |
| | | //行政区划不为空添加进集合 |
| | | if (list.size() > 0) { |
| | | finalRegionCodeList.addAll(list); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId(), communityCode); |
| | | // 民警角色 |
| | | if (!Strings.isBlank(roleName) && roleName.equals("mj")) { |
| | | regionChildCodesList = SysCache.getPoliceRegionChildCodesByDeptId(AuthUtil.getDeptId(),communityCode); |
| | | regionChildCodesList = SysCache.getGridRegionChildCodesByDeptId(AuthUtil.getDeptId(),communityCode,roleName); |
| | | } |
| | | } |
| | | // 获取网格编号集合 |
| | |
| | | BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); |
| | | // boolQueryBuilder.should(QueryBuilders.matchQuery("content", esParam.getSearchKey())); |
| | | // boolQueryBuilder.should(QueryBuilders.matchQuery("name", esParam.getSearchKey())); |
| | | boolQueryBuilder.must(QueryBuilders.matchQuery("title", esParam.getSearchKey())); |
| | | boolQueryBuilder.should(QueryBuilders.matchQuery("title", esParam.getSearchKey())); |
| | | // boolQueryBuilder.should(QueryBuilders.matchQuery("location", esParam.getSearchKey())); |
| | | // boolQueryBuilder.should(QueryBuilders.matchQuery("phone", esParam.getSearchKey())); |
| | | // boolQueryBuilder.should(QueryBuilders.matchQuery("idCard", esParam.getSearchKey())); |
| | |
| | | } |
| | | if (roleName.equals("mj")) { |
| | | // 查询对应的社区编号 |
| | | communityList = SysCache.getPoliceRegionChildCodesByDeptId(AuthUtil.getDeptId(),null); |
| | | communityList = SysCache.getGridRegionChildCodesByDeptId(AuthUtil.getDeptId(),null,roleName); |
| | | } |
| | | // 查询街道 |
| | | List<TreeStringNode> townList = baseMapper.getRegionListByGroupTwon(houseParam, stringList, communityList); |
| | |
| | | if (null != houseParam.getRoleName() && !houseParam.getRoleName().equals("")) { |
| | | if (houseParam.getRoleName().equals("mj") && !userId.equals("1726859808689696770")) { |
| | | // 查询对应社区编号集合 |
| | | stringList = SysCache.getPoliceRegionChildCodesByDeptId(AuthUtil.getDeptId(),null); |
| | | stringList = SysCache.getGridRegionChildCodesByDeptId(AuthUtil.getDeptId(),null,houseParam.getRoleName()); |
| | | } |
| | | } |
| | | return stringList; |
| | |
| | | // 无权限 |
| | | doorplateAddressVO.setIsJur(2); |
| | | // 查询对应的社区code |
| | | list = SysCache.getPoliceRegionChildCodesByDeptId(AuthUtil.getDeptId(),null); |
| | | list = SysCache.getGridRegionChildCodesByDeptId(AuthUtil.getDeptId(),null,roleName); |
| | | if (null != list && list.size() > 0) { |
| | | boolean contains = list.contains(doorplateAddressVO.getNeiCode()); |
| | | if (contains) { |
| | |
| | | * |
| | | * @param householdEntity |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveOrUpdateUser(HouseholdEntity householdEntity) { |
| | | if (null != householdEntity.getPhoneNumber() && !householdEntity.getPhoneNumber().equals("")) { |
| | | //根据手机号查询库里的数据 |
| | | User userParams = new User(); |
| | | userParams.setPhone(householdEntity.getPhoneNumber()); |
| | | User user = userService.getOne(Condition.getQueryWrapper(userParams)); |
| | | if (null != user) { |
| | | List<User> list = userService.getUserListByPhoneOrAccount(householdEntity.getPhoneNumber()); |
| | | if (list.size()>0) { |
| | | User user = list.get(0); |
| | | //如果用户存在,则该用户id绑定住户 |
| | | householdEntity.setAssociatedUserId(user.getId()); |
| | | // 判断用户是否包含了居民角色,不包含则需更新 |
| | |
| | | // 查询公安对应的辖区树 |
| | | return NodeTreeUtil.getStringNodeTree(baseMapper.getPoliceTreeList()); |
| | | } |
| | | // 综治的需要查到网格 |
| | | if (region.getDeptNature()==2){ |
| | | region.setCityCode("361100"); |
| | | } |
| | | } |
| | | // 非公安 |
| | | return NodeTreeUtil.getStringNodeTree(baseMapper.getTreeList(region,regionChildCodesList,isAdministrator)); |
| | |
| | | // 查询综治区域集合 |
| | | List<Region> regionChildList = baseMapper.getGridRegionChildList(regionCode); |
| | | list.addAll(regionChildList); |
| | | }else if (!Strings.isBlank(roleName) && roleName.equals("mj")){ |
| | | // 查询公安相关的区域数据 |
| | | List<Region> regionList = baseMapper.getPoliceList(communityCode); |
| | | if (regionList.size()>0) { |
| | | List<Region> policeList = treeRegionList(regionList,regionCode, list); |
| | | list.addAll(policeList); |
| | | } |
| | | }else { |
| | | // 查询综治区域集合 |
| | | List<Region> regionChildList = baseMapper.getRegionChildList(regionCode, communityCode, roleName); |
| | |
| | | //递归遍历下一级 |
| | | treeRegionList(regionList,region.getCode(),list); |
| | | } |
| | | if(region.getCode().equals(parentCode)){ |
| | | // 本身也加入 |
| | | list.add(region); |
| | | } |
| | | } |
| | | return list; |
| | | } |