From 39b129b4d6e9e058711234fe0adee4ceeedc3ed5 Mon Sep 17 00:00:00 2001
From: zhangli <1109134334@qq.com>
Date: Fri, 10 Jun 2022 09:39:26 +0800
Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90=E8=80=83?=
=?UTF-8?q?=E8=AF=95=E8=AF=BE=E7=A8=8B=E6=8E=92=E8=80=83=E6=97=B6=E9=97=B4?=
=?UTF-8?q?=EF=BC=88=E6=9C=AA=E5=AE=8C=E6=88=90=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controllers/Exam_ExamPlanController.cs | 28 +++++++++--
.../Views/Exam_ExamPlan/Index.js | 15 ++++++
.../Exam_ExamPlanLessonBLL.cs | 20 ++++++++
.../Exam_ExamPlanLessonEntity.cs | 5 ++
.../Exam_ExamPlanLessonIBLL.cs | 2 +
.../Exam_ExamPlanLessonService.cs | 49 +++++++++++++++++++
6 files changed, 114 insertions(+), 5 deletions(-)
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanController.cs
index 6e7b8efa4..02954f117 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanController.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanController.cs
@@ -269,11 +269,11 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
return Success("操作成功!");
}
///
- /// 一键安排班级
- ///
- ///
- ///
- [HttpPost]
+ /// 一键安排班级
+ ///
+ ///
+ ///
+ [HttpPost]
[AjaxOnly]
public ActionResult PlanClassByEPId(string keyValue)
{
@@ -286,6 +286,24 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
exam_ExamPlanClassIBLL.PlanClassByEPId(keyValue);
return Success("操作成功!");
}
+ ///
+ /// 自动生成考试课程排考时间
+ ///
+ ///
+ ///
+ [HttpPost]
+ [AjaxOnly]
+ public ActionResult PlanLessonTimeByEPId(string keyValue)
+ {
+ var count = exam_ExamPlanLessonIBLL.GetListByEPId(keyValue).Count();
+ if (count <= 0)
+ {
+ return Fail("请先安排课程!");
+ }
+ exam_ExamPlanLessonIBLL.PlanLessonTimeByEPId(keyValue);
+ return Success("操作成功!");
+ }
+
#endregion
}
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Index.js
index 8f43e80d8..913b3239c 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Index.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Index.js
@@ -190,6 +190,21 @@ var bootstrap = function ($, learun) {
});
}
});
+
+ //自动生成排考时间
+ $('#lr_examlessontime').on('click',
+ function () {
+ var keyValue = $('#gridtable').jfGridValue('EPId');
+ if (learun.checkrow(keyValue)) {
+ learun.layerConfirm('是否确认生成排考时间!', function (res) {
+ if (res) {
+ learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/PlanLessonTimeByEPId', { keyValue: keyValue }, function () {
+ refreshGirdData();
+ });
+ }
+ });
+ }
+ });
},
// 初始化列表
initGird: function () {
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonBLL.cs
index 76c291449..3dd2fe689 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonBLL.cs
@@ -263,6 +263,26 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}
+
+ public (bool flag, string msg) PlanLessonTimeByEPId(string EPId)
+ {
+ try
+ {
+ return exam_ExamPlanLessonService.PlanLessonTimeByEPId(EPId);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
#endregion
}
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonEntity.cs
index 6cfa48f54..01ff1f76d 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonEntity.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonEntity.cs
@@ -108,6 +108,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
public string AcademicYearNo { get; set; }
[NotMapped]
public string Semester { get; set; }
+ ///
+ /// 考试时长
+ ///
+ [NotMapped]
+ public int? ExamLength { get; set; }
#endregion
}
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonIBLL.cs
index 9557074df..051781014 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonIBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonIBLL.cs
@@ -52,6 +52,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// 实体
void SaveEntity(string keyValue, Exam_ExamPlanLessonEntity entity);
+ (bool flag, string msg) PlanLessonTimeByEPId(string keyValue);
+
(bool flag, string lessonname) IsExamTimeClash(Exam_ExamPlanLessonEntity entity);
#endregion
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonService.cs
index 5c3f6a862..33ddb0c9f 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonService.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonService.cs
@@ -411,6 +411,55 @@ and AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and Semester='{exam_ExamPlan
}
}
}
+
+ ///
+ /// 自动生成考试课程排考时间
+ ///
+ ///
+ ///
+ public (bool flag, string msg) PlanLessonTimeByEPId(string EPId)
+ {
+ try
+ {
+ /*
+ * 1.查询考试记录是否已安排时间
+ * 2.查询考试课程的考试时长是否大于0
+ * 3.同一时间段内只能一个专业安排一门课程
+ */
+
+ //安排时间数据
+ var EPTimeList = this.BaseRepository("CollegeMIS")
+ .FindList(x => x.EPId == EPId);
+ if (EPTimeList.Count() <= 0)
+ {
+ return (false, "请先安排考试记录时间!");
+ }
+ //考试课程数据
+ var EPLessonList = this.BaseRepository("CollegeMIS")
+ .FindList($@"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
}