feat: 外标引用标准列表权限
This commit is contained in:
+7
@@ -156,4 +156,11 @@ public interface ISysDepartService extends IService<SysDepart>{
|
||||
* @return
|
||||
*/
|
||||
List<SysDepart> queryDeptByPid(String pid);
|
||||
|
||||
/**
|
||||
* 获取所有节点的Id
|
||||
* @param departList
|
||||
* @return
|
||||
*/
|
||||
List<String> getAllId(List<SysDepartTreeModel> departList);
|
||||
}
|
||||
|
||||
+33
@@ -558,6 +558,39 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
|
||||
return this.baseMapper.queryDeptByPid(pid);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取树形结构中所有节点的ID
|
||||
* @param departList 树形结构的根节点列表
|
||||
* @return 包含所有节点ID的列表
|
||||
*/
|
||||
@Override
|
||||
public List<String> getAllId(List<SysDepartTreeModel> departList) {
|
||||
List<String> ids = new ArrayList<>();
|
||||
for (SysDepartTreeModel depart : departList) {
|
||||
collectIds(depart, ids);
|
||||
}
|
||||
return ids;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归收集节点ID
|
||||
* @param node 当前节点
|
||||
* @param ids 收集到的ID列表
|
||||
*/
|
||||
private static void collectIds(SysDepartTreeModel node, List<String> ids) {
|
||||
if (node == null) {
|
||||
return;
|
||||
}
|
||||
ids.add(node.getId()); // 添加当前节点的ID
|
||||
List<SysDepartTreeModel> children = node.getChildren();
|
||||
if (children != null) {
|
||||
for (SysDepartTreeModel child : children) {
|
||||
collectIds(child, ids); // 递归处理子节点
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据关键字筛选部门信息
|
||||
* @param keyWord
|
||||
|
||||
Reference in New Issue
Block a user