Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haoban3.0
haoban-manage3.0
Commits
7d3ead7c
Commit
7d3ead7c
authored
Jun 13, 2023
by
jinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分批次提交续期订单任务
parent
7d4dc912
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
11 deletions
+20
-11
LicenceOrderApiServiceImpl.java
.../service/out/impl/licence/LicenceOrderApiServiceImpl.java
+14
-10
StaffMapper.xml
...manage3-service/src/main/resources/mapper/StaffMapper.xml
+6
-1
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/licence/LicenceOrderApiServiceImpl.java
View file @
7d3ead7c
...
@@ -178,6 +178,7 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
...
@@ -178,6 +178,7 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
*/
*/
List
<
String
>
staffIdList
=
licenceOrderQDTO
.
getStaffIdList
();
List
<
String
>
staffIdList
=
licenceOrderQDTO
.
getStaffIdList
();
List
<
TabHaobanStaff
>
staffList
=
staffService
.
listStaffWithIds
(
staffIdList
);
List
<
TabHaobanStaff
>
staffList
=
staffService
.
listStaffWithIds
(
staffIdList
);
logger
.
info
(
"需要续期的成员idList:{}"
,
JSON
.
toJSONString
(
staffList
));
List
<
InvalidUserInfoDTO
>
invalidUserInfoDTOList
=
new
ArrayList
<>();
List
<
InvalidUserInfoDTO
>
invalidUserInfoDTOList
=
new
ArrayList
<>();
String
jobId
=
null
;
String
jobId
=
null
;
if
(
CollUtil
.
isEmpty
(
staffList
)){
if
(
CollUtil
.
isEmpty
(
staffList
)){
...
@@ -186,7 +187,6 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
...
@@ -186,7 +187,6 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
Map
<
String
,
TabHaobanStaff
>
collect
=
staffList
.
stream
().
collect
(
Collectors
.
toMap
(
TabHaobanStaff:
:
getWxUserId
,
a
->
a
));
Map
<
String
,
TabHaobanStaff
>
collect
=
staffList
.
stream
().
collect
(
Collectors
.
toMap
(
TabHaobanStaff:
:
getWxUserId
,
a
->
a
));
List
<
AccountListQDTO
>
userIdList
=
new
ArrayList
<>();
List
<
AccountListQDTO
>
userIdList
=
new
ArrayList
<>();
List
<
List
<
AccountListQDTO
>>
userIds
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
staffList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
staffList
.
size
();
i
++)
{
if
(
staffList
.
get
(
i
).
getWxUserId
()
!=
null
){
if
(
staffList
.
get
(
i
).
getWxUserId
()
!=
null
){
AccountListQDTO
accountListQDTO
=
new
AccountListQDTO
();
AccountListQDTO
accountListQDTO
=
new
AccountListQDTO
();
...
@@ -195,16 +195,18 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
...
@@ -195,16 +195,18 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
accountListQDTO
.
setUserid
(
staffList
.
get
(
i
).
getWxUserId
());
accountListQDTO
.
setUserid
(
staffList
.
get
(
i
).
getWxUserId
());
userIdList
.
add
(
accountListQDTO
);
userIdList
.
add
(
accountListQDTO
);
}
}
if
((
i
+
1
)
%
1000
==
0
)
{
userIds
.
add
(
userIdList
);
userIdList
.
clear
();
}
}
}
if
(
CollectionUtils
.
isNotEmpty
(
userIdList
))
{
if
(
CollUtil
.
isEmpty
(
userIdList
)){
userIds
.
add
(
userIdList
);
return
ServiceResponse
.
failure
(
"-9999"
,
"续期成员的userId查询为空!"
);
userIdList
.
clear
();
}
}
for
(
List
<
AccountListQDTO
>
list
:
userIds
){
//分批次处理 最多1000/次
int
limit
=
1000
;
int
size
=
userIdList
.
size
();
int
times
=
(
size
/
limit
+
1
);
for
(
int
i
=
1
;
i
<=
times
;
i
++)
{
int
from
=
(
i
-
1
)
*
limit
;
int
to
=
Math
.
min
(
i
*
limit
,
size
);
List
<
AccountListQDTO
>
list
=
userIdList
.
subList
(
from
,
to
);
logger
.
info
(
"续期成员个数{}"
,
list
.
size
());
logger
.
info
(
"续期成员个数{}"
,
list
.
size
());
ServiceResponse
<
CreateRenewOrderJobDTO
>
job
=
qywxOrderApiService
.
createRenewOrderJob
(
serviceCorpid
,
openCorpid
,
jobId
,
list
);
ServiceResponse
<
CreateRenewOrderJobDTO
>
job
=
qywxOrderApiService
.
createRenewOrderJob
(
serviceCorpid
,
openCorpid
,
jobId
,
list
);
logger
.
info
(
"企业微信续期订单接口返回信息:{}"
,
JSON
.
toJSONString
(
job
));
logger
.
info
(
"企业微信续期订单接口返回信息:{}"
,
JSON
.
toJSONString
(
job
));
...
@@ -230,9 +232,11 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
...
@@ -230,9 +232,11 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
}
}
}
else
{
}
else
{
logger
.
info
(
"企业微信创建续期任务接口返回失败"
);
logger
.
info
(
"企业微信创建续期任务接口返回失败"
);
return
ServiceResponse
.
failure
(
"-9999"
,
"企业微信创建续期任务接口返回失败"
);
return
ServiceResponse
.
failure
(
job
.
getCode
(),
job
.
getMessage
()
);
}
}
}
}
//提交任务订单
//提交任务订单
orderQDTO
.
setJobId
(
jobId
);
orderQDTO
.
setJobId
(
jobId
);
ServiceResponse
<
CreateOrderResponseDTO
>
submitOrderJob
=
qywxOrderApiService
.
submitOrderJob
(
serviceCorpid
,
openCorpid
,
orderQDTO
);
ServiceResponse
<
CreateOrderResponseDTO
>
submitOrderJob
=
qywxOrderApiService
.
submitOrderJob
(
serviceCorpid
,
openCorpid
,
orderQDTO
);
...
...
haoban-manage3-service/src/main/resources/mapper/StaffMapper.xml
View file @
7d3ead7c
...
@@ -349,7 +349,12 @@
...
@@ -349,7 +349,12 @@
and a.expire_time is not null
and a.expire_time is not null
</if>
</if>
</if>
</if>
<if
test=
"null != startTime"
>
and a.expire_time
<![CDATA[>=]]>
#{startTime}
</if>
<if
test=
"null != endTime"
>
and a.expire_time
<![CDATA[<=]]>
#{endTime}
</if>
<if
test=
"departmentIds != null and departmentIds.size() > 0"
>
<if
test=
"departmentIds != null and departmentIds.size() > 0"
>
and b.department_id IN
and b.department_id IN
<foreach
collection=
"departmentIds"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
<foreach
collection=
"departmentIds"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
...
...
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