Commit 52579ab5 authored by 黄奎's avatar 黄奎

上课计划修改老师,新增更新签到表中的老师

parent bca42010
......@@ -1527,7 +1527,6 @@ namespace Edu.Module.Course
{nameof(RB_Class_Plan_ViewModel.TeacherId),extModel.TeacherId },
{nameof(RB_Class_Plan_ViewModel.ClassDate),extModel.ClassDate },
};
if (oldPlanModel.ClassRoomId != extModel.ClassRoomId)
{
string roomIds = oldPlanModel.ClassRoomId + "," + extModel.ClassRoomId;
......@@ -1550,7 +1549,27 @@ namespace Edu.Module.Course
{
logContent += string.Format(",日期由【{0}】修改为【{1}】.", Common.ConvertHelper.FormatDate(oldPlanModel.ClassDate), Common.ConvertHelper.FormatDate(extModel.ClassDate));
}
//如果老师变更且存在签到记录则更新签到表中的老师Id
if (oldPlanModel.TeacherId != extModel.TeacherId)
{
var checkList= classCheckRepository.GetClassCheckListRepository(new RB_Class_Check_ViewModel()
{
Q_ClassIds = extModel.ClassId.ToString(),
StartDate = Common.ConvertHelper.FormatDate(extModel.ClassDate),
EndDate = Common.ConvertHelper.FormatDate(extModel.ClassDate),
});
if (checkList != null && checkList.Count > 0)
{
foreach (var sItem in checkList)
{
Dictionary<string, object> checkFileds = new Dictionary<string, object>()
{
{nameof(RB_Class_Check_ViewModel.TeacherId),extModel.TeacherId }
};
classCheckRepository.Update(checkFileds, new WhereHelper(nameof(RB_Class_Check_ViewModel.ClassCheckId), sItem.ClassCheckId));
}
}
}
flag = class_PlanRepository.Update(fileds, new WhereHelper(nameof(RB_Class_Plan_ViewModel.ClassPlanId), extModel.ClassPlanId));
}
else
......@@ -1597,12 +1616,20 @@ namespace Edu.Module.Course
class_TimeRepository.Delete(dItem.ClassTimeId);
}
}
var BasicMinutes = class_ConfigRepository.GetBasicMinutesRepository(extModel.Group_Id);
foreach (var item in extModel.PlanTimeList)
{
item.ClassId = extModel.ClassId;
item.ClassPlanId = extModel.ClassPlanId;
item.Group_Id = extModel.Group_Id;
item.School_Id = extModel.School_Id;
var startDate = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " " + item.StartTime + ":00");
var endDate = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " " + item.EndTime + ":00");
TimeSpan span = endDate.Subtract(startDate);
if (item.TimeHour <= 0)
{
item.TimeHour = Convert.ToDecimal(span.TotalMinutes / BasicMinutes);
}
if (item.ClassTimeId == 0)
{
logContent += string.Format(",新增{0}上课时间【{1} - {2}】", Common.ConvertHelper.FormatDate(extModel.ClassDate), item.StartTime, item.EndTime);
......@@ -1626,6 +1653,7 @@ namespace Edu.Module.Course
}
}
}
if (!string.IsNullOrEmpty(logContent))
{
classLogRepository.AddClassLogRepository(
......
......@@ -156,9 +156,6 @@ WHERE 1=1
return Get<RB_Class_Time_ViewModel>(builder.ToString()).ToList();
}
/// <summary>
/// 获取班级上课时间列表
/// </summary>
......
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