Commit c004b49c by 王祖波

Merge branch 'bugfix-20231225' into 'master'

企微接口1000批次发送

See merge request !1595
parents 1b810b1a 78b4359a
...@@ -332,6 +332,9 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService { ...@@ -332,6 +332,9 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
if (ObjectUtil.isNull(noticeMessageTypeEnum)) { if (ObjectUtil.isNull(noticeMessageTypeEnum)) {
return ServiceResponse.failure("-1", "模版枚举不存在"); return ServiceResponse.failure("-1", "模版枚举不存在");
} }
List<String> userIdList = relationList.stream().map(StaffClerkRelationDTO::getClerkId).distinct().collect(Collectors.toList());
List<List<String>> listList = ListUtil.split(userIdList, 1000);
for (List<String> list : listList) {
noticeMessageHandler.sendMessage(NoticeMessageForm.builder() noticeMessageHandler.sendMessage(NoticeMessageForm.builder()
.messageCode(noticeMessageTypeEnum.getMessageCode()) .messageCode(noticeMessageTypeEnum.getMessageCode())
.mqRouterCode(noticeMessageTypeEnum.getRouterCode()) .mqRouterCode(noticeMessageTypeEnum.getRouterCode())
...@@ -339,8 +342,9 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService { ...@@ -339,8 +342,9 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
.createTime(new Date()) .createTime(new Date())
.enterpriseId(notifyMessageBatchQDTO.getEnterpriseId()) .enterpriseId(notifyMessageBatchQDTO.getEnterpriseId())
.uniqueKey(UniqueIdUtils.uniqueLongHex()) .uniqueKey(UniqueIdUtils.uniqueLongHex())
.userIdList(relationList.stream().map(StaffClerkRelationDTO::getClerkId).distinct().collect(Collectors.toList())) .userIdList(list)
.variableMap(variableMap).build()); .variableMap(variableMap).build());
}
} catch (Exception e) { } catch (Exception e) {
logger.error("发送消息通知失败",e); logger.error("发送消息通知失败",e);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment