|
|
@@ -411,6 +411,55 @@ and AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and Semester='{exam_ExamPlan |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 自动生成考试课程排考时间 |
|
|
|
/// </summary> |
|
|
|
/// <param name="EPId"></param> |
|
|
|
/// <returns></returns> |
|
|
|
public (bool flag, string msg) PlanLessonTimeByEPId(string EPId) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
/* |
|
|
|
* 1.查询考试记录是否已安排时间 |
|
|
|
* 2.查询考试课程的考试时长是否大于0 |
|
|
|
* 3.同一时间段内只能一个专业安排一门课程 |
|
|
|
*/ |
|
|
|
|
|
|
|
//安排时间数据 |
|
|
|
var EPTimeList = this.BaseRepository("CollegeMIS") |
|
|
|
.FindList<Exam_ExamPlanTimeEntity>(x => x.EPId == EPId); |
|
|
|
if (EPTimeList.Count() <= 0) |
|
|
|
{ |
|
|
|
return (false, "请先安排考试记录时间!"); |
|
|
|
} |
|
|
|
//考试课程数据 |
|
|
|
var EPLessonList = this.BaseRepository("CollegeMIS") |
|
|
|
.FindList<Exam_ExamPlanLessonEntity>($@"select elesson.ExamTime as ExamLength,t.* from Exam_ExamPlanLesson t |
|
|
|
join Exam_ExamLesson elesson on t.LessonNo=elesson.LessonNo |
|
|
|
where t.EPId='{EPId}'"); |
|
|
|
if (EPLessonList.ToList().Exists(x => x.ExamLength == null || x.ExamLength == 0)) |
|
|
|
{ |
|
|
|
return (false, "请先设置考试课程时长!"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return (true, ""); |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
if (ex is ExceptionEx) |
|
|
|
{ |
|
|
|
throw; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
throw ExceptionEx.ThrowServiceException(ex); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#endregion |
|
|
|
|
|
|
|
} |
|
|
|