From 6cf22b546510bfecd982a797b5a75e283440f81e Mon Sep 17 00:00:00 2001 From: ndbs Date: Fri, 15 Apr 2022 20:26:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E8=AF=95=E8=AE=B0=E5=BD=95-=E7=94=9F?= =?UTF-8?q?=E6=88=90/=E6=B8=85=E9=99=A4=E6=8E=92=E8=80=83=E5=90=8D?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Exam_ExamPlanController.cs | 60 ++++++++++++++-- .../Views/Exam_ExamPlan/ClearForm.cshtml | 19 +++++ .../Views/Exam_ExamPlan/ClearForm.js | 58 ++++++++++++++++ .../Views/Exam_ExamPlan/GenerateForm.cshtml | 19 +++++ .../Views/Exam_ExamPlan/GenerateForm.js | 69 +++++++++++++++++++ .../Views/Exam_ExamPlan/Index.js | 22 ++++++ .../Learun.Application.Web.csproj | 4 ++ .../Exam_ExamPlan/Exam_ExamPlanBLL.cs | 50 ++++++++++++++ .../Exam_ExamPlan/Exam_ExamPlanIBLL.cs | 21 ++++++ .../Exam_ExamPlan/Exam_ExamPlanService.cs | 67 ++++++++++++++++-- 10 files changed, 377 insertions(+), 12 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/ClearForm.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/ClearForm.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/GenerateForm.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/GenerateForm.js 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 95ae373a7..560342202 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 @@ -26,7 +26,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult Index() { - return View(); + return View(); } /// /// 表单页 @@ -35,7 +35,25 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult Form() { - return View(); + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult GenerateForm() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult ClearForm() + { + return View(); } #endregion @@ -71,8 +89,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [AjaxOnly] public ActionResult GetFormData(string keyValue) { - var Exam_ExamPlanData = exam_ExamPlanIBLL.GetExam_ExamPlanEntity( keyValue ); - var jsonData = new { + var Exam_ExamPlanData = exam_ExamPlanIBLL.GetExam_ExamPlanEntity(keyValue); + var jsonData = new + { Exam_ExamPlan = Exam_ExamPlanData, }; return Success(jsonData); @@ -105,12 +124,43 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult SaveForm(string keyValue, string strEntity) { Exam_ExamPlanEntity entity = strEntity.ToObject(); - exam_ExamPlanIBLL.SaveEntity(keyValue,entity); + exam_ExamPlanIBLL.SaveEntity(keyValue, entity); if (string.IsNullOrEmpty(keyValue)) { } return Success("保存成功!"); } + + /// + /// 生成排考名单 + /// + /// + /// + /// + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult GenerateForm(string AcademicYearNo, string Semester, string PlanType) + { + int res = exam_ExamPlanIBLL.ClaerForm(AcademicYearNo, Semester, PlanType); + return Success("清空(" + res + ")条数据成功!"); + } + /// + /// 清除排考名单 + /// + /// + /// + /// + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult ClearForm(string AcademicYearNo, string Semester, string PlanType) + { + int res = exam_ExamPlanIBLL.GenerateForm(AcademicYearNo, Semester, PlanType); + return Success("清空(" + res + ")条数据成功!"); + } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/ClearForm.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/ClearForm.cshtml new file mode 100644 index 000000000..f6c8bd6de --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/ClearForm.cshtml @@ -0,0 +1,19 @@ +@{ + ViewBag.Title = "考试课程表"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
学年*
+
+
+
+
学期*
+
+
+
+
考试类型
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ExamPlan/ClearForm.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/ClearForm.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/ClearForm.js new file mode 100644 index 000000000..90adffa29 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/ClearForm.js @@ -0,0 +1,58 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2022-04-12 15:47 + * 描 述:考试课程表 + */ +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + }, + bind: function () { + $('#AcademicYearNo').lrselect({ + placeholder: "学年", + allowSearch: false, + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo', + value: 'value', + text: 'text', + maxHeight: 200, + }); + //学期 + $('#Semester').lrselect({ + placeholder: "学期", + allowSearch: false, + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', + value: 'value', + text: 'text' + }); + $('#PlanType').lrDataItemSelect({ code: 'StudentType' }); + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var postData = { + AcademicYearNo: $('#AcademicYearNo').lrselectGet(), + Semester: $('#Semester').lrselectGet(), + PlanType: $('#PlanType').lrselectGet() + }; + learun.layerConfirm('是否确认清空!', function (res) { + if (res) { + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/ClearTable', postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/GenerateForm.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/GenerateForm.cshtml new file mode 100644 index 000000000..60718af63 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/GenerateForm.cshtml @@ -0,0 +1,19 @@ +@{ + ViewBag.Title = "考试课程表"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
学年*
+
+
+
+
学期*
+
+
+
+
考试类型*
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ExamPlan/GenerateForm.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/GenerateForm.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/GenerateForm.js new file mode 100644 index 000000000..28fd099b4 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/GenerateForm.js @@ -0,0 +1,69 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2022-04-12 15:47 + * 描 述:考试课程表 + */ +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#AcademicYearNo').lrselect({ + placeholder: "学年", + allowSearch: false, + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo', + value: 'value', + text: 'text', + maxHeight: 200, + }); + //学期 + $('#Semester').lrselect({ + placeholder: "学期", + allowSearch: false, + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', + value: 'value', + text: 'text' + }); + $('#PlanType').lrDataItemSelect({ code: 'StudentType' }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/GetFormData?keyValue=' + keyValue, function (data) { + for (var id in data) { + if (!!data[id].length && data[id].length > 0) { + $('#' + id ).jfGridSet('refreshdata', data[id]); + } + else { + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var postData = { + AcademicYearNo: $('#AcademicYearNo').lrselectGet(), + Semester: $('#Semester').lrselectGet(), + PlanType: $('#PlanType').lrselectGet() + }; + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/GenerateForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} 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 4a3990b5a..7b043026b 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 @@ -86,9 +86,31 @@ var bootstrap = function ($, learun) { }); //  生成排考名单 $('#lr_generate').on('click', function () { + learun.layerForm({ + id: 'form_clear', + title: '生成排考名单', + url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/GenerateForm', + width: 500, + height: 300, + btn: ['确定', '关闭'], + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); }); //  清除排考名单 $('#lr_cleargenerate').on('click', function () { + learun.layerForm({ + id: 'form_generate', + title: '清除排考名单', + url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/GenerateForm', + width: 500, + height: 300, + btn: ['确定', '关闭'], + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); }); //  安排考试 $('#lr_planks').on('click', function () { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index df2c8a63d..db1a56a36 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -996,6 +996,8 @@ + + @@ -7644,6 +7646,8 @@ + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanBLL.cs index 8fd0c72b6..187483bff 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanBLL.cs @@ -119,6 +119,56 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 清空 + /// + /// + /// + /// + /// + public int ClaerForm(string AcademicYearNo, string Semester, string PlanType) + { + try + { + return exam_ExamPlanService.ClaerForm(AcademicYearNo, Semester, PlanType); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 生成 + /// + /// + /// + /// + /// + public int GenerateForm(string AcademicYearNo, string Semester, string PlanType) + { + try + { + return exam_ExamPlanService.GenerateForm(AcademicYearNo, Semester, PlanType); + } + 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_ExamPlan/Exam_ExamPlanIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanIBLL.cs index 2775b00cc..207862e8f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanIBLL.cs @@ -42,6 +42,27 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 主键 /// 实体 void SaveEntity(string keyValue, Exam_ExamPlanEntity entity); + + /// + /// 清空 + /// + /// + /// + /// + /// + int ClaerForm(string AcademicYearNo, string Semester, string PlanType); + /// + /// 生成 + /// + /// + /// + /// + /// + int GenerateForm(string AcademicYearNo, string Semester, string PlanType); + + + + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanService.cs index 88bd8b7c0..dbb19a35b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanService.cs @@ -50,12 +50,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration var dp = new DynamicParameters(new { }); if (!queryParam["AcademicYearNo"].IsEmpty()) { - dp.Add("AcademicYearNo",queryParam["AcademicYearNo"].ToString(), DbType.String); + dp.Add("AcademicYearNo", queryParam["AcademicYearNo"].ToString(), DbType.String); strSql.Append(" AND t.AcademicYearNo = @AcademicYearNo "); } if (!queryParam["Semester"].IsEmpty()) { - dp.Add("Semester",queryParam["Semester"].ToString(), DbType.String); + dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); strSql.Append(" AND t.Semester = @Semester "); } if (!queryParam["PlanName"].IsEmpty()) @@ -65,7 +65,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } if (!queryParam["PlanType"].IsEmpty()) { - dp.Add("PlanType",queryParam["PlanType"].ToString(), DbType.String); + dp.Add("PlanType", queryParam["PlanType"].ToString(), DbType.String); strSql.Append(" AND t.PlanType = @PlanType "); } if (!queryParam["PlanCode"].IsEmpty()) @@ -75,15 +75,15 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } if (!queryParam["EPRandom"].IsEmpty()) { - dp.Add("EPRandom",queryParam["EPRandom"].ToString(), DbType.String); + dp.Add("EPRandom", queryParam["EPRandom"].ToString(), DbType.String); strSql.Append(" AND t.EPRandom = @EPRandom "); } if (!queryParam["EPGenarate"].IsEmpty()) { - dp.Add("EPGenarate",queryParam["EPGenarate"].ToString(), DbType.String); + dp.Add("EPGenarate", queryParam["EPGenarate"].ToString(), DbType.String); strSql.Append(" AND t.EPGenarate = @EPGenarate "); } - return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) { @@ -134,7 +134,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - this.BaseRepository("CollegeMIS").Delete(t=>t.EPId == keyValue); + this.BaseRepository("CollegeMIS").Delete(t => t.EPId == keyValue); } catch (Exception ex) { @@ -182,6 +182,59 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 清空 + /// + /// + /// + /// + /// + public int ClaerForm(string AcademicYearNo, string Semester, string PlanType) + { + try + { + string sql = ""; + return this.BaseRepository("CollegeMIS").ExecuteBySql(sql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 生成 + /// + /// + /// + /// + /// + public int GenerateForm(string AcademicYearNo, string Semester, string PlanType) + { + try + { + string sql = ""; + return this.BaseRepository("CollegeMIS").Insert(sql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion }