Commit 61c26b3c authored by liudong1993's avatar liudong1993

1

parent b0cc020a
...@@ -2022,6 +2022,7 @@ namespace Edu.Module.Course ...@@ -2022,6 +2022,7 @@ namespace Edu.Module.Course
{nameof(RB_Order_Guest_ViewModel.CompleteHours),completeHours } {nameof(RB_Order_Guest_ViewModel.CompleteHours),completeHours }
}; };
var orderModel = orderRepository.GetEntity(guestModel.OrderId);
string LogContent = ""; string LogContent = "";
var shenyuHours = guestModel.ValidClassHours - completeHours; var shenyuHours = guestModel.ValidClassHours - completeHours;
//已上课时>=有效课时,如果是,修改学员状态为停课,并且备注“有效课时消耗完毕,系统自动停课” //已上课时>=有效课时,如果是,修改学员状态为停课,并且备注“有效课时消耗完毕,系统自动停课”
...@@ -2032,7 +2033,6 @@ namespace Edu.Module.Course ...@@ -2032,7 +2033,6 @@ namespace Edu.Module.Course
orderFileds.Add(nameof(RB_Order_Guest_ViewModel.DropOutRemark), "有效课时消耗完毕,系统自动停课"); orderFileds.Add(nameof(RB_Order_Guest_ViewModel.DropOutRemark), "有效课时消耗完毕,系统自动停课");
LogContent = guestModel.GuestName + "有效课时消耗完毕,系统自动停课!"; LogContent = guestModel.GuestName + "有效课时消耗完毕,系统自动停课!";
var orderModel = orderRepository.GetEntity(guestModel.OrderId);
var shengyuMoney = orderModel.PreferPrice - orderModel.Income + orderModel.Refund - orderModel.PlatformTax - orderModel.DiscountMoney - orderModel.LessPrice; var shengyuMoney = orderModel.PreferPrice - orderModel.Income + orderModel.Refund - orderModel.PlatformTax - orderModel.DiscountMoney - orderModel.LessPrice;
var classModel = classRepository.GetEntity<RB_Class_ViewModel>(guestModel.ClassId); var classModel = classRepository.GetEntity<RB_Class_ViewModel>(guestModel.ClassId);
var sellerInfo = UserReidsCache.GetUserLoginInfo(orderModel.EnterID); var sellerInfo = UserReidsCache.GetUserLoginInfo(orderModel.EnterID);
...@@ -2094,7 +2094,6 @@ namespace Edu.Module.Course ...@@ -2094,7 +2094,6 @@ namespace Edu.Module.Course
} }
else if (guestModel.TotalHours > guestModel.ValidClassHours && shenyuHours < 12) else if (guestModel.TotalHours > guestModel.ValidClassHours && shenyuHours < 12)
{ {
var orderModel = orderRepository.GetEntity(guestModel.OrderId);
var shengyuMoney = orderModel.PreferPrice - orderModel.Income + orderModel.Refund - orderModel.PlatformTax - orderModel.DiscountMoney - orderModel.LessPrice; var shengyuMoney = orderModel.PreferPrice - orderModel.Income + orderModel.Refund - orderModel.PlatformTax - orderModel.DiscountMoney - orderModel.LessPrice;
var classModel = classRepository.GetEntity<RB_Class_ViewModel>(guestModel.ClassId); var classModel = classRepository.GetEntity<RB_Class_ViewModel>(guestModel.ClassId);
var sellerInfo = UserReidsCache.GetUserLoginInfo(orderModel.EnterID); var sellerInfo = UserReidsCache.GetUserLoginInfo(orderModel.EnterID);
...@@ -2155,7 +2154,6 @@ namespace Edu.Module.Course ...@@ -2155,7 +2154,6 @@ namespace Edu.Module.Course
} }
else if (guestModel.TotalHours == guestModel.ValidClassHours && shenyuHours < 12 && shenyuHours > 0) else if (guestModel.TotalHours == guestModel.ValidClassHours && shenyuHours < 12 && shenyuHours > 0)
{ {
var orderModel = orderRepository.GetEntity(guestModel.OrderId);
var shengyuMoney = orderModel.PreferPrice - orderModel.Income + orderModel.Refund - orderModel.PlatformTax - orderModel.DiscountMoney - orderModel.LessPrice; var shengyuMoney = orderModel.PreferPrice - orderModel.Income + orderModel.Refund - orderModel.PlatformTax - orderModel.DiscountMoney - orderModel.LessPrice;
var classModel = classRepository.GetEntity<RB_Class_ViewModel>(guestModel.ClassId); var classModel = classRepository.GetEntity<RB_Class_ViewModel>(guestModel.ClassId);
var sellerInfo = UserReidsCache.GetUserLoginInfo(orderModel.EnterID); var sellerInfo = UserReidsCache.GetUserLoginInfo(orderModel.EnterID);
...@@ -2219,7 +2217,6 @@ namespace Edu.Module.Course ...@@ -2219,7 +2217,6 @@ namespace Edu.Module.Course
} }
else if (guestModel.TotalHours == guestModel.ValidClassHours && shenyuHours == 0) else if (guestModel.TotalHours == guestModel.ValidClassHours && shenyuHours == 0)
{ {
var orderModel = orderRepository.GetEntity(guestModel.OrderId);
var shengyuMoney = orderModel.PreferPrice - orderModel.Income + orderModel.Refund - orderModel.PlatformTax - orderModel.DiscountMoney - orderModel.LessPrice; var shengyuMoney = orderModel.PreferPrice - orderModel.Income + orderModel.Refund - orderModel.PlatformTax - orderModel.DiscountMoney - orderModel.LessPrice;
var classModel = classRepository.GetEntity<RB_Class_ViewModel>(guestModel.ClassId); var classModel = classRepository.GetEntity<RB_Class_ViewModel>(guestModel.ClassId);
var sellerInfo = UserReidsCache.GetUserLoginInfo(orderModel.EnterID); var sellerInfo = UserReidsCache.GetUserLoginInfo(orderModel.EnterID);
...@@ -2343,6 +2340,8 @@ namespace Edu.Module.Course ...@@ -2343,6 +2340,8 @@ namespace Edu.Module.Course
} }
#region B2B同业推送 #region B2B同业推送
if (orderModel != null && orderModel.CustomerId > 0)
{
//最后5个课时做处理 //最后5个课时做处理
if (completeHours > guestModel.ValidClassHours) if (completeHours > guestModel.ValidClassHours)
{ {
...@@ -2352,7 +2351,7 @@ namespace Edu.Module.Course ...@@ -2352,7 +2351,7 @@ namespace Edu.Module.Course
Id = 0, Id = 0,
Type = 3, Type = 3,
StudentId = guestModel.Id, StudentId = guestModel.Id,
CustomerId = 1, CustomerId = orderModel.CustomerId,
Title = "停课通知", Title = "停课通知",
Content = "学员" + guestModel.GuestName + " 有效课时消耗完毕,已自动停课,关联单号:" + guestModel.OrderId + "!", Content = "学员" + guestModel.GuestName + " 有效课时消耗完毕,已自动停课,关联单号:" + guestModel.OrderId + "!",
IsLook = 2, IsLook = 2,
...@@ -2371,7 +2370,7 @@ namespace Edu.Module.Course ...@@ -2371,7 +2370,7 @@ namespace Edu.Module.Course
Id = 0, Id = 0,
Type = 1, Type = 1,
StudentId = guestModel.Id, StudentId = guestModel.Id,
CustomerId = 1, CustomerId = orderModel.CustomerId,
Title = "欠费预警", Title = "欠费预警",
Content = "学员" + guestModel.GuestName + " 即将欠费,剩余课时" + shenyuHours + ",关联单号:" + guestModel.OrderId + "!", Content = "学员" + guestModel.GuestName + " 即将欠费,剩余课时" + shenyuHours + ",关联单号:" + guestModel.OrderId + "!",
IsLook = 2, IsLook = 2,
...@@ -2390,7 +2389,7 @@ namespace Edu.Module.Course ...@@ -2390,7 +2389,7 @@ namespace Edu.Module.Course
Id = 0, Id = 0,
Type = 2, Type = 2,
StudentId = guestModel.Id, StudentId = guestModel.Id,
CustomerId = 1, CustomerId = orderModel.CustomerId,
Title = "结课预警", Title = "结课预警",
Content = "学员" + guestModel.GuestName + " 即将结课,剩余课时" + shenyuHours + ",关联单号:" + guestModel.OrderId + "!", Content = "学员" + guestModel.GuestName + " 即将结课,剩余课时" + shenyuHours + ",关联单号:" + guestModel.OrderId + "!",
IsLook = 2, IsLook = 2,
...@@ -2409,7 +2408,7 @@ namespace Edu.Module.Course ...@@ -2409,7 +2408,7 @@ namespace Edu.Module.Course
Id = 0, Id = 0,
Type = 4, Type = 4,
StudentId = guestModel.Id, StudentId = guestModel.Id,
CustomerId = 1, CustomerId = orderModel.CustomerId,
Title = "结课通知", Title = "结课通知",
Content = "学员" + guestModel.GuestName + " 已结课,关联单号:" + guestModel.OrderId + "!", Content = "学员" + guestModel.GuestName + " 已结课,关联单号:" + guestModel.OrderId + "!",
IsLook = 2, IsLook = 2,
...@@ -2420,6 +2419,7 @@ namespace Edu.Module.Course ...@@ -2420,6 +2419,7 @@ namespace Edu.Module.Course
UpdateTime = DateTime.Now UpdateTime = DateTime.Now
}); });
} }
}
#endregion #endregion
} }
} }
......
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