diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/MeetingManagement/MeetingManagementIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/MeetingManagement/MeetingManagementIBLL.cs index afd1b1318..ef3282473 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/MeetingManagement/MeetingManagementIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/MeetingManagement/MeetingManagementIBLL.cs @@ -76,6 +76,9 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement /// /// void ChangeStatusByProcessId(string processId, string status, string userId); + + void ReceivedList(string processId); + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/MeetingManagement/MeetingManagementService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/MeetingManagement/MeetingManagementService.cs index c064e357c..430b23a3a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/MeetingManagement/MeetingManagementService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/MeetingManagement/MeetingManagementService.cs @@ -1,11 +1,19 @@ using Dapper; using Learun.Application.Organization; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using Learun.Application.TwoDevelopment.LR_Desktop; using Learun.DataBase.Repository; using Learun.Util; +using Microsoft.AspNet.SignalR.Client; +using Newtonsoft.Json; using System; using System.Collections.Generic; +using System.Configuration; using System.Data; +using System.Linq; using System.Text; +using System.Threading.Tasks; +using System.Web; namespace Learun.Application.TwoDevelopment.PersonnelManagement { @@ -467,7 +475,101 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } + public void ReceivedList(string processId) + { + var Received = GetMeetingManagementEntityByProcessId(processId); + List userInfos = new List(); + foreach (var rid in Received.InternalParticipants.Split(',')) + { + var user = this.BaseRepository().FindEntity(m => m.F_UserId == rid); + if (!userInfos.Contains(user)) + { + userInfos.Add(user); + } + } + //foreach (var uitem in userInfos) + //{ + // SYS_ReceiveMessageEntity receiveMessageEntity = new SYS_ReceiveMessageEntity(); + // receiveMessageEntity.Create(); + // receiveMessageEntity.SENDERID = Received.SENDERID; + // receiveMessageEntity.SENDER = messageentity.SENDER; + // receiveMessageEntity.RECEIVERID = uitem.F_UserId; + // receiveMessageEntity.RECEIVER = uitem.F_RealName; + // receiveMessageEntity.TITLE = messageentity.TITLE; + // receiveMessageEntity.CONTENTS = messageentity.CONTENTS; + // receiveMessageEntity.URL = messageentity.URL; + // receiveMessageEntity.READFLAG = 0; + // receiveMessageEntity.SENDTIME = DateTime.Now; + // receiveMessageEntity.DelFlag = false; + // this.BaseRepository().Insert(receiveMessageEntity); + //} + + //读取信息推送管理-会议申请推送(03)的配置 + var informationPushEntity = this.BaseRepository().FindEntity(x => x.PushItem == "03"); + if (informationPushEntity != null && informationPushEntity.Status == true) + { + //微信推送 + try + { + PushWeixin(userInfos, Received.MeetingTitle); + } + catch (Exception e) + { + } + //飞星推送 + Task.Run(async () => + { + using (var hubConnection = new HubConnection(ConfigurationManager.AppSettings["CommunicationServeraddress"])) + { + var hubProxy = hubConnection.CreateHubProxy("SignalRHub"); + await hubConnection.Start(); + await hubProxy.Invoke("PushAnnouncement", Received.InternalParticipants, Received.MeetingTitle, Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(Received.Content)).Length < 20 ? Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(Received.Content)) : Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(Received.Content)).Substring(0, 20), "mail", string.Join(",", userInfos.Select(m => m.F_UserId)), ""); + } + }); + } + } + public void PushWeixin(List needpostuserlist, string title) + { + var WeChatConfigentity = BaseRepository().FindEntity(m => m.IsEnable == true); + string appid = WeChatConfigentity.APPId; + string secret = WeChatConfigentity.secret; + var wechatemplete = BaseRepository() + .FindEntity(m => m.WeID == WeChatConfigentity.ID && m.TCode == "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); + 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=mail\"," + + "\"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); + } + } + } + } + } + } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/MeetingManagementApplyMethod.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/MeetingManagementApplyMethod.cs index 55ee0ae70..9885a02bd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/MeetingManagementApplyMethod.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/MeetingManagementApplyMethod.cs @@ -1,9 +1,4 @@ using Learun.Application.TwoDevelopment.PersonnelManagement; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Learun.Application.WorkFlow { @@ -17,6 +12,7 @@ namespace Learun.Application.WorkFlow if (parameter.code == "agree") { meetingManagementIBLL.ChangeStatusByProcessId(parameter.processId, "1", parameter.userId); + meetingManagementIBLL.ReceivedList(parameter.processId); } else { diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/manifest.json b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/manifest.json index bff0c2bc1..2a1860b43 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/manifest.json +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/manifest.json @@ -1,6 +1,6 @@ { "name" : "智慧校园", - "appid" : "__UNI__0CE0195", + "appid" : "__UNI__3039520", "description" : "智慧校园移动端", "versionName" : "2.1.0", "versionCode" : 20100,