Commit 79021de9 authored by 吴春's avatar 吴春

Merge branch 'master' of http://gitlab.oytour.com/Kui2/education

parents 59526f17 dc5356dd
...@@ -5258,52 +5258,45 @@ namespace Edu.Module.Course ...@@ -5258,52 +5258,45 @@ namespace Edu.Module.Course
if (omodel == null) { return false; } if (omodel == null) { return false; }
if (omodel.OrderType == OrderTypeEnum.CourseOrder) if (omodel.OrderType == OrderTypeEnum.CourseOrder)
{ {
var cmodel = education_ContractRepository.GetList(new RB_Education_Contract_ViewModel() { Group_Id = gmodel.Group_Id, GuestId = gmodel.Id, Status = -1 }).Where(x => x.Status != 4).FirstOrDefault(); //有合同
if (cmodel != null) omodel.Income = money >= 0 ? money : 0;
omodel.Income -= (omodel.CoursewareFee + omodel.TextbookFee);
if (omodel.Income < 0) { omodel.Income = 0; }
omodel.Unit_Price = 0;
if (gmodel.TotalHours > 0)
{ {
//有合同 omodel.Unit_Price = Math.Round((omodel.PreferPrice - omodel.DiscountMoney - omodel.CoursewareFee - omodel.TextbookFee) / gmodel.TotalHours, 6, MidpointRounding.AwayFromZero);//根据合同计算
cmodel.Income = money >= 0 ? money : 0; }
cmodel.Unit_Price = 0; decimal validClassHours = omodel.Unit_Price > 0 ? Math.Round(omodel.Income / omodel.Unit_Price, 2, MidpointRounding.AwayFromZero) : 0;
if (cmodel.TotalClassHours > 0)
{
if (cmodel.TotalDiscountMoney > 0)
{
cmodel.Unit_Price = Math.Round((cmodel.TotalCourseFee - (cmodel.TotalDiscountMoney / cmodel.TotalSub) * cmodel.TotalCourseFee) / cmodel.TotalClassHours, 6, MidpointRounding.AwayFromZero);//根据合同计算
}
else
{
cmodel.Unit_Price = Math.Round(cmodel.TotalCourseFee / cmodel.TotalClassHours, 6, MidpointRounding.AwayFromZero);//根据合同计算
}
}
decimal validClassHours = cmodel.Unit_Price > 0 ? Math.Round(cmodel.Income / cmodel.Unit_Price, 2, MidpointRounding.AwayFromZero) : 0;
Dictionary<string, object> keyValues = new Dictionary<string, object>() Dictionary<string, object> keyValues = new Dictionary<string, object>()
{ {
{ nameof(RB_Order_Guest.ValidClassHours),validClassHours} { nameof(RB_Order_Guest.ValidClassHours),validClassHours}
}; };
//HK2021-07-19新增【有效课时大于完成课时修改学员状态为正常】 //HK2021-07-19新增【有效课时大于完成课时修改学员状态为正常】
string LogContent = ""; string LogContent = "";
if (gmodel.CompleteHours <= validClassHours) if (gmodel.CompleteHours <= validClassHours)
{ {
keyValues.Add(nameof(RB_Order_Guest.GuestState), (int)GuestStateEnum.Normal); keyValues.Add(nameof(RB_Order_Guest.GuestState), (int)GuestStateEnum.Normal);
keyValues.Add(nameof(RB_Order_Guest.DropOutRemark), "有效课时大于完成课时,恢复学员状态!"); keyValues.Add(nameof(RB_Order_Guest.DropOutRemark), "有效课时大于完成课时,恢复学员状态!");
LogContent = gmodel.GuestName + "有效课时大于完成课时,系统恢复学员状态!"; LogContent = gmodel.GuestName + "有效课时大于完成课时,系统恢复学员状态!";
} }
if (!string.IsNullOrEmpty(LogContent)) if (!string.IsNullOrEmpty(LogContent))
{
changeLogRepository.Insert(new Model.Entity.Log.RB_User_ChangeLog()
{ {
changeLogRepository.Insert(new Model.Entity.Log.RB_User_ChangeLog() Id = 0,
{ Type = 3,
Id = 0, CreateBy = gmodel.CreateBy,
Type = 3, CreateTime = DateTime.Now,
CreateBy = gmodel.CreateBy, Group_Id = gmodel.Group_Id,
CreateTime = DateTime.Now, LogContent = LogContent,
Group_Id = gmodel.Group_Id, School_Id = gmodel.School_Id,
LogContent = LogContent, SourceId = gmodel.Id
School_Id = gmodel.School_Id, });
SourceId = gmodel.Id }
}); List<WhereHelper> wheres = new List<WhereHelper>()
}
List<WhereHelper> wheres = new List<WhereHelper>()
{ {
new WhereHelper() new WhereHelper()
{ {
...@@ -5312,9 +5305,9 @@ namespace Edu.Module.Course ...@@ -5312,9 +5305,9 @@ namespace Edu.Module.Course
OperatorEnum= OperatorEnum.Equal OperatorEnum= OperatorEnum.Equal
} }
}; };
order_GuestRepository.Update(keyValues, wheres); order_GuestRepository.Update(keyValues, wheres);
}
} }
//培训/留学订单 直接验证 订单的应收 大于等于实收 //培训/留学订单 直接验证 订单的应收 大于等于实收
if (omodel.PreferPrice - omodel.DiscountMoney == money && money > 0) if (omodel.PreferPrice - omodel.DiscountMoney == money && money > 0)
{ {
......
...@@ -552,6 +552,9 @@ namespace Edu.Module.Course ...@@ -552,6 +552,9 @@ namespace Edu.Module.Course
string StartTime = dmodel.Month + "-01"; string StartTime = dmodel.Month + "-01";
string EndTime = Convert.ToDateTime(dmodel.Month + "-01").AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd"); string EndTime = Convert.ToDateTime(dmodel.Month + "-01").AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd");
var plist = class_PlanRepository.GetClassPlanList_V2(new RB_Class_Plan_ViewModel() { Group_Id = userInfo.Group_Id, Q_TeacherIds = dmodel.TeacherIds, StartTime = StartTime, EndTime = EndTime }); var plist = class_PlanRepository.GetClassPlanList_V2(new RB_Class_Plan_ViewModel() { Group_Id = userInfo.Group_Id, Q_TeacherIds = dmodel.TeacherIds, StartTime = StartTime, EndTime = EndTime });
#region 排除 老师是管理员的数据
plist = plist.Where(x => x.TeacherId != 41).ToList();//ID 41=管理员
#endregion
//查询所有课程的上课时间 //查询所有课程的上课时间
List<RB_Class_Type_ViewModel> typeList = new List<RB_Class_Type_ViewModel>(); List<RB_Class_Type_ViewModel> typeList = new List<RB_Class_Type_ViewModel>();
List<RB_Class_Check_ViewModel> checkList = new List<RB_Class_Check_ViewModel>(); List<RB_Class_Check_ViewModel> checkList = new List<RB_Class_Check_ViewModel>();
......
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