Procházet zdrojové kódy

会议签到 发送消息

临城职教中职
ndbs před 2 roky
rodič
revize
8f2df56076
4 změnil soubory, kde provedl 107 přidání a 6 odebrání
  1. +3
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/MeetingManagement/MeetingManagementIBLL.cs
  2. +102
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/MeetingManagement/MeetingManagementService.cs
  3. +1
    -5
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/MeetingManagementApplyMethod.cs
  4. +1
    -1
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/manifest.json

+ 3
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/MeetingManagement/MeetingManagementIBLL.cs Zobrazit soubor

@@ -76,6 +76,9 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
/// <summary>
/// <returns></returns>
void ChangeStatusByProcessId(string processId, string status, string userId);

void ReceivedList(string processId);

#endregion

}


+ 102
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/MeetingManagement/MeetingManagementService.cs Zobrazit soubor

@@ -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<UserEntity> userInfos = new List<UserEntity>();
foreach (var rid in Received.InternalParticipants.Split(','))
{
var user = this.BaseRepository().FindEntity<UserEntity>(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<Sys_InformationPushEntity>(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<UserEntity> needpostuserlist, string title)
{
var WeChatConfigentity = BaseRepository().FindEntity<WeChatConfigEntity>(m => m.IsEnable == true);
string appid = WeChatConfigentity.APPId;
string secret = WeChatConfigentity.secret;
var wechatemplete = BaseRepository()
.FindEntity<WeChatTemplateEntity>(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<dynamic>(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

}


+ 1
- 5
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/MeetingManagementApplyMethod.cs Zobrazit soubor

@@ -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
{


+ 1
- 1
Learun.Framework.Ultimate V7/LearunApp-2.2.0/manifest.json Zobrazit soubor

@@ -1,6 +1,6 @@
{
"name" : "智慧校园",
"appid" : "__UNI__0CE0195",
"appid" : "__UNI__3039520",
"description" : "智慧校园移动端",
"versionName" : "2.1.0",
"versionCode" : 20100,


Načítá se…
Zrušit
Uložit