Browse Source

支持工作流关注者查看消息

master
yashen 9 years ago
parent
commit
64e0f97d83
3 changed files with 35 additions and 7 deletions
  1. +9
    -5
      B3WeChat/Rpcs/ApproveMessageRpc.cs
  2. +24
    -0
      B3WeChat/Rpcs/ClientRpc.cs
  3. +2
    -2
      B3WeChat/Utils/SendMessageUtil.cs

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

@ -48,14 +48,18 @@ namespace BWP.B3WeChat.Rpcs
ApproveMessageBL.Instance.Insert(message);
#if !DEBUG
var mainSystemConfig = new MainSystemConfig();
var internetAccessAddress = mainSystemConfig.InternetAccessAddress.Value;
var originUrl = internetAccessAddress + "app/index.html?messageid=" + message.ID;
var messageid = message.ID;
var originUrl = GetMessageInternetAccessUrl(messageid);
SendMessageUtil.SendTodoMessage(openID, context.CustomerName, message.Username, "微信工作流审批", DateTime.Now, originUrl);
}
#endif
public static string GetMessageInternetAccessUrl(string messageid)
{
var mainSystemConfig = new MainSystemConfig();
var internetAccessAddress = mainSystemConfig.InternetAccessAddress.Value;
var originUrl = internetAccessAddress + "app/index.html?messageid=" + messageid;
return originUrl;
}


+ 24
- 0
B3WeChat/Rpcs/ClientRpc.cs View File

@ -1,5 +1,6 @@
using Bwp.MainSystem.BO;
using BWP.B3WeChat.BO;
using BWP.B3WeChat.BO.NamedValueTemplate;
using BWP.B3WeChat.Utils;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
@ -40,6 +41,29 @@ namespace BWP.B3WeChat.Rpcs
SendMessageUtil.SendSystemMessage(CustomerUserContext.Current.GetOpenID(username), username, content);
}
[Rpc]
public static void SendFollowMessage(string username, string content, string businessNo)
{
var query = new DQueryDom(new JoinAlias(typeof(ApproveMessage)));
query.Where.Conditions.Add(DQCondition.EQ("CustomerCode", CustomerUserContext.Current.CustomerCode));
query.Where.Conditions.Add(DQCondition.EQ("BusinessNo", businessNo));
query.Where.Conditions.Add(DQCondition.InList(DQExpression.Field("ApproveResult"),
DQExpression.Value(.), DQExpression.Value(.退)));
query.Range = SelectRange.Top(1);
query.Columns.Add(DQSelectColumn.Field("ID"));
var messageid = query.EExecuteScalar<string>();
if (string.IsNullOrEmpty(messageid))
{
Send(username, content);
return;
}
var url = ApproveMessageRpc.GetMessageInternetAccessUrl(messageid);
SendMessageUtil.SendSystemMessage(CustomerUserContext.Current.GetOpenID(username), username, content, url);
}
static string GetOpenId(string username)
{
string customer = GetDeviceNumber();


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

@ -72,14 +72,14 @@ namespace BWP.B3WeChat.Utils
//时间:{{keyword1.DATA}}
//描述:{{keyword2.DATA}}
//{{remark.DATA}}
public static void SendSystemMessage(string openID,string name,string content)
public static void SendSystemMessage(string openID,string name,string content,string url="")
{
var dict = new Dictionary<string, ValueColor>();
var first = string.Format("你好,ERP系统中的用户{0},系统发给你下面的消息", name);
dict.Add("first",new ValueColor(first));
dict.Add("keyword1", new ValueColor(FormatTime(DateTime.Now)));
dict.Add("keyword2", new ValueColor(content));
InOutMessageUtil.SendTemplateMessage(openID, "QEgY8xa4BuAAcyTex1qXuN9KeKM93O9XHCz2Ti-oCpc", dict);
InOutMessageUtil.SendTemplateMessage(openID, "QEgY8xa4BuAAcyTex1qXuN9KeKM93O9XHCz2Ti-oCpc", dict, url);
}
public static void SendCloseMessage(string openID, string messageID,string description)


Loading…
Cancel
Save