luodangjia
2025-01-07 d0542b6f8b7ead9cea467f12d989eaabb8ec6e60
medicalWaste-system/src/main/java/com/sinata/system/service/impl/SysDepartmentServiceImpl.java
@@ -161,6 +161,24 @@
        }
        return root;
    }
    public List<SysDepartmentVO> getRegionTree2(String keyword) {
        List<SysDepartmentVO> root = new ArrayList<>();
        SysDepartment currentDepartment = this.baseMapper.selectById(-1);
        if (Objects.isNull(currentDepartment)) {
            return root;
        }
        if (!currentDepartment.getOrgType().equals(DepartmentEnum.REGION.getCode())) {
            return root;
        }
        Map<Long, List<SysDepartment>> childrenMap = getChildrenDepartmentByOrgType(currentDepartment, Collections.singletonList(DepartmentEnum.REGION.getCode()));
        SysDepartmentVO sysDepartmentVO = fillChildrenTreeModel(currentDepartment, childrenMap);
        root.add(sysDepartmentVO);
        if (StringUtils.isNotBlank(keyword)) {
            treeMatch(root, keyword);
        }
        return root;
    }
    /**
     * 获取当前登录用户所属区域