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
1ffc538b
提交
1ffc538b
authored
7月 02, 2025
作者:
000516
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
飞书日志形式修改
上级
77548800
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
7 行增加
和
13 行删除
+7
-13
FeiShuUtil.java
src/main/java/com/sfa/common/core/utils/sdk/FeiShuUtil.java
+7
-13
没有找到文件。
src/main/java/com/sfa/common/core/utils/sdk/FeiShuUtil.java
浏览文件 @
1ffc538b
...
@@ -31,7 +31,6 @@ import org.springframework.stereotype.Component;
...
@@ -31,7 +31,6 @@ import org.springframework.stereotype.Component;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Objects
;
/**
/**
* @author : liqiulin
* @author : liqiulin
...
@@ -106,8 +105,7 @@ public class FeiShuUtil {
...
@@ -106,8 +105,7 @@ public class FeiShuUtil {
.
userAccessToken
(
userAccessToken
)
.
userAccessToken
(
userAccessToken
)
.
build
());
.
build
());
if
(!
resp
.
success
())
{
if
(!
resp
.
success
())
{
log
.
error
(
String
.
format
(
"code:%s,msg:%s,reqId:%s, resp:%s"
,
log
.
error
(
"根据userAccessToken获取用户信息失败:code:{},msg:{},body{}"
,
resp
.
getCode
(),
resp
.
getMsg
(),
new
String
(
resp
.
getRawResponse
().
getBody
(),
UTF_8
));
resp
.
getCode
(),
resp
.
getMsg
(),
resp
.
getRequestId
(),
Jsons
.
createGSON
(
true
,
false
).
toJson
(
JsonParser
.
parseString
(
new
String
(
resp
.
getRawResponse
().
getBody
(),
"UTF-8"
)))));
return
null
;
return
null
;
}
}
return
resp
.
getData
();
return
resp
.
getData
();
...
@@ -151,8 +149,7 @@ public class FeiShuUtil {
...
@@ -151,8 +149,7 @@ public class FeiShuUtil {
BatchGetDepartmentResp
resp
=
client
.
corehr
().
v2
().
department
().
batchGet
(
req
);
BatchGetDepartmentResp
resp
=
client
.
corehr
().
v2
().
department
().
batchGet
(
req
);
// 处理服务端错误
// 处理服务端错误
if
(!
resp
.
success
())
{
if
(!
resp
.
success
())
{
log
.
error
(
String
.
format
(
"code:%s,msg:%s,reqId:%s, resp:%s"
,
log
.
error
(
"获取飞书部门信息失败:code:{},msg:{},body{}"
,
resp
.
getCode
(),
resp
.
getMsg
(),
new
String
(
resp
.
getRawResponse
().
getBody
(),
UTF_8
));
resp
.
getCode
(),
resp
.
getMsg
(),
resp
.
getRequestId
(),
Jsons
.
createGSON
(
true
,
false
).
toJson
(
JsonParser
.
parseString
(
new
String
(
resp
.
getRawResponse
().
getBody
(),
UTF_8
)))));
return
null
;
return
null
;
}
}
Department
[]
items
=
resp
.
getData
().
getItems
();
Department
[]
items
=
resp
.
getData
().
getItems
();
...
@@ -177,8 +174,7 @@ public class FeiShuUtil {
...
@@ -177,8 +174,7 @@ public class FeiShuUtil {
.
build
();
.
build
();
ChildrenDepartmentResp
resp
=
client
.
contact
().
department
().
children
(
req
);
ChildrenDepartmentResp
resp
=
client
.
contact
().
department
().
children
(
req
);
if
(!
resp
.
success
())
{
if
(!
resp
.
success
())
{
log
.
error
(
String
.
format
(
"%s,code:%s,msg:%s,reqId:%s, resp:%s"
,
"根据部门父编码获取子部门失败"
,
log
.
error
(
"根据部门父编码获取子部门失败:code:{},msg:{},body{}"
,
resp
.
getCode
(),
resp
.
getMsg
(),
new
String
(
resp
.
getRawResponse
().
getBody
(),
UTF_8
));
resp
.
getCode
(),
resp
.
getMsg
(),
resp
.
getRequestId
(),
Jsons
.
createGSON
(
true
,
false
).
toJson
(
JsonParser
.
parseString
(
new
String
(
resp
.
getRawResponse
().
getBody
(),
UTF_8
)))));
return
null
;
return
null
;
}
}
JSONArray
items
=
JSONObject
.
parse
(
Jsons
.
DEFAULT
.
toJson
(
resp
.
getData
())).
getJSONArray
(
"items"
);
JSONArray
items
=
JSONObject
.
parse
(
Jsons
.
DEFAULT
.
toJson
(
resp
.
getData
())).
getJSONArray
(
"items"
);
...
@@ -203,8 +199,7 @@ public class FeiShuUtil {
...
@@ -203,8 +199,7 @@ public class FeiShuUtil {
.
build
();
.
build
();
FindByDepartmentUserResp
resp
=
client
.
contact
().
user
().
findByDepartment
(
req
);
FindByDepartmentUserResp
resp
=
client
.
contact
().
user
().
findByDepartment
(
req
);
if
(!
resp
.
success
())
{
if
(!
resp
.
success
())
{
log
.
error
(
String
.
format
(
"%s,code:%s,msg:%s,reqId:%s, resp:%s"
,
"获取部门用户"
,
log
.
error
(
"获取部门用户:code:{},msg:{},body{}"
,
resp
.
getCode
(),
resp
.
getMsg
(),
new
String
(
resp
.
getRawResponse
().
getBody
(),
UTF_8
));
resp
.
getCode
(),
resp
.
getMsg
(),
resp
.
getRequestId
(),
Jsons
.
createGSON
(
true
,
false
).
toJson
(
JsonParser
.
parseString
(
new
String
(
resp
.
getRawResponse
().
getBody
(),
UTF_8
)))));
return
null
;
return
null
;
}
}
JSONArray
items
=
JSONObject
.
parse
(
Jsons
.
DEFAULT
.
toJson
(
resp
.
getData
())).
getJSONArray
(
"items"
);
JSONArray
items
=
JSONObject
.
parse
(
Jsons
.
DEFAULT
.
toJson
(
resp
.
getData
())).
getJSONArray
(
"items"
);
...
@@ -291,8 +286,8 @@ public class FeiShuUtil {
...
@@ -291,8 +286,8 @@ public class FeiShuUtil {
GetInstanceResp
resp
=
client
.
approval
().
v4
().
instance
().
get
(
req
);
GetInstanceResp
resp
=
client
.
approval
().
v4
().
instance
().
get
(
req
);
// 处理服务端错误
// 处理服务端错误
if
(!
resp
.
success
())
{
if
(!
resp
.
success
())
{
throw
new
RuntimeException
(
String
.
format
(
"%s,code:%s,msg:%s,reqId:%s, resp:%s"
,
"创建飞书审批失败"
,
log
.
error
(
"创建飞书审批失败:code:{},msg:{},body{}"
,
resp
.
getCode
(),
resp
.
getMsg
(),
new
String
(
resp
.
getRawResponse
().
getBody
(),
UTF_8
));
resp
.
getCode
(),
resp
.
getMsg
(),
resp
.
getRequestId
(),
Jsons
.
createGSON
(
true
,
false
).
toJson
(
JsonParser
.
parseString
(
new
String
(
resp
.
getRawResponse
().
getBody
(),
UTF_8
)))))
;
return
null
;
}
}
return
JSONObject
.
toJSONString
(
resp
.
getData
());
return
JSONObject
.
toJSONString
(
resp
.
getData
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -378,8 +373,7 @@ public class FeiShuUtil {
...
@@ -378,8 +373,7 @@ public class FeiShuUtil {
BatchGetEmployeeResp
resp
=
client
.
corehr
().
v2
().
employee
().
batchGet
(
req
);
BatchGetEmployeeResp
resp
=
client
.
corehr
().
v2
().
employee
().
batchGet
(
req
);
// 处理服务端错误
// 处理服务端错误
if
(!
resp
.
success
())
{
if
(!
resp
.
success
())
{
log
.
error
(
String
.
format
(
"code:%s,msg:%s,reqId:%s, resp:%s"
,
log
.
error
(
"批量查询员工信息:code:{},msg:{},body{}"
,
resp
.
getCode
(),
resp
.
getMsg
(),
new
String
(
resp
.
getRawResponse
().
getBody
(),
UTF_8
));
resp
.
getCode
(),
resp
.
getMsg
(),
resp
.
getRequestId
(),
Jsons
.
createGSON
(
true
,
false
).
toJson
(
JsonParser
.
parseString
(
new
String
(
resp
.
getRawResponse
().
getBody
(),
UTF_8
)))));
return
null
;
return
null
;
}
}
// 只查询一个员工
// 只查询一个员工
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论