发送消息到亚微

This commit is contained in:
wangliwen 2022-08-31 16:53:43 +08:00
parent cdca90474d
commit be6968c78f
1 changed files with 14 additions and 10 deletions

View File

@ -7,7 +7,6 @@ import io.renren.common.constant.Constant;
import io.renren.common.page.PageData; import io.renren.common.page.PageData;
import io.renren.common.service.impl.CrudServiceImpl; import io.renren.common.service.impl.CrudServiceImpl;
import io.renren.common.utils.ConvertUtils; import io.renren.common.utils.ConvertUtils;
import io.renren.common.utils.Result;
import io.renren.modules.notice.dao.SysNoticeDao; import io.renren.modules.notice.dao.SysNoticeDao;
import io.renren.modules.notice.dto.SysNoticeDTO; import io.renren.modules.notice.dto.SysNoticeDTO;
import io.renren.modules.notice.entity.SysNoticeEntity; import io.renren.modules.notice.entity.SysNoticeEntity;
@ -194,7 +193,12 @@ public class SysNoticeServiceImpl extends CrudServiceImpl<SysNoticeDao, SysNotic
//通过WebSocket提示选中用户有新通知 //通过WebSocket提示选中用户有新通知
MessageData<String> message = new MessageData<String>().msg(notice.getTitle()); MessageData<String> message = new MessageData<String>().msg(notice.getTitle());
webSocketServer.sendMessage(finalUserIdList, message); webSocketServer.sendMessage(finalUserIdList, message);
sendToYaweiUser(notice, finalUserIdList); }, executor).thenRunAsync(() -> {
try {
sendToYaweiUser(notice, finalUserIdList);
} catch (Exception exception) {
logger.error("", exception);
}
}, executor); }, executor);
} }
} }
@ -241,14 +245,14 @@ public class SysNoticeServiceImpl extends CrudServiceImpl<SysNoticeDao, SysNotic
exchangeCodes.append(ywMobile + ";"); exchangeCodes.append(ywMobile + ";");
} }
} }
if (userNames.charAt(userNames.length()-1) == ';') { if (userNames.charAt(userNames.length() - 1) == ';') {
userNames.deleteCharAt(userNames.length()-1); userNames.deleteCharAt(userNames.length() - 1);
} }
if (userGuids.charAt(userGuids.length()-1) == ';') { if (userGuids.charAt(userGuids.length() - 1) == ';') {
userGuids.deleteCharAt(userGuids.length()-1); userGuids.deleteCharAt(userGuids.length() - 1);
} }
if (exchangeCodes.charAt(exchangeCodes.length()-1) == ';') { if (exchangeCodes.charAt(exchangeCodes.length() - 1) == ';') {
exchangeCodes.deleteCharAt(exchangeCodes.length()-1); exchangeCodes.deleteCharAt(exchangeCodes.length() - 1);
} }
@ -259,7 +263,7 @@ public class SysNoticeServiceImpl extends CrudServiceImpl<SysNoticeDao, SysNotic
" <InsertTodealByPollCode xmlns=\"http://tempuri.org/\">\n" + " <InsertTodealByPollCode xmlns=\"http://tempuri.org/\">\n" +
String.format("<todealGuid>{%s}</todealGuid>\n", UUID.randomUUID().toString().toUpperCase()) + String.format("<todealGuid>{%s}</todealGuid>\n", UUID.randomUUID().toString().toUpperCase()) +
String.format("<fileGuid>{%s}</fileGuid>\n", UUID.randomUUID().toString().toUpperCase()) + String.format("<fileGuid>{%s}</fileGuid>\n", UUID.randomUUID().toString().toUpperCase()) +
String.format("<title>%s</title>\n",notice.getTitle()) + String.format("<title>%s</title>\n", notice.getTitle()) +
" <docType>2</docType>\n" + " <docType>2</docType>\n" +
String.format("<receiveLocalPerson>%s</receiveLocalPerson>\n", userNames.toString()) + String.format("<receiveLocalPerson>%s</receiveLocalPerson>\n", userNames.toString()) +
String.format("<receiveLocalPersonGuid>%s</receiveLocalPersonGuid>\n", userGuids.toString()) + String.format("<receiveLocalPersonGuid>%s</receiveLocalPersonGuid>\n", userGuids.toString()) +
@ -291,7 +295,7 @@ public class SysNoticeServiceImpl extends CrudServiceImpl<SysNoticeDao, SysNotic
logger.error("推送待办失败:" + body); logger.error("推送待办失败:" + body);
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("推送亚威待办失败", e); logger.error("推送亚威待办失败", e);
} }
} }