From df4de900bc7b6bdbf529cafb318fa9a1b00b79f6 Mon Sep 17 00:00:00 2001 From: yashen Date: Wed, 8 Feb 2017 10:24:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=91=E9=80=81=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E8=AF=84=E4=BB=B7=E9=93=BE=E6=8E=A5=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- B3WeChat/B3WeChat.csproj | 5 +++++ B3WeChat/Rpcs/C3Rpc.cs | 30 ++++++++++++++++++++++++++++++ B3WeChat/Utils/SendMessageUtil.cs | 23 +++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 B3WeChat/Rpcs/C3Rpc.cs diff --git a/B3WeChat/B3WeChat.csproj b/B3WeChat/B3WeChat.csproj index 20e4a47..65a25d5 100644 --- a/B3WeChat/B3WeChat.csproj +++ b/B3WeChat/B3WeChat.csproj @@ -35,6 +35,10 @@ False ..\..\..\tsref\Debug\B3Frameworks.dll + + False + ..\..\..\tsref\Debug\B3Frameworks.Web.dll + False ..\..\..\tsref\Debug\Forks.EnterpriseServices.dll @@ -131,6 +135,7 @@ + diff --git a/B3WeChat/Rpcs/C3Rpc.cs b/B3WeChat/Rpcs/C3Rpc.cs new file mode 100644 index 0000000..b3326f7 --- /dev/null +++ b/B3WeChat/Rpcs/C3Rpc.cs @@ -0,0 +1,30 @@ +using BWP.B3WeChat.BO; +using BWP.B3WeChat.Utils; +using BWP.Web.Utils; +using Forks.EnterpriseServices.JsonRpc; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BWP.B3WeChat.Rpcs +{ + [Rpc] + public static class C3Rpc + { + [Rpc] + public static void SendAppraiseLinkMessage(string serviceNo,string username,string first,string billNo,string remark,string url) + { + var openID = WebBLUtil.GetDmoProperty("OpenID", + new Tuple("CustomerCode", serviceNo), + new Tuple("CustomerUsername", username)); + + if (string.IsNullOrEmpty(openID)) + { + throw new Exception(string.Format("该客户的用户{0}未关注公众号", username)); + } + + SendMessageUtil.SendAppraiseLinkMessage(openID, first, billNo, remark, url); + } + } +} diff --git a/B3WeChat/Utils/SendMessageUtil.cs b/B3WeChat/Utils/SendMessageUtil.cs index fc52b61..91b17de 100644 --- a/B3WeChat/Utils/SendMessageUtil.cs +++ b/B3WeChat/Utils/SendMessageUtil.cs @@ -17,6 +17,29 @@ namespace BWP.B3WeChat.Utils } + //OPENTM202765054 + //模板IDQOQFm0G2CiCNF03xdwpDcArfZBsFVtwDWp-hrECqRLk + //开发者调用模板消息接口时需提供模板ID + //标题服务评价通知 + //行业IT科技 - IT软件与服务 + //详细内容 + //{{first.DATA}} + //编号:{{keyword1.DATA}} + //时间:{{keyword2.DATA}} + //{{remark.DATA}} + public static void SendAppraiseLinkMessage(string openID, string first,string no,string remark,string url) + { + Dictionary dic = new Dictionary(); + dic.Add("first", new ValueColor(first)); + dic.Add("keyword1", new ValueColor(no)); + dic.Add("keyword2", new ValueColor(FormatTime(DateTime.Now))); + dic.Add("remark", new ValueColor(remark)); + InOutMessageUtil.SendTemplateMessage(openID, "IDQOQFm0G2CiCNF03xdwpDcArfZBsFVtwDWp-hrECqRLk", dic, url); + } + + + + //编号:OPENTM406714250 //标题:流程待办提醒 //{{first.DATA}}