Commit de784c46 authored by 黄奎's avatar 黄奎

新增停课日志

parent 3edae069
......@@ -44,7 +44,7 @@ namespace Edu.Model.Entity.Log
private int type = 1;
/// <summary>
/// 类型 1日常日志 2订单日志
/// 类型1-日常日志;2-订单日志;3-学员日志
/// </summary>
public int Type { get => type; set => type = value; }
......
......@@ -149,6 +149,11 @@ namespace Edu.Module.Course
/// </summary>
private readonly RB_Student_MakeupRepository student_MakeupRepository = new RB_Student_MakeupRepository();
/// <summary>
/// 日志仓储对象
/// </summary>
private readonly RB_User_ChangeLogRepository user_ChangeLogRepository = new RB_User_ChangeLogRepository();
/// <summary>
/// 获取班级列表
/// </summary>
......@@ -1475,13 +1480,29 @@ namespace Edu.Module.Course
{
{nameof(RB_Order_Guest_ViewModel.CompleteHours),completeHours }
};
string LogContent = "";
//已上课时>=有效课时,如果是,修改学员状态为停课,并且备注“有效课时消耗完毕,系统自动停课”
if (completeHours > guestModel.ValidClassHours)
{
orderFileds.Add(nameof(RB_Order_Guest_ViewModel.GuestState), 5);
orderFileds.Add(nameof(RB_Order_Guest_ViewModel.DropOutRemark), "有效课时消耗完毕,系统自动停课");
LogContent = guestModel.GuestName + "有效课时消耗完毕,系统自动停课!";
}
flag = order_GuestRepository.Update(orderFileds, new WhereHelper(nameof(RB_Order_Guest_ViewModel.Id), item.OrderGuestId));
if (flag && !string.IsNullOrEmpty(LogContent))
{
user_ChangeLogRepository.Insert(new Model.Entity.Log.RB_User_ChangeLog()
{
Id = 0,
Type = 3,
CreateBy = item.CreateBy,
CreateTime = DateTime.Now,
Group_Id = item.Group_Id,
LogContent = LogContent,
School_Id = item.School_Id,
SourceId = guestModel.Id
});
}
//缺勤和请假
if (item.CheckStatus == 1 || item.CheckStatus == 2)
{
......
......@@ -2557,10 +2557,26 @@ namespace Edu.Module.Course
{ nameof(RB_Order_Guest.ValidClassHours),validClassHours}
};
//HK2021-07-19新增【有效课时大于完成课时修改学员状态为正常】
string LogContent = "";
if (gmodel.CompleteHours < validClassHours)
{
keyValues.Add(nameof(RB_Order_Guest.GuestState), 1);
keyValues.Add(nameof(RB_Order_Guest.DropOutRemark), "有效课时大于完成课时,恢复学员状态!");
LogContent = gmodel.GuestName + "有效课时大于完成课时,系统恢复学员状态!";
}
if (!string.IsNullOrEmpty(LogContent))
{
changeLogRepository.Insert(new Model.Entity.Log.RB_User_ChangeLog()
{
Id = 0,
Type = 3,
CreateBy = gmodel.CreateBy,
CreateTime = DateTime.Now,
Group_Id = gmodel.Group_Id,
LogContent = LogContent,
School_Id = gmodel.School_Id,
SourceId = gmodel.Id
});
}
List<WhereHelper> wheres = new List<WhereHelper>()
{
......
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