|
|
@@ -258,7 +258,7 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');"); |
|
|
|
/// 是否可以生成排考名单 |
|
|
|
/// </summary> |
|
|
|
/// <param name="keyValue">排考记录主表Id</param> |
|
|
|
public bool IsGenerate(string keyValue) |
|
|
|
public (bool flag, string str) IsGenerate(string keyValue) |
|
|
|
{ |
|
|
|
var db = this.BaseRepository("CollegeMIS"); |
|
|
|
try |
|
|
@@ -266,27 +266,45 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');"); |
|
|
|
db.BeginTrans(); |
|
|
|
//排考记录表 |
|
|
|
var examPlan = db.FindEntity<Exam_ExamPlanEntity>(keyValue); |
|
|
|
//安排考试数据 |
|
|
|
var EPTimeList = db.FindList<Exam_ExamPlanTimeEntity>(x => x.EPId == keyValue); |
|
|
|
if (EPTimeList.Count() <= 0) |
|
|
|
{ |
|
|
|
return (false, "请先安排时间!"); |
|
|
|
} |
|
|
|
|
|
|
|
//排考安排课程已审核的数据 |
|
|
|
var planLessonData = this.BaseRepository("CollegeMIS").FindList<Exam_ExamPlanLessonEntity>(x => x.EPId == keyValue && x.ELCheckMark == true); |
|
|
|
var planLessonData = db.FindList<Exam_ExamPlanLessonEntity>(x => x.EPId == keyValue); |
|
|
|
if (planLessonData.Count() <= 0) |
|
|
|
{ |
|
|
|
return false; |
|
|
|
return (false, "请先安排考试课程!"); |
|
|
|
} |
|
|
|
else |
|
|
|
//考试课程ids |
|
|
|
var EPLIds = string.Join("','", planLessonData.Select(x => x.EPLId).ToList()); |
|
|
|
//排考班级 |
|
|
|
var EPClass = db.FindList<Exam_ExamPlanClassEntity>($"select * from Exam_ExamPlanClass where eplid in ('{EPLIds}')"); |
|
|
|
if (EPClass.Count() <= 0) |
|
|
|
{ |
|
|
|
foreach (var planLesson in planLessonData) |
|
|
|
{ |
|
|
|
var planClassData = this.BaseRepository("CollegeMIS").FindList<Exam_ExamPlanClassEntity>(x => x.EPLId == planLesson.EPLId); |
|
|
|
var planRoomData = this.BaseRepository("CollegeMIS").FindList<Exam_ExamPlanRoomEntity>(x => x.EPLId == planLesson.EPLId); |
|
|
|
if (planClassData.Count() <= 0 || planRoomData.Count() <= 0) |
|
|
|
{ |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
return (false,"请安排班级!"); |
|
|
|
} |
|
|
|
|
|
|
|
//排考考场 |
|
|
|
var EPRoom = db.FindList<Exam_ExamPlanRoomEntity>($"select * from Exam_ExamPlanRoom where eplid in ('{EPLIds}')"); |
|
|
|
if (EPRoom.Count() <= 0) |
|
|
|
{ |
|
|
|
return (false, "请安排考场!"); |
|
|
|
} |
|
|
|
if (EPRoom.Where(x => string.IsNullOrEmpty(x.EmpNo)).Count() <= 0) |
|
|
|
{ |
|
|
|
return (false, "请安排监考老师!"); |
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
if (planLessonData.Where(x => x.ELCheckMark == false).Count() <= 0) |
|
|
|
{ |
|
|
|
return (false, "请先安排考试!"); |
|
|
|
} |
|
|
|
|
|
|
|
return (true, ""); |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|