使用消息平台发送业务消息方法Demo
消息接口调用Demo:
/// <summary>
/// 消息平台发消息通知用户Demo
/// </summary>
/// <param name="ctx">上下文</param>
private void sendMessage(Context ctx)
{
NormalTextSendMessageInfo normalTextMessageInfo = new NormalTextSendMessageInfo();
//定义消息级别: 1-提醒 2-警告 3-紧急
normalTextMessageInfo.Level = 1;
//定义接受人的集合传入用户ID的数组(下面例子是通知当前操作用户和系统管理员)
HashSet<long> lstReciverIds = new HashSet<long>();
lstReciverIds.Add(ctx.UserId);
lstReciverIds.Add(FormConst.AdministratorID);
normalTextMessageInfo.ReceiverIds = lstReciverIds.ToArray();
//定义发送人的ID
normalTextMessageInfo.SenderId = ctx.UserId;
//定义标题内容
normalTextMessageInfo.Title = "消息标题";
//定义消息类型:1-业务消息 2-预警消息 3-运营消息 4-公告消息 5-运营消息(金蝶)
normalTextMessageInfo.MsgType = 1;
//定义具体的消息内容
normalTextMessageInfo.Content = "消息内容";
//调用消息平台发送消息:(两种方法,使用哪一种都可以)
//方法1:(插件层调用)
Kingdee.BOS.ServiceHelper.MessageCenter.MessageServiceHelper.AsyncSendNormalTextMessage(ctx, normalTextMessageInfo);
//方法2:(服务层调用)
var messageService = Kingdee.BOS.Contracts.ServiceFactory.GetService<IMessageService>(ctx);
messageService.AsyncSendNormalTextMessage(ctx, normalTextMessageInfo);
}
使用消息平台发送业务消息方法Demo
本文2024-09-23 03:49:11发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-161303.html
- 鼎捷EAI整合規範文件V3.1.07 (集團).pdf
- 鼎捷OpenAPI應用場景說明_基礎資料.pdf
- 鼎捷OpenAPI應用場景說明_財務管理.pdf
- 鼎捷T100 API設計器使用手冊T100 APIDesigner(V1.0).docx
- 鼎新e-GoB2雲端ERP B2 線上課程E6-2應付票據整批郵寄 領取.pdf
- 鼎新e-GoB2雲端ERP B2 線上課程A4使用者建立權限設定.pdf
- 鼎新e-GoB2雲端ERP B2 線上課程C3會計開帳與會計傳票.pdf
- 鼎新e-GoB2雲端ERP B2 線上課程E6-1應付票據.pdf
- 鼎新e-GoB2雲端ERP B2 線上課程A5-1進銷存參數設定(初階篇).pdf
- 鼎新e-GoB2雲端ERP B2 線上課程D2帳款開帳與票據開帳.pdf