Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
wangxiaolu-sfa-common-core
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
sfa
wangxiaolu-sfa-common-core
Commits
b078e4c6
提交
b078e4c6
authored
7月 07, 2025
作者:
000516
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
根据部门ID查询上级部门树
上级
1ffc538b
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
26 行增加
和
1 行删除
+26
-1
FeiShuUtil.java
src/main/java/com/sfa/common/core/utils/sdk/FeiShuUtil.java
+26
-1
没有找到文件。
src/main/java/com/sfa/common/core/utils/sdk/FeiShuUtil.java
浏览文件 @
b078e4c6
...
...
@@ -122,7 +122,6 @@ public class FeiShuUtil {
public
Department
getDepartmentCorehr
(
String
deptId
)
{
// 判断部门ID,如果是"od-"开头,部门ID类型为"open_department_id",否则为"people_corehr_department_id"
String
departmentIdType
=
deptId
.
startsWith
(
"od-"
)
?
"open_department_id"
:
"people_corehr_department_id"
;
log
.
info
(
"部门ID<{}>所属类型为:{}"
,
deptId
,
departmentIdType
);
String
[]
deptIds
=
new
String
[]{
deptId
};
try
{
Client
client
=
getClientLUZX
();
...
...
@@ -160,6 +159,32 @@ public class FeiShuUtil {
}
}
public
DepartmentParentInfo
[]
getParentsDepartmentReq
(
String
deptId
){
// 延迟3s
String
[]
deptIds
=
new
String
[]{
deptId
};
String
departmentIdType
=
deptId
.
startsWith
(
"od-"
)
?
"open_department_id"
:
"people_corehr_department_id"
;
try
{
Client
client
=
getClientLUZX
();
ParentsDepartmentReq
req
=
ParentsDepartmentReq
.
newBuilder
()
.
departmentIdType
(
departmentIdType
)
.
parentsDepartmentReqBody
(
ParentsDepartmentReqBody
.
newBuilder
()
.
departmentIdList
(
deptIds
)
.
build
())
.
build
();
ParentsDepartmentResp
resp
=
client
.
corehr
().
v2
().
department
().
parents
(
req
);
if
(!
resp
.
success
())
{
log
.
error
(
"获取飞书人事部门上级树结构失效:code:{},msg:{},body{}"
,
resp
.
getCode
(),
resp
.
getMsg
(),
new
String
(
resp
.
getRawResponse
().
getBody
(),
UTF_8
));
return
null
;
}
return
resp
.
getData
().
getItems
()[
0
].
getParentDepartmentList
();
}
catch
(
Exception
e
)
{
log
.
error
(
"获取飞书人事部门上级树结构失效,停止执行!"
);
throw
new
RuntimeException
(
e
);
}
}
/**
* 根据部门父编码获取子部门
* 公司编码:"0"
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论