From 6d67ad125417c882b9537f680c452815dd20a3e7 Mon Sep 17 00:00:00 2001 From: liangkun Date: Sat, 25 Dec 2021 11:59:54 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=85=AC=E5=91=8A=E5=AE=A1?= =?UTF-8?q?=E6=89=B9=E5=90=8E=E4=B8=8B=E5=8F=91=E6=B6=88=E6=81=AF=E9=80=9A?= =?UTF-8?q?=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/NoticeController.cs | 185 +--------------- .../LR_OAModule/Views/Notice/FormFlow.js | 26 ++- .../Learun.Application.OA/News/NewsEntity.cs | 2 +- .../Learun.Application.OA/News/NewsService.cs | 1 + .../Notice/NoticeService.cs | 4 +- .../Learun.Application.WorkFlow.csproj | 5 + .../NodeMethod/OA_NewsMethod.cs | 207 +++++++++++++++++- 7 files changed, 231 insertions(+), 199 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/NoticeController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/NoticeController.cs index 08c14f80d..a545684e2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/NoticeController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/NoticeController.cs @@ -343,111 +343,9 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers { entity.F_NewsContent = WebHelper.HtmlEncode(entity.F_NewsContent); noticeIBLL.SaveEntity(keyValue, entity); - //读取信息推送管理-通知公告推送(01)的配置 - var informationPushEntity = sys_InformationPushIBLL.GetEntityByPushItem("01"); - if (informationPushEntity != null && informationPushEntity.Status == true) - { - //推送微信和消息提醒表 - Task.Run(async () => { await DoWeixinPush(entity); }); - } - if (entity.F_IsSendFX.HasValue && entity.F_IsSendFX == true) - { - Task.Run(async () => - { - using (var hubConnection = new HubConnection(ConfigurationManager.AppSettings["CommunicationServeraddress"])) - { - var hubProxy = hubConnection.CreateHubProxy("SignalRHub"); - await hubConnection.Start(); - await hubProxy.Invoke("PushAnnouncement", entity.F_NewsId, entity.F_FullHead, Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(entity.F_NewsContent)).Length < 20 ? Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(entity.F_NewsContent)) : Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(entity.F_NewsContent)).Substring(0, 20), "news", entity.F_SendPostId, entity.F_SendDeptId); - } - }); - } - return Success("保存成功!"); - } - Task DoWeixinPush(NewsEntity entity) - { - //微信推送、消息提醒表 - try - { - var allteacherlist = userIbll.GetAllList().Where(m => - m.F_DeleteMark != 1 && m.F_EnabledMark == 1 && m.F_Description == "教师"); - var userralationlist = userRelationIBLL.GetUserIdList("2"); - var needpostuserlist = new List(); - if (!string.IsNullOrEmpty(entity.F_SendDeptId)) - { - if (!entity.F_SendDeptId.Contains(",")) - { - var departteacherlist = allteacherlist.Where(m => entity.F_SendDeptId == m.F_DepartmentId); - needpostuserlist.AddRange(departteacherlist.ToList()); - if (!string.IsNullOrEmpty(entity.F_SendPostId)) - { - var newpostuserlist = new List(); - foreach (var uuitem in needpostuserlist) - { - var postids = userralationlist?.Count(m => m.F_UserId == uuitem.F_UserId && entity.F_SendPostId.Contains(m.F_ObjectId)); - if (postids > 0) - { - newpostuserlist.Add(uuitem); - } - } - needpostuserlist = newpostuserlist; - } - } - else - { - foreach (var senddeptid in entity.F_SendDeptId.Split(',')) - { - var departteacherlist = allteacherlist.Where(m => senddeptid == m.F_DepartmentId); - needpostuserlist.AddRange(departteacherlist.ToList()); - if (!string.IsNullOrEmpty(entity.F_SendPostId)) - { - var newpostuserlist = new List(); - foreach (var uuitem in needpostuserlist) - { - var postids = userralationlist?.Count(m => m.F_UserId == uuitem.F_UserId && entity.F_SendPostId.Contains(m.F_ObjectId)); - if (postids > 0) - { - newpostuserlist.Add(uuitem); - } - } - needpostuserlist = newpostuserlist; - } - } - } - } - else - { - if (!string.IsNullOrEmpty(entity.F_SendPostId)) - { - //岗位下发 - var newpostuserlist = new List(); - foreach (var uuitem in allteacherlist) - { - var postids = userralationlist?.Count(m => m.F_UserId == uuitem.F_UserId && entity.F_SendPostId.Contains(m.F_ObjectId)); - if (postids > 0) - { - newpostuserlist.Add(uuitem); - } - } - needpostuserlist = newpostuserlist; - } - else - { - //全员下发 - needpostuserlist = allteacherlist.ToList(); - } - } - PushWeixin(needpostuserlist, entity.F_FullHead); - //消息提醒表 - PushMessageRemind(needpostuserlist, entity); - return Task.CompletedTask; - } - catch (Exception e) - { - return Task.FromException(e); - } + return Success("保存成功!"); } /// @@ -477,87 +375,6 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers noticeIBLL.RecycleForm(keyValue, "0"); return Success("操作成功!"); } - public void PushWeixin(List needpostuserlist, string title) - { - var WeChatConfigentity = weChatConfigIbll.GetEnableEntity(); - string appid = WeChatConfigentity.APPId; - string secret = WeChatConfigentity.secret; - var wechatemplete = weChatTempletIbll.GetWeChatTemplateEntityByCodeConfigId(WeChatConfigentity.ID, "task"); - string weixintaskurl = wechatemplete.TUrl; - string weixintasktempid = wechatemplete.TempId; - var responsejson = Util.HttpMethods.HttpGet("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + appid + "&secret=" + secret); - - OperateLogModel operateLogModel = new OperateLogModel(); - operateLogModel.title = title; - operateLogModel.type = OperationType.Other; - operateLogModel.url = "NoticeController"; - operateLogModel.sourceObjectId = "002"; - operateLogModel.sourceContentJson = responsejson; - OperatorHelper.Instance.WriteOperateLog(operateLogModel); - - foreach (UserEntity userinfo in needpostuserlist) - { - if (userinfo != null && !string.IsNullOrEmpty(userinfo.OpenIdForWeixin)) - { - //执行推送任务 - if (!string.IsNullOrEmpty(appid) && !string.IsNullOrEmpty(secret) && !string.IsNullOrEmpty(weixintaskurl) && !string.IsNullOrEmpty(weixintasktempid)) - { - if (!string.IsNullOrEmpty(responsejson)) - { - var weixintokenobj = JsonConvert.DeserializeObject(responsejson); - if (string.IsNullOrEmpty(weixintokenobj.errcode)) - { - string access_token = weixintokenobj.access_token; - string jsondata = "{\"touser\":\"" + userinfo.OpenIdForWeixin + "\"," + - "\"template_id\":\"" + weixintasktempid + "\"," + - "\"url\":\"" + weixintaskurl + "/#/?page=notice\"," + - "\"data\":{" + - "\"first\": {\"value\":\"您有新的未读通知公告\",\"color\":\"#173177\"}," + - "\"keyword1\":{\"value\":\"未读通知公告\",\"color\":\"#173177\"}," + - "\"keyword2\": {\"value\":\"" + title + "\",\"color\":\"#173177\"}," + - "\"keyword3\": {\"value\":\"待查看\",\"color\":\"#173177\"}," + - "\"keyword4\": {\"value\":\"您有新的未读通知公告【" + title + "】\",\"color\":\"#173177\"}" + - "}" + - "}"; - string pushresult = Util.HttpMethods.HttpPost("https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" + access_token, jsondata); - - operateLogModel.title = title; - operateLogModel.type = OperationType.Other; - operateLogModel.url = "NoticeController"; - operateLogModel.sourceObjectId = "002"; - operateLogModel.sourceContentJson = pushresult; - OperatorHelper.Instance.WriteOperateLog(operateLogModel); - } - } - } - } - } - } - - /// - /// 消息提醒 - /// - /// - /// - public void PushMessageRemind(List needpostuserlist, NewsEntity model) - { - foreach (UserEntity userinfo in needpostuserlist) - { - MessageRemindEntity entity = new MessageRemindEntity(); - entity.ReceiptId = userinfo.F_UserId; - entity.ReceiptName = userinfo.F_RealName; - entity.SenderId = model.F_CreateUserId; - entity.SenderName = model.F_CreateUserName; - entity.TheTitle = "通知公告"; - entity.TheContent = model.F_FullHead; - entity.InstanceId = model.F_NewsId; - entity.ConnectionUrl = "/Utility/ListContentIndex?id="; - entity.SendTime = DateTime.Now; - entity.ReadSigns = false; - messageRindIBLL.SaveEntity("", entity); - } - - } #endregion #region 流程 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormFlow.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormFlow.js index 6c6b9199c..21eed58c4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormFlow.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormFlow.js @@ -66,17 +66,21 @@ var bootstrap = function ($, learun) { setFormData = function (processId) { if (!!processId) { $.lrSetForm(top.$.rootUrl + '/LR_OAModule/Notice/GetFormDataByProcessId?processId=' + processId, function (data) { - for (var id in data) { - if (!!data[id] && data[id].length > 0) { - $('#' + id).jfGridSet('refreshdata', data[id]); - } - else { - if (id == 'Sys_ReceiveFile') { - keyValue = data[id].F_DeptRelationId; - } - $('[data-table="' + id + '"]').lrSetFormData(data[id]); - } - } + $('#form').lrSetFormData(data); + setTimeout(function () { + ue.setContent(data.F_NewsContent); + }, 100); + //for (var id in data) { + // if (!!data[id] && data[id].length > 0) { + // $('#' + id).jfGridSet('refreshdata', data[id]); + // } + // else { + // if (id == 'Sys_ReceiveFile') { + // keyValue = data[id].F_DeptRelationId; + // } + // $('[data-table="' + id + '"]').lrSetFormData(data[id]); + // } + //} }); } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/News/NewsEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/News/NewsEntity.cs index 2459d74bd..857ed0364 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/News/NewsEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/News/NewsEntity.cs @@ -225,7 +225,7 @@ namespace Learun.Application.OA this.F_CreateDate = DateTime.Now; this.F_ReleaseTime = DateTime.Now; this.F_DeleteMark = 0; - this.F_EnabledMark = 1; + this.F_EnabledMark = 0; F_Status = "0"; this.F_PV = 0; diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/News/NewsService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/News/NewsService.cs index 326f292c2..4ad7ec6b1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/News/NewsService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/News/NewsService.cs @@ -191,6 +191,7 @@ namespace Learun.Application.OA if (status == 2) { newEntity.F_Status = "2"; + newEntity.F_EnabledMark = 1; } else { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeService.cs index 127c06df0..1d303f0e1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeService.cs @@ -27,7 +27,7 @@ namespace Learun.Application.OA try { var strSql = new StringBuilder(); - strSql.Append("SELECT * FROM LR_OA_News t WHERE t.F_TypeId = 2 and F_Status<>'-1' "); + strSql.Append("SELECT * FROM LR_OA_News t WHERE t.F_TypeId = 2 and F_Status<>'-1' and F_DeleteMark=0"); if (!string.IsNullOrEmpty(keyword)) { strSql.Append(" AND F_FullHead like @keyword"); @@ -213,7 +213,7 @@ namespace Learun.Application.OA var strSql = new StringBuilder(); strSql.Append("SELECT t.*,r.RNewsId,r.RTime FROM LR_OA_News t "); strSql.Append(" left join LR_OA_NewsRead r on t.F_NewsId = r.NewsId and r.RUserId=@userId "); - strSql.Append(" WHERE t.F_TypeId = 2 and F_Status<>'-1' "); + strSql.Append(" WHERE t.F_TypeId = 2 and F_Status<>'-1' and t.F_DeleteMark=0 "); if (!string.IsNullOrEmpty(categoryId)) { strSql.Append($" AND F_CategoryId = '{categoryId}'"); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/Learun.Application.WorkFlow.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/Learun.Application.WorkFlow.csproj index c8a60a3ab..2292459c9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/Learun.Application.WorkFlow.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/Learun.Application.WorkFlow.csproj @@ -77,6 +77,7 @@ + @@ -216,6 +217,10 @@ {81c03609-ae0d-414c-829b-16b990487add} Learun.Ioc + + {ad556b7a-e0d1-41bd-9d5b-18f8502e9f33} + Learun.Util.Operat + {cf8ae293-88ab-436c-9720-a8386ba5d7b7} Learun.Util diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/OA_NewsMethod.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/OA_NewsMethod.cs index d3c1fbcf9..e71203542 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/OA_NewsMethod.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/OA_NewsMethod.cs @@ -1,26 +1,231 @@ using System; using System.Collections.Generic; +using System.Configuration; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Web; +using Learun.Application.Base.AuthorizeModule; +using Learun.Application.Base.SystemModule; using Learun.Application.OA; +using Learun.Application.Organization; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using Learun.Application.TwoDevelopment.LR_Desktop; +using Learun.Util.Operat; +using Microsoft.AspNet.SignalR.Client; +using Newtonsoft.Json; namespace Learun.Application.WorkFlow { public class OA_NewsMethod : IWorkFlowMethod { - NewsIBLL newsIBLL=new NewsBLL(); + NewsIBLL newsIBLL = new NewsBLL(); + private NoticeIBLL noticeIBLL = new NoticeBLL(); + private WeChatConfigIBLL weChatConfigIbll = new WeChatConfigBLL(); + private WeChatTempletIBLL weChatTempletIbll = new WeChatTempletBLL(); + private UserIBLL userIbll = new UserBLL(); + private UserRelationIBLL userRelationIBLL = new UserRelationBLL(); + private Sys_InformationPushIBLL sys_InformationPushIBLL = new Sys_InformationPushBLL(); + private MessageRindIBLL messageRindIBLL = new MessageRindBLL(); public void Execute(WfMethodParameter parameter) { if (parameter.code == "agree") { newsIBLL.ChangeStatusByProcessId(parameter.processId, 2); + var entity = noticeIBLL.GetEntityByProcessId(parameter.processId); + //推送通知 + //读取信息推送管理-通知公告推送(01)的配置 + var informationPushEntity = sys_InformationPushIBLL.GetEntityByPushItem("01"); + if (informationPushEntity != null && informationPushEntity.Status == true) + { + //推送微信 + Task.Run(async () => { await DoWeixinPush(entity); }); + } + if (entity.F_IsSendFX.HasValue && entity.F_IsSendFX == true) + { + Task.Run(async () => + { + using (var hubConnection = new HubConnection(ConfigurationManager.AppSettings["CommunicationServeraddress"])) + { + var hubProxy = hubConnection.CreateHubProxy("SignalRHub"); + await hubConnection.Start(); + await hubProxy.Invoke("PushAnnouncement", entity.F_NewsId, entity.F_FullHead, Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(entity.F_NewsContent)).Length < 20 ? Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(entity.F_NewsContent)) : Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(entity.F_NewsContent)).Substring(0, 20), "news", entity.F_SendPostId, entity.F_SendDeptId); + } + }); + } } else { newsIBLL.ChangeStatusByProcessId(parameter.processId, 0); } } + + Task DoWeixinPush(NewsEntity entity) + { + //微信推送 + try + { + var allteacherlist = userIbll.GetAllList().Where(m => + m.F_DeleteMark != 1 && m.F_EnabledMark == 1 && m.F_Description == "教师"); + var userralationlist = userRelationIBLL.GetUserIdList("2"); + var needpostuserlist = new List(); + if (!string.IsNullOrEmpty(entity.F_SendDeptId)) + { + if (!entity.F_SendDeptId.Contains(",")) + { + var departteacherlist = allteacherlist.Where(m => entity.F_SendDeptId == m.F_DepartmentId); + needpostuserlist.AddRange(departteacherlist.ToList()); + if (!string.IsNullOrEmpty(entity.F_SendPostId)) + { + var newpostuserlist = new List(); + foreach (var uuitem in needpostuserlist) + { + var postids = userralationlist?.Count(m => m.F_UserId == uuitem.F_UserId && entity.F_SendPostId.Contains(m.F_ObjectId)); + if (postids > 0) + { + newpostuserlist.Add(uuitem); + } + } + needpostuserlist = newpostuserlist; + } + } + else + { + foreach (var senddeptid in entity.F_SendDeptId.Split(',')) + { + var departteacherlist = allteacherlist.Where(m => senddeptid == m.F_DepartmentId); + needpostuserlist.AddRange(departteacherlist.ToList()); + if (!string.IsNullOrEmpty(entity.F_SendPostId)) + { + var newpostuserlist = new List(); + foreach (var uuitem in needpostuserlist) + { + var postids = userralationlist?.Count(m => m.F_UserId == uuitem.F_UserId && entity.F_SendPostId.Contains(m.F_ObjectId)); + if (postids > 0) + { + newpostuserlist.Add(uuitem); + } + } + needpostuserlist = newpostuserlist; + } + } + } + } + else + { + if (!string.IsNullOrEmpty(entity.F_SendPostId)) + { + //岗位下发 + var newpostuserlist = new List(); + foreach (var uuitem in allteacherlist) + { + var postids = userralationlist?.Count(m => m.F_UserId == uuitem.F_UserId && entity.F_SendPostId.Contains(m.F_ObjectId)); + if (postids > 0) + { + newpostuserlist.Add(uuitem); + } + } + needpostuserlist = newpostuserlist; + } + else + { + //全员下发 + needpostuserlist = allteacherlist.ToList(); + } + } + PushWeixin(needpostuserlist, entity.F_FullHead); + + //消息提醒表 + PushMessageRemind(needpostuserlist, entity); + return Task.CompletedTask; + } + catch (Exception e) + { + return Task.FromException(e); + } + } + + public void PushWeixin(List needpostuserlist, string title) + { + var WeChatConfigentity = weChatConfigIbll.GetEnableEntity(); + string appid = WeChatConfigentity.APPId; + string secret = WeChatConfigentity.secret; + var wechatemplete = weChatTempletIbll.GetWeChatTemplateEntityByCodeConfigId(WeChatConfigentity.ID, "task"); + string weixintaskurl = wechatemplete.TUrl; + string weixintasktempid = wechatemplete.TempId; + var responsejson = Util.HttpMethods.HttpGet("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + appid + "&secret=" + secret); + + OperateLogModel operateLogModel = new OperateLogModel(); + operateLogModel.title = title; + operateLogModel.type = OperationType.Other; + operateLogModel.url = "NoticeController"; + operateLogModel.sourceObjectId = "002"; + operateLogModel.sourceContentJson = responsejson; + OperatorHelper.Instance.WriteOperateLog(operateLogModel); + + foreach (UserEntity userinfo in needpostuserlist) + { + if (userinfo != null && !string.IsNullOrEmpty(userinfo.OpenIdForWeixin)) + { + //执行推送任务 + if (!string.IsNullOrEmpty(appid) && !string.IsNullOrEmpty(secret) && !string.IsNullOrEmpty(weixintaskurl) && !string.IsNullOrEmpty(weixintasktempid)) + { + if (!string.IsNullOrEmpty(responsejson)) + { + var weixintokenobj = JsonConvert.DeserializeObject(responsejson); + if (string.IsNullOrEmpty(weixintokenobj.errcode)) + { + string access_token = weixintokenobj.access_token; + string jsondata = "{\"touser\":\"" + userinfo.OpenIdForWeixin + "\"," + + "\"template_id\":\"" + weixintasktempid + "\"," + + "\"url\":\"" + weixintaskurl + "\"," + + "\"data\":{" + + "\"first\": {\"value\":\"您有新的未读通知公告\",\"color\":\"#173177\"}," + + "\"keyword1\":{\"value\":\"未读通知公告\",\"color\":\"#173177\"}," + + "\"keyword2\": {\"value\":\"" + title + "\",\"color\":\"#173177\"}," + + "\"keyword3\": {\"value\":\"待查看\",\"color\":\"#173177\"}," + + "\"keyword4\": {\"value\":\"您有新的未读通知公告【" + title + "】\",\"color\":\"#173177\"}" + + "}" + + "}"; + string pushresult = Util.HttpMethods.HttpPost("https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" + access_token, jsondata); + + operateLogModel.title = title; + operateLogModel.type = OperationType.Other; + operateLogModel.url = "NoticeController"; + operateLogModel.sourceObjectId = "002"; + operateLogModel.sourceContentJson = pushresult; + OperatorHelper.Instance.WriteOperateLog(operateLogModel); + } + } + } + } + } + } + + /// + /// 消息提醒 + /// + /// + /// + public void PushMessageRemind(List needpostuserlist, NewsEntity model) + { + foreach (UserEntity userinfo in needpostuserlist) + { + MessageRemindEntity entity = new MessageRemindEntity(); + entity.ReceiptId = userinfo.F_UserId; + entity.ReceiptName = userinfo.F_RealName; + entity.SenderId = model.F_CreateUserId; + entity.SenderName = model.F_CreateUserName; + entity.TheTitle = "通知公告"; + entity.TheContent = model.F_FullHead; + entity.InstanceId = model.F_NewsId; + entity.ConnectionUrl = "/Utility/ListContentIndex?id="; + entity.SendTime = DateTime.Now; + entity.ReadSigns = false; + messageRindIBLL.SaveEntity("", entity); + } + + } } }