列表操作执行成功之后根据销售员发送普通消息二开示例
本示例是基于生产订单列表的执行至下达操作,以下代码是列表插件代码。
public override void AfterDoOperation(Core.DynamicForm.PlugIn.Args.AfterDoOperationEventArgs e) { base.AfterDoOperation(e); if (e.OperationResult.IsSuccess && e.Operation.Operation.ToLower() == "torelease") { string[] billIds = this.ListView.SelectedRowsInfo.GetPrimaryKeyValues(); List<SelectorItemInfo> selectKey = new List<SelectorItemInfo>(); selectKey.Add(new SelectorItemInfo("F_dev_Base"));//销售员 var objs = BusinessDataServiceHelper.Load(Context, this.View.BillBusinessInfo.GetForm().Id, selectKey, OQLFilter.CreateHeadEntityFilter(string.Format(@"FID IN ({0})", string.Join(",", billIds)))).ToList(); if (objs != null && objs.Count > 0) { List<object> list = new List<object>(); object[] salerIds = objs.Where(p => p["F_dev_Base"] != null).Select(p => (p["F_dev_Base"] as DynamicObject)["Id"]).ToArray(); var userIds = GetUserIdBySaler(salerIds); foreach (var userid in userIds) { //根据userid构建json string json = "{\"Model\":[{\"FTitle\":\"我是标题\",\"FContent\":\"我是内容,单据id=1\",\"FReceivers\":\"123\",\"FType\":\"1\",\"FObjectTypeId\":\"AM_VOUCHER\",\"FKeyValue\":\"100012\"}]}"; WebApiServiceCall.SendMsg(this.View.Context, json); } } } /// <summary> /// 通过销售员获取用户ID /// </summary> /// <param name="salerIds"></param> /// <returns></returns> private long[] GetUserIdBySaler(object[]salerIds) { //参考一下sql查询 //select t5.FUSERID //from V_BD_SALESMAN t1 inner join T_BD_STAFF t2 on t1.FSTAFFID=t2.FSTAFFID //inner join T_BD_STAFFPOSTINFO t3 on t2.FSTAFFID=t3.FSTAFFID //inner join T_BD_PERSON t4 on t2.FPERSONID=t4.FPERSONID //inner join T_SEC_USER t5 on t4.FPERSONID=t5.FLINKOBJECT //where t1.fid=136513 return new long[] { 123 }; }
列表操作执行成功之后根据销售员发送普通消息二开示例
本示例是基于生产订单列表的执行至下达操作,以下代码是列表插件代码。public override void AfterDoOperation(Core.DynamicForm.PlugIn.Ar...
点击下载文档
本文2024-09-23 04:19:58发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-164627.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章