From 9a0e76baa43cdb429288c348cba0c4a081ee8266 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Wed, 22 Jun 2022 16:21:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E8=AF=95=E8=AE=B0=E5=BD=95--=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E5=AE=A1=E6=A0=B8=E6=89=80=E6=9C=89=E8=80=83=E8=AF=95?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Exam_ExamPlanController.cs | 18 ++++++++++ .../Views/Exam_ExamPlan/Index.cshtml | 3 +- .../Views/Exam_ExamPlan/Index.js | 16 ++++++++- .../Exam_ExamPlanLessonBLL.cs | 19 ++++++++++ .../Exam_ExamPlanLessonIBLL.cs | 1 + .../Exam_ExamPlanLessonService.cs | 35 +++++++++++++++++++ 6 files changed, 90 insertions(+), 2 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 35d52a9f6..eaaa66089 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 @@ -357,6 +357,24 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return Success("操作成功!"); } + + /// + /// 审核所有考试课程 + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult CheckAllPlanLesson(string keyValue) + { + var res = exam_ExamPlanLessonIBLL.CheckAllPlanLesson(keyValue); + if (!res.flag) + { + return Fail(res.str); + } + + return Success("操作成功!"); + } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Index.cshtml index 643b5ac7b..a76aca1c4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Index.cshtml @@ -2,7 +2,7 @@ ViewBag.Title = "考试记录表"; Layout = "~/Views/Shared/_Index.cshtml"; } -
+
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 183bfbeaa..ca4a672f3 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 @@ -237,7 +237,21 @@ var bootstrap = function ($, learun) { }); } }); - + + //一键审核所有考试课程 + $('#lr_checkAll').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/CheckAllPlanLesson', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); //老师时间管理 $('#lr_teacherTimeManage').on('click', 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 5961c20fc..b69de675b 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 @@ -340,6 +340,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + + public (bool flag, string str) CheckAllPlanLesson(string EPId) + { + try + { + return exam_ExamPlanLessonService.CheckAllPlanLesson(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_ExamPlanLessonIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonIBLL.cs index f1c23aab6..1bdef576f 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 @@ -57,6 +57,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration (bool flag, string msg) PlanLessonTimeByEPId(string keyValue); (bool flag, string str) IsAllowSave(Exam_ExamPlanLessonEntity entity); (bool flag, string lessonname) IsExamTimeClash(Exam_ExamPlanLessonEntity entity); + (bool flag, string str) CheckAllPlanLesson(string keyValue); #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 8737dad17..043ebbcf5 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 @@ -561,6 +561,7 @@ left join CdLessonType ltype on info.LessonTypeId=ltype.LTId } } } + /// /// 自动生成考试课程排考时间 /// @@ -683,6 +684,40 @@ left join CdLessonType ltype on info.LessonTypeId=ltype.LTId } } + /// + /// 一键审核考试课程 + /// + /// + /// + public (bool flag, string str) CheckAllPlanLesson(string EPId) + { + var db = this.BaseRepository("CollegeMIS"); + try + { + db.BeginTrans(); + var list = db.FindList($"select * FROM Exam_ExamPlanLesson where epid='{EPId}' and examdate is not null and ExamTime is not null and SeatCount>0 and realstucount>0 and SeatCount>=realstucount"); + var EPLIds = string.Join("','", list.Select(x => x.EPLId).ToList()); + string sql = $"update Exam_ExamPlanLesson set ELCheckMark='1' where EPLId in ('{EPLIds}')"; + db.ExecuteBySql(sql); + //更新排考记录表是否生成字段 + string updsql = $"update Exam_ExamPlan set EPGenarate=0 where EPId='{EPId}'"; + db.ExecuteBySql(updsql); + db.Commit(); + return (true, ""); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion }