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
5a026396
Commit
5a026396
authored
Mar 16, 2023
by
王祖波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
好办消息通知去重
parent
c9510909
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
NoticeMessageApiServiceImpl.java
...rvice/service/notify/out/NoticeMessageApiServiceImpl.java
+8
-6
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/notify/out/NoticeMessageApiServiceImpl.java
View file @
5a026396
...
@@ -5,9 +5,7 @@ import static org.slf4j.LoggerFactory.getLogger;
...
@@ -5,9 +5,7 @@ import static org.slf4j.LoggerFactory.getLogger;
import
java.io.UnsupportedEncodingException
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
java.net.URLEncoder
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.charset.StandardCharsets
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
cn.hutool.core.collection.ListUtil
;
import
cn.hutool.core.collection.ListUtil
;
...
@@ -194,15 +192,17 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
...
@@ -194,15 +192,17 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
logger
.
info
(
"企业为空:{}"
,
wxEnterpriseId
);
logger
.
info
(
"企业为空:{}"
,
wxEnterpriseId
);
return
;
return
;
}
}
// 用于成员去重
Set
<
String
>
userIdSet
=
new
HashSet
<>();
List
<
List
<
StaffClerkRelationDTO
>>
listList
=
ListUtil
.
split
(
v
,
1000
);
List
<
List
<
StaffClerkRelationDTO
>>
listList
=
ListUtil
.
split
(
v
,
1000
);
listList
.
forEach
(
list
->{
listList
.
forEach
(
list
->{
sendMessage
(
notifyMessageBatchQDTO
,
list
,
qwDTO
);
sendMessage
(
notifyMessageBatchQDTO
,
list
,
userIdSet
,
qwDTO
);
});
});
});
});
return
ServiceResponse
.
success
();
return
ServiceResponse
.
success
();
}
}
private
void
sendMessage
(
NotifyMessageBatchQDTO
notifyMessageBatchQDTO
,
List
<
StaffClerkRelationDTO
>
list
,
WxEnterpriseQwDTO
qwDTO
)
{
private
void
sendMessage
(
NotifyMessageBatchQDTO
notifyMessageBatchQDTO
,
List
<
StaffClerkRelationDTO
>
list
,
Set
<
String
>
userIdSet
,
WxEnterpriseQwDTO
qwDTO
)
{
//企业微信模板
//企业微信模板
List
<
TemplateContentBO
>
contentList
=
getDescriotion
(
notifyMessageBatchQDTO
);
List
<
TemplateContentBO
>
contentList
=
getDescriotion
(
notifyMessageBatchQDTO
);
//好办模板
//好办模板
...
@@ -224,7 +224,9 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
...
@@ -224,7 +224,9 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
if
(
qwDTO
.
needOpenUserId3th
())
{
if
(
qwDTO
.
needOpenUserId3th
())
{
wxUserId
=
relationDTO
.
getOpenUserId
()
;
wxUserId
=
relationDTO
.
getOpenUserId
()
;
}
}
wxUserIdList
.
add
(
wxUserId
);
if
(
userIdSet
.
add
(
wxUserId
))
{
wxUserIdList
.
add
(
wxUserId
);
}
//消息组装 新增消息
//消息组装 新增消息
NoticeMessageBO
noticeMessageBO
=
new
NoticeMessageBO
();
NoticeMessageBO
noticeMessageBO
=
new
NoticeMessageBO
();
noticeMessageBO
.
setCategoryType
(
messageTypeEnum
.
getCategory
());
noticeMessageBO
.
setCategoryType
(
messageTypeEnum
.
getCategory
());
...
...
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