|
|
@@ -128,7 +128,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
return this.BaseRepository("CollegeMIS").FindList<Exam_ExamPlanRoomEntity>(x => x.EPLId == EPLId && x.ClassroomNo == ClassroomNo).Count() > 0 ? true : false; |
|
|
|
return this.BaseRepository("CollegeMIS").FindList<Exam_ExamPlanRoomEntity>(x => x.EPLId == EPLId && x.ClassroomNo == ClassroomNo).Count() > 0 ? true : false; |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
@@ -269,6 +269,55 @@ where l.EPLId='{EPLId}'"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 自动安排考场 |
|
|
|
/// </summary> |
|
|
|
/// <param name="EPId">考试记录表Id</param> |
|
|
|
/// <returns></returns> |
|
|
|
public (bool flag, string str) PlanRoomByEPId(string EPId) |
|
|
|
{ |
|
|
|
var db = this.BaseRepository("CollegeMIS"); |
|
|
|
try |
|
|
|
{ |
|
|
|
db.BeginTrans(); |
|
|
|
/* |
|
|
|
* 1.查询是否已添加考试课程和班级 |
|
|
|
* 2.查询是否生成课程排考时间 |
|
|
|
* 3.查询考试课程并循环, |
|
|
|
* 根据考试课程的总班级人数和排考时间,随机安排考场(同一时间段考场不能重复) |
|
|
|
*/ |
|
|
|
//考试记录表 |
|
|
|
var examPlan = db.FindEntity<Exam_ExamPlanEntity>(EPId); |
|
|
|
//考试课程 |
|
|
|
var examLessonList = db.FindList<Exam_ExamPlanLessonEntity>(x => x.EPId == EPId).ToList(); |
|
|
|
if (examLessonList.Count() <= 0) |
|
|
|
{ |
|
|
|
return (false, "请先添加考试课程!"); |
|
|
|
} |
|
|
|
if (!examLessonList.Exists(x => x.ExamDate != null)) |
|
|
|
{ |
|
|
|
return (false, "请先设置排考时间!"); |
|
|
|
} |
|
|
|
//考试班级 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
db.Commit(); |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
db.Rollback(); |
|
|
|
if (ex is ExceptionEx) |
|
|
|
{ |
|
|
|
throw; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
throw ExceptionEx.ThrowServiceException(ex); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion |
|
|
|
|
|
|
|
} |
|
|
|