Commit 1268abd5 authored by 吴春's avatar 吴春

1

parent e7f559c7
...@@ -31,6 +31,7 @@ using Edu.Model.Public; ...@@ -31,6 +31,7 @@ using Edu.Model.Public;
using Edu.Module.User; using Edu.Module.User;
using Senparc.Weixin.MP.AdvancedAPIs; using Senparc.Weixin.MP.AdvancedAPIs;
using Edu.Model.ViewModel.Sell; using Edu.Model.ViewModel.Sell;
using Senparc.CO2NET.Extensions;
namespace Edu.Module.Duty namespace Edu.Module.Duty
{ {
...@@ -316,12 +317,15 @@ namespace Edu.Module.Duty ...@@ -316,12 +317,15 @@ namespace Edu.Module.Duty
{ {
queryNotifyManager.ForEach(x => queryNotifyManager.ForEach(x =>
{ {
var path = $"/h5page/TrialClass?Id={model.Id}";//这个地址是欠费的通知地址,后续有H5需要改 if (!string.IsNullOrWhiteSpace(x.WorkUserId))
path = HttpUtility.UrlEncode(path); {
string newUrl = $"{Config.ErpUrl}/login?loginId={x.Id}&target={path}"; var path = $"/h5page/TrialClass?Id={model.Id}";//这个地址是欠费的通知地址,后续有H5需要改
Common.Plugin.LogHelper.WriteInfo("试听推送::" + newUrl); path = HttpUtility.UrlEncode(path);
var content = $"<font color='info'>学员试听课通知</font>\n>**概要信息** \n>学员名称:<font color='warning'>{guestModel.StuName}({guestModel.StuRealMobile})</font>\n>预约时间:<font color='warning'>{Common.ConvertHelper.FormatDate(model.ReservationDate)}</font>\n>试听需求:<font color='warning'>{Common.Plugin.StringHelper.FilterHtml(model.Demand)}</font>\n>请 点 击:[查看详情]({newUrl})"; string newUrl = $"{Config.ErpUrl}/login?loginId={x.Id}&target={path}";
PushWorkChatHelper.PushToWorkChat(content, x.WorkUserId, "学员试听课通知"); Common.Plugin.LogHelper.WriteInfo("试听推送::" + newUrl);
var content = $"<font color='info'>学员试听课通知</font>\n>**概要信息** \n>学员名称:<font color='warning'>{guestModel.StuName}({guestModel.StuRealMobile})</font>\n>预约时间:<font color='warning'>{Common.ConvertHelper.FormatDate(model.ReservationDate)}</font>\n>试听需求:<font color='warning'>{Common.Plugin.StringHelper.FilterHtml(model.Demand)}</font>\n>请 点 击:[查看详情]({newUrl})";
PushWorkChatHelper.PushToWorkChat(content, x.WorkUserId, "学员试听课通知");
}
}); });
} }
#endregion #endregion
...@@ -382,21 +386,24 @@ namespace Edu.Module.Duty ...@@ -382,21 +386,24 @@ namespace Edu.Module.Duty
string markdownContent = $@"`留学需求通知` 学员留学需求通知\n>**概要信息** \n>学员名称:{studentModel.StuName}({studentModel.StuRealMobile})\n> string markdownContent = $@"`留学需求通知` 学员留学需求通知\n>**概要信息** \n>学员名称:{studentModel.StuName}({studentModel.StuRealMobile})\n>
留学需求:<font color='warning'>{model.Remark}\n> 留学需求:<font color='warning'>{model.Remark}\n>
请点击:[查看详情]({Config.ErpUrl}/autologin?loginId={x.Id}&target={path})"; 请点击:[查看详情]({Config.ErpUrl}/autologin?loginId={x.Id}&target={path})";
Common.Message.PushMessageModel modelWork = new Common.Message.PushMessageModel() if (!string.IsNullOrWhiteSpace(x.WorkUserId))
{ {
CategoryId = PushMessageCategoryEnum.SalePeople, Common.Message.PushMessageModel modelWork = new Common.Message.PushMessageModel()
Content = markdownContent, {
CoverImg = "", CategoryId = PushMessageCategoryEnum.SalePeople,
CreateByName = userInfo.AccountName, Content = markdownContent,
JumpUrl = "", CoverImg = "",
WorkMsgType = "markdown", CreateByName = userInfo.AccountName,
SendTime = DateTime.Now, JumpUrl = "",
SendType = 0, WorkMsgType = "markdown",
Title = "学员留学需求通知", SendTime = DateTime.Now,
Platform = 5, SendType = 0,
ReceiveId = x.WorkUserId??"" Title = "学员留学需求通知",
}; Platform = 5,
pushList.Add(modelWork); ReceiveId = x.WorkUserId ?? ""
};
pushList.Add(modelWork);
}
}); });
if (pushList != null && pushList.Any()) if (pushList != null && pushList.Any())
{ {
...@@ -455,21 +462,24 @@ namespace Edu.Module.Duty ...@@ -455,21 +462,24 @@ namespace Edu.Module.Duty
{ {
queryNotifyManager.ForEach(x => queryNotifyManager.ForEach(x =>
{ {
Common.Message.PushMessageModel modelWork = new Common.Message.PushMessageModel() if (!string.IsNullOrWhiteSpace(x.WorkUserId))
{ {
CategoryId = PushMessageCategoryEnum.ReserveClass, Common.Message.PushMessageModel modelWork = new Common.Message.PushMessageModel()
Content = markdownContents + $"/autologin?loginId={x.Id}&target={paths})", {
CoverImg = "", CategoryId = PushMessageCategoryEnum.ReserveClass,
CreateByName = "系统", Content = markdownContents + $"/autologin?loginId={x.Id}&target={paths})",
JumpUrl = "", CoverImg = "",
WorkMsgType = "markdown", CreateByName = "系统",
SendTime = DateTime.Now, JumpUrl = "",
SendType = 0, WorkMsgType = "markdown",
Title = "学员试听课通知", SendTime = DateTime.Now,
Platform = 5, SendType = 0,
ReceiveId = x.WorkUserId Title = "学员试听课通知",
}; Platform = 5,
pushList.Add(modelWork); ReceiveId = x.WorkUserId
};
pushList.Add(modelWork);
}
}); });
} }
...@@ -482,20 +492,24 @@ namespace Edu.Module.Duty ...@@ -482,20 +492,24 @@ namespace Edu.Module.Duty
}); });
foreach (var item in teacherList) foreach (var item in teacherList)
{ {
Common.Message.PushMessageModel pushModels = new Common.Message.PushMessageModel() if (!string.IsNullOrWhiteSpace(item.WorkUserId))
{ {
CategoryId = PushMessageCategoryEnum.ReserveClass, Common.Message.PushMessageModel pushModels = new Common.Message.PushMessageModel()
Content = markdownContents + $"/autologin?loginId={item.Id}&target={paths})", {
CoverImg = "", CategoryId = PushMessageCategoryEnum.ReserveClass,
CreateByName = UserInfo.AccountName, Content = markdownContents + $"/autologin?loginId={item.Id}&target={paths})",
JumpUrl = "", CoverImg = "",
SendTime = DateTime.Now, CreateByName = UserInfo.AccountName,
SendType = 0, JumpUrl = "",
Title = "试听课", SendTime = DateTime.Now,
Platform = 2, SendType = 0,
ReceiveId = (item?.WorkUserId).ToString(), Title = "试听课",
}; Platform = 2,
pushList.Add(pushModels); ReceiveId = (item?.WorkUserId).ToString(),
};
pushList.Add(pushModels);
}
} }
if (pushList != null && pushList.Any()) if (pushList != null && pushList.Any())
{ {
...@@ -1066,20 +1080,23 @@ namespace Edu.Module.Duty ...@@ -1066,20 +1080,23 @@ namespace Edu.Module.Duty
#region 老师消息推送 #region 老师消息推送
if (model.TeacherId != oldTeacherId && oldTeacherId > 0) if (model.TeacherId != oldTeacherId && oldTeacherId > 0)
{ {
Common.Message.PushMessageModel pushModel2 = new Common.Message.PushMessageModel() if (!string.IsNullOrWhiteSpace((teacherList.Where(qitem => qitem.AccountId == oldTeacherId)?.FirstOrDefault()?.WorkUserId)))
{ {
CategoryId = PushMessageCategoryEnum.ReserveClass, Common.Message.PushMessageModel pushModel2 = new Common.Message.PushMessageModel()
Content = "您有试听课被取消!请查收", {
CoverImg = "", CategoryId = PushMessageCategoryEnum.ReserveClass,
CreateByName = UserInfo.AccountName, Content = "您有试听课被取消!请查收",
JumpUrl = $"/course/classPlan?ClassType=2", CoverImg = "",
SendTime = DateTime.Now, CreateByName = UserInfo.AccountName,
SendType = 0, JumpUrl = $"/course/classPlan?ClassType=2",
Title = "试听课", SendTime = DateTime.Now,
Platform = 2, SendType = 0,
ReceiveId = (teacherList.Where(qitem => qitem.AccountId == oldTeacherId)?.FirstOrDefault()?.WorkUserId).ToString(), Title = "试听课",
}; Platform = 2,
pushList.Add(pushModel2); ReceiveId = (teacherList.Where(qitem => qitem.AccountId == oldTeacherId)?.FirstOrDefault()?.WorkUserId).ToString(),
};
pushList.Add(pushModel2);
}
} }
var path = $"/course/classPlan?ClassType=2";// var path = $"/course/classPlan?ClassType=2";//
path = HttpUtility.UrlEncode(path); path = HttpUtility.UrlEncode(path);
...@@ -1090,21 +1107,24 @@ namespace Edu.Module.Duty ...@@ -1090,21 +1107,24 @@ namespace Edu.Module.Duty
课程名称:<font color='warning'>{model.LessonName}\n> 课程名称:<font color='warning'>{model.LessonName}\n>
教室:<font color='warning'>{model.RoomName}\n> 教室:<font color='warning'>{model.RoomName}\n>
请点击:[查看详情]({Config.ErpUrl}/autologin?loginId={(teacherList.Where(qitem => qitem.AccountId == model.TeacherId)?.FirstOrDefault()?.Id ?? 0)}&target={path})"; 请点击:[查看详情]({Config.ErpUrl}/autologin?loginId={(teacherList.Where(qitem => qitem.AccountId == model.TeacherId)?.FirstOrDefault()?.Id ?? 0)}&target={path})";
Common.Message.PushMessageModel pushModel = new Common.Message.PushMessageModel() if (!string.IsNullOrWhiteSpace((teacherList.Where(qitem => qitem.AccountId == model.TeacherId)?.FirstOrDefault()?.WorkUserId ?? "")))
{ {
CategoryId = PushMessageCategoryEnum.ReserveClass, Common.Message.PushMessageModel pushModel = new Common.Message.PushMessageModel()
Content = markdownContent, {
CoverImg = "", CategoryId = PushMessageCategoryEnum.ReserveClass,
CreateByName = UserInfo.AccountName, Content = markdownContent,
JumpUrl = "", CoverImg = "",
WorkMsgType = "markdown", CreateByName = UserInfo.AccountName,
SendTime = DateTime.Now, JumpUrl = "",
SendType = 0, WorkMsgType = "markdown",
Title = "学员试听课通知", SendTime = DateTime.Now,
Platform = 2, SendType = 0,
ReceiveId = (teacherList.Where(qitem => qitem.AccountId == model.TeacherId)?.FirstOrDefault()?.WorkUserId ?? "").ToString(), Title = "学员试听课通知",
}; Platform = 2,
pushList.Add(pushModel); ReceiveId = (teacherList.Where(qitem => qitem.AccountId == model.TeacherId)?.FirstOrDefault()?.WorkUserId ?? "").ToString(),
};
pushList.Add(pushModel);
}
#endregion #endregion
#region 销售消息推送 #region 销售消息推送
...@@ -1123,21 +1143,24 @@ namespace Edu.Module.Duty ...@@ -1123,21 +1143,24 @@ namespace Edu.Module.Duty
课程名称:<font color='warning'>{model.LessonName}\n> 课程名称:<font color='warning'>{model.LessonName}\n>
教室:<font color='warning'>{model.RoomName}\n> 教室:<font color='warning'>{model.RoomName}\n>
请点击:[查看详情]({Config.ErpUrl}/autologin?loginId={modelReserve.CreateBy}&target={paths})"; 请点击:[查看详情]({Config.ErpUrl}/autologin?loginId={modelReserve.CreateBy}&target={paths})";
Common.Message.PushMessageModel pushModels = new Common.Message.PushMessageModel() if (!string.IsNullOrWhiteSpace(saleModel.WorkUserId))
{ {
CategoryId = PushMessageCategoryEnum.ReserveClass, Common.Message.PushMessageModel pushModels = new Common.Message.PushMessageModel()
Content = markdownContents, {
CoverImg = "", CategoryId = PushMessageCategoryEnum.ReserveClass,
CreateByName = UserInfo.AccountName, Content = markdownContents,
JumpUrl = "", CoverImg = "",
WorkMsgType = "markdown", CreateByName = UserInfo.AccountName,
SendTime = DateTime.Now, JumpUrl = "",
SendType = 0, WorkMsgType = "markdown",
Title = "学员试听课通知", SendTime = DateTime.Now,
Platform = 2, SendType = 0,
ReceiveId = (saleModel?.WorkUserId ?? "").ToString(), Title = "学员试听课通知",
}; Platform = 2,
pushList.Add(pushModels); ReceiveId = (saleModel?.WorkUserId ?? "").ToString(),
};
pushList.Add(pushModels);
}
#endregion #endregion
LogHelper.WriteInfo("这是设置老师等发送消息:" + JsonHelper.Serialize(pushList)); LogHelper.WriteInfo("这是设置老师等发送消息:" + JsonHelper.Serialize(pushList));
......
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