Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
邬吉朋
ops
Commits
c2726c0e
Commit
c2726c0e
authored
Feb 28, 2025
by
wujipeng
Browse files
钉钉-获取子部门ID列表
parent
78ffcc9a
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/java/com/ruzhoukj/sms/controller/DingAttendanceController.java
View file @
c2726c0e
...
...
@@ -33,16 +33,15 @@ public class DingAttendanceController {
@ApiOperation
(
value
=
"获取子部门ID列表"
)
@GetMapping
(
"/child/{deptId}"
)
public
List
<
Long
>
getChildIdList
(
@PathVariable
Stri
ng
deptId
)
{
public
List
<
Long
>
getChildIdList
(
@PathVariable
Lo
ng
deptId
)
{
String
accessToken
=
permissionConfig
.
getAccessToken
();
try
{
DingTalkClient
client
=
new
DefaultDingTalkClient
(
"https://oapi.dingtalk.com/topapi/v2/department/listsubid"
);
OapiV2DepartmentListsubidRequest
req
=
new
OapiV2DepartmentListsubidRequest
();
OapiV2DepartmentListsubidResponse
rsp
=
client
.
execute
(
req
,
""
);
req
.
setDeptId
(
Long
.
valueOf
(
deptId
));
Map
<
String
,
String
>
textParams
=
req
.
getTextParams
();
textParams
.
put
(
"access_token"
,
accessToken
);
req
.
setDeptId
(
deptId
);
req
.
setHttpMethod
(
"POST"
);
OapiV2DepartmentListsubidResponse
rsp
=
client
.
execute
(
req
,
accessToken
);
OapiV2DepartmentListsubidResponse
.
DeptListSubIdResponse
result
=
rsp
.
getResult
();
return
result
.
getDeptIdList
();
}
catch
(
ApiException
e
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment