|
@@ -79,19 +79,41 @@ public class CXCommonUtils {
|
|
|
*/
|
|
|
public static void sendNotify(String title, String content, String remark,
|
|
|
List<String> recipientIds, String roption,
|
|
|
- String notifyStatus,boolean pushWebsocket) {
|
|
|
+ String notifyStatus, boolean pushWebsocket) {
|
|
|
+ sendNotify(SecurityUtil.getUUID(), null, title, content, remark, recipientIds, roption, notifyStatus, pushWebsocket);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 发送消息提醒
|
|
|
+ *
|
|
|
+ * @param notifyId 消息提醒ID
|
|
|
+ * @param tenantId 消息提醒公司信息
|
|
|
+ * @param title 消息提醒标题
|
|
|
+ * @param content 消息提醒内容
|
|
|
+ * @param remark 消息提醒备注
|
|
|
+ * @param recipientIds 接收人ID
|
|
|
+ * @param roption 目前存的是业务数据ID
|
|
|
+ * @param notifyStatus 消息提醒类型
|
|
|
+ * @param pushWebsocket 是否向webSocket推送消息
|
|
|
+ */
|
|
|
+ public static void sendNotify(String notifyId, String tenantId, String title, String content, String remark,
|
|
|
+ List<String> recipientIds, String roption,
|
|
|
+ String notifyStatus, boolean pushWebsocket) {
|
|
|
if (recipientIds == null || recipientIds.isEmpty()) {
|
|
|
log.debug("接收人ID为空");
|
|
|
return;
|
|
|
}
|
|
|
SysNotifyAnnounceVo sysNotifyAnnounceVo = new SysNotifyAnnounceVo();
|
|
|
- sysNotifyAnnounceVo.setId(SecurityUtil.getUUID());
|
|
|
+ sysNotifyAnnounceVo.setId(notifyId);
|
|
|
sysNotifyAnnounceVo.setSenderid("8672bf72ab274bec83052868ae336b38");
|
|
|
sysNotifyAnnounceVo.setNotifytype(notifyStatus);
|
|
|
sysNotifyAnnounceVo.setNotifystatus(DEFAULT_NOTIFY_STATUS);
|
|
|
sysNotifyAnnounceVo.setNotifytitle(title);
|
|
|
- sysNotifyAnnounceVo.setNotifycontent(content.replace("null"," "));
|
|
|
+ sysNotifyAnnounceVo.setNotifycontent(content.replace("null", " "));
|
|
|
sysNotifyAnnounceVo.setRemark(remark);
|
|
|
+ if (StringUtils.isNotBlank(tenantId)) {
|
|
|
+ sysNotifyAnnounceVo.setTenantid(tenantId);
|
|
|
+ }
|
|
|
// 特殊处理
|
|
|
if (StringUtils.isNotBlank(roption)) {
|
|
|
sysNotifyAnnounceVo.setRoption(roption);
|
|
@@ -100,14 +122,15 @@ public class CXCommonUtils {
|
|
|
log.debug("开始通过fegin发送消息通知: {}", sysNotifyAnnounceVo);
|
|
|
commonFeginClient.sendNotify(sysNotifyAnnounceVo);
|
|
|
// 通过webSocket推送数据
|
|
|
- if(pushWebsocket){
|
|
|
+ if (pushWebsocket) {
|
|
|
//防止推送用户过多,导致调用接口报错,实行分流
|
|
|
- Lists.partition(recipientIds, 10).forEach(userIds->{
|
|
|
+ Lists.partition(recipientIds, 10).forEach(userIds -> {
|
|
|
pushApp(title, content, userIds);
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 发送消息提醒
|
|
|
*
|
|
@@ -275,8 +298,8 @@ public class CXCommonUtils {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static R upload(MultipartFile file) {
|
|
|
- return commonFeginClient.upload(file);
|
|
|
+ public static R upload(MultipartFile file, String relationid) {
|
|
|
+ return commonFeginClient.upload(file, relationid);
|
|
|
}
|
|
|
|
|
|
}
|