Browse Source

增加发送微信评价链接消息

master
yashen 9 years ago
parent
commit
df4de900bc
3 changed files with 58 additions and 0 deletions
  1. +5
    -0
      B3WeChat/B3WeChat.csproj
  2. +30
    -0
      B3WeChat/Rpcs/C3Rpc.cs
  3. +23
    -0
      B3WeChat/Utils/SendMessageUtil.cs

+ 5
- 0
B3WeChat/B3WeChat.csproj View File

@ -35,6 +35,10 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\tsref\Debug\B3Frameworks.dll</HintPath>
</Reference>
<Reference Include="B3Frameworks.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a04fa581c0f74d43, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\tsref\Debug\B3Frameworks.Web.dll</HintPath>
</Reference>
<Reference Include="Forks.EnterpriseServices, Version=3.1.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\tsref\Debug\Forks.EnterpriseServices.dll</HintPath>
@ -131,6 +135,7 @@
<Compile Include="Entities\WeiChartServerList.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Rpcs\ApproveMessageRpc.cs" />
<Compile Include="Rpcs\C3Rpc.cs" />
<Compile Include="Rpcs\ClientRpc.cs" />
<Compile Include="Rpcs\WeChatUserRpc.cs" />
<Compile Include="Tasks\ClearExpiredApproveMessagesTask.cs" />


+ 30
- 0
B3WeChat/Rpcs/C3Rpc.cs View File

@ -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<CustomerUser, string>("OpenID",
new Tuple<string, object>("CustomerCode", serviceNo),
new Tuple<string, object>("CustomerUsername", username));
if (string.IsNullOrEmpty(openID))
{
throw new Exception(string.Format("该客户的用户{0}未关注公众号", username));
}
SendMessageUtil.SendAppraiseLinkMessage(openID, first, billNo, remark, url);
}
}
}

+ 23
- 0
B3WeChat/Utils/SendMessageUtil.cs View File

@ -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<string, ValueColor> dic = new Dictionary<string, ValueColor>();
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}}


Loading…
Cancel
Save