Commit 5a026396 by 王祖波

好办消息通知去重

parent c9510909
......@@ -5,9 +5,7 @@ import static org.slf4j.LoggerFactory.getLogger;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
import cn.hutool.core.collection.ListUtil;
......@@ -194,15 +192,17 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
logger.info("企业为空:{}",wxEnterpriseId);
return;
}
// 用于成员去重
Set<String> userIdSet = new HashSet<>();
List<List<StaffClerkRelationDTO>> listList = ListUtil.split(v, 1000);
listList.forEach(list->{
sendMessage(notifyMessageBatchQDTO, list, qwDTO);
sendMessage(notifyMessageBatchQDTO, list,userIdSet, qwDTO);
});
});
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);
//好办模板
......@@ -224,7 +224,9 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
if(qwDTO.needOpenUserId3th()) {
wxUserId = relationDTO.getOpenUserId() ;
}
if (userIdSet.add(wxUserId)) {
wxUserIdList.add(wxUserId);
}
//消息组装 新增消息
NoticeMessageBO noticeMessageBO = new NoticeMessageBO();
noticeMessageBO.setCategoryType(messageTypeEnum.getCategory());
......
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