Commit 2dd5a27a authored by 罗超's avatar 罗超

新增推送

parent 05ece96e
...@@ -81,5 +81,11 @@ namespace Edu.Common.Enum.System ...@@ -81,5 +81,11 @@ namespace Edu.Common.Enum.System
/// </summary> /// </summary>
[EnumField("公告发布")] [EnumField("公告发布")]
NoticePub = 11, NoticePub = 11,
/// <summary>
/// 销售通知
/// </summary>
[EnumField("销售通知")]
SalePeople = 12,
} }
} }
...@@ -28,6 +28,9 @@ using Edu.Model.Entity.Mall; ...@@ -28,6 +28,9 @@ using Edu.Model.Entity.Mall;
using Edu.Repository.BackClass; using Edu.Repository.BackClass;
using Edu.Repository.Grade; using Edu.Repository.Grade;
using Edu.Repository.Sell; using Edu.Repository.Sell;
using Edu.Module.User;
using System.Web;
using Edu.Common.Enum.System;
namespace Edu.Module.Course namespace Edu.Module.Course
{ {
...@@ -195,6 +198,8 @@ namespace Edu.Module.Course ...@@ -195,6 +198,8 @@ namespace Edu.Module.Course
/// </summary> /// </summary>
private readonly Repository.Mall.RB_Goods_SpecificationPriceRepository goods_SpecificationPriceRepository = new Repository.Mall.RB_Goods_SpecificationPriceRepository(); private readonly Repository.Mall.RB_Goods_SpecificationPriceRepository goods_SpecificationPriceRepository = new Repository.Mall.RB_Goods_SpecificationPriceRepository();
private readonly RB_AccountRepository accountRepository= new RB_AccountRepository();
/// <summary> /// <summary>
/// 获取班级列表 /// 获取班级列表
/// </summary> /// </summary>
...@@ -1916,6 +1921,7 @@ namespace Edu.Module.Course ...@@ -1916,6 +1921,7 @@ namespace Edu.Module.Course
{ {
{nameof(RB_Order_Guest_ViewModel.CompleteHours),completeHours } {nameof(RB_Order_Guest_ViewModel.CompleteHours),completeHours }
}; };
string LogContent = ""; string LogContent = "";
//已上课时>=有效课时,如果是,修改学员状态为停课,并且备注“有效课时消耗完毕,系统自动停课” //已上课时>=有效课时,如果是,修改学员状态为停课,并且备注“有效课时消耗完毕,系统自动停课”
if (completeHours > guestModel.ValidClassHours) if (completeHours > guestModel.ValidClassHours)
...@@ -1924,6 +1930,68 @@ namespace Edu.Module.Course ...@@ -1924,6 +1930,68 @@ namespace Edu.Module.Course
orderFileds.Add(nameof(RB_Order_Guest_ViewModel.ChangeEffectTime), System.DateTime.Now); orderFileds.Add(nameof(RB_Order_Guest_ViewModel.ChangeEffectTime), System.DateTime.Now);
orderFileds.Add(nameof(RB_Order_Guest_ViewModel.DropOutRemark), "有效课时消耗完毕,系统自动停课"); orderFileds.Add(nameof(RB_Order_Guest_ViewModel.DropOutRemark), "有效课时消耗完毕,系统自动停课");
LogContent = guestModel.GuestName + "有效课时消耗完毕,系统自动停课!"; LogContent = guestModel.GuestName + "有效课时消耗完毕,系统自动停课!";
#region 欠费提醒
var orderModel = orderRepository.GetEntity(guestModel.OrderId);
var queryTargetWorkId = accountRepository.GetWorkUserIdRepository(orderModel.EnterID);
if (!string.IsNullOrEmpty(queryTargetWorkId))
{
// 学员名称(名称+电话),剩余课时,关联单号,待收金额,班级老师,班级名称
var path = $"/sale/myOrder?OrderId={guestModel.OrderId}";
path = HttpUtility.UrlEncode(path);
var shengyuMoney = orderModel.PreferPrice - orderModel.Income + orderModel.Refund - orderModel.PlatformTax - orderModel.DiscountMoney - orderModel.LessPrice;
var classModel = classRepository.GetEntity<RB_Class_ViewModel>(guestModel.ClassId);
string markdownContent = $"`欠费通知` 学员欠费停课通知\n>**概要信息** \n>学员名称:{guestModel.GuestName}({guestModel.Mobile})\n>当前状态:<font color='warning'>停课</font>\n>关联单号:{guestModel.OrderId}\n>\n>待收金额:<font color='warning'>¥{shengyuMoney.ToString("0.00")}</font>\n>班级教师:<font color='comment'>{classModel.TeacherName}老师</font>\n>班级名称:<font>{classModel.ClassName}</font>\n>请点击:[查看详情]({Config.ErpUrl}/autologin?loginId={orderModel.EnterID}&target={path})";
Common.Message.PushMessageModel modelWork = new Common.Message.PushMessageModel()
{
CategoryId = PushMessageCategoryEnum.SalePeople,
Content = markdownContent,
CoverImg = "",
CreateByName = "系统",
JumpUrl = "",
WorkMsgType = "markdown",
SendTime = DateTime.Now,
SendType = 0,
Title = "学员欠费停课通知",
Platform = 5,
ReceiveId = queryTargetWorkId
};
Common.Message.MessageHelper.SendMessage(modelWork);
}
#endregion
}
else if (guestModel.TotalHours > guestModel.ValidClassHours && (guestModel.ValidClassHours - completeHours) < 12)
{
#region 即将欠费提醒
var orderModel = orderRepository.GetEntity(guestModel.OrderId);
var queryTargetWorkId = accountRepository.GetWorkUserIdRepository(orderModel.EnterID);
if (!string.IsNullOrEmpty(queryTargetWorkId))
{
// 学员名称(名称+电话),剩余课时,关联单号,待收金额,班级老师,班级名称
var path = $"/sale/myOrder?OrderId={guestModel.OrderId}";
path = HttpUtility.UrlEncode(path);
var shengyuMoney = orderModel.PreferPrice - orderModel.Income + orderModel.Refund - orderModel.PlatformTax - orderModel.DiscountMoney - orderModel.LessPrice;
var classModel = classRepository.GetEntity<RB_Class_ViewModel>(guestModel.ClassId);
string markdownContent = $"`欠费预警` 学员即将欠费通知\n>**概要信息** \n>学员名称:{guestModel.GuestName}({guestModel.Mobile})\n>剩余课时:<font color='warning'>{guestModel.ValidClassHours-completeHours}</font>\n>关联单号:{guestModel.OrderId}\n>\n>待收金额:<font color='warning'>¥{shengyuMoney.ToString("0.00")}</font>\n>班级教师:<font color='comment'>{classModel.TeacherName}老师</font>\n>班级名称:<font>{classModel.ClassName}</font>\n>请点击:[查看详情]({Config.ErpUrl}/autologin?loginId={orderModel.EnterID}&target={path})";
Common.Message.PushMessageModel modelWork = new Common.Message.PushMessageModel()
{
CategoryId = PushMessageCategoryEnum.SalePeople,
Content = markdownContent,
CoverImg = "",
CreateByName = "系统",
JumpUrl = "",
WorkMsgType = "markdown",
SendTime = DateTime.Now,
SendType = 0,
Title = "学员即将欠费通知",
Platform = 5,
ReceiveId = queryTargetWorkId
};
Common.Message.MessageHelper.SendMessage(modelWork);
}
#endregion
} }
flag = order_GuestRepository.Update(orderFileds, new WhereHelper(nameof(RB_Order_Guest_ViewModel.Id), item.OrderGuestId)); flag = order_GuestRepository.Update(orderFileds, new WhereHelper(nameof(RB_Order_Guest_ViewModel.Id), item.OrderGuestId));
if (flag && !string.IsNullOrEmpty(LogContent)) if (flag && !string.IsNullOrEmpty(LogContent))
......
...@@ -5,6 +5,11 @@ ...@@ -5,6 +5,11 @@
<NoWarn>$(NoWarn);NETSDK1138</NoWarn> <NoWarn>$(NoWarn);NETSDK1138</NoWarn>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Edu.Aop\Edu.Aop.csproj" /> <ProjectReference Include="..\Edu.Aop\Edu.Aop.csproj" />
<ProjectReference Include="..\Edu.Cache\Edu.Cache.csproj" /> <ProjectReference Include="..\Edu.Cache\Edu.Cache.csproj" />
......
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