|
@@ -22,6 +22,7 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
import java.time.LocalDate;
|
|
|
import java.util.Calendar;
|
|
|
import java.util.Date;
|
|
|
+import java.util.LinkedList;
|
|
|
import java.util.List;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -104,6 +105,24 @@ public class CXCommonUtils {
|
|
|
log.debug("开始通过fegin发送消息通知: {}", sysNotifyAnnounceVo);
|
|
|
commonFeginClient.sendNotify(sysNotifyAnnounceVo);
|
|
|
|
|
|
+ //防止推送用户过多,导致调用接口报错,实行分流
|
|
|
+ List<String> userList = new LinkedList<>();
|
|
|
+ for (String recipientId : recipientIds) {
|
|
|
+ userList.add(recipientId);
|
|
|
+ if(userList.size() == 10){
|
|
|
+ pushApp(title, content, userList);
|
|
|
+ userList = new LinkedList<>();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (userList.size()>0){
|
|
|
+ pushApp(title, content, userList);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void pushApp(String title, String content, List<String> recipientIds){
|
|
|
//推送websocket消息给app
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("title", title);
|