BUG-12572: 给cm发消息时,按人做过滤
This commit is contained in:
parent
3c8ba8e42e
commit
e977cc5bbe
@ -23,7 +23,9 @@ import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static java.util.stream.Collectors.toList;
|
||||
import static java.util.stream.Collectors.toSet;
|
||||
@ -116,10 +118,14 @@ public class TemplateMessage {
|
||||
imReq.setMsgTemplateContent(JSON.toJSONString(sendVo));
|
||||
// 接收人
|
||||
ArrayList<ReceivePerson> receivers = new ArrayList<>();
|
||||
Set<Long> cmUniquePersonIds = new HashSet<>();
|
||||
for (PersonV3DTO receiver : req.receivers()) {
|
||||
PersonV3DTO.ReceiveModel imReceiveModel = receiver.getImReceiveModel();
|
||||
Long ouId = imReceiveModel == null ? req.determineReceiversOuId() : imReceiveModel.getOuId();
|
||||
for (AppTypeEnum app : apps) {
|
||||
if (app == AppTypeEnum.CM && !cmUniquePersonIds.add(receiver.getId())) {
|
||||
continue;
|
||||
}
|
||||
receivers.add(new ReceivePerson(String.valueOf(receiver.getId()), ouId, app));
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ public class MnsProperties {
|
||||
/**
|
||||
* 业务上每天发送重复内容的次数限制
|
||||
*/
|
||||
private long bizLimitPerDay = 20;
|
||||
private long bizLimitPerDay = 10;
|
||||
|
||||
/**
|
||||
* 验证码15分钟内发送的内容都是一样的
|
||||
|
||||
Loading…
Reference in New Issue
Block a user