| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import liquibase.repackaged.org.apache.commons.lang3.StringUtils; |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.springblade.common.constant.DictConstant; |
| | | import org.springblade.common.node.TreeStringNode; |
| | | import org.springblade.common.utils.ComplexNumberStringComparator; |
| | | import org.springblade.common.utils.NodeTreeUtil; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.modules.category.dto.CategoryLabelDTO; |
| | | import org.springblade.modules.category.service.ICategoryLabelService; |
| | | 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.community.service.ICommunityService; |
| | | import org.springblade.modules.district.entity.DistrictEntity; |
| | |
| | | private IDistrictService districtService; |
| | | |
| | | @Autowired |
| | | private ICategoryLabelService iCategoryLabelService; |
| | | private ICategoryService iCategoryService; |
| | | |
| | | @Autowired |
| | | private ICommunityService communityService; |
| | |
| | | List<TreeStringNode> placeNodeList = placeService.selectPlaceNodeList(AuthUtil.getUserId()); |
| | | for (TreeStringNode treeNode : placeNodeList) { |
| | | treeNode.setAddressType(2); |
| | | CategoryLabelDTO categoryLabelDTO = new CategoryLabelDTO(); |
| | | categoryLabelDTO.setPlaceId(treeNode.getId()); |
| | | List<CategoryLabelDTO> categoryLabelDTOS = iCategoryLabelService.selectCategoryLabelList(categoryLabelDTO); |
| | | treeNode.setCategoryLabelList(categoryLabelDTOS); |
| | | CategoryDTO categoryDTO = new CategoryDTO(); |
| | | categoryDTO.setPlaceId(treeNode.getId()); |
| | | List<CategoryDTO> categoryDTOS = iCategoryService.selectCategoryLabelList(categoryDTO); |
| | | treeNode.setCategoryList(categoryDTOS); |
| | | // if (DictConstant.SMALL_DOORPLATE.equals(treeNode.getDoorplateType()) || |
| | | // (DictConstant.centre_DOORPLATE.equals(treeNode.getDoorplateType()) && |
| | | // treeNode.getAddressLevel().equals(1))) { |
| | |
| | | houseNode.setId("1"); |
| | | houseNode.setHasChildren(true); |
| | | houseNode.setChildren(houseNodeList); |
| | | list.add(houseNode); |
| | | |
| | | TreeStringNode placeNode = new TreeStringNode(); |
| | | placeNode.setName("场所"); |
| | | placeNode.setId("2"); |
| | | placeNode.setHasChildren(true); |
| | | placeNode.setChildren(placeNodeList); |
| | | |
| | | list.add(houseNode); |
| | | list.add(placeNode); |
| | | // 返回 |
| | | return list; |
| | | } |
| | | if (houseNodeList.size()>0){ |
| | | list = houseNodeList; |
| | | TreeStringNode houseNode = new TreeStringNode(); |
| | | houseNode.setName("房屋"); |
| | | houseNode.setId("1"); |
| | | houseNode.setHasChildren(true); |
| | | houseNode.setChildren(houseNodeList); |
| | | list.add(houseNode); |
| | | } |
| | | if (placeNodeList.size()>0){ |
| | | list = placeNodeList; |
| | | TreeStringNode placeNode = new TreeStringNode(); |
| | | placeNode.setName("场所"); |
| | | placeNode.setId("2"); |
| | | placeNode.setHasChildren(true); |
| | | placeNode.setChildren(placeNodeList); |
| | | list.add(placeNode); |
| | | } |
| | | // 返回 |
| | | return list; |
| | |
| | | getGridInfoByGridman(houseParam); |
| | | // 查询商超 |
| | | List<FuncNode> doorplateNameList = baseMapper.getPlaceRelDetailList(houseParam); |
| | | // 按单元(网格)分组 |
| | | Map<String, List<FuncNode>> listMap = doorplateNameList.stream().collect(Collectors.groupingBy(FuncNode::getUnitName)); |
| | | // |
| | | List<FuncNode> tempList = new ArrayList<>(); |
| | | // 遍历 |
| | | listMap.forEach((s, temps) -> { |
| | | FuncNode funcNode = new FuncNode(); |
| | | funcNode.setUnitName(s); |
| | | funcNode.setAddressType(4); |
| | | funcNode.setUnitCode(temps.get(0).getUnitCode()); |
| | | funcNode.setChildren(temps); |
| | | // 查询网格对应的排序 |
| | | QueryWrapper<GridEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("community_code",funcNode.getUnitCode()).eq("grid_name",funcNode.getUnitName()); |
| | | // 查询网格 |
| | | GridEntity one = gridService.getOne(wrapper); |
| | | if (null!=one){ |
| | | funcNode.setSort(one.getSort()); |
| | | } |
| | | tempList.add(funcNode); |
| | | }); |
| | | // 排序 |
| | | List<FuncNode> sortList = tempList.stream().sorted(Comparator.comparing(X -> X.getSort())).collect(Collectors.toList()); |
| | | map.put("aoiList",new ArrayList<>()); |
| | | map.put("shopList",doorplateNameList); |
| | | map.put("shopList",sortList); |
| | | // 返回 |
| | | return map; |
| | | } |
| | |
| | | firstKey = key; |
| | | break; |
| | | } |
| | | if (firstKey.equals("未知单元")){ |
| | | // 取出数据按楼层分组 |
| | | List<FuncNode> unitList = listMap.get(firstKey); |
| | | Map<String, List<FuncNode>> floorListMap = unitList.stream().collect(Collectors.groupingBy(FuncNode::getFloor)); |
| | | List<FuncNode> funcNodeList = new ArrayList<>(); |
| | | floorListMap.forEach((s, temps) -> { |
| | | FuncNode funcNode = new FuncNode(); |
| | | funcNode.setFloor(s); |
| | | funcNode.setChildren(temps); |
| | | funcNode.setAddressType(1); |
| | | funcNodeList.add(funcNode); |
| | | }); |
| | | // 取出数据按楼层分组 |
| | | List<FuncNode> unitList = listMap.get(firstKey); |
| | | Map<String, List<FuncNode>> floorListMap = unitList.stream().collect(Collectors.groupingBy(FuncNode::getFloor)); |
| | | List<FuncNode> funcNodeList = new ArrayList<>(); |
| | | floorListMap.forEach((s, temps) -> { |
| | | FuncNode funcNode = new FuncNode(); |
| | | funcNode.setUnitName("一单元"); |
| | | funcNode.setChildren(funcNodeList); |
| | | funcNode.setFloor(s); |
| | | funcNode.setChildren(temps); |
| | | funcNode.setAddressType(1); |
| | | list.add(funcNode); |
| | | funcNodeList.add(funcNode); |
| | | }); |
| | | FuncNode funcNode = new FuncNode(); |
| | | if (firstKey.equals("未知单元")) { |
| | | funcNode.setUnitName("一单元"); |
| | | }else { |
| | | funcNode.setUnitName(firstKey); |
| | | } |
| | | funcNode.setChildren(funcNodeList); |
| | | funcNode.setAddressType(1); |
| | | list.add(funcNode); |
| | | } |
| | | } |
| | | |
| | |
| | | placeEntity.setPlaceName(addressEntity.getPoi()); |
| | | placeEntity.setLng(addressEntity.getX()); |
| | | placeEntity.setLat(addressEntity.getY()); |
| | | placeEntity.setLocaltion(addressEntity.getAddressName()); |
| | | placeEntity.setLocation(addressEntity.getAddressName()); |
| | | // 设置来源( 1:地址总表 2:国控采集) |
| | | placeEntity.setSource(1); |
| | | // 加入集合 |
| | |
| | | // 扫码时调用,需判断是否有权限查看 |
| | | DoorplateAddressVO one = baseMapper.getDoorplateAddressVODetail(doorplateAddress); |
| | | if (null!=one){ |
| | | // 不限制 |
| | | one.setIsJur(1); |
| | | if (!Strings.isBlank(doorplateAddress.getRoleName())) { |
| | | // 判断是否有权限 |
| | | if (doorplateAddress.getRoleName().equals("网格员")) { |
| | |
| | | }else { |
| | | one.setIsJur(1); |
| | | } |
| | | }else if (doorplateAddress.getRoleName().equals("民警")){ |
| | | // 查询对应的社区code |
| | | list = communityService.getCommunityCodeListByUserId(AuthUtil.getUserId()); |
| | | boolean contains = list.contains(doorplateAddress.getNeiCode().replaceAll("0+$", "")); |
| | | if (list.size()==0 || !contains){ |
| | | // 无权限 |
| | | one.setIsJur(2); |
| | | }else { |
| | | one.setIsJur(1); |
| | | } |
| | | }else { |
| | | // 不限制 |
| | | one.setIsJur(1); |