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
1
Merge Requests
1
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
be72f9cf
Commit
be72f9cf
authored
Apr 21, 2023
by
songyinghui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 分片写
parent
739c5280
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
GroupMessageServiceImpl.java
...service/service/content/impl/GroupMessageServiceImpl.java
+13
-3
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/content/impl/GroupMessageServiceImpl.java
View file @
be72f9cf
...
@@ -34,6 +34,7 @@ import com.gic.wechat.api.dto.qywx.group.QywxGroupMsgSendResultDTO;
...
@@ -34,6 +34,7 @@ import com.gic.wechat.api.dto.qywx.group.QywxGroupMsgSendResultDTO;
import
com.gic.wechat.api.dto.qywx.group.QywxMomentRespDTO
;
import
com.gic.wechat.api.dto.qywx.group.QywxMomentRespDTO
;
import
com.gic.wechat.api.dto.qywx.group.QywxMomentSendResultRespDTO
;
import
com.gic.wechat.api.dto.qywx.group.QywxMomentSendResultRespDTO
;
import
com.gic.wechat.api.service.qywx.QywxSuiteApiService
;
import
com.gic.wechat.api.service.qywx.QywxSuiteApiService
;
import
com.google.common.collect.Lists
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -344,12 +345,15 @@ public class GroupMessageServiceImpl implements GroupMessageService {
...
@@ -344,12 +345,15 @@ public class GroupMessageServiceImpl implements GroupMessageService {
log
.
info
(
"处理导购群发朋友圈触达客户日志, 成员无好友. staffId:{}"
,
clerkShareLogBo
.
getStaffId
());
log
.
info
(
"处理导购群发朋友圈触达客户日志, 成员无好友. staffId:{}"
,
clerkShareLogBo
.
getStaffId
());
return
;
return
;
}
}
List
<
TriggerCustomerDetailBO
>
customerDetailBos
=
externalUserIds
.
stream
()
List
<
List
<
String
>>
partition
=
Lists
.
partition
(
externalUserIds
,
1000
);
for
(
List
<
String
>
userIds
:
partition
)
{
List
<
TriggerCustomerDetailBO
>
customerDetailBos
=
userIds
.
stream
()
.
map
(
item
->
this
.
convertCustomerDetailLog
(
clerkShareLogBo
,
item
))
.
map
(
item
->
this
.
convertCustomerDetailLog
(
clerkShareLogBo
,
item
))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
triggerCustomerDetailService
.
batchSave
(
customerDetailBos
);
triggerCustomerDetailService
.
batchSave
(
customerDetailBos
);
}
}
}
}
}
/**
/**
* 获取与分享日志匹配msgId
* 获取与分享日志匹配msgId
...
@@ -551,12 +555,15 @@ public class GroupMessageServiceImpl implements GroupMessageService {
...
@@ -551,12 +555,15 @@ public class GroupMessageServiceImpl implements GroupMessageService {
if
(
CollectionUtils
.
isEmpty
(
groupMsgSendResultInfos
))
{
if
(
CollectionUtils
.
isEmpty
(
groupMsgSendResultInfos
))
{
return
;
return
;
}
}
List
<
TriggerCustomerDetailBO
>
customerDetailBos
=
groupMsgSendResultInfos
List
<
List
<
QywxGroupMsgSendResultDTO
.
GroupMsgSendResultInfo
>>
partition
=
Lists
.
partition
(
groupMsgSendResultInfos
,
1000
);
for
(
List
<
QywxGroupMsgSendResultDTO
.
GroupMsgSendResultInfo
>
msgSendResultInfos
:
partition
)
{
List
<
TriggerCustomerDetailBO
>
customerDetailBos
=
msgSendResultInfos
.
stream
()
.
stream
()
.
map
(
item
->
this
.
convertCustomerDetailLog
(
clerkShareLogBO
,
item
.
getExternalUserId
()))
.
map
(
item
->
this
.
convertCustomerDetailLog
(
clerkShareLogBO
,
item
.
getExternalUserId
()))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
triggerCustomerDetailService
.
batchSave
(
customerDetailBos
);
triggerCustomerDetailService
.
batchSave
(
customerDetailBos
);
}
}
}
/**
/**
* 保存触达日志明细 群发到群
* 保存触达日志明细 群发到群
...
@@ -569,12 +576,15 @@ public class GroupMessageServiceImpl implements GroupMessageService {
...
@@ -569,12 +576,15 @@ public class GroupMessageServiceImpl implements GroupMessageService {
if
(
CollectionUtils
.
isEmpty
(
groupChatUserBos
))
{
if
(
CollectionUtils
.
isEmpty
(
groupChatUserBos
))
{
return
;
return
;
}
}
List
<
TriggerCustomerDetailBO
>
customerDetailBos
=
groupChatUserBos
List
<
List
<
GroupChatUserBO
>>
partition
=
Lists
.
partition
(
groupChatUserBos
,
1000
);
for
(
List
<
GroupChatUserBO
>
groupChatUserBOS
:
partition
)
{
List
<
TriggerCustomerDetailBO
>
customerDetailBos
=
groupChatUserBOS
.
stream
()
.
stream
()
.
map
(
item
->
this
.
convertCustomerDetailLog
(
clerkShareLogBO
,
item
.
getUserId
()))
.
map
(
item
->
this
.
convertCustomerDetailLog
(
clerkShareLogBO
,
item
.
getUserId
()))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
triggerCustomerDetailService
.
batchSave
(
customerDetailBos
);
triggerCustomerDetailService
.
batchSave
(
customerDetailBos
);
}
}
}
private
TriggerCustomerDetailBO
convertCustomerDetailLog
(
ClerkShareLogBO
clerkShareLogBO
,
String
externalUserId
)
{
private
TriggerCustomerDetailBO
convertCustomerDetailLog
(
ClerkShareLogBO
clerkShareLogBO
,
String
externalUserId
)
{
TriggerCustomerDetailBO
temp
=
new
TriggerCustomerDetailBO
();
TriggerCustomerDetailBO
temp
=
new
TriggerCustomerDetailBO
();
...
...
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