香堤湾 更新消息模板
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Appointment.Api.xml">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Appointment.Entity.xml">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@@ -6,6 +7,7 @@ using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Appointment.Entity
|
||||
{
|
||||
@@ -441,7 +443,7 @@ namespace Appointment.Entity
|
||||
}
|
||||
StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding(encoding));
|
||||
string retString = reader.ReadToEnd();
|
||||
_logger.Info("-->" + itemMsg);
|
||||
_logger.Info("-->" + itemMsg + " response-->" + retString);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(retString))
|
||||
{
|
||||
@@ -464,5 +466,76 @@ namespace Appointment.Entity
|
||||
if (msg.Length > 0) _logger.Error(msg.ToString());
|
||||
|
||||
}
|
||||
|
||||
public static ApiResult SendTempMsg(string msg)
|
||||
{
|
||||
try
|
||||
{
|
||||
string accessTokenMode = BaseConfig.App(new string[] { "AccessTokenMode" });
|
||||
if (string.IsNullOrWhiteSpace(accessTokenMode))
|
||||
{
|
||||
_logger.Error("配置文件中未获取有效的AccessTokenMode");
|
||||
return ApiResult.Failed("配置文件中未获取有效的AccessTokenMode");
|
||||
}
|
||||
|
||||
// 获取 AccessToken
|
||||
string access_token = string.Empty;
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
ApiResult<string> tokenResult = null;
|
||||
if (i == 0)
|
||||
{
|
||||
tokenResult = accessTokenMode == "1" ? AizhuhotelGetAccesstoken() : GetAccessToken();
|
||||
}
|
||||
else
|
||||
{
|
||||
tokenResult = accessTokenMode == "1" ? AizhuhotelGetAccesstoken() : GetAccessToken(true);
|
||||
}
|
||||
if (tokenResult.IsSuccess && !string.IsNullOrEmpty(tokenResult.Info))
|
||||
{
|
||||
access_token = tokenResult.Info;
|
||||
break;
|
||||
}
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(access_token)) return ApiResult.Failed("未获取有效的AccessToken");
|
||||
|
||||
// 推送消息
|
||||
var postUrl = $"https://api.weixin.qq.com/cgi-bin/message/template/send?access_token={access_token}";
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(postUrl);
|
||||
request.Proxy = null;
|
||||
request.Method = "POST";
|
||||
request.ContentType = "application/json";
|
||||
using (StreamWriter dataStream = new StreamWriter(request.GetRequestStream()))
|
||||
{
|
||||
dataStream.Write(msg);
|
||||
dataStream.Close();
|
||||
}
|
||||
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
|
||||
string encoding = response.ContentEncoding;
|
||||
if (encoding == null || encoding.Length < 1)
|
||||
{
|
||||
encoding = "UTF-8"; //默认编码
|
||||
}
|
||||
StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding(encoding));
|
||||
string retString = reader.ReadToEnd();
|
||||
_logger.Info("-->" + msg + " response-->" + retString);
|
||||
if (!string.IsNullOrWhiteSpace(retString))
|
||||
{
|
||||
var sendTemplateMsgRes = JsonConvert.DeserializeObject<SendTemplateMsgRes>(retString);
|
||||
if (sendTemplateMsgRes.Errmsg.ToLower() == "ok")
|
||||
{
|
||||
return ApiResult.Success(string.Empty);
|
||||
}
|
||||
}
|
||||
return ApiResult.Failed(msg: "", info: retString);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Debug(ex.ToString());
|
||||
return ApiResult.Failed(msg: "", info: ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
@@ -9,6 +10,7 @@ namespace Appointment.Entity
|
||||
public class WechatHelper
|
||||
{
|
||||
private static HttpClient _HttpClient = null;
|
||||
static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(WechatHelper));
|
||||
|
||||
static WechatHelper()
|
||||
{
|
||||
@@ -40,6 +42,7 @@ namespace Appointment.Entity
|
||||
if (res.StatusCode == HttpStatusCode.OK)
|
||||
{
|
||||
var result = Encoding.Default.GetString(res.Content.ReadAsByteArrayAsync().Result);
|
||||
log.Info($"jscode2session:{result}");
|
||||
if (string.IsNullOrWhiteSpace(result) || result.IndexOf("session_key") == -1)
|
||||
{
|
||||
return ApiResult<WeChatLoginRes>.Failed("调用微信接口失败,可能code已失效");
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Appointment.IRepository.xml">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Appointment.Repository.xml">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Appointment.Entity;
|
||||
using Appointment.Entity.Utility;
|
||||
using Appointment.IRepository;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using SqlSugar;
|
||||
@@ -1347,21 +1348,38 @@ namespace Appointment.Repository
|
||||
}
|
||||
else if (AppId == "wx2b6e92e9e0c6025f") // 香堤湾
|
||||
{
|
||||
// v_IPzOm9JwAFfJdQLWy11eoHZ9CkOb4PaHbOqosGQcY
|
||||
|
||||
// 审核提醒
|
||||
//===========================
|
||||
// 资料已提交,请尽快审核 {{first.DATA}}
|
||||
// 审核内容:XX资料 审核内容:{{keyword1.DATA}}
|
||||
// 时间:2015-06-22 时间:{{keyword2.DATA}}
|
||||
// 请尽快审核 {{remark.DATA}}
|
||||
//-----------------------------
|
||||
// 详情
|
||||
//===========================
|
||||
string first = $"预定部 {loginUserRes.Info.UserName}取消了您的订单";
|
||||
var keyword = new[] { $"{summaryM.BuyerTitle}", now.ToString("yyyy-MM-dd HH:mm") };
|
||||
string remark = "请注意查看";
|
||||
AizhuhotelHelper.SendTemplateMsg(userWxServiceId, "v_IPzOm9JwAFfJdQLWy11eoHZ9CkOb4PaHbOqosGQcY", $"pages/index/index?hotelid={Hotelid}&status=5", first, remark, keyword);
|
||||
//---------------
|
||||
// {{first.DATA}}
|
||||
// 订单编号:{{OrderSn.DATA}}
|
||||
// 订单状态:{{OrderStatus.DATA}}
|
||||
// {{remark.DATA}}
|
||||
//-----------
|
||||
// 详情 >
|
||||
//---------------
|
||||
// 2024-09-12
|
||||
string appId = BaseConfig.App(new string[] { "WeChat", "AppId" });
|
||||
if (string.IsNullOrWhiteSpace(appId)) ApiResult<WeChatLoginRes>.Failed("缺少配置参数 [AppId]!");
|
||||
var first = $"预定部 {loginUserRes.Info.UserName}取消了您的订单";
|
||||
var json = new
|
||||
{
|
||||
touser = userWxServiceId,
|
||||
template_id = "21Qr9bf5k3UlxD3K6EBKjEnxrz8Djiw6TIu6yExMGLg",
|
||||
miniprogram = new
|
||||
{
|
||||
appid = appId, // 小程序appId
|
||||
pagepath = $"pages/index/index?hotelid={Hotelid}&status=5" // 跳转到小程序中的地址
|
||||
},
|
||||
topcolor = "#FF0000",
|
||||
data = new
|
||||
{
|
||||
first = new { value = first },
|
||||
keyword1 = new { value = summaryM.No },
|
||||
keyword2 = new { value = first },
|
||||
remark = new { value = "请注意查看" }
|
||||
}
|
||||
};
|
||||
var msg = JsonConvert.SerializeObject(json);
|
||||
AizhuhotelHelper.SendTempMsg(msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3529,6 +3547,7 @@ namespace Appointment.Repository
|
||||
DateTime now = DateTime.Now;
|
||||
string AppId = BaseConfig.App(new string[] { "WeChatService", "AppId" });
|
||||
string Hotelid = BaseConfig.App(new string[] { "Hotelid" });
|
||||
string appId = BaseConfig.App(new string[] { "WeChat", "AppId" });// 小程序的appid
|
||||
var userAll = Db.Queryable<UcLogin>().ToList().Replace();
|
||||
var userCreate = userAll.Where(t => t.OpId == summary.UserId).FirstOrDefault();
|
||||
if (userCreate == null) return;
|
||||
@@ -3567,9 +3586,37 @@ namespace Appointment.Repository
|
||||
else if (AppId == "wx2b6e92e9e0c6025f") // 香堤湾
|
||||
{
|
||||
string first = $"{userCreate.OpName}提交了新的预订申请";
|
||||
var keyword = new[] { $"{summary.BuyerTitle}", now.ToString("yyyy-MM-dd HH:mm") };
|
||||
string remark = "请尽快审核";
|
||||
AizhuhotelHelper.SendTemplateMsg(usersPost.Select(t => t.WxServiceId).ToList(), "v_IPzOm9JwAFfJdQLWy11eoHZ9CkOb4PaHbOqosGQcY", $"pages/index/index?hotelid={Hotelid}&status=2", first, remark, keyword);
|
||||
var tousers = usersPost.Select(t => t.WxServiceId).ToList();
|
||||
|
||||
if (tousers != null && tousers.Count > 0)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(appId)) ApiResult<WeChatLoginRes>.Failed("缺少配置参数 [AppId]!");
|
||||
|
||||
foreach (var touser in tousers)
|
||||
{
|
||||
var json = new
|
||||
{
|
||||
touser = touser,
|
||||
template_id = "21Qr9bf5k3UlxD3K6EBKjEnxrz8Djiw6TIu6yExMGLg",
|
||||
miniprogram = new
|
||||
{
|
||||
appid = appId, // 小程序appId
|
||||
pagepath = $"pages/index/index?hotelid={Hotelid}&status=2" // 跳转到小程序中的地址
|
||||
},
|
||||
topcolor = "#FF0000",
|
||||
data = new
|
||||
{
|
||||
first = new { value = first },
|
||||
keyword1 = new { value = $"{summary.BuyerTitle}" },
|
||||
keyword2 = new { value = first },
|
||||
remark = new { value = remark }
|
||||
}
|
||||
};
|
||||
var msg = JsonConvert.SerializeObject(json);
|
||||
AizhuhotelHelper.SendTempMsg(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3596,16 +3643,41 @@ namespace Appointment.Repository
|
||||
}
|
||||
else if (AppId == "wx2b6e92e9e0c6025f") // 香堤湾
|
||||
{
|
||||
if (createUserOpenid != null && createUserOpenid.Count > 0)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(appId)) ApiResult<WeChatLoginRes>.Failed("缺少配置参数 [AppId]!");
|
||||
|
||||
string audoter = userAll.Where(t => t.OpId == audimM.UserId).FirstOrDefault()?.OpName;
|
||||
string first = $"预定部{audoter}审核通过了您的预定申请";
|
||||
|
||||
var keyword = new[] { $"{summary.BuyerTitle}", now.ToString("yyyy-MM-dd HH:mm") };
|
||||
|
||||
string remark = "";
|
||||
if (!string.IsNullOrEmpty(audimM.Remark)) remark += $"审核评语[{audimM.Remark}],";
|
||||
remark += "后续流程:请等待销售经理审核";
|
||||
|
||||
AizhuhotelHelper.SendTemplateMsg(createUserOpenid, "v_IPzOm9JwAFfJdQLWy11eoHZ9CkOb4PaHbOqosGQcY", $"pages/index/index?hotelid={Hotelid}&status=7", first, remark, keyword);
|
||||
foreach (var createUserOpenidItem in createUserOpenid)
|
||||
{
|
||||
var json = new
|
||||
{
|
||||
touser = createUserOpenidItem,
|
||||
template_id = "21Qr9bf5k3UlxD3K6EBKjEnxrz8Djiw6TIu6yExMGLg",
|
||||
miniprogram = new
|
||||
{
|
||||
appid = appId, // 小程序appId
|
||||
pagepath = $"pages/index/index?hotelid={Hotelid}&status=7" // 跳转到小程序中的地址
|
||||
},
|
||||
topcolor = "#FF0000",
|
||||
data = new
|
||||
{
|
||||
first = new { value = first },
|
||||
keyword1 = new { value = $"{summary.BuyerTitle}" },
|
||||
keyword2 = new { value = first },
|
||||
remark = new { value = remark }
|
||||
}
|
||||
};
|
||||
var msg = JsonConvert.SerializeObject(json);
|
||||
AizhuhotelHelper.SendTempMsg(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3630,9 +3702,36 @@ namespace Appointment.Repository
|
||||
else if (AppId == "wx2b6e92e9e0c6025f") // 香堤湾
|
||||
{
|
||||
string first = $"{userCreate.OpName}提交了预订申请";
|
||||
var keyword = new[] { $"{summary.BuyerTitle}", now.ToString("yyyy-MM-dd HH:mm") };
|
||||
string remark = "请尽快审核";
|
||||
AizhuhotelHelper.SendTemplateMsg(usersPost.Select(t => t.WxServiceId).ToList(), "v_IPzOm9JwAFfJdQLWy11eoHZ9CkOb4PaHbOqosGQcY", $"pages/index/index?hotelid={Hotelid}&status=2", first, remark, keyword);
|
||||
|
||||
var tousers = usersPost.Select(t => t.WxServiceId).ToList();
|
||||
if (tousers != null && tousers.Count > 0)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(appId)) ApiResult<WeChatLoginRes>.Failed("缺少配置参数 [AppId]!");
|
||||
foreach (var touser in tousers)
|
||||
{
|
||||
var json = new
|
||||
{
|
||||
touser = touser,
|
||||
template_id = "21Qr9bf5k3UlxD3K6EBKjEnxrz8Djiw6TIu6yExMGLg",
|
||||
miniprogram = new
|
||||
{
|
||||
appid = appId, // 小程序appId
|
||||
pagepath = $"pages/index/index?hotelid={Hotelid}&status=2" // 跳转到小程序中的地址
|
||||
},
|
||||
topcolor = "#FF0000",
|
||||
data = new
|
||||
{
|
||||
first = new { value = first },
|
||||
keyword1 = new { value = summary.BuyerTitle },
|
||||
keyword2 = new { value = first },
|
||||
remark = new { value = remark }
|
||||
}
|
||||
};
|
||||
var msg = JsonConvert.SerializeObject(json);
|
||||
AizhuhotelHelper.SendTempMsg(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3658,17 +3757,39 @@ namespace Appointment.Repository
|
||||
AizhuhotelHelper.SendTemplateMsg(createUserOpenid, "80CnTAF5tLIPJgi6GPS2eEit-bDqFZ_IjYEeGjarQx8", $"pages/index/index?hotelid={Hotelid}&status=7", first, remark, keyword);
|
||||
}
|
||||
else if (AppId == "wx2b6e92e9e0c6025f") // 香堤湾
|
||||
{
|
||||
if (createUserOpenid != null && createUserOpenid.Count > 0)
|
||||
{
|
||||
string audoter = userAll.Where(t => t.OpId == audimM.UserId).FirstOrDefault()?.OpName;
|
||||
string first = $"销售经理{audoter}审核通过了您的预订申请";
|
||||
|
||||
var keyword = new[] { $"{summary.BuyerTitle}", now.ToString("yyyy-MM-dd HH:mm") };
|
||||
|
||||
string remark = "";
|
||||
if (!string.IsNullOrEmpty(audimM.Remark)) remark += $"审核评语[{audimM.Remark}],";
|
||||
remark += "后续流程:请等待财务经理审核";
|
||||
|
||||
AizhuhotelHelper.SendTemplateMsg(createUserOpenid, "v_IPzOm9JwAFfJdQLWy11eoHZ9CkOb4PaHbOqosGQcY", $"pages/index/index?hotelid={Hotelid}&status=7", first, remark, keyword);
|
||||
foreach (var item in createUserOpenid)
|
||||
{
|
||||
var json = new
|
||||
{
|
||||
touser = item,
|
||||
template_id = "21Qr9bf5k3UlxD3K6EBKjEnxrz8Djiw6TIu6yExMGLg",
|
||||
miniprogram = new
|
||||
{
|
||||
appid = appId, // 小程序appId
|
||||
pagepath = $"pages/index/index?hotelid={Hotelid}&status=7" // 跳转到小程序中的地址
|
||||
},
|
||||
topcolor = "#FF0000",
|
||||
data = new
|
||||
{
|
||||
first = new { value = first },
|
||||
keyword1 = new { value = summary.BuyerTitle },
|
||||
keyword2 = new { value = first },
|
||||
remark = new { value = remark }
|
||||
}
|
||||
};
|
||||
var msg = JsonConvert.SerializeObject(json);
|
||||
AizhuhotelHelper.SendTempMsg(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3691,11 +3812,37 @@ namespace Appointment.Repository
|
||||
AizhuhotelHelper.SendTemplateMsg(usersPost.Select(t => t.WxServiceId).ToList(), "80CnTAF5tLIPJgi6GPS2eEit-bDqFZ_IjYEeGjarQx8", $"pages/index/index?hotelid={Hotelid}&status=2", first, remark, keyword);
|
||||
}
|
||||
else if (AppId == "wx2b6e92e9e0c6025f") // 香堤湾
|
||||
{
|
||||
var tousers = usersPost.Select(t => t.WxServiceId).ToList();
|
||||
if (tousers != null && tousers.Count > 0)
|
||||
{
|
||||
string first = $"{userCreate.OpName}提交了预订申请";
|
||||
var keyword = new[] { $"{summary.BuyerTitle}", now.ToString("yyyy-MM-dd HH:mm") };
|
||||
string remark = "请尽快审核";
|
||||
AizhuhotelHelper.SendTemplateMsg(usersPost.Select(t => t.WxServiceId).ToList(), "v_IPzOm9JwAFfJdQLWy11eoHZ9CkOb4PaHbOqosGQcY", $"pages/index/index?hotelid={Hotelid}&status=2", first, remark, keyword);
|
||||
foreach (var touser in tousers)
|
||||
{
|
||||
var json = new
|
||||
{
|
||||
touser = touser,
|
||||
template_id = "21Qr9bf5k3UlxD3K6EBKjEnxrz8Djiw6TIu6yExMGLg",
|
||||
miniprogram = new
|
||||
{
|
||||
appid = appId, // 小程序appId
|
||||
pagepath = $"pages/index/index?hotelid={Hotelid}&status=2" // 跳转到小程序中的地址
|
||||
},
|
||||
topcolor = "#FF0000",
|
||||
data = new
|
||||
{
|
||||
first = new { value = first },
|
||||
keyword1 = new { value = summary.BuyerTitle },
|
||||
keyword2 = new { value = first },
|
||||
remark = new { value = remark }
|
||||
}
|
||||
};
|
||||
var msg = JsonConvert.SerializeObject(json);
|
||||
AizhuhotelHelper.SendTempMsg(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3721,17 +3868,41 @@ namespace Appointment.Repository
|
||||
AizhuhotelHelper.SendTemplateMsg(createUserOpenid, "80CnTAF5tLIPJgi6GPS2eEit-bDqFZ_IjYEeGjarQx8", $"pages/index/index?hotelid={Hotelid}&status=7", first, remark, keyword);
|
||||
}
|
||||
else if (AppId == "wx2b6e92e9e0c6025f") // 香堤湾
|
||||
{
|
||||
if (createUserOpenid != null && createUserOpenid.Count > 0)
|
||||
{
|
||||
string audoter = userAll.Where(t => t.OpId == audimM.UserId).FirstOrDefault()?.OpName;
|
||||
string first = $"财务经理{audoter}审核通过了您的预订申请";
|
||||
|
||||
var keyword = new[] { $"{summary.BuyerTitle}", now.ToString("yyyy-MM-dd HH:mm") };
|
||||
|
||||
string remark = "";
|
||||
if (!string.IsNullOrEmpty(audimM.Remark)) remark += $"审核评语[{audimM.Remark}],";
|
||||
remark += "后续流程:请等待财务总监审核";
|
||||
foreach (var item in createUserOpenid)
|
||||
{
|
||||
var json = new
|
||||
{
|
||||
touser = item,
|
||||
template_id = "21Qr9bf5k3UlxD3K6EBKjEnxrz8Djiw6TIu6yExMGLg",
|
||||
miniprogram = new
|
||||
{
|
||||
appid = appId, // 小程序appId
|
||||
pagepath = $"pages/index/index?hotelid={Hotelid}&status=7" // 跳转到小程序中的地址
|
||||
},
|
||||
topcolor = "#FF0000",
|
||||
data = new
|
||||
{
|
||||
first = new { value = first },
|
||||
keyword1 = new { value = summary.BuyerTitle },
|
||||
keyword2 = new { value = first },
|
||||
remark = new { value = remark }
|
||||
}
|
||||
};
|
||||
var msg = JsonConvert.SerializeObject(json);
|
||||
AizhuhotelHelper.SendTempMsg(msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
AizhuhotelHelper.SendTemplateMsg(createUserOpenid, "v_IPzOm9JwAFfJdQLWy11eoHZ9CkOb4PaHbOqosGQcY", $"pages/index/index?hotelid={Hotelid}&status=7", first, remark, keyword);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3754,11 +3925,37 @@ namespace Appointment.Repository
|
||||
AizhuhotelHelper.SendTemplateMsg(usersPost.Select(t => t.WxServiceId).ToList(), "80CnTAF5tLIPJgi6GPS2eEit-bDqFZ_IjYEeGjarQx8", $"pages/index/index?hotelid={Hotelid}&status=2", first, remark, keyword);
|
||||
}
|
||||
else if (AppId == "wx2b6e92e9e0c6025f") // 香堤湾
|
||||
{
|
||||
|
||||
var tousers = usersPost.Select(t => t.WxServiceId).ToList();
|
||||
if (tousers != null && tousers.Count > 0)
|
||||
{
|
||||
string first = $"{userCreate.OpName}提交了预订申请";
|
||||
var keyword = new[] { $"{summary.BuyerTitle}", now.ToString("yyyy-MM-dd HH:mm") };
|
||||
string remark = "请尽快审核";
|
||||
AizhuhotelHelper.SendTemplateMsg(usersPost.Select(t => t.WxServiceId).ToList(), "v_IPzOm9JwAFfJdQLWy11eoHZ9CkOb4PaHbOqosGQcY", $"pages/index/index?hotelid={Hotelid}&status=2", first, remark, keyword);
|
||||
foreach (var touser in tousers)
|
||||
{
|
||||
var json = new
|
||||
{
|
||||
touser = touser,
|
||||
template_id = "21Qr9bf5k3UlxD3K6EBKjEnxrz8Djiw6TIu6yExMGLg",
|
||||
miniprogram = new
|
||||
{
|
||||
appid = appId, // 小程序appId
|
||||
pagepath = $"pages/index/index?hotelid={Hotelid}&status=2" // 跳转到小程序中的地址
|
||||
},
|
||||
topcolor = "#FF0000",
|
||||
data = new
|
||||
{
|
||||
first = new { value = first },
|
||||
keyword1 = new { value = summary.BuyerTitle },
|
||||
keyword2 = new { value = first },
|
||||
remark = new { value = remark }
|
||||
}
|
||||
};
|
||||
var msg = JsonConvert.SerializeObject(json);
|
||||
AizhuhotelHelper.SendTempMsg(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3784,17 +3981,40 @@ namespace Appointment.Repository
|
||||
AizhuhotelHelper.SendTemplateMsg(createUserOpenid, "80CnTAF5tLIPJgi6GPS2eEit-bDqFZ_IjYEeGjarQx8", $"pages/index/index?hotelid={Hotelid}&status=7", first, remark, keyword);
|
||||
}
|
||||
else if (AppId == "wx2b6e92e9e0c6025f") // 香堤湾
|
||||
{
|
||||
if (createUserOpenid != null && createUserOpenid.Count > 0)
|
||||
{
|
||||
string audoter = userAll.Where(t => t.OpId == audimM.UserId).FirstOrDefault()?.OpName;
|
||||
string first = $"财务总监{audoter}审核通过了您的预订申请";
|
||||
|
||||
var keyword = new[] { $"{summary.BuyerTitle}", now.ToString("yyyy-MM-dd HH:mm") };
|
||||
|
||||
string remark = "";
|
||||
if (!string.IsNullOrEmpty(audimM.Remark)) remark += $"审核评语[{audimM.Remark}],";
|
||||
remark += "后续流程:请等待总经理审核";
|
||||
|
||||
AizhuhotelHelper.SendTemplateMsg(createUserOpenid, "v_IPzOm9JwAFfJdQLWy11eoHZ9CkOb4PaHbOqosGQcY", $"pages/index/index?hotelid={Hotelid}&status=7", first, remark, keyword);
|
||||
foreach (var item in createUserOpenid)
|
||||
{
|
||||
var json = new
|
||||
{
|
||||
touser = item,
|
||||
template_id = "21Qr9bf5k3UlxD3K6EBKjEnxrz8Djiw6TIu6yExMGLg",
|
||||
miniprogram = new
|
||||
{
|
||||
appid = appId, // 小程序appId
|
||||
pagepath = $"pages/index/index?hotelid={Hotelid}&status=7" // 跳转到小程序中的地址
|
||||
},
|
||||
topcolor = "#FF0000",
|
||||
data = new
|
||||
{
|
||||
first = new { value = first },
|
||||
keyword1 = new { value = summary.BuyerTitle },
|
||||
keyword2 = new { value = first },
|
||||
remark = new { value = remark }
|
||||
}
|
||||
};
|
||||
var msg = JsonConvert.SerializeObject(json);
|
||||
AizhuhotelHelper.SendTempMsg(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3817,11 +4037,38 @@ namespace Appointment.Repository
|
||||
AizhuhotelHelper.SendTemplateMsg(usersPost.Select(t => t.WxServiceId).ToList(), "80CnTAF5tLIPJgi6GPS2eEit-bDqFZ_IjYEeGjarQx8", $"pages/index/index?hotelid={Hotelid}&status=2", first, remark, keyword);
|
||||
}
|
||||
else if (AppId == "wx2b6e92e9e0c6025f") // 香堤湾
|
||||
{
|
||||
var tousers = usersPost.Select(t => t.WxServiceId).ToList();
|
||||
if (tousers != null && tousers.Count > 0)
|
||||
{
|
||||
string first = $"{userCreate.OpName}提交了预订申请";
|
||||
var keyword = new[] { $"{summary.BuyerTitle}", now.ToString("yyyy-MM-dd HH:mm") };
|
||||
string remark = "请尽快审核";
|
||||
AizhuhotelHelper.SendTemplateMsg(usersPost.Select(t => t.WxServiceId).ToList(), "v_IPzOm9JwAFfJdQLWy11eoHZ9CkOb4PaHbOqosGQcY", $"pages/index/index?hotelid={Hotelid}&status=2", first, remark, keyword);
|
||||
|
||||
foreach (var touser in tousers)
|
||||
{
|
||||
var json = new
|
||||
{
|
||||
touser = touser,
|
||||
template_id = "21Qr9bf5k3UlxD3K6EBKjEnxrz8Djiw6TIu6yExMGLg",
|
||||
miniprogram = new
|
||||
{
|
||||
appid = appId, // 小程序appId
|
||||
pagepath = $"pages/index/index?hotelid={Hotelid}&status=2" // 跳转到小程序中的地址
|
||||
},
|
||||
topcolor = "#FF0000",
|
||||
data = new
|
||||
{
|
||||
first = new { value = first },
|
||||
keyword1 = new { value = summary.BuyerTitle },
|
||||
keyword2 = new { value = first },
|
||||
remark = new { value = remark }
|
||||
}
|
||||
};
|
||||
var msg = JsonConvert.SerializeObject(json);
|
||||
AizhuhotelHelper.SendTempMsg(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3847,17 +4094,40 @@ namespace Appointment.Repository
|
||||
AizhuhotelHelper.SendTemplateMsg(createUserOpenid, "80CnTAF5tLIPJgi6GPS2eEit-bDqFZ_IjYEeGjarQx8", $"pages/index/index?hotelid={Hotelid}&status=8", first, remark, keyword);
|
||||
}
|
||||
else if (AppId == "wx2b6e92e9e0c6025f") // 香堤湾
|
||||
{
|
||||
if (createUserOpenid != null && createUserOpenid.Count > 0)
|
||||
{
|
||||
string audoter = userAll.Where(t => t.OpId == audimM.UserId).FirstOrDefault()?.OpName;
|
||||
string first = $"总经理{audoter}审核通过了您的预订申请";
|
||||
|
||||
var keyword = new[] { $"{summary.BuyerTitle}", now.ToString("yyyy-MM-dd HH:mm") };
|
||||
|
||||
string remark = "";
|
||||
if (!string.IsNullOrEmpty(audimM.Remark)) remark += $"审核评语[{audimM.Remark}],";
|
||||
remark += "后续流程:请团队来临前生成完成单,以便触发消息推送给相关人员";
|
||||
|
||||
AizhuhotelHelper.SendTemplateMsg(createUserOpenid, "v_IPzOm9JwAFfJdQLWy11eoHZ9CkOb4PaHbOqosGQcY", $"pages/index/index?hotelid={Hotelid}&status=8", first, remark, keyword);
|
||||
foreach (var item in createUserOpenid)
|
||||
{
|
||||
var json = new
|
||||
{
|
||||
touser = item,
|
||||
template_id = "21Qr9bf5k3UlxD3K6EBKjEnxrz8Djiw6TIu6yExMGLg",
|
||||
miniprogram = new
|
||||
{
|
||||
appid = appId, // 小程序appId
|
||||
pagepath = $"pages/index/index?hotelid={Hotelid}&status=8" // 跳转到小程序中的地址
|
||||
},
|
||||
topcolor = "#FF0000",
|
||||
data = new
|
||||
{
|
||||
first = new { value = first },
|
||||
keyword1 = new { value = summary.BuyerTitle },
|
||||
keyword2 = new { value = first },
|
||||
remark = new { value = remark }
|
||||
}
|
||||
};
|
||||
var msg = JsonConvert.SerializeObject(json);
|
||||
AizhuhotelHelper.SendTempMsg(msg);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3908,6 +4178,8 @@ namespace Appointment.Repository
|
||||
AizhuhotelHelper.SendTemplateMsg(createUserOpenid, "80CnTAF5tLIPJgi6GPS2eEit-bDqFZ_IjYEeGjarQx8", $"pages/index/index?hotelid={Hotelid}&status=4", first, remark, keyword);
|
||||
}
|
||||
else if (AppId == "wx2b6e92e9e0c6025f") // 香堤湾
|
||||
{
|
||||
if (createUserOpenid != null && createUserOpenid.Count > 0)
|
||||
{
|
||||
// 获取驳回前最后一条审核记录以推理驳回人的角色
|
||||
// 因为驳回即发送信息,不做严谨判断了
|
||||
@@ -3937,15 +4209,34 @@ namespace Appointment.Repository
|
||||
|
||||
string audoter = userAll.Where(t => t.OpId == audimM.UserId).FirstOrDefault()?.OpName;
|
||||
var first = $"{zw}{audoter}驳回了您的预订申请";
|
||||
|
||||
|
||||
var keyword = new[] { $"{summary.BuyerTitle}", now.ToString("yyyy-MM-dd HH:mm") };
|
||||
|
||||
string remark = "";
|
||||
if (!string.IsNullOrEmpty(audimM.Remark)) remark += $"驳回评语[{audimM.Remark}],";
|
||||
remark += "后续流程:请核对信息进行修改后重新提交";
|
||||
|
||||
AizhuhotelHelper.SendTemplateMsg(createUserOpenid, "v_IPzOm9JwAFfJdQLWy11eoHZ9CkOb4PaHbOqosGQcY", $"pages/index/index?hotelid={Hotelid}&status=4", first, remark, keyword);
|
||||
foreach (var item in createUserOpenid)
|
||||
{
|
||||
var json = new
|
||||
{
|
||||
touser = item,
|
||||
template_id = "21Qr9bf5k3UlxD3K6EBKjEnxrz8Djiw6TIu6yExMGLg",
|
||||
miniprogram = new
|
||||
{
|
||||
appid = appId, // 小程序appId
|
||||
pagepath = $"pages/index/index?hotelid={Hotelid}&status=4" // 跳转到小程序中的地址
|
||||
},
|
||||
topcolor = "#FF0000",
|
||||
data = new
|
||||
{
|
||||
first = new { value = first },
|
||||
keyword1 = new { value = summary.BuyerTitle },
|
||||
keyword2 = new { value = first },
|
||||
remark = new { value = remark }
|
||||
}
|
||||
};
|
||||
var msg = JsonConvert.SerializeObject(json);
|
||||
AizhuhotelHelper.SendTempMsg(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3975,6 +4266,8 @@ namespace Appointment.Repository
|
||||
DateTime now = DateTime.Now;
|
||||
string AppId = BaseConfig.App(new string[] { "WeChatService", "AppId" });
|
||||
string Hotelid = BaseConfig.App(new string[] { "Hotelid" });
|
||||
string appId = BaseConfig.App(new string[] { "WeChat", "AppId" });
|
||||
if (string.IsNullOrWhiteSpace(appId)) ApiResult<WeChatLoginRes>.Failed("缺少配置参数 [AppId]!");
|
||||
if (AppId == "wx3f193488e04b2ed8")
|
||||
{
|
||||
string first = "";
|
||||
@@ -4023,11 +4316,26 @@ namespace Appointment.Repository
|
||||
}
|
||||
}
|
||||
msgremark += "请关注订单信息";
|
||||
|
||||
var keyword = new[] { $"{buyerTitle}", now.ToString("yyyy-MM-dd HH:mm") };
|
||||
|
||||
|
||||
AizhuhotelHelper.SendTemplateMsg(wxSericeOpenId, "v_IPzOm9JwAFfJdQLWy11eoHZ9CkOb4PaHbOqosGQcY", $"pages/index/index?hotelid={Hotelid}&status=6", first, msgremark, keyword);
|
||||
var json = new
|
||||
{
|
||||
touser = wxSericeOpenId,
|
||||
template_id = "21Qr9bf5k3UlxD3K6EBKjEnxrz8Djiw6TIu6yExMGLg",
|
||||
miniprogram = new
|
||||
{
|
||||
appid = appId, // 小程序appId
|
||||
pagepath = $"pages/index/index?hotelid={Hotelid}&status=6" // 跳转到小程序中的地址
|
||||
},
|
||||
topcolor = "#FF0000",
|
||||
data = new
|
||||
{
|
||||
first = new { value = first },
|
||||
keyword1 = new { value = buyerTitle },
|
||||
keyword2 = new { value = first },
|
||||
remark = new { value = msgremark }
|
||||
}
|
||||
};
|
||||
var msg = JsonConvert.SerializeObject(json);
|
||||
AizhuhotelHelper.SendTempMsg(msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user