Commit 1748f3ea authored by liudong1993's avatar liudong1993
parents ea45a710 98511c35
......@@ -32,9 +32,11 @@ namespace Mall.Common.Plugin
return flag;
}
string content = string.Format("您有{0}个新订单未支付,请点击链接地址进行支付! ", pushUrlList.Count);
int index = 1;
foreach (var item in pushUrlList)
{
content += item + " \r\n";
content += string.Format("订单{0}:" + item + " \n", index);
index++;
}
//请求路径
string url = string.Format("https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token={0}", access_token);
......
......@@ -91,19 +91,24 @@ namespace Mall.WebApi.Controllers.Adapay
Request.Body.Position = 0;
}
#endregion
Common.Plugin.LogHelper.Write("请求参数:: responseData" + responseData);
if (!string.IsNullOrEmpty(responseData))
{
JObject jobj = JObject.Parse(responseData);
string openId = jobj.GetStringValue("FromUserName");
string MsgType = jobj.GetStringValue("MsgType");
string Conten = jobj.GetStringValue("Content");
if (MsgType == "text" && string.IsNullOrEmpty(openId) && !string.IsNullOrEmpty("支付"))
string Content = jobj.GetStringValue("Content");
Common.Plugin.LogHelper.Write($"请求参数:: openId:{openId} MsgType:{MsgType} Content:{Content}" );
if (MsgType == "text" && !string.IsNullOrEmpty(openId) && !string.IsNullOrEmpty(Content) && Content.Contains("支付"))
{
Task.Run(() =>
{
Common.Plugin.LogHelper.WriteInfo($"消息_推送客服消息:{openId}");
string payInfoKey = CacheManager.DataStatistic.DataConstant.DATA_AliPay_Order + openId;
Common.Plugin.LogHelper.WriteInfo($"消息_推送客服消息:获取缓存");
var zfbPayList = UserReidsCache.GetOrderPay(payInfoKey);
if (zfbPayList != null && zfbPayList.Count > 0)
{
Common.Plugin.LogHelper.WriteInfo($"消息_推送客服缓存:{JsonHelper.Serialize(zfbPayList)}");
List<string> pushUrlList = new List<string>();
foreach (var item in zfbPayList)
{
......@@ -112,10 +117,13 @@ namespace Mall.WebApi.Controllers.Adapay
pushUrlList.Add(item.PayInfo);
}
}
Common.Plugin.LogHelper.WriteInfo($"消息_删除缓存");
//删除缓存
UserReidsCache.DeleteMiniAppUsetOpenId(payInfoKey);
SendMessage(openId, pushUrlList);
Common.Plugin.LogHelper.WriteInfo($"消息_推送客服消息:{openId} ,地址:{JsonHelper.Serialize(pushUrlList)}");
}
});
}
}
......@@ -153,7 +161,7 @@ namespace Mall.WebApi.Controllers.Adapay
System.Threading.Tasks.Task.Run(() => WeiXinReidsCache.Set(miniProgram.MiniAppId, token));
}
Common.Plugin.LogHelper.WriteInfo($"SendMessage:{token}");
bool flag = Common.Plugin.WeChatMessageHelper.SendCustomerMessage(token, toUser, targerList, out string message);
bool flag = Common.Plugin.WeChatMessageHelper.SendCustomerMessage(token, toUser, pushList, out string message);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment