Browse Source

新建审批消息时发送日志

master
yashen 9 years ago
parent
commit
ef69b6e92d
2 changed files with 11 additions and 2 deletions
  1. +9
    -0
      B3WeChat/Rpcs/ApproveMessageRpc.cs
  2. +2
    -2
      B3WeChat/Utils/SendMessageUtil.cs

+ 9
- 0
B3WeChat/Rpcs/ApproveMessageRpc.cs View File

@ -2,6 +2,7 @@
using BWP.B3WeChat.BL;
using BWP.B3WeChat.BO;
using BWP.B3WeChat.BO.NamedValueTemplate;
using BWP.B3WeChat.Utils;
using Forks.EnterpriseServices.BusinessInterfaces;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
@ -12,6 +13,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using TSingSoft.WebPluginFramework;
namespace BWP.B3WeChat.Rpcs
@ -22,6 +24,8 @@ namespace BWP.B3WeChat.Rpcs
static IApproveMessageBL bl = BIFactory.Create<IApproveMessageBL>();
const string authUrlTemplate = "https://open.weixin.qq.com/connect/oauth2/authorize?appid={APPID}&redirect_uri={REDIRECT_URI}&response_type=code&scope=snsapi_base #wechat_redirect";
[Rpc]
public static void Insert(ApproveMessage message)
{
@ -49,6 +53,11 @@ namespace BWP.B3WeChat.Rpcs
var mainSystemConfig = new MainSystemConfig();
var internetAccessAddress = mainSystemConfig.InternetAccessAddress.Value;
var originUrl = internetAccessAddress + "app/index.html";
var authUrl = internetAccessAddress + "WeChatLogin.aspx?url=" + HttpUtility.UrlEncode(originUrl);
SendMessageUtil.SendInformInfo(message.OpenID, message.Title, DateTime.Now.ToShortTimeString(), message.Content, message.Username, BLContext.ClientIP, DateTime.Now.ToShortTimeString(), "", authUrl);
}


+ 2
- 2
B3WeChat/Utils/SendMessageUtil.cs View File

@ -38,7 +38,7 @@ namespace BWP.B3WeChat.Utils
/// <param name="when">操作时间</param>
/// <param name="remark">备注</param>
/// <returns></returns>
public static SendTemplateMessageResult SendInformInfo(string openid, string title, string informtime, string informcontent, string who,string ip, string when, string remark)
public static SendTemplateMessageResult SendInformInfo(string openid, string title, string informtime, string informcontent, string who,string ip, string when, string remark,string url="")
{
Dictionary<string, ValueColor> dic = new Dictionary<string, ValueColor>();
dic.Add("first", new ValueColor() { value = title, color = "#173177" });
@ -48,7 +48,7 @@ namespace BWP.B3WeChat.Utils
dic.Add("keyword4", new ValueColor() { value = ip, color = "#173177" });
dic.Add("keyword5", new ValueColor() { value = when, color = "#173177" });
dic.Add("remark", new ValueColor() { value = remark, color = "#173177" });
return InOutMessageUtil.SendTemplateMessage(openid, "JEOjjJ-L-hflfWoHEf7dRMlhj7fCs9NoOYf1iTQ03D4", dic);
return InOutMessageUtil.SendTemplateMessage(openid, "JEOjjJ-L-hflfWoHEf7dRMlhj7fCs9NoOYf1iTQ03D4", dic,url);
}
}
}

Loading…
Cancel
Save