Commit 140bbd7e authored by 黄奎's avatar 黄奎

页面修改

parent 082073ad
......@@ -558,7 +558,7 @@ namespace Edu.Module.Course
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool AddClassPlanModule(int ClassId, List<RB_Class_Plan_ViewModel> planList,out bool result)
public bool AddClassPlanModule(int ClassId, List<RB_Class_Plan_ViewModel> planList,UserInfo user,out bool result)
{
bool flag = true;
result = false;
......@@ -607,7 +607,21 @@ namespace Edu.Module.Course
var classLogModel = new Model.Entity.Log.RB_Class_Log()
{
LogType = Common.Enum.Course.ClassLogTypeEnum.CreateClass,
LogContent = "创建上课计划成功!但是存在冲突的上课安排,等待管理员处理!",
LogContent = string.Format("班级管理员{0}创建上课计划成功!但是存在冲突的上课安排,等待管理员处理!",user.AccountName),
ClassId = ClassId,
Group_Id = model.Group_Id,
School_Id = model.School_Id,
CreateBy = model.CreateBy,
CreateTime = System.DateTime.Now
};
classLogRepository.AddClassLogRepository(classLogModel);
}
else
{
var classLogModel = new Model.Entity.Log.RB_Class_Log()
{
LogType = Common.Enum.Course.ClassLogTypeEnum.CreateClass,
LogContent = string.Format("班级管理员{0},完成班级排课计划冲突",user.AccountName),
ClassId = ClassId,
Group_Id = model.Group_Id,
School_Id = model.School_Id,
......@@ -629,14 +643,14 @@ namespace Edu.Module.Course
/// <param name="TimeList"></param>
/// <param name="result"></param>
/// <returns></returns>
public bool BatchUpdateClassPlanModule(int ClassId,int ChangeType,int ClassRoomId,int TeacherId,List<int> ClassPlanIdList, List<TimeItem> TimeList, out bool result)
public bool BatchUpdateClassPlanModule(int ClassId, int ChangeType, int ClassRoomId, int TeacherId, List<int> ClassPlanIdList, List<TimeItem> TimeList, UserInfo user, out bool result)
{
bool flag = false;
string ids = string.Join(",", ClassPlanIdList);
result = false;
if (ChangeType == 1)
{
flag= class_PlanRepository.UpdateClassPlanTeacherOrClassRoomIdRepository(TeacherId,0, ids);
flag = class_PlanRepository.UpdateClassPlanTeacherOrClassRoomIdRepository(TeacherId, 0, ids);
}
if (ChangeType == 2)
{
......@@ -644,7 +658,7 @@ namespace Edu.Module.Course
}
if (ChangeType == 3)
{
flag= class_TimeRepository.DeleteClassTimeByPlanIdsRepository(ids);
flag = class_TimeRepository.DeleteClassTimeByPlanIdsRepository(ids);
var planList = class_PlanRepository.GetClassPlanListRepository(new RB_Class_Plan_ViewModel()
{
QClassPlanIds = ids
......@@ -678,6 +692,34 @@ namespace Edu.Module.Course
}
}
class_PlanRepository.CheckClassPlanRepeatRepository(ClassId, out result);
if (result)
{
var classLogModel = new Model.Entity.Log.RB_Class_Log()
{
LogType = Common.Enum.Course.ClassLogTypeEnum.CreateClass,
LogContent = string.Format("班级管理员{0}修改上课计划成功!但是存在冲突的上课安排,等待管理员处理!", user.AccountName),
ClassId = ClassId,
Group_Id = user.Group_Id,
School_Id = user.School_Id,
CreateBy = user.Id,
CreateTime = System.DateTime.Now
};
classLogRepository.AddClassLogRepository(classLogModel);
}
else
{
var classLogModel = new Model.Entity.Log.RB_Class_Log()
{
LogType = Common.Enum.Course.ClassLogTypeEnum.CreateClass,
LogContent = string.Format("班级管理员{0},完成班级排课计划冲突", user.AccountName),
ClassId = ClassId,
Group_Id = user.Group_Id,
School_Id = user.School_Id,
CreateBy = user.Id,
CreateTime = System.DateTime.Now
};
classLogRepository.AddClassLogRepository(classLogModel);
}
return flag;
}
......@@ -706,7 +748,7 @@ namespace Edu.Module.Course
/// 单个修改上课计划
/// </summary>
/// <returns></returns>
public bool UpdateClassPlanSingleModule(List<RB_Class_Plan_ViewModel> list,int createBy, out bool result)
public bool UpdateClassPlanSingleModule(List<RB_Class_Plan_ViewModel> list, UserInfo user, out bool result)
{
var flag = true;
result = false;
......@@ -714,7 +756,7 @@ namespace Edu.Module.Course
{
if (flag)
{
flag = SetClassPlanModule(item, createBy);
flag = SetClassPlanModule(item, user.Id);
}
}
......@@ -722,6 +764,34 @@ namespace Edu.Module.Course
{
class_PlanRepository.CheckClassPlanRepeatRepository(list[0].ClassId, out result);
}
if (result)
{
var classLogModel = new Model.Entity.Log.RB_Class_Log()
{
LogType = Common.Enum.Course.ClassLogTypeEnum.CreateClass,
LogContent = string.Format("班级管理员{0}修改上课计划成功!但是存在冲突的上课安排,等待管理员处理!", user.AccountName),
ClassId = list[0].ClassId,
Group_Id = user.Group_Id,
School_Id = user.School_Id,
CreateBy = user.Id,
CreateTime = System.DateTime.Now
};
classLogRepository.AddClassLogRepository(classLogModel);
}
else
{
var classLogModel = new Model.Entity.Log.RB_Class_Log()
{
LogType = Common.Enum.Course.ClassLogTypeEnum.CreateClass,
LogContent = string.Format("班级管理员{0},完成班级排课计划冲突", user.AccountName),
ClassId = list[0].ClassId,
Group_Id = user.Group_Id,
School_Id = user.School_Id,
CreateBy = user.Id,
CreateTime = System.DateTime.Now
};
classLogRepository.AddClassLogRepository(classLogModel);
}
return flag;
}
......
......@@ -382,7 +382,7 @@ namespace Edu.WebApi.Controllers.Course
List<RB_Class_Plan_ViewModel> result = new List<RB_Class_Plan_ViewModel>();
bool flag = false;
bool IsRepeat = false;
var t1 = new Task(() => { flag = classModule.AddClassPlanModule(ClassId, planList,out IsRepeat); });
var t1 = new Task(() => { flag = classModule.AddClassPlanModule(ClassId, planList,base.UserInfo,out IsRepeat); });
t1.Start();
Task.WaitAll(t1);
return flag ? ApiResult.Success(data: IsRepeat) : ApiResult.Failed();
......@@ -399,7 +399,7 @@ namespace Edu.WebApi.Controllers.Course
var ChangeType = base.ParmJObj.GetInt("ChangeType");
var ClassRoomId = base.ParmJObj.GetInt("ClassRoomId");
var TeacherId = base.ParmJObj.GetInt("TeacherId");
var timeStr = base.ParmJObj.GetStringValue("TimeList");
var timeStr = base.ParmJObj.GetStringValue("PlanTimeList");
var TimeList = new List<TimeItem>();
if (!string.IsNullOrEmpty(timeStr))
{
......@@ -427,7 +427,7 @@ namespace Edu.WebApi.Controllers.Course
{
return ApiResult.ParamIsNull(message: "请选择上课时间段!");
}
bool flag = classModule.BatchUpdateClassPlanModule(ClassId,ChangeType, ClassRoomId, TeacherId, ClassPlanIdList,TimeList, out bool result);
bool flag = classModule.BatchUpdateClassPlanModule(ClassId,ChangeType, ClassRoomId, TeacherId, ClassPlanIdList,TimeList,base.UserInfo,out bool result);
return flag ? ApiResult.Success(data: result) : ApiResult.Failed();
}
......@@ -502,7 +502,7 @@ namespace Edu.WebApi.Controllers.Course
{
return ApiResult.ParamIsNull(message: "请选择要调整的上课计划!");
}
var flag = classModule.UpdateClassPlanSingleModule(list, base.UserInfo.Id, out bool result);
var flag = classModule.UpdateClassPlanSingleModule(list, base.UserInfo, out bool result);
return flag ? ApiResult.Success(data: result) : ApiResult.Failed();
}
......
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