第三方系统给金蝶云星空发普通信息首页弹框二开示例
二开普通信息首页弹框效果如下:
步骤一:,首先要把普通消息弹框的选项勾选上:
步骤二:自定义WebAPI接口:
using Kingdee.BOS.App.Core; using Kingdee.BOS.Orm.DataEntity; using Kingdee.BOS.ServiceHelper; using Kingdee.BOS.Workflow.App.Core.Repositories; using Kingdee.BOS.Workflow.Models.WindowRemind; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Kingdee.BOS.Printing.PlugIn.Test { public class MsgBroadCastAPIService : Kingdee.BOS.WebApi.ServicesStub.AbstractWebApiBusinessService { public MsgBroadCastAPIService(Kingdee.BOS.ServiceFacade.KDServiceFx.KDServiceContext context) : base(context) { } public bool ExecuteService(string[] receivers,string title) { List<DynamicObject> recList = new List<DynamicObject>(); List<long> msgReceivers = new List<long>(); List<long> id = DBServiceHelper.GetSequenceInt64(this.KDContext.Session.AppContext, "T_BAS_BROADCASTMSG", 1).ToList(); BroadCastMsg msg = new BroadCastMsg(new DynamicObject(Kingdee.BOS.Workflow.Models.WindowRemind.BroadCastMsg.BroadCastMsgType)); msg.Title = new LocaleValue(Kingdee.BOS.Resource.ResManager.LoadKDString("您有新的普通消息", "002406000006760", Kingdee.BOS.Resource.SubSystemType.BOS)); msg.Content = new LocaleValue(title); DateTime failureTime = TimeServiceHelper.GetSystemDateTime(this.KDContext.Session.AppContext).AddMinutes(6); msg.FailureTime = failureTime; msg.SendType = 4; msg.Id = id[0]; foreach (var item in receivers) { int msgReceiver = int.Parse(item); MessageRepository ser = new MessageRepository(); bool isCommonMsgWindowRemind = ser.GetIsCommonMsgWindowRemind(this.KDContext.Session.AppContext, msgReceiver); if (isCommonMsgWindowRemind) { BroadCastReceiver rec = new BroadCastReceiver(); rec.Receiver = msgReceiver; rec.Id = id[0]; recList.Add(rec); } } if (recList.Count > 0) { SaveService service = new SaveService(); service.Save(this.KDContext.Session.AppContext, new DynamicObject[] { msg }); service.Save(this.KDContext.Session.AppContext, recList.ToArray()); } return true; } } }
第三步:客户端调用示例:
private void btnTest_Click(object sender, EventArgs e) { if (Login()) { string json = "{\"Model\":[{\"FTitle\":\"我是标题\",\"FContent\":\"我是内容,单据id=1\",\"FReceivers\":\"demo\",\"FType\":\"1\",\"FObjectTypeId\":\"AM_VOUCHER\",\"FKeyValue\":\"100012\"}]}"; object[] paramInfo = new object[] { json}; var result = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.SendMsg", paramInfo); if (JObject.Parse(result)["Result"]["ResponseStatus"]["IsSuccess"].Value<bool>()) { object[] paramInfo2 = new object[] { new string[]{"100008"}, "我是接口测试" }; client.Execute<string>("Kingdee.BOS.Printing.PlugIn.Test.MsgBroadCastAPIService.ExecuteService,Kingdee.BOS.Printing.PlugIn.Test", paramInfo2); } } }
第三方系统给金蝶云星空发普通信息首页弹框二开示例
二开普通信息首页弹框效果如下:步骤一:,首先要把普通消息弹框的选项勾选上:步骤二:自定义WebAPI接口:using Kingdee.BOS.App.Core;usi...
点击下载文档
本文2024-09-23 04:19:59发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-164629.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章