Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
attendance-performance-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
attendance-performance-platform
Commits
a9b5f524
Commit
a9b5f524
authored
Jan 25, 2024
by
周亚武
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
钉钉相关接口
parent
8851d215
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
11 deletions
+24
-11
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dingding/personal/service/IDingPersonService.java
.../module/dingding/personal/service/IDingPersonService.java
+2
-2
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dingding/personal/service/impl/DingPersonServiceImpl.java
...dingding/personal/service/impl/DingPersonServiceImpl.java
+22
-9
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dingding/personal/service/IDingPersonService.java
View file @
a9b5f524
...
...
@@ -83,8 +83,8 @@ public interface IDingPersonService extends IDingTalkService {
* @param endTime 审批实例结束时间,Unix时间戳,单位毫秒。
* @param nextToken 分页游标。如果是非首次调用,该参数传上次调用时返回的nextToken。
* @param maxResults 分页参数,每页大小,最多传20。
* @param phone
发起人电话
* @param phone
s 发起人电话列表 最大列表长度为10
*/
Rest
<
ListProcessInstanceIdsResponse
>
getProcessInstanceIdByPhone
(
String
processCode
,
long
startTime
,
long
endTime
,
long
nextToken
,
long
maxResults
,
String
phone
)
throws
Exception
;
Rest
<
ListProcessInstanceIdsResponse
>
getProcessInstanceIdByPhone
(
String
processCode
,
long
startTime
,
long
endTime
,
long
nextToken
,
long
maxResults
,
String
phone
s
)
throws
Exception
;
}
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dingding/personal/service/impl/DingPersonServiceImpl.java
View file @
a9b5f524
...
...
@@ -42,6 +42,7 @@ import org.springframework.util.ObjectUtils;
import
java.math.BigDecimal
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -195,7 +196,7 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID
* @param endTime 审批实例结束时间,Unix时间戳,单位毫秒。
* @param nextToken 分页游标。如果是非首次调用,该参数传上次调用时返回的nextToken。
* @param maxResults 分页参数,每页大小,最多传20。
* @param phone
发起人电话
* @param phone
s 发起人电话列表 最大列表长度为10
*
* @return 返回示例 {
* "result" : {
...
...
@@ -205,13 +206,27 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID
* "success" : true
* }
*/
public
Rest
<
ListProcessInstanceIdsResponse
>
getProcessInstanceIdByPhone
(
String
processCode
,
long
startTime
,
long
endTime
,
long
nextToken
,
long
maxResults
,
String
phone
)
throws
Exception
{
public
Rest
<
ListProcessInstanceIdsResponse
>
getProcessInstanceIdByPhone
(
String
processCode
,
long
startTime
,
long
endTime
,
long
nextToken
,
long
maxResults
,
String
phone
s
)
throws
Exception
{
String
userIds
=
""
;
if
(!
phones
.
isEmpty
()){
List
<
String
>
phonesList
=
Arrays
.
asList
(
phones
);
for
(
String
phone
:
phonesList
){
Rest
<
String
>
mobileRest
=
getPersonByMobile
(
phone
);
if
(
mobileRest
.
getCode
()
==
Rest
.
SUCCESS
)
{
String
userId
=
mobileRest
.
getData
();
if
(
mobileRest
.
getCode
()
==
Rest
.
SUCCESS
){
userIds
+=
mobileRest
.
getData
()+
","
;
}
}
}
//去掉末尾的逗号
if
(
userIds
.
endsWith
(
","
)){
userIds
=
userIds
.
substring
(
0
,
userIds
.
lastIndexOf
(
","
));
}
if
(!
userIds
.
equals
(
""
))
{
com
.
aliyun
.
dingtalkworkflow_1_0
.
Client
client
=
new
com
.
aliyun
.
dingtalkworkflow_1_0
.
Client
(
setConfig
());
com
.
aliyun
.
dingtalkworkflow_1_0
.
models
.
ListProcessInstanceIdsHeaders
listProcessInstanceIdsHeaders
=
new
com
.
aliyun
.
dingtalkworkflow_1_0
.
models
.
ListProcessInstanceIdsHeaders
();
listProcessInstanceIdsHeaders
.
xAcsDingtalkAccessToken
=
getToken
();
...
...
@@ -224,7 +239,7 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID
.
setEndTime
(
endTime
)
.
setNextToken
(
nextToken
)
.
setMaxResults
(
maxResults
)
.
setUserIds
(
java
.
util
.
Arrays
.
asList
(
userId
));
.
setUserIds
(
java
.
util
.
Arrays
.
asList
(
userId
s
));
try
{
ListProcessInstanceIdsResponse
rsp
=
client
.
listProcessInstanceIdsWithOptions
(
listProcessInstanceIdsRequest
,
listProcessInstanceIdsHeaders
,
new
RuntimeOptions
());
return
Rest
.
ok
(
"成功"
,
rsp
);
...
...
@@ -237,11 +252,9 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID
}
return
Rest
.
fail
(
"获取审批实例列表失败:"
+
com
.
aliyun
.
teautil
.
Common
.
empty
(
err
.
message
));
}
}
else
{
log
.
error
(
"根据手机号: "
+
phone
+
" 未查询到钉钉userid; erro->"
+
mobileRest
.
getMsg
());
return
Rest
.
fail
(
"根据手机号: "
+
phone
+
" 未查询到钉钉userid; erro->"
+
mobileRest
.
getMsg
());
}
return
Rest
.
fail
(
"根据手机号: "
+
phones
+
" 未查询到钉钉userid"
);
}
...
...
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