diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ArrangeExamTermItemNewController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ArrangeExamTermItemNewController.cs new file mode 100644 index 000000000..ea0f05b07 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ArrangeExamTermItemNewController.cs @@ -0,0 +1,117 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Web.Mvc; +using System.Collections.Generic; + +namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-22 16:51 + /// 描 述:考场安排明细 + /// + public class Exam_ArrangeExamTermItemNewController : MvcControllerBase + { + private Exam_ArrangeExamTermItemNewIBLL exam_ArrangeExamTermItemNewIBLL = new Exam_ArrangeExamTermItemNewBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = exam_ArrangeExamTermItemNewIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var Exam_ArrangeExamTermItemNewData = exam_ArrangeExamTermItemNewIBLL.GetExam_ArrangeExamTermItemNewEntity( keyValue ); + var jsonData = new { + Exam_ArrangeExamTermItemNew = Exam_ArrangeExamTermItemNewData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + exam_ArrangeExamTermItemNewIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + Exam_ArrangeExamTermItemNewEntity entity = strEntity.ToObject(); + exam_ArrangeExamTermItemNewIBLL.SaveEntity(keyValue,entity); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ArrangeExamTermNewController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ArrangeExamTermNewController.cs new file mode 100644 index 000000000..cc1b13b0e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ArrangeExamTermNewController.cs @@ -0,0 +1,117 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Web.Mvc; +using System.Collections.Generic; + +namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-22 16:00 + /// 描 述:排考安排 + /// + public class Exam_ArrangeExamTermNewController : MvcControllerBase + { + private Exam_ArrangeExamTermNewIBLL exam_ArrangeExamTermNewIBLL = new Exam_ArrangeExamTermNewBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = exam_ArrangeExamTermNewIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var ArrangeExamTermNewData = exam_ArrangeExamTermNewIBLL.GetExam_ArrangeExamTermNewEntity( keyValue ); + var jsonData = new { + ArrangeExamTermNew = ArrangeExamTermNewData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + exam_ArrangeExamTermNewIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + Exam_ArrangeExamTermNewEntity entity = strEntity.ToObject(); + exam_ArrangeExamTermNewIBLL.SaveEntity(keyValue,entity); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + #endregion + + } +} 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 560342202..f4dce10ad 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 @@ -113,6 +113,31 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return Success("删除成功!"); } /// + /// 生成排考名单 + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult Generate(string keyValue) + { + exam_ExamPlanIBLL.Generate(keyValue); + return Success("生成成功!"); + } + /// + /// 清除排考名单/清除所有排考记录 + /// + /// 排考记录主表Id + /// 1:清除排考名单;2:清除所有排考记录 + /// + [HttpPost] + [AjaxOnly] + public ActionResult ClearGenerate(string keyValue, int type) + { + exam_ExamPlanIBLL.ClearGenerate(keyValue, type); + return Success("操作成功!"); + } + /// /// 保存实体数据(新增、修改) /// /// 主键 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanLessonController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanLessonController.cs index a6cb01b66..84a640d37 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanLessonController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanLessonController.cs @@ -3,6 +3,8 @@ using System.Data; using Learun.Application.TwoDevelopment.EducationalAdministration; using System.Web.Mvc; using System.Collections.Generic; +using System; +using System.Linq; namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { @@ -16,12 +18,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public class Exam_ExamPlanLessonController : MvcControllerBase { private Exam_ExamPlanLessonIBLL exam_ExamPlanLessonIBLL = new Exam_ExamPlanLessonBLL(); + private Exam_ExamPlanClassIBLL exam_ExamPlanClassIBLL = new Exam_ExamPlanClassBLL(); + private Exam_ExamPlanRoomIBLL exam_ExamPlanRoomIBLL = new Exam_ExamPlanRoomBLL(); #region 视图功能 /// /// 主页面 - /// + /// + /// 排考记录主表Id /// [HttpGet] public ActionResult Index(string EPId) @@ -36,12 +41,63 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult Form() { - return View(); + return View(); + } + [HttpGet] + public ActionResult FormClass() + { + return View(); } + + [HttpGet] + public ActionResult FormRoom() + { + return View(); + } + [HttpGet] + public ActionResult FormTeacher() + { + return View(); + } + + [HttpGet] + public ActionResult FormRoomTeacher() + { + return View(); + } + #endregion #region 获取数据 + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetListForClass(string queryJson) + { + var data = exam_ExamPlanClassIBLL.GetList(queryJson); + + return Success(data); + } + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetListForRoom(string pagination, string queryJson) + { + var data = exam_ExamPlanRoomIBLL.GetList(queryJson); + + return Success(data); + } /// /// 获取页面显示列表数据 /// @@ -63,6 +119,19 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers }; return Success(jsonData); } + + [HttpGet] + [AjaxOnly] + public ActionResult GetFormRoom(string keyValue) + { + var data = exam_ExamPlanRoomIBLL.GetEntity(keyValue); + + var jsonData = new + { + Exam_ExamPlanRoom = data, + }; + return Success(jsonData); + } /// /// 获取表单数据 /// @@ -72,8 +141,16 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [AjaxOnly] public ActionResult GetFormData(string keyValue) { - var Exam_ExamPlanLessonData = exam_ExamPlanLessonIBLL.GetExam_ExamPlanLessonEntity( keyValue ); - var jsonData = new { + var Exam_ExamPlanLessonData = exam_ExamPlanLessonIBLL.GetExam_ExamPlanLessonEntity(keyValue); + if (!string.IsNullOrEmpty(Exam_ExamPlanLessonData.ExamTime)) + { + var etime = Exam_ExamPlanLessonData.ExamTime.Split('-'); + Exam_ExamPlanLessonData.ExamTimeStart = etime[0]; + Exam_ExamPlanLessonData.ExamTimeEnd = etime[1]; + } + + var jsonData = new + { Exam_ExamPlanLesson = Exam_ExamPlanLessonData, }; return Success(jsonData); @@ -89,6 +166,14 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers var data = exam_ExamPlanLessonIBLL.GetTree(); return Success(data); } + [HttpGet] + [AjaxOnly] + public ActionResult ValidateRoom(string EPLId, string ClassroomNo) + { + var data = exam_ExamPlanRoomIBLL.ValidateRoom(EPLId, ClassroomNo); + return Success(data); + } + #endregion #region 提交数据 @@ -118,6 +203,48 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers exam_ExamPlanLessonIBLL.DeleteEntity(keyValue); return Success("删除成功!"); } + [HttpPost] + [AjaxOnly] + public ActionResult DeleteClass(string keyValue) + { + exam_ExamPlanClassIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + + [HttpPost] + [AjaxOnly] + public ActionResult DeleteRoom(string keyValue) + { + exam_ExamPlanRoomIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 审核 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult Check(string keyValue, int ELCheckMark) + { + if (ELCheckMark == 1) + { + var entity = exam_ExamPlanLessonIBLL.GetExam_ExamPlanLessonEntity(keyValue); + if ((entity.RealClassNum == null || entity.RealClassNum == 0) || + (entity.SeatCount == null || entity.SeatCount == 0)) + { + return Fail("请先安排班级和考场!"); + } + + if (entity.SeatCount < entity.RealStuCount) + { + return Fail("考场座位数不足!"); + } + } + + exam_ExamPlanLessonIBLL.Check(keyValue, ELCheckMark); + return Success("审核成功!"); + } /// /// 保存实体数据(新增、修改) /// @@ -130,12 +257,57 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult SaveForm(string keyValue, string strEntity) { Exam_ExamPlanLessonEntity entity = strEntity.ToObject(); - exam_ExamPlanLessonIBLL.SaveEntity(keyValue,entity); - if (string.IsNullOrEmpty(keyValue)) + DateTime time; + bool flag = DateTime.TryParse(entity.ExamTimeStart, out time); + if (!flag) + { + return Fail("考试开始时间格式不正确!"); + } + if (!DateTime.TryParse(entity.ExamTimeEnd, out time)) + { + return Fail("考试结束时间格式不正确!"); + } + + if (!string.IsNullOrEmpty(entity.ExamTimeStart) && !string.IsNullOrEmpty(entity.ExamTimeEnd)) { + entity.ExamTime = entity.ExamTimeStart.Trim() + "-" + entity.ExamTimeEnd; } + + exam_ExamPlanLessonIBLL.SaveEntity(keyValue, entity); + return Success("保存成功!"); + } + + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveClass(string EPLId, List list) + { + exam_ExamPlanClassIBLL.SaveList(list); + return Success("保存成功!"); + } + + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveRoomAndTeacher(string keyValue, string strEntity, string Exam_ExamPlanTeacherList) + { + var entity = strEntity.ToObject(); + var teacherList = Exam_ExamPlanTeacherList.ToObject>(); + entity.EmpNo = string.Join(",", teacherList.Select(x => x.EmpNo).ToList()); + entity.EmpName = string.Join(",", teacherList.Select(x => x.EmpName).ToList()); + exam_ExamPlanRoomIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); } + + //[HttpPost] + //[ValidateAntiForgeryToken] + //[AjaxOnly] + //public ActionResult SaveRoom(List list) + //{ + // exam_ExamPlanRoomIBLL.SaveList(list); + // return Success("保存成功!"); + //} + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermItemNew/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermItemNew/Form.cshtml new file mode 100644 index 000000000..04a607d77 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermItemNew/Form.cshtml @@ -0,0 +1,51 @@ +@{ + ViewBag.Title = "考场安排明细"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
课程编号
+ +
+
+
课程名称
+ +
+
+
考试日期
+ +
+
+
考试时间
+ +
+
+
监考老师编号
+ +
+
+
监考老师姓名
+ +
+
+
考场编号
+ +
+
+
考场名称
+ +
+
+
座位号
+ +
+
+
学生编号
+ +
+
+
学生姓名
+ +
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermItemNew/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermItemNew/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermItemNew/Form.js new file mode 100644 index 000000000..8a837a059 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermItemNew/Form.js @@ -0,0 +1,50 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2022-04-22 16:51 + * 描 述:考场安排明细 + */ +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 () { + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermItemNew/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 = { + strEntity: JSON.stringify($('body').lrGetFormData()) + }; + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermItemNew/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermItemNew/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermItemNew/Index.cshtml new file mode 100644 index 000000000..4a259bbbc --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermItemNew/Index.cshtml @@ -0,0 +1,68 @@ +@{ + ViewBag.Title = "考场安排明细"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
课程编号
+ +
+
+
课程名称
+ +
+
+
监考老师编号
+ +
+
+
监考老师姓名
+ +
+
+
考场编号
+ +
+
+
考场名称
+ +
+
+
学生编号
+ +
+
+
学生姓名
+ +
+
+
考试日期
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermItemNew/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermItemNew/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermItemNew/Index.js new file mode 100644 index 000000000..2d6e766dc --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermItemNew/Index.js @@ -0,0 +1,101 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2022-04-22 16:51 + * 描 述:考场安排明细 + */ +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermItemNew/Form', + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('EPIId'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermItemNew/Form?keyValue=' + keyValue, + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('EPIId'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermItemNew/DeleteForm', { keyValue: keyValue}, function () { + refreshGirdData(); + }); + } + }); + } + }); + // 打印 + $('#lr_print').on('click', function () { + $('#gridtable').jqprintTable(); + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermItemNew/GetPageList', + headData: [ + { label: "课程编号", name: "LessonNo", width: 100, align: "left"}, + { label: "课程名称", name: "LessonName", width: 100, align: "left"}, + { label: "考试日期", name: "ExamDate", width: 100, align: "left"}, + { label: "考试时间", name: "ExamTime", width: 100, align: "left"}, + { label: "监考老师编号", name: "EmpNo", width: 100, align: "left"}, + { label: "监考老师姓名", name: "EmpName", width: 100, align: "left"}, + { label: "考场编号", name: "ClassroomNo", width: 100, align: "left"}, + { label: "考场名称", name: "ClassroomName", width: 100, align: "left"}, + { label: "座位号", name: "SitNumber", width: 100, align: "left"}, + { label: "学生编号", name: "StuNo", width: 100, align: "left"}, + { label: "学生姓名", name: "StuName", width: 100, align: "left"}, + ], + mainId:'EPIId', + isPage: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + $('#gridtable').jfGridSet('reload'); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/Form.cshtml new file mode 100644 index 000000000..3ec6a3a91 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/Form.cshtml @@ -0,0 +1,39 @@ +@{ + ViewBag.Title = "排考安排"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
课程编号
+ +
+
+
课程名称
+ +
+
+
考试日期
+ +
+
+
考试时间
+ +
+
+
监考老师编号
+ +
+
+
监考老师姓名
+ +
+
+
考场编号
+ +
+
+
考场名称
+ +
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/Form.js new file mode 100644 index 000000000..8e5ce3bc7 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/Form.js @@ -0,0 +1,50 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2022-04-22 16:00 + * 描 述:排考安排 + */ +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 () { + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/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 = { + strEntity: JSON.stringify($('body').lrGetFormData()) + }; + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/Index.cshtml new file mode 100644 index 000000000..f638c27fa --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/Index.cshtml @@ -0,0 +1,60 @@ +@{ + ViewBag.Title = "排考安排"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
考试日期
+
+
+
课程编号
+ +
+
+
课程名称
+ +
+
+
监考老师编号
+ +
+
+
监考老师姓名
+ +
+
+
考场编号
+ +
+
+
考场名称
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/Index.js new file mode 100644 index 000000000..1987e3a45 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/Index.js @@ -0,0 +1,98 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2022-04-22 16:00 + * 描 述:排考安排 + */ +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/Form', + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('EPIId'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/Form?keyValue=' + keyValue, + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('EPIId'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/DeleteForm', { keyValue: keyValue}, function () { + refreshGirdData(); + }); + } + }); + } + }); + // 打印 + $('#lr_print').on('click', function () { + $('#gridtable').jqprintTable(); + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/GetPageList', + headData: [ + { label: "课程编号", name: "LessonNo", width: 100, align: "left"}, + { label: "课程名称", name: "LessonName", width: 100, align: "left"}, + { label: "考试日期", name: "ExamDate", width: 100, align: "left"}, + { label: "考试时间", name: "ExamTime", width: 100, align: "left"}, + { label: "监考老师编号", name: "EmpNo", width: 100, align: "left"}, + { label: "监考老师姓名", name: "EmpName", width: 100, align: "left"}, + { label: "考场编号", name: "ClassroomNo", width: 100, align: "left"}, + { label: "考场名称", name: "ClassroomName", width: 100, align: "left"}, + ], + mainId:'EPIId', + isPage: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + $('#gridtable').jfGridSet('reload'); + }; + page.init(); +} 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 15b62df28..5c4065e36 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 @@ -55,6 +55,7 @@ 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 f4d904e3c..9d045a9ec 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,31 +86,42 @@ 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); - } - }); + var keyValue = $('#gridtable').jfGridValue('EPId'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认生成排考名单!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/Generate', { keyValue: keyValue }, function () { + 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); - } - }); + var keyValue = $('#gridtable').jfGridValue('EPId'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认清除排考名单!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/ClearGenerate', { keyValue: keyValue, type: 1 }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //清除排考记录 + $('#lr_cleardata').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/ClearGenerate', { keyValue: keyValue, type: 2 }, function () { + refreshGirdData(); + }); + } + }); + } }); //  安排考试 $('#lr_planks').on('click', diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Form.cshtml index 307d91c32..f425f78b1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Form.cshtml @@ -3,17 +3,17 @@ Layout = "~/Views/Shared/_Form.cshtml"; }
-
-
考试日期
- +
+
考试日期*
+
-
+
考试开始时间*
- +
-
-
结束时间
- +
+
结束时间*
+
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormClass.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormClass.cshtml new file mode 100644 index 000000000..dd0fbe7c9 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormClass.cshtml @@ -0,0 +1,44 @@ +@{ + ViewBag.Title = "添加排考班级"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
班级名称
+ +
+
+
班级代码
+ +
+
+
系部
+
+
+
+
专业
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormClass.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormClass.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormClass.js new file mode 100644 index 000000000..7b7d46cd6 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormClass.js @@ -0,0 +1,149 @@ + +var refreshGirdData; +var acceptClick; +//考试安排课程表Id +var EPLId = request('EPLId'); +var EPId = request('EPId'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); + $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GetPageList', + headData: [ + { label: "班级名称", name: "ClassName", width: 200, align: "left" }, + { label: "班级代码", name: "ClassNo", width: 100, align: "left" }, + { + label: "系部", name: "DeptNo", width: 200, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', + key: value, + keyId: 'deptno', + callback: function (_data) { + callback(_data['deptname']); + } + }); + } + }, + { + label: "专业", name: "MajorNo", width: 200, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + key: value, + keyId: 'majorno', + callback: function (_data) { + callback(_data['majorname']); + } + }); + } + }, + { label: "默认教室", name: "SerialNum", width: 100, align: "left" }, + { + label: "班级类型", name: "ClassType", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'ClassType', + callback: function (_data) { + callback(_data.text); + } + }); + } + + }, + { label: "年级", name: "Grade", width: 80, align: "center" }, + { label: "学生人数", name: "StuNum", width: 80, align: "left" }, + { + label: "班主任", name: "ClassDiredctorNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', + key: value, + keyId: 'f_encode', + callback: function (_data) { + callback(_data['f_realname']); + } + }); + } + }, + { + label: "辅导员", name: "ClassTutorNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', + key: value, + keyId: 'f_encode', + callback: function (_data) { + callback(_data['f_realname']); + } + }); + } + }, + ], + mainId: 'ClassId', + isPage: true, + isMultiselect: true, + sidx: 'ClassNo', + sord: 'ASC' + }); + page.search(); + }, + search: function (param) { + param = param || {}; + //考试安排课程表Id + param.EPLId = EPLId; + param.SqlParameter = " and CheckMark=1"; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + page.search(); + }; + // 保存数据 + acceptClick = function (callBack) { + var selectedRow = $('#gridtable').jfGridGet('rowdata'); + var list = []; + $.each(selectedRow, + function (i, item) { + var entity = { + ClassName: item.ClassName, + ClassNo: item.ClassNo, + ClassStuNum: item.StuNum, + EPCId: learun.newGuid(), + EPLId: EPLId + } + list.push(entity); + + }); + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/SaveClass?EPLId=' + EPLId, + { list: list }), function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }; + if (!!callBack) { + callBack(); + } + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoom.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoom.cshtml new file mode 100644 index 000000000..f4697b424 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoom.cshtml @@ -0,0 +1,44 @@ +@{ + ViewBag.Title = "添加排考考场"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
学年
+
+
+
+
学期
+
+
+
+
考场编号
+ +
+
+
考场名称
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoom.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoom.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoom.js new file mode 100644 index 000000000..9b4ec8238 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoom.js @@ -0,0 +1,106 @@ + +var refreshGirdData; +var acceptClick; +//考试安排课程表Id +var EPLId = request('EPLId'); +var EPId = request('EPId'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + $('#AcademicYearNo').lrselect({ + placeholder: "学年", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo', + value: 'value', + text: 'text' + }); + //学期 + $('#Semester').lrselect({ + placeholder: "学期", + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', + value: 'value', + text: 'text' + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamRoom/GetPageList', + headData: [ + { label: "学年", name: "AcademicYearNo", width: 100, align: "left" }, + { label: "学期", name: "Semester", width: 100, align: "left" }, + { label: "考场编号", name: "ClassroomNo", width: 100, align: "left" }, + { label: "考场名称", name: "ClassroomName", width: 200, align: "left" }, + { label: "座位行数", name: "SeatRows", width: 100, align: "left" }, + { label: "座位列数", name: "SeatColumns", width: 100, align: "left" }, + { label: "考场座位数", name: "SeatCount", width: 100, align: "left" }, + //{ + // label: "是否启用", name: "EREnabled", width: 100, align: "left", + // formatter: function (cellvalue) { + // return cellvalue == 1 ? "" : ""; + // } + //}, + ], + mainId: 'ERId', + isPage: true, + //isMultiselect: true, + + }); + page.search(); + }, + search: function (param) { + param = param || {}; + //考试安排课程表Id + param.EPLId = EPLId; + param.SqlParameter = " and t.EREnabled=1"; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + page.search(); + }; + // 保存数据 + acceptClick = function (callBack) { + var selectedRow = $('#gridtable').jfGridGet('rowdata'); + learun.layerClose(window.name); + callBack(selectedRow); + //var list = []; + //$.each(selectedRow, + // function (i, item) { + // var entity = { + // ClassroomName: item.ClassroomName, + // ClassroomNo: item.ClassroomNo, + // SeatCount: item.SeatCount, + // EPRId: learun.newGuid(), + // EPLId: EPLId + // } + // list.push(entity); + + // }); + //$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/SaveRoom?EPLId=' + EPLId, + // { list: list }), function (res) { + // // 保存成功后才回调 + // if (!!callBack) { + // callBack(); + // } + // }; + + //if (!!callBack) { + // callBack(); + //} + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.cshtml new file mode 100644 index 000000000..b4257ae8d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.cshtml @@ -0,0 +1,28 @@ +@{ + ViewBag.Title = "添加排考考场"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
考场名称*
+ + +
+
+
考场编号
+ +
+
+
考场座位数
+ +
+
+
监考老师
+ + +
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.js new file mode 100644 index 000000000..302f0a453 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.js @@ -0,0 +1,163 @@ + +//考试安排课程表Id +var EPLId = request('EPLId'); +var EPId = request('EPId'); +var keyValue = request('keyValue'); +var acceptClick; +// 设置表单数据 +var setFormData; +// 验证数据是否填写完整 +var validForm; +// 保存数据 +var save; +var refreshGirdData; +var refreshRoomData; +var selectedRow; +var tempdatra = new Array(); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + $("#detailadd").on('click', function () { + selectedRow = null; + learun.layerForm({ + id: 'formitem', + title: '新增明细', + url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/FormTeacher?EPLId=' + EPLId + '&EPRId=' + keyValue, + width: 860, + height: 600, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + $("#detaildel").on('click', function () { + var keyValue = $('#Exam_ExamPlanTeacher').jfGridValue('EmpNo'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res, index) { + if (res) { + $.each(tempdatra, function (key, val) { + if (!!val && val.EmpNo === keyValue) { + tempdatra.splice(key, 1); + } + }); + $('#Exam_ExamPlanTeacher').jfGridSet('refreshdata', tempdatra); + top.layer.close(index); + } + }); + } + }); + page.bind(); + page.initData(); + }, + bind: function () { + $("#selectRoom").on('click', function () { + selectedRow = null; + learun.layerForm({ + id: 'formroom1', + title: '新增考场', + url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/FormRoom?EPLId=' + EPLId, + width: 850, + height: 500, + callBack: function (id) { + return top[id].acceptClick(refreshRoomData); + } + }); + }); + + $('#Exam_ExamPlanTeacher').jfGrid({ + headData: [ + { + label: '编号', name: 'EmpNo', width: 150, align: 'left' + }, + { + label: '姓名', name: 'EmpName', width: 150, align: 'left' + } + ], + height: 400, + mainId: 'AAIId', + reloadSelected: false, + }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm( + top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/GetFormRoom?keyValue=' + keyValue, + function (data) { + tempdatra = []; + 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]); + var empnoArr = data[id].EmpNo.split(','); + var empnameArr = data[id].EmpName.split(','); + $.each(empnoArr, function (i, val) { + tempdatra.push({ EmpNo: val, EmpName: empnameArr[i] }); + }); + $('#Exam_ExamPlanTeacher').jfGridSet('refreshdata', tempdatra); + } + } + }); + } + } + }; + refreshGirdData = function (temprow) { + //console.log('temprow', temprow); + //求数组并集 + //两数组连接(包括重复值) + var arr3 = tempdatra.concat(temprow); + //var result = []; + var obj = []; + //去重 + tempdatra = arr3.reduce(function (prev, cur, index, arr) { + //console.log(prev, cur); + obj[cur.EmpNo] ? '' : obj[cur.EmpNo] = true && prev.push(cur); + return prev; + }, []); + $('#Exam_ExamPlanTeacher').jfGridSet('refreshdata', tempdatra); + }; + refreshRoomData = function (temprow) { + // console.log('teacherRow', temprow); + learun.httpAsyncGet(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/ValidateRoom?EPLId=' + EPLId + '&ClassroomNo=' + temprow.ClassroomNo, function (res) { + + if (res.data == true) { + return learun.alert.warning("考场不可重复选择!"); + } else { + $("#ClassroomName").val(temprow.ClassroomName); + $('#ClassroomNo').val(temprow.ClassroomNo); + $('#SeatCount').val(temprow.SeatCount); + } + }); + }; + // 验证数据是否填写完整 + validForm = function () { + if (!$('.lr-form-wrap').lrValidform()) { + return false; + } + var datas = $('#Exam_ExamPlanTeacher').jfGridGet('rowdatas'); + if (datas == null || datas.length == 0) { + learun.alert.warning("请先新增监考老师!"); + return false; + } + return true; + }; + // 保存数据 + acceptClick = function (callBack, i) { + var postData = {}; + var formData = $('[data-table="Exam_ExamPlanRoom"]').lrGetFormData(); + formData.EPLId = EPLId; + postData.strEntity = JSON.stringify(formData); + postData.Exam_ExamPlanTeacherList = JSON.stringify($('#Exam_ExamPlanTeacher').jfGridGet('rowdatas')); + + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/SaveRoomAndTeacher?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(res, formData, i); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormTeacher.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormTeacher.cshtml new file mode 100644 index 000000000..7800bb401 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormTeacher.cshtml @@ -0,0 +1,44 @@ +@{ + ViewBag.Title = "添加排考监考老师"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
学年
+
+
+
+
学期
+
+
+
+
教师编号
+ +
+
+
教师姓名
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormTeacher.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormTeacher.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormTeacher.js new file mode 100644 index 000000000..93d2ea740 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormTeacher.js @@ -0,0 +1,105 @@ + +var refreshGirdData; +var acceptClick; +//考试安排课程表Id +var EPLId = request('EPLId'); +//安排考场表Id +var EPRId = request('EPRId'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + $('#AcademicYearNo').lrselect({ + placeholder: "学年", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo', + value: 'value', + text: 'text' + }); + //学期 + $('#Semester').lrselect({ + placeholder: "学期", + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', + value: 'value', + text: 'text' + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/Exam_InvigilateTeacher/GetPageList', + headData: [ + { label: "学年", name: "AcademicYearNo", width: 100, align: "left" }, + { label: "学期", name: "Semester", width: 100, align: "left" }, + { label: "教师编号", name: "EmpNo", width: 100, align: "left" }, + { label: "教师姓名", name: "EmpName", width: 100, align: "left" }, + { + label: "是否启用", name: "ITEnabled", width: 100, align: "left", + formatter: function (cellvalue) { + return cellvalue == 1 ? "" : ""; + } + }, + ], + mainId: 'ITId', + isPage: true, + isMultiselect: true, + }); + page.search(); + }, + search: function (param) { + param = param || {}; + //考试安排课程表Id + param.EPLId = EPLId; + //安排考场表Id + param.EPRId = EPRId; + param.SqlParameter = " and t.ITEnabled=1"; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + page.search(); + }; + // 保存数据 + acceptClick = function (callBack) { + var selectedRow = $('#gridtable').jfGridGet('rowdata'); + learun.layerClose(window.name); + callBack(selectedRow); + //var list = []; + //$.each(selectedRow, + // function (i, item) { + // var entity = { + // ClassroomName: item.ClassroomName, + // ClassroomNo: item.ClassroomNo, + // SeatCount: item.SeatCount, + // EPRId: learun.newGuid(), + // EPLId: EPLId + // } + // list.push(entity); + + // }); + //$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/SaveRoom?EPLId=' + EPLId, + // { list: list }), function (res) { + // // 保存成功后才回调 + // if (!!callBack) { + // callBack(); + // } + // }; + + //if (!!callBack) { + // callBack(); + //} + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Index.cshtml index 9e048ef21..8d6d102b6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Index.cshtml @@ -13,17 +13,24 @@ width: 50%; padding-left: 10px; } + .tbTitle { float: left; line-height: 32px; color: #666; padding-left: 15px; } + + .examTimeShow { + line-height: 60px; + font-size: 12px; + margin-right: 15px; + }
-
树形列表
+
考试课程
@@ -34,15 +41,17 @@
+ 考试日期: + 考试时间:
@@ -50,9 +59,8 @@
班级信息
- @@ -60,7 +68,7 @@
考场信息
-
+
 新增  编辑  删除 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Index.js index 00043d059..44a579921 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Index.js @@ -7,6 +7,9 @@ var refreshGirdData; //排考记录Id var EPId = request('EPId'); +//安排课程表Id +var EPLId; +var ELCheckMark; var bootstrap = function ($, learun) { "use strict"; var page = { @@ -19,49 +22,158 @@ var bootstrap = function ($, learun) { $('#dataTree').lrtree({ url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/GetTree', nodeClick: function (item) { - page.search({ EPLId: item.value }); + //安排课程表ID(Exam_ExamPlanLesson) + EPLId = item.id; + //显示考试时间 + page.show(EPLId); + page.search({ EPLId: item.id }); + + $('#titleinfo').html(item.text); } }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); }); - // 新增 - $('#lr_add').on('click', function () { - learun.layerForm({ - id: 'form', - title: '新增', - url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/Form', - width: 600, - height: 400, - callBack: function (id) { - return top[id].acceptClick(refreshGirdData); - } - }); - }); - // 编辑 - $('#lr_edit').on('click', function () { - var keyValue = $('#gridtable').jfGridValue('EPLId'); - if (learun.checkrow(keyValue)) { + //设置考试时间 + $('#lr_ExamTime').on('click', function () { + if (!!EPLId) { learun.layerForm({ id: 'form', - title: '编辑', - url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/Form?keyValue=' + keyValue, + title: '设置考试时间', + url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/Form?keyValue=' + EPLId, width: 600, height: 400, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } }); + } else { + return learun.alert.warning("请选择考试课程!"); } }); - // 删除 - $('#lr_delete').on('click', function () { - var keyValue = $('#gridtable').jfGridValue('EPLId'); + //审核 + $('#lr_check').on('click', function () { + if (!!EPLId) { + if (ELCheckMark == 1) { + return learun.alert.warning('该项已审核!'); + } + learun.layerConfirm('是否确认审核!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/Check', { keyValue: EPLId, ELCheckMark: 1 }, function () { + refreshGirdData(); + }); + } + }); + } else { + return learun.alert.warning("请选择考试课程!"); + } + }); + //去审核 + $('#lr_nocheck').on('click', function () { + if (!!EPLId) { + learun.layerConfirm('是否确认去审核!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/Check', { keyValue: EPLId, ELCheckMark: 0 }, function () { + refreshGirdData(); + }); + } + }); + } else { + return learun.alert.warning("请选择考试课程!"); + } + }); + //班级 新增 + $('#lr_add_Class').on('click', function () { + if (!!EPLId) { + if (ELCheckMark == 1) { + return learun.alert.warning("该项已审核!"); + } + learun.layerForm({ + id: 'formclass', + title: '新增班级', + url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/FormClass?EPLId=' + EPLId + '&EPId=' + EPId, + width: 850, + height: 500, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } else { + return learun.alert.warning("请选择考试课程!"); + } + }); + // 班级删除 + $('#lr_delete_Class').on('click', function () { + var keyValue = $('#gridtable_Class').jfGridValue('EPCId'); if (learun.checkrow(keyValue)) { - learun.layerConfirm('是否确认删除该项!', function (res) { + if (ELCheckMark == 1) { + return learun.alert.warning("该项已审核!"); + } + learun.layerConfirm('是否确认删除选中记录!', function (res) { if (res) { - learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/DeleteForm', { keyValue: keyValue }, function () { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/DeleteClass', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + + //考场 新增 + $('#lr_add_Room').on('click', function () { + if (!!EPLId) { + if (ELCheckMark == 1) { + return learun.alert.warning("该项已审核!"); + } + learun.layerForm({ + id: 'formteacherRoom', + title: '新增考场', + url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/FormRoomTeacher?EPLId=' + EPLId + '&EPId=' + EPId, + width: 850, + height: 500, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } else { + return learun.alert.warning("请选择考试课程!"); + } + }); + + //考场 编辑 + $('#lr_edit_Room').on('click', function () { + if (!!EPLId) { + if (ELCheckMark == 1) { + return learun.alert.warning("该项已审核!"); + } + var keyValue = $('#gridtable_Room').jfGridValue('EPRId'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'formteacherRoom', + title: '编辑考场', + url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/FormRoomTeacher?EPLId=' + EPLId + '&EPId=' + EPId + '&keyValue=' + keyValue, + width: 850, + height: 500, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + } else { + return learun.alert.warning("请选择考试课程!"); + } + }); + // 考场删除 + $('#lr_delete_Room').on('click', function () { + var keyValue = $('#gridtable_Room').jfGridValue('EPRId'); + if (learun.checkrow(keyValue)) { + if (ELCheckMark == 1) { + return learun.alert.warning("该项已审核!"); + } + learun.layerConfirm('是否确认删除选中记录!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/DeleteRoom', { keyValue: keyValue }, function () { refreshGirdData(); }); } @@ -75,33 +187,83 @@ var bootstrap = function ($, learun) { }, // 初始化列表 initGird: function () { - $('#gridtable').jfGrid({ - url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/GetPageList', + //班级 + $('#gridtable_Class').jfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/GetListForClass', + headData: [ + { label: "班级名称", name: "ClassName", width: 100, align: "left" }, + { label: "班级编号", name: "ClassNo", width: 100, align: "left" }, + { label: "班级人数", name: "ClassStuNum", width: 100, align: "left" }, + ], + mainId: 'EPCId', + //isPage: true, + isMultiselect: true, + }); + //考场 + $('#gridtable_Room').jfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/GetListForRoom', headData: [ - { label: "考试日期", name: "ExamDate", width: 100, align: "left" }, - { label: "考试开始时间", name: "ExamTime", width: 100, align: "left" }, - { label: "结束时间", name: "ClassNum", width: 100, align: "left" }, + { label: "考场名称", name: "ClassroomName", width: 100, align: "left" }, + { label: "考场编号", name: "ClassroomNo", width: 100, align: "left" }, + { label: "考场座位数", name: "SeatCount", width: 100, align: "left" }, + { label: "监考老师编号", name: "EmpNo", width: 100, align: "left" }, + { label: "监考老师姓名", name: "EmpName", width: 100, align: "left" }, ], - mainId: 'EPLId', - isPage: true + mainId: 'EPRId', + //isPage: true, + isMultiselect: true, }); page.search(); }, - //initTree: function () { - // //初始化左侧课程数据 - // if (!!EPId) { - // learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/InitExamPlanLesson', { EPId: EPId }, function () { - // refreshGirdData(); - // }); - // } - //}, search: function (param) { - param = param || {}; - $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + if (!!EPLId) { + param = param || {}; + $('#gridtable_Class').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + $('#gridtable_Room').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }, + //显示考试时间 + show: function () { + if (!!EPLId) { + var res = learun.httpGet(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/GetFormData?keyValue=' + EPLId); + + var data = res.data.Exam_ExamPlanLesson; + ELCheckMark = data.ELCheckMark; + if (!!data.ExamDate) { + $('#examDate').html(learun.formatDate(data.ExamDate, 'yyyy-MM-dd')); + $('#examTime').html(data.ExamTime); + } else { + $('#examDate').html(''); + $('#examTime').html(''); + //未设置考试时间 + learun.layerConfirm('请先设置考试时间!', function (res) { + if (res) { + if (!!EPLId) { + learun.layerForm({ + id: 'form', + title: '设置考试时间', + url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/Form?keyValue=' + EPLId, + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } else { + return learun.alert.warning("请选择考试课程!"); + } + } + }); + } + } } }; refreshGirdData = function () { - $('#gridtable').jfGridSet('reload'); + if (!!EPLId) { + $('#gridtable_Class').jfGridSet('reload'); + $('#gridtable_Room').jfGridSet('reload'); + page.show(); + } }; page.init(); } 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 0b7c08aeb..c02b2f36c 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 @@ -839,6 +839,8 @@ + + @@ -997,7 +999,10 @@ - + + + + @@ -6384,6 +6389,14 @@ + + + + + + + + @@ -7646,7 +7659,6 @@ - @@ -7656,8 +7668,12 @@ + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Exam_ArrangeExamTermItemNewMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Exam_ArrangeExamTermItemNewMap.cs new file mode 100644 index 000000000..76710ed53 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Exam_ArrangeExamTermItemNewMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-22 16:51 + /// 描 述:考场安排明细 + /// + public class Exam_ArrangeExamTermItemNewMap : EntityTypeConfiguration + { + public Exam_ArrangeExamTermItemNewMap() + { + #region 表、主键 + //表 + this.ToTable("EXAM_ARRANGEEXAMTERMITEMNEW"); + //主键 + this.HasKey(t => t.EPIId); + #endregion + + #region 配置关系 + #endregion + } + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Exam_ArrangeExamTermNewMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Exam_ArrangeExamTermNewMap.cs new file mode 100644 index 000000000..e004f384e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Exam_ArrangeExamTermNewMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-14 18:12 + /// 描 述:考试记录表 + /// + public class Exam_ArrangeExamTermNewMap : EntityTypeConfiguration + { + public Exam_ArrangeExamTermNewMap() + { + #region 表、主键 + //表 + this.ToTable("EXAM_ARRANGEEXAMTERMNEW"); + //主键 + this.HasKey(t => t.EPIId); + #endregion + + #region 配置关系 + #endregion + } + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Exam_ExamPlanClassMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Exam_ExamPlanClassMap.cs new file mode 100644 index 000000000..914687ec3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Exam_ExamPlanClassMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-15 18:07 + /// 描 述:排考安排班级 + /// + public class Exam_ExamPlanClassMap : EntityTypeConfiguration + { + public Exam_ExamPlanClassMap() + { + #region 表、主键 + //表 + this.ToTable("EXAM_EXAMPLANCLASS"); + //主键 + this.HasKey(t => t.EPCId); + #endregion + + #region 配置关系 + #endregion + } + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Exam_ExamPlanRoomMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Exam_ExamPlanRoomMap.cs new file mode 100644 index 000000000..25bf1ffed --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Exam_ExamPlanRoomMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-15 18:12 + /// 描 述:排考安排考场表 + /// + public class Exam_ExamPlanRoomMap : EntityTypeConfiguration + { + public Exam_ExamPlanRoomMap() + { + #region 表、主键 + //表 + this.ToTable("EXAM_EXAMPLANROOM"); + //主键 + this.HasKey(t => t.EPRId); + #endregion + + #region 配置关系 + #endregion + } + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj index be9c255f8..d130b9451 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj @@ -82,6 +82,7 @@ + @@ -577,6 +578,9 @@ + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoService.cs index 1075e48cd..fb44678f2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoService.cs @@ -70,6 +70,23 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("MajorNo", queryParam["MajorNo"].ToString(), DbType.String); strSql.Append(" AND t.MajorNo = @MajorNo "); } + if (!queryParam["SqlParameter"].IsEmpty()) + { + strSql.Append(queryParam["SqlParameter"].ToString()); + } + + if (!queryParam["EPLId"].IsEmpty()) + { + var elSql = + $"select * from Exam_ExamLesson where ELId=(select ELId from Exam_ExamPlanLesson where EPLId='{queryParam["EPLId"].ToString()}')"; + var entity = this.BaseRepository("CollegeMIS").FindList(elSql).FirstOrDefault(); + if (entity != null) + { + strSql.Append($" and deptno='{entity.DeptNo}' and majorno='{entity.MajorNo}' and grade='{entity.Grade}'"); + strSql.Append($" and classno not in (select ClassNo from Exam_ExamPlanClass where EPLId='{queryParam["EPLId"].ToString()}')"); + + } + } return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermItemNew/Exam_ArrangeExamTermItemNewBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermItemNew/Exam_ArrangeExamTermItemNewBLL.cs new file mode 100644 index 000000000..39f94b5f5 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermItemNew/Exam_ArrangeExamTermItemNewBLL.cs @@ -0,0 +1,125 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-22 16:51 + /// 描 述:考场安排明细 + /// + public class Exam_ArrangeExamTermItemNewBLL : Exam_ArrangeExamTermItemNewIBLL + { + private Exam_ArrangeExamTermItemNewService exam_ArrangeExamTermItemNewService = new Exam_ArrangeExamTermItemNewService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return exam_ArrangeExamTermItemNewService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取Exam_ArrangeExamTermItemNew表实体数据 + /// + /// 主键 + /// + public Exam_ArrangeExamTermItemNewEntity GetExam_ArrangeExamTermItemNewEntity(string keyValue) + { + try + { + return exam_ArrangeExamTermItemNewService.GetExam_ArrangeExamTermItemNewEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + exam_ArrangeExamTermItemNewService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, Exam_ArrangeExamTermItemNewEntity entity) + { + try + { + exam_ArrangeExamTermItemNewService.SaveEntity(keyValue, entity); + } + 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_ArrangeExamTermItemNew/Exam_ArrangeExamTermItemNewEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermItemNew/Exam_ArrangeExamTermItemNewEntity.cs new file mode 100644 index 000000000..2328c5c1d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermItemNew/Exam_ArrangeExamTermItemNewEntity.cs @@ -0,0 +1,110 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-22 16:51 + /// 描 述:考场安排明细 + /// + public class Exam_ArrangeExamTermItemNewEntity + { + #region 实体成员 + /// + /// EPIId + /// + [Column("EPIID")] + public string EPIId { get; set; } + /// + /// 排考记录主表Id + /// + [Column("EPID")] + public string EPId { get; set; } + /// + /// 课程名称 + /// + [Column("LESSONNAME")] + public string LessonName { get; set; } + /// + /// 课程编号 + /// + [Column("LESSONNO")] + public string LessonNo { get; set; } + /// + /// 考试日期 + /// + [Column("EXAMDATE")] + public DateTime? ExamDate { get; set; } + /// + /// 考试起止时间 + /// + [Column("EXAMTIME")] + public string ExamTime { get; set; } + /// + /// 监考老师姓名 + /// + [Column("EMPNAME")] + public string EmpName { get; set; } + /// + /// 监考老师编号 + /// + [Column("EMPNO")] + public string EmpNo { get; set; } + /// + /// 考场名称 + /// + [Column("CLASSROOMNAME")] + public string ClassroomName { get; set; } + /// + /// 考场编号 + /// + [Column("CLASSROOMNO")] + public string ClassroomNo { get; set; } + /// + /// 校区Id + /// + [Column("F_SCHOOLID")] + public string F_SchoolId { get; set; } + /// + /// 坐位号 + /// + [Column("SITNUMBER")] + public string SitNumber { get; set; } + /// + /// 学生编号 + /// + [Column("STUNO")] + public string StuNo { get; set; } + /// + /// 学生姓名 + /// + [Column("STUNAME")] + public string StuName { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.EPIId = Guid.NewGuid().ToString(); + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.EPIId = keyValue; + } + #endregion + #region 扩展字段 + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermItemNew/Exam_ArrangeExamTermItemNewIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermItemNew/Exam_ArrangeExamTermItemNewIBLL.cs new file mode 100644 index 000000000..8928bc35a --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermItemNew/Exam_ArrangeExamTermItemNewIBLL.cs @@ -0,0 +1,48 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-22 16:51 + /// 描 述:考场安排明细 + /// + public interface Exam_ArrangeExamTermItemNewIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取Exam_ArrangeExamTermItemNew表实体数据 + /// + /// 主键 + /// + Exam_ArrangeExamTermItemNewEntity GetExam_ArrangeExamTermItemNewEntity(string keyValue); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, Exam_ArrangeExamTermItemNewEntity entity); + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermItemNew/Exam_ArrangeExamTermItemNewService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermItemNew/Exam_ArrangeExamTermItemNewService.cs new file mode 100644 index 000000000..1fbed29f3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermItemNew/Exam_ArrangeExamTermItemNewService.cs @@ -0,0 +1,200 @@ +using Dapper; +using Learun.DataBase.Repository; +using Learun.Util; +using System; +using System.Collections.Generic; +using System.Data; +using System.Text; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-22 16:51 + /// 描 述:考场安排明细 + /// + public class Exam_ArrangeExamTermItemNewService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.EPIId, + t.LessonNo, + t.LessonName, + t.ExamDate, + t.ExamTime, + t.EmpNo, + t.EmpName, + t.ClassroomNo, + t.ClassroomName, + t.SitNumber, + t.StuNo, + t.StuName + "); + strSql.Append(" FROM Exam_ArrangeExamTermItemNew t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["LessonNo"].IsEmpty()) + { + dp.Add("LessonNo", "%" + queryParam["LessonNo"].ToString() + "%", DbType.String); + strSql.Append(" AND t.LessonNo Like @LessonNo "); + } + if (!queryParam["LessonName"].IsEmpty()) + { + dp.Add("LessonName", "%" + queryParam["LessonName"].ToString() + "%", DbType.String); + strSql.Append(" AND t.LessonName Like @LessonName "); + } + if (!queryParam["EmpNo"].IsEmpty()) + { + dp.Add("EmpNo", "%" + queryParam["EmpNo"].ToString() + "%", DbType.String); + strSql.Append(" AND t.EmpNo Like @EmpNo "); + } + if (!queryParam["EmpName"].IsEmpty()) + { + dp.Add("EmpName", "%" + queryParam["EmpName"].ToString() + "%", DbType.String); + strSql.Append(" AND t.EmpName Like @EmpName "); + } + if (!queryParam["ClassroomNo"].IsEmpty()) + { + dp.Add("ClassroomNo", "%" + queryParam["ClassroomNo"].ToString() + "%", DbType.String); + strSql.Append(" AND t.ClassroomNo Like @ClassroomNo "); + } + if (!queryParam["ClassroomName"].IsEmpty()) + { + dp.Add("ClassroomName", "%" + queryParam["ClassroomName"].ToString() + "%", DbType.String); + strSql.Append(" AND t.ClassroomName Like @ClassroomName "); + } + if (!queryParam["StuNo"].IsEmpty()) + { + dp.Add("StuNo", "%" + queryParam["StuNo"].ToString() + "%", DbType.String); + strSql.Append(" AND t.StuNo Like @StuNo "); + } + if (!queryParam["StuName"].IsEmpty()) + { + dp.Add("StuName", "%" + queryParam["StuName"].ToString() + "%", DbType.String); + strSql.Append(" AND t.StuName Like @StuName "); + } + if (!queryParam["ExamDate"].IsEmpty()) + { + dp.Add("ExamDate",queryParam["ExamDate"].ToString(), DbType.String); + strSql.Append(" AND t.ExamDate = @ExamDate "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取Exam_ArrangeExamTermItemNew表实体数据 + /// + /// 主键 + /// + public Exam_ArrangeExamTermItemNewEntity GetExam_ArrangeExamTermItemNewEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + this.BaseRepository("CollegeMIS").Delete(t=>t.EPIId == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, Exam_ArrangeExamTermItemNewEntity entity) + { + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(keyValue); + this.BaseRepository("CollegeMIS").Update(entity); + } + else + { + entity.Create(); + this.BaseRepository("CollegeMIS").Insert(entity); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/ArrangeExamTermNewEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/ArrangeExamTermNewEntity.cs new file mode 100644 index 000000000..e2fd66f95 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/ArrangeExamTermNewEntity.cs @@ -0,0 +1,95 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-22 16:00 + /// 描 述:排考安排 + /// + public class Exam_ArrangeExamTermNewEntity + { + #region 实体成员 + /// + /// EPIId + /// + [Column("EPIID")] + public string EPIId { get; set; } + /// + /// 排考记录主表Id + /// + [Column("EPID")] + public string EPId { get; set; } + /// + /// 课程名称 + /// + [Column("LESSONNAME")] + public string LessonName { get; set; } + /// + /// 课程编号 + /// + [Column("LESSONNO")] + public string LessonNo { get; set; } + /// + /// 考试日期 + /// + [Column("EXAMDATE")] + public DateTime? ExamDate { get; set; } + /// + /// 考试起止时间 + /// + [Column("EXAMTIME")] + public string ExamTime { get; set; } + /// + /// 监考老师姓名 + /// + [Column("EMPNAME")] + public string EmpName { get; set; } + /// + /// 监考老师编号 + /// + [Column("EMPNO")] + public string EmpNo { get; set; } + /// + /// 考场名称 + /// + [Column("CLASSROOMNAME")] + public string ClassroomName { get; set; } + /// + /// 考场编号 + /// + [Column("CLASSROOMNO")] + public string ClassroomNo { get; set; } + /// + /// 校区Id + /// + [Column("F_SCHOOLID")] + public string F_SchoolId { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.EPIId = Guid.NewGuid().ToString(); + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.EPIId = keyValue; + } + #endregion + #region 扩展字段 + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewBLL.cs new file mode 100644 index 000000000..a87fd1f80 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewBLL.cs @@ -0,0 +1,125 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-22 16:00 + /// 描 述:排考安排 + /// + public class Exam_ArrangeExamTermNewBLL : Exam_ArrangeExamTermNewIBLL + { + private Exam_ArrangeExamTermNewService exam_ArrangeExamTermNewService = new Exam_ArrangeExamTermNewService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return exam_ArrangeExamTermNewService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取ArrangeExamTermNew表实体数据 + /// + /// 主键 + /// + public Exam_ArrangeExamTermNewEntity GetExam_ArrangeExamTermNewEntity(string keyValue) + { + try + { + return exam_ArrangeExamTermNewService.GetExam_ArrangeExamTermNewEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + exam_ArrangeExamTermNewService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, Exam_ArrangeExamTermNewEntity entity) + { + try + { + exam_ArrangeExamTermNewService.SaveEntity(keyValue, entity); + } + 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_ArrangeExamTermNew/Exam_ArrangeExamTermNewIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewIBLL.cs new file mode 100644 index 000000000..2e82623eb --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewIBLL.cs @@ -0,0 +1,48 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-22 16:00 + /// 描 述:排考安排 + /// + public interface Exam_ArrangeExamTermNewIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取ArrangeExamTermNew表实体数据 + /// + /// 主键 + /// + Exam_ArrangeExamTermNewEntity GetExam_ArrangeExamTermNewEntity(string keyValue); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, Exam_ArrangeExamTermNewEntity entity); + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewService.cs new file mode 100644 index 000000000..42cfa9323 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewService.cs @@ -0,0 +1,187 @@ +using Dapper; +using Learun.DataBase.Repository; +using Learun.Util; +using System; +using System.Collections.Generic; +using System.Data; +using System.Text; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-22 16:00 + /// 描 述:排考安排 + /// + public class Exam_ArrangeExamTermNewService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.EPIId, + t.LessonNo, + t.LessonName, + t.ExamDate, + t.ExamTime, + t.EmpNo, + t.EmpName, + t.ClassroomNo, + t.ClassroomName + "); + strSql.Append(" FROM ArrangeExamTermNew t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["ExamDate"].IsEmpty()) + { + dp.Add("ExamDate",queryParam["ExamDate"].ToString(), DbType.String); + strSql.Append(" AND t.ExamDate = @ExamDate "); + } + if (!queryParam["LessonNo"].IsEmpty()) + { + dp.Add("LessonNo", "%" + queryParam["LessonNo"].ToString() + "%", DbType.String); + strSql.Append(" AND t.LessonNo Like @LessonNo "); + } + if (!queryParam["LessonName"].IsEmpty()) + { + dp.Add("LessonName", "%" + queryParam["LessonName"].ToString() + "%", DbType.String); + strSql.Append(" AND t.LessonName Like @LessonName "); + } + if (!queryParam["EmpNo"].IsEmpty()) + { + dp.Add("EmpNo", "%" + queryParam["EmpNo"].ToString() + "%", DbType.String); + strSql.Append(" AND t.EmpNo Like @EmpNo "); + } + if (!queryParam["EmpName"].IsEmpty()) + { + dp.Add("EmpName", "%" + queryParam["EmpName"].ToString() + "%", DbType.String); + strSql.Append(" AND t.EmpName Like @EmpName "); + } + if (!queryParam["ClassroomNo"].IsEmpty()) + { + dp.Add("ClassroomNo", "%" + queryParam["ClassroomNo"].ToString() + "%", DbType.String); + strSql.Append(" AND t.ClassroomNo Like @ClassroomNo "); + } + if (!queryParam["ClassroomName"].IsEmpty()) + { + dp.Add("ClassroomName", "%" + queryParam["ClassroomName"].ToString() + "%", DbType.String); + strSql.Append(" AND t.ClassroomName Like @ClassroomName "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取ArrangeExamTermNew表实体数据 + /// + /// 主键 + /// + public Exam_ArrangeExamTermNewEntity GetExam_ArrangeExamTermNewEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + this.BaseRepository("CollegeMIS").Delete(t=>t.EPIId == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, Exam_ArrangeExamTermNewEntity entity) + { + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(keyValue); + this.BaseRepository("CollegeMIS").Update(entity); + } + else + { + entity.Create(); + this.BaseRepository("CollegeMIS").Insert(entity); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamLesson/Exam_ExamLessonService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamLesson/Exam_ExamLessonService.cs index 1abc35f39..93acdbd95 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamLesson/Exam_ExamLessonService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamLesson/Exam_ExamLessonService.cs @@ -235,7 +235,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration ,[LessonNo] ,[ELOrder] ,[ELEnabled]) -select NEWID(),AcademicYearNo,Semester,Grade,DeptNo,MajorNo,LessonName,[LessonNo],0,1 from OpenLessonPlan where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' +select NEWID(),AcademicYearNo,Semester,Grade,DeptNo,MajorNo,LessonName,[LessonNo],0,1 from OpenLessonPlan where lessonsortno=1 and AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and [LessonNo] not in (select [LessonNo] from Exam_ExamLesson where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' ) "; return this.BaseRepository("CollegeMIS").ExecuteBySql(sql); 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 187483bff..cf4c8e992 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 @@ -93,6 +93,43 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + public void ClearGenerate(string keyValue, int type) + { + try + { + exam_ExamPlanService.ClearGenerate(keyValue, type); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public void Generate(string keyValue) + { + try + { + exam_ExamPlanService.Generate(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } /// /// 保存实体数据(新增、修改) 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 207862e8f..fad617a88 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 @@ -36,6 +36,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// 主键 void DeleteEntity(string keyValue); + + void ClearGenerate(string keyValue, int type); + void Generate(string keyValue); /// /// 保存实体数据(新增、修改) /// 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 dbb19a35b..ba209c059 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 @@ -4,6 +4,7 @@ using Learun.Util; using System; using System.Collections.Generic; using System.Data; +using System.Linq; using System.Text; namespace Learun.Application.TwoDevelopment.EducationalAdministration @@ -149,6 +150,205 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 清除排考名单/清除所有排考记录 + /// + /// 排考记录主表Id + /// 1:清除排考名单;2:清除所有排考记录 + /// + public void ClearGenerate(string keyValue, int type) + { + var db = this.BaseRepository("CollegeMIS"); + try + { + db.BeginTrans(); + //清除排考名单 + db.ExecuteBySql($@"delete from Exam_ArrangeExamTermNew where EPId='{keyValue}'; +delete from Exam_ArrangeExamTermItemNew where EPId='{keyValue}';"); + if (type == 2) + { + //清除所有排考记录 + + //考试安排课程表 + var planLessonList = db.FindList(x => x.EPId == keyValue); + var planLessonIds = ""; + if (planLessonList.Count() > 1) + { + planLessonIds = string.Join("','", planLessonList.Select(x => x.EPLId).ToList()); + } + else if (planLessonList.Count() == 1) + { + planLessonIds = planLessonList.Select(x => x.EPLId).FirstOrDefault(); + } + + if (!string.IsNullOrEmpty(planLessonIds)) + { + db.ExecuteBySql($@"delete from Exam_ExamPlanClass where EPLId in ('{planLessonIds}'); +delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');"); + db.ExecuteBySql($@"delete from Exam_ExamPlanLesson where EPId='{keyValue}'"); + } + } + + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 生成排考名单 + /// + /// 排考记录主表Id + public void Generate(string keyValue) + { + var db = this.BaseRepository("CollegeMIS"); + try + { + db.BeginTrans(); + //排考安排课程已审核的数据 + var planLessonData = db.FindList(x => x.EPId == keyValue && x.ELCheckMark == true); + + //排考安排明细数据 + List itemList = new List(); + foreach (var planLesson in planLessonData) + { + //排考安排考场 + var planRoomData = db.FindList(x => x.EPLId == planLesson.EPLId).ToList(); + //考场数 + int planRoomCount = planRoomData.Count(); + //添加排考安排数据 + foreach (var planRoom in planRoomData) + { + var ExamTermEntity = db.FindEntity(x => x.ClassroomNo == planRoom.ClassroomNo); + //排考安排表 + if (ExamTermEntity == null) + { + Exam_ArrangeExamTermNewEntity ExamTermNewEntity = new Exam_ArrangeExamTermNewEntity(); + ExamTermNewEntity.Create(); + ExamTermNewEntity.EPId = keyValue; + ExamTermNewEntity.LessonName = planLesson.LessonName; + ExamTermNewEntity.LessonNo = planLesson.LessonNo; + ExamTermNewEntity.ExamDate = planLesson.ExamDate; + ExamTermNewEntity.ExamTime = planLesson.ExamTime; + ExamTermNewEntity.EmpName = planRoom.EmpName; + ExamTermNewEntity.EmpNo = planRoom.EmpNo; + ExamTermNewEntity.ClassroomName = planRoom.ClassroomName; + ExamTermNewEntity.ClassroomNo = planRoom.ClassroomNo; + ExamTermNewEntity.F_SchoolId = LoginUserInfo.Get().companyId; + db.Insert(ExamTermNewEntity); + } + else + { + //修改 + ExamTermEntity.LessonName = planLesson.LessonName; + ExamTermEntity.LessonNo = planLesson.LessonNo; + ExamTermEntity.ExamDate = planLesson.ExamDate; + ExamTermEntity.ExamTime = planLesson.ExamTime; + ExamTermEntity.EmpName = planRoom.EmpName; + ExamTermEntity.EmpNo = planRoom.EmpNo; + ExamTermEntity.ClassroomName = planRoom.ClassroomName; + ExamTermEntity.ClassroomNo = planRoom.ClassroomNo; + db.Update(ExamTermEntity); + } + + //生成考场随机数 + var sealNumArr = getRanNum(planRoom.SeatCount.Value); + for (int n = 0; n < sealNumArr.Count; n++) + { + //考场安排明细 + Exam_ArrangeExamTermItemNewEntity item = new Exam_ArrangeExamTermItemNewEntity(); + item.Create(); + item.EPId = keyValue; + item.LessonNo = planLesson.LessonNo; + item.LessonName = planLesson.LessonName; + item.ExamDate = planLesson.ExamDate; + item.ExamTime = planLesson.ExamTime; + item.EmpName = planRoom.EmpName; + item.EmpNo = planRoom.EmpNo; + item.ClassroomName = planRoom.ClassroomName; + item.ClassroomNo = planRoom.ClassroomNo; + item.F_SchoolId = LoginUserInfo.Get().userId; + item.SitNumber = sealNumArr[n].ToString().PadLeft(3, '0'); + itemList.Add(item); + } + } + + //排考安排班级 + var planClassData = db.FindList(x => x.EPLId == planLesson.EPLId); + var classnos = string.Join("','", planClassData.Select(x => x.ClassNo).ToList()); + string stuSql = $"select * from StuInfoBasic where classno in ('{classnos}') and stuno not in (select StuNo from Exam_ArrangeExamTermItemNew where EPId='{keyValue}')"; + //所有考生 + var stuInfoList = db.FindList(stuSql).ToList(); + + if (itemList.Count >= stuInfoList.Count()) + { + //为考生安排座位 + for (int i = 0; i < stuInfoList.Count; i++) + { + itemList[i].StuNo = stuInfoList[i].StuNo; + itemList[i].StuName = stuInfoList[i].StuName; + } + + db.Insert(itemList); + } + } + + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 生成随机数组 + /// + /// + /// + private List getRanNum(int maxValue) + { + Random ra = new Random(unchecked((int)DateTime.Now.Ticks)); + int[] arrNum = { }; + var list = new List(); + int tmp = 0; + int minValue = 1; + for (int i = 0; i < maxValue; i++) + { + tmp = ra.Next(minValue, maxValue + 1); //随机取数 + list.Add(getNum(list, tmp, minValue, maxValue + 1, ra)); //取出值赋到数组中 + } + + return list; + } + + private int getNum(List list, int tmp, int minValue, int maxValue, Random ra) + { + if (list.Exists(x => x == tmp)) + { + tmp = ra.Next(minValue, maxValue); //重新随机获取。 + tmp = getNum(list, tmp, minValue, maxValue, ra);//递归:如果取出来的数字和已取得的数字有重复就重新随机获取。 + + } + return tmp; + } /// /// 保存实体数据(新增、修改) /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassBLL.cs new file mode 100644 index 000000000..264503ac2 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassBLL.cs @@ -0,0 +1,169 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-15 15:03 + /// 描 述:排考安排班级 + /// + public class Exam_ExamPlanClassBLL : Exam_ExamPlanClassIBLL + { + private Exam_ExamPlanClassService exam_ExamPlanClassService = new Exam_ExamPlanClassService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return exam_ExamPlanClassService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetList(string queryJson) + { + try + { + return exam_ExamPlanClassService.GetList( queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取实体数据 + /// + /// 主键 + /// + public Exam_ExamPlanClassEntity GetEntity(string keyValue) + { + try + { + return exam_ExamPlanClassService.GetEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + exam_ExamPlanClassService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, Exam_ExamPlanClassEntity entity) + { + try + { + exam_ExamPlanClassService.SaveEntity(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public void SaveList(List list) + { + try + { + exam_ExamPlanClassService.SaveList(list); + } + 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_ExamPlanClass/Exam_ExamPlanClassEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassEntity.cs new file mode 100644 index 000000000..75969caf4 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassEntity.cs @@ -0,0 +1,68 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; +namespace Learun.Application.TwoDevelopment.EducationalAdministration + +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-15 18:07 + /// 描 述:排考安排班级 + /// + public class Exam_ExamPlanClassEntity + { + #region 实体成员 + /// + /// EPCId + /// + /// + [Column("EPCID")] + public string EPCId { get; set; } + /// + /// EPLId + /// + /// + [Column("EPLID")] + public string EPLId { get; set; } + /// + /// ClassName + /// + /// + [Column("CLASSNAME")] + public string ClassName { get; set; } + /// + /// ClassNo + /// + /// + [Column("CLASSNO")] + public string ClassNo { get; set; } + /// + /// ClassStuNum + /// + /// + [Column("CLASSSTUNUM")] + public int? ClassStuNum { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.EPCId = Guid.NewGuid().ToString(); + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.EPCId = keyValue; + } + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassIBLL.cs new file mode 100644 index 000000000..23f3499a4 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassIBLL.cs @@ -0,0 +1,52 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-15 15:03 + /// 描 述:排考安排课程 + /// + public interface Exam_ExamPlanClassIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + IEnumerable GetList(string queryJson); + /// + /// 获取实体数据 + /// + /// 主键 + /// + Exam_ExamPlanClassEntity GetEntity(string keyValue); + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, Exam_ExamPlanClassEntity entity); + + void SaveList(List list); + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassService.cs new file mode 100644 index 000000000..f8ddd5618 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassService.cs @@ -0,0 +1,262 @@ +using Dapper; +using Learun.DataBase.Repository; +using Learun.Util; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-15 15:03 + /// 描 述:排考安排班级 + /// + public class Exam_ExamPlanClassService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.* + "); + strSql.Append(" FROM Exam_ExamPlanClass t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["EPLId"].IsEmpty()) + { + dp.Add("EPLId", queryParam["EPLId"].ToString(), DbType.String); + strSql.Append(" AND t.EPLId = @EPLId "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetList(string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.* + "); + strSql.Append(" FROM Exam_ExamPlanClass t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["EPLId"].IsEmpty()) + { + dp.Add("EPLId", queryParam["EPLId"].ToString(), DbType.String); + strSql.Append(" AND t.EPLId = @EPLId "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取实体数据 + /// + /// 主键 + /// + public Exam_ExamPlanClassEntity GetEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + var entity = new Exam_ExamPlanClassEntity(); + if (keyValue.Contains(",")) + { + entity = this.BaseRepository("CollegeMIS").FindEntity((keyValue.Split(','))[0]); + keyValue = string.Join("','", keyValue.Split(',')); + } + else + { + entity = this.BaseRepository("CollegeMIS").FindEntity(keyValue); + } + + string sql = $"delete from Exam_ExamPlanClass where EPCId in ('{keyValue}')"; + + this.BaseRepository("CollegeMIS").ExecuteBySql(sql); + + UpdateExamPlanLesson(entity.EPLId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, Exam_ExamPlanClassEntity entity) + { + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(keyValue); + this.BaseRepository("CollegeMIS").Update(entity); + } + else + { + entity.Create(); + this.BaseRepository("CollegeMIS").Insert(entity); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 排考安排班级 + /// + /// + public void SaveList(List list) + { + try + { + this.BaseRepository("CollegeMIS").Insert(list); + //更新排考安排课程表实排班级数、实排人数 + //排考安排课程表Id + var EPLId = list.Select(x => x.EPLId).FirstOrDefault(); + UpdateExamPlanLesson(EPLId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 更新排考安排课程 + /// + /// 排考安排课程表Id + private void UpdateExamPlanLesson(string EPLId) + { + try + { + //更新排考安排课程表实排班级数、实排人数 + string sql = $@"update l +set l.RealStuCount=t.RealStuCount,l.RealClassNum=t.RealClassNum +from Exam_ExamPlanLesson l +join (select '{EPLId}' as EPLId,count(1) as RealClassNum,sum(ClassStuNum) as RealStuCount from Exam_ExamPlanClass where EPLId='{EPLId}' +)t on l.EPLId=t.EPLId +where l.EPLId='{EPLId}' +"; + this.BaseRepository("CollegeMIS").ExecuteBySql(sql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + + } +} 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 9c3d469bb..d21c1fc14 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 @@ -81,7 +81,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { TreeModel node = new TreeModel { - id = item["lessonno"].ToString(), + id = item["eplid"].ToString(), text = item["lessonname"].ToString(), value = item["lessonno"].ToString(), showcheck = false, @@ -132,6 +132,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + + /// + /// 审核 + /// + /// 主键 + public void Check(string keyValue,int ELCheckMark) + { + try + { + exam_ExamPlanLessonService.Check(keyValue, ELCheckMark); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// /// 初始化 /// 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 11e04c48e..b818a7b4a 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 @@ -20,10 +20,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration [Column("EPLID")] public string EPLId { get; set; } /// - /// EPId + /// 排考记录主表Id /// [Column("EPID")] public string EPId { get; set; } + /// + /// 考试课程表Id + /// + [Column("ELID")] + public string ELId { get; set; } + /// /// LessonName /// @@ -35,42 +41,42 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration [Column("LESSONNO")] public string LessonNo { get; set; } /// - /// ExamDate + /// 考试日期 /// [Column("EXAMDATE")] public DateTime? ExamDate { get; set; } /// - /// ExamTime + /// 考试时间 /// [Column("EXAMTIME")] public string ExamTime { get; set; } /// - /// ClassNum + /// 应排班级数 /// [Column("CLASSNUM")] public int? ClassNum { get; set; } /// - /// RealClassNum + /// 实排班级数 /// [Column("REALCLASSNUM")] public int? RealClassNum { get; set; } /// - /// StuCount + /// 应考人数 /// [Column("STUCOUNT")] public int? StuCount { get; set; } /// - /// RealStuCount + /// 实考人数 /// [Column("REALSTUCOUNT")] public int? RealStuCount { get; set; } /// - /// SeatCount + /// 考场座位数 /// [Column("SEATCOUNT")] public int? SeatCount { get; set; } /// - /// ELCheckMark + /// 审核标志 /// [Column("ELCHECKMARK")] public bool? ELCheckMark { get; set; } @@ -94,6 +100,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } #endregion #region 扩展字段 + [NotMapped] + public string ExamTimeStart { get; set; } + [NotMapped] + public string ExamTimeEnd { 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 56a231ee4..575c23e50 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 @@ -41,6 +41,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration ///
/// 主键 void DeleteEntity(string keyValue); + void Check(string keyValue,int ELCheckMark); void InitExamPlanLesson(string EPId); /// /// 保存实体数据(新增、修改) 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 8b6325585..e5c4bbde7 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 @@ -4,6 +4,7 @@ using Learun.Util; using System; using System.Collections.Generic; using System.Data; +using System.Linq; using System.Text; namespace Learun.Application.TwoDevelopment.EducationalAdministration @@ -44,10 +45,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration var dp = new DynamicParameters(new { }); if (!queryParam["ExamDate"].IsEmpty()) { - dp.Add("ExamDate",queryParam["ExamDate"].ToString(), DbType.String); + dp.Add("ExamDate", queryParam["ExamDate"].ToString(), DbType.String); strSql.Append(" AND t.ExamDate = @ExamDate "); } - return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) { @@ -94,7 +95,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - return this.BaseRepository("CollegeMIS").FindTable(" select distinct LessonName,LessonNo from Exam_ExamPlanLesson"); + return this.BaseRepository("CollegeMIS").FindTable(" select distinct EPLId,LessonName,LessonNo from Exam_ExamPlanLesson"); } catch (Exception ex) { @@ -121,7 +122,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - this.BaseRepository("CollegeMIS").Delete(t=>t.EPLId == keyValue); + this.BaseRepository("CollegeMIS").Delete(t => t.EPLId == keyValue); } catch (Exception ex) { @@ -136,23 +137,71 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 审核 + /// + /// + public void Check(string keyValue, int ELCheckMark) + { + try + { + string sql = $"update Exam_ExamPlanLesson set ELCheckMark='{ELCheckMark}' where EPLId='{keyValue}'"; + this.BaseRepository("CollegeMIS").ExecuteBySql(sql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } /// /// 初始化排考课程数据 /// /// 排考记录主表Id public void InitExamPlanLesson(string EPId) { + var db = this.BaseRepository("CollegeMIS"); try { var Exam_ExamPlan = this.BaseRepository("CollegeMIS") .FindEntity(x => x.EPId == EPId); - string sql = $@"insert into Exam_ExamPlanLesson(EPLId,EPId,LessonName,LessonNo) -select NEWID(),'{EPId}',LessonName,LessonNo from Exam_ExamLesson where AcademicYearNo='{Exam_ExamPlan.AcademicYearNo}' and Semester='{Exam_ExamPlan.Semester}' + string sql = $@"insert into Exam_ExamPlanLesson(EPLId,EPId,ELId,LessonName,LessonNo) +select NEWID(),'{EPId}',ELId,LessonName,LessonNo from Exam_ExamLesson where AcademicYearNo='{Exam_ExamPlan.AcademicYearNo}' and Semester='{Exam_ExamPlan.Semester}' and LessonNo not in (select LessonNo from Exam_ExamPlanLesson where EPId='{EPId}')"; this.BaseRepository("CollegeMIS").ExecuteBySql(sql); + + db.BeginTrans(); + //排考记录主表 + var exam_ExamPlan = db.FindEntity(x => x.EPId == EPId); + //排考课程表 + var list = db.FindList(x => x.EPId == EPId); + //班级 + var classInfo = db.FindList(); + foreach (var lesson in list) + { + //考试课程信息 + var examLesson = db.FindEntity(x => x.ELId == lesson.ELId); + //班级 + var classList = classInfo.Where(x => + x.DeptNo == examLesson.DeptNo && x.MajorNo == examLesson.MajorNo && + x.Grade == examLesson.Grade); + //应排班级数 + lesson.ClassNum = classList.Count(); + //应考人数 + lesson.StuCount = classList.Sum(x => x.StuNum); + db.Update(lesson); + } + db.Commit(); } catch (Exception ex) { + db.Rollback(); if (ex is ExceptionEx) { throw; diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomBLL.cs new file mode 100644 index 000000000..b6afaf0d3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomBLL.cs @@ -0,0 +1,181 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-15 15:03 + /// 描 述:排考安排考场 + /// + public class Exam_ExamPlanRoomBLL : Exam_ExamPlanRoomIBLL + { + private Exam_ExamPlanRoomService exam_ExamPlanRoomService = new Exam_ExamPlanRoomService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return exam_ExamPlanRoomService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public IEnumerable GetList(string queryJson) + { + try + { + return exam_ExamPlanRoomService.GetList(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取实体数据 + /// + /// 主键 + /// + public Exam_ExamPlanRoomEntity GetEntity(string keyValue) + { + try + { + return exam_ExamPlanRoomService.GetEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public bool ValidateRoom(string EPLId, string ClassroomNo) + { + try + { + return exam_ExamPlanRoomService.ValidateRoom(EPLId, ClassroomNo); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + exam_ExamPlanRoomService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, Exam_ExamPlanRoomEntity entity) + { + try + { + exam_ExamPlanRoomService.SaveEntity(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public void SaveList(List list) + { + try + { + exam_ExamPlanRoomService.SaveList(list); + } + 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_ExamPlanRoom/Exam_ExamPlanRoomEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomEntity.cs new file mode 100644 index 000000000..c03fe1c6b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomEntity.cs @@ -0,0 +1,80 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; +namespace Learun.Application.TwoDevelopment.EducationalAdministration + +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-15 18:12 + /// 描 述:排考安排考场表 + /// + public class Exam_ExamPlanRoomEntity + { + #region 实体成员 + /// + /// EPRId + /// + /// + [Column("EPRID")] + public string EPRId { get; set; } + /// + /// EPLId + /// + /// + [Column("EPLID")] + public string EPLId { get; set; } + /// + /// ClassroomName + /// + /// + [Column("CLASSROOMNAME")] + public string ClassroomName { get; set; } + /// + /// 课程类型编号 + /// + /// + [Column("CLASSROOMNO")] + public string ClassroomNo { get; set; } + /// + /// SeatCount + /// + /// + [Column("SEATCOUNT")] + public int? SeatCount { get; set; } + /// + /// EmpNo + /// + /// + [Column("EMPNO")] + public string EmpNo { get; set; } + /// + /// EmpName + /// + /// + [Column("EMPNAME")] + public string EmpName { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.EPRId = Guid.NewGuid().ToString(); + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.EPRId = keyValue; + } + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomIBLL.cs new file mode 100644 index 000000000..21f15eed4 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomIBLL.cs @@ -0,0 +1,53 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-15 15:03 + /// 描 述:排考安排考场 + /// + public interface Exam_ExamPlanRoomIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + + IEnumerable GetList(string queryJson); + /// + /// 获取实体数据 + /// + /// 主键 + /// + Exam_ExamPlanRoomEntity GetEntity(string keyValue); + + bool ValidateRoom(string EPLId, string ClassroomNo); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, Exam_ExamPlanRoomEntity entity); + void SaveList (List list); + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomService.cs new file mode 100644 index 000000000..7a9c0aa77 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomService.cs @@ -0,0 +1,275 @@ +using Dapper; +using Learun.DataBase.Repository; +using Learun.Util; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-15 15:03 + /// 描 述:排考安排考场 + /// + public class Exam_ExamPlanRoomService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.* + "); + strSql.Append(" FROM Exam_ExamPlanRoom t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["EPLId"].IsEmpty()) + { + dp.Add("EPLId", queryParam["EPLId"].ToString(), DbType.String); + strSql.Append(" AND t.EPLId = @EPLId "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetList(string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.* + "); + strSql.Append(" FROM Exam_ExamPlanRoom t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["EPLId"].IsEmpty()) + { + dp.Add("EPLId", queryParam["EPLId"].ToString(), DbType.String); + strSql.Append(" AND t.EPLId = @EPLId "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取Exam_ExamPlanLesson表实体数据 + /// + /// 主键 + /// + public Exam_ExamPlanRoomEntity GetEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + public bool ValidateRoom(string EPLId, string ClassroomNo) + { + try + { + return this.BaseRepository("CollegeMIS").FindList(x => x.EPLId == EPLId && x.ClassroomNo == ClassroomNo).Count() > 0 ? true : false; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + var entity = new Exam_ExamPlanRoomEntity(); + if (keyValue.Contains(",")) + { + entity = this.BaseRepository("CollegeMIS").FindEntity((keyValue.Split(','))[0]); + + keyValue = string.Join("','", keyValue.Split(',')); + } + else + { + entity = this.BaseRepository("CollegeMIS").FindEntity(keyValue); + } + + string sql = $"delete from Exam_ExamPlanRoom where EPRId in ('{keyValue}')"; + + this.BaseRepository("CollegeMIS").ExecuteBySql(sql); + + UpdateExamPlanLesson(entity.EPLId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, Exam_ExamPlanRoomEntity entity) + { + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(keyValue); + this.BaseRepository("CollegeMIS").Update(entity); + } + else + { + entity.Create(); + this.BaseRepository("CollegeMIS").Insert(entity); + } + + UpdateExamPlanLesson(entity.EPLId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + public void SaveList(List list) + { + try + { + this.BaseRepository("CollegeMIS").Insert(list); + //更新排考安排课程表考场座位数 + //排考安排课程表Id + var EPLId = list.Select(x => x.EPLId).FirstOrDefault(); + UpdateExamPlanLesson(EPLId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + private void UpdateExamPlanLesson(string EPLId) + { + try + { + //更新排考安排课程表考场座位数 + string sql = $@"update l +set l.SeatCount=t.SeatCount +from Exam_ExamPlanLesson l +join (select '{EPLId}' as EPLId,sum(SeatCount) as SeatCount from Exam_ExamPlanRoom where EPLId='{EPLId}' +)t on l.EPLId=t.EPLId +where l.EPLId='{EPLId}'"; + this.BaseRepository("CollegeMIS").ExecuteBySql(sql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoom/Exam_ExamRoomService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoom/Exam_ExamRoomService.cs index 91241b86e..956c32387 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoom/Exam_ExamRoomService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoom/Exam_ExamRoomService.cs @@ -4,6 +4,7 @@ using Learun.Util; using System; using System.Collections.Generic; using System.Data; +using System.Linq; using System.Text; namespace Learun.Application.TwoDevelopment.EducationalAdministration @@ -56,6 +57,24 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("ClassroomName", "%" + queryParam["ClassroomName"].ToString() + "%", DbType.String); strSql.Append(" AND t.ClassroomName Like @ClassroomName "); } + if (!queryParam["EPLId"].IsEmpty()) + { + //排考安排课程表Id + var ELEntity = this.BaseRepository("CollegeMIS").FindList($@"select * from Exam_ExamPlan where EPId=( +select EPId from Exam_ExamPlanLesson where EPLId='{queryParam["EPLId"].ToString()}')").FirstOrDefault(); + if (ELEntity != null) + { + strSql.Append($" AND t.AcademicYearNo = '{ELEntity.AcademicYearNo}' "); + strSql.Append($" AND t.Semester = '{ELEntity.Semester}' "); + } + + } + + if (!queryParam["SqlParameter"].IsEmpty()) + { + strSql.Append(queryParam["SqlParameter"].ToString()); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) @@ -222,7 +241,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 座位行数 /// 座位列数 /// - public int Import(string AcademicYearNo, string Semester,int SeatRows,int SeatColumns) + public int Import(string AcademicYearNo, string Semester, int SeatRows, int SeatColumns) { try { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherService.cs index 38c8c5eb1..d0fb8287d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherService.cs @@ -4,6 +4,7 @@ using Learun.Util; using System; using System.Collections.Generic; using System.Data; +using System.Linq; using System.Text; namespace Learun.Application.TwoDevelopment.EducationalAdministration @@ -59,6 +60,34 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("EmpName", "%" + queryParam["EmpName"].ToString() + "%", DbType.String); strSql.Append(" AND t.EmpName Like @EmpName "); } + if (!queryParam["EPLId"].IsEmpty()) + { + //排考安排课程表Id + var ELEntity = this.BaseRepository("CollegeMIS").FindList($@"select * from Exam_ExamPlan where EPId=( +select EPId from Exam_ExamPlanLesson where EPLId='{queryParam["EPLId"].ToString()}')").FirstOrDefault(); + if (ELEntity != null) + { + strSql.Append($" AND t.AcademicYearNo = '{ELEntity.AcademicYearNo}' "); + strSql.Append($" AND t.Semester = '{ELEntity.Semester}' "); + } + + var empSql = $"select EmpNo from Exam_ExamPlanRoom where EPLId='{queryParam["EPLId"].ToString()}'"; + if (!queryParam["EPRId"].IsEmpty()) + { + empSql += $" and EPRId<>'{queryParam["EPRId"].ToString()}'"; + } + + var obj = this.BaseRepository("CollegeMIS").FindObject(empSql); + if (obj != null) + { + var empNo = string.Join("','", obj.ToString().Split(',')); + strSql.Append($" AND t.EmpNo not in ('{empNo}')"); + } + } + if (!queryParam["SqlParameter"].IsEmpty()) + { + strSql.Append(queryParam["SqlParameter"].ToString()); + } return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj index 4c9946f9a..c511cb3bd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj @@ -156,6 +156,12 @@ + + + + + + @@ -1787,6 +1793,16 @@ + + + + + + + + + +