소스 검색

安排考试设置考试时间时增加判断考试时间是否冲突的限制

西昌缴费二期
zhangli 2 년 전
부모
커밋
57b1e379e7
4개의 변경된 파일37개의 추가작업 그리고 8개의 파일을 삭제
  1. +8
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanLessonController.cs
  2. +2
    -2
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonBLL.cs
  3. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonIBLL.cs
  4. +26
    -4
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonService.cs

+ 8
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanLessonController.cs 파일 보기

@@ -305,8 +305,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
entity.ExamTime = entity.ExamTimeStart.Trim() + "-" + entity.ExamTimeEnd;
}

entity.EPLId = keyValue;
//判断考试时间是否冲突
//exam_ExamPlanLessonIBLL.IsExamTimeClash(entity);
var res = exam_ExamPlanLessonIBLL.IsExamTimeClash(entity);
if (res.flag && !string.IsNullOrEmpty(res.lessonname))
{
return Fail("考试时间与课程(" + res.lessonname + ")冲突!");
}

//保存
exam_ExamPlanLessonIBLL.SaveEntity(keyValue, entity);
return Success("保存成功!");


+ 2
- 2
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonBLL.cs 파일 보기

@@ -208,11 +208,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// 判断考试时间是否冲突
/// </summary>
/// <param name="entity"></param>
public void IsExamTimeClash(Exam_ExamPlanLessonEntity entity)
public (bool flag, string lessonname) IsExamTimeClash(Exam_ExamPlanLessonEntity entity)
{
try
{
exam_ExamPlanLessonService.IsExamTimeClash(entity);
return exam_ExamPlanLessonService.IsExamTimeClash(entity);
}
catch (Exception ex)
{


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonIBLL.cs 파일 보기

@@ -50,7 +50,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// <param name="entity">实体</param>
void SaveEntity(string keyValue, Exam_ExamPlanLessonEntity entity);

void IsExamTimeClash(Exam_ExamPlanLessonEntity entity);
(bool flag, string lessonname) IsExamTimeClash(Exam_ExamPlanLessonEntity entity);
#endregion

}


+ 26
- 4
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonService.cs 파일 보기

@@ -224,7 +224,7 @@ and AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and Semester='{exam_ExamPlan
{
//考试课程信息
var examLesson = db.FindEntity<Exam_ExamLessonEntity>(x => x.ELId == lesson.ELId);
//应排班级数
lesson.ClassNum = classInfo.Count();
//应考人数
@@ -281,14 +281,36 @@ and AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and Semester='{exam_ExamPlan
}

/// <summary>
/// 判断考试时间是否冲突(未完成)
/// 判断考试时间是否冲突
/// </summary>
/// <param name="entity"></param>
public void IsExamTimeClash(Exam_ExamPlanLessonEntity entity)
public (bool flag, string lessonname) IsExamTimeClash(Exam_ExamPlanLessonEntity entity)
{
try
{
var epl = this.BaseRepository("CollegeMIS").FindEntity<Exam_ExamPlanLessonEntity>(entity.EPLId);
//查询和entity考试日期同一天的考试课程
var daylist = this.BaseRepository("CollegeMIS").FindList<Exam_ExamPlanLessonEntity>($"select * from [dbo].[Exam_ExamPlanLesson] where epid='{epl.EPId}' and examtime is not null and datediff(day, examdate, '{entity.ExamDate}') = 0");
//考试开始时间
var examstartTime = Convert.ToDateTime(entity.ExamDate.Value.ToString("yyyy-MM-dd") + " " + entity.ExamTimeStart.Trim());
//考试结束时间
var examendTime = Convert.ToDateTime(entity.ExamDate.Value.ToString("yyyy-MM-dd") + " " + entity.ExamTimeEnd.Trim());

foreach (var examPlanLesson in daylist)
{
//开始时间
var startTime = Convert.ToDateTime(examPlanLesson.ExamDate.Value.ToString("yyyy-MM-dd") + " " + examPlanLesson.ExamTime.Split('-')[0]);
//结束时间
var endTime = Convert.ToDateTime(examPlanLesson.ExamDate.Value.ToString("yyyy-MM-dd") + " " + examPlanLesson.ExamTime.Split('-')[1]);
if ((examstartTime >= startTime && examstartTime <= endTime) ||
(examendTime >= startTime && examendTime <= endTime))
{
return (true, examPlanLesson.LessonName);
}

}

return (false, "");
}
catch (Exception ex)
{


불러오는 중...
취소
저장