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..219fe92a8 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,7 @@ using System.Data; using Learun.Application.TwoDevelopment.EducationalAdministration; using System.Web.Mvc; using System.Collections.Generic; +using System; namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { @@ -16,12 +17,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 +40,60 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult Form() { - return View(); + return View(); } + [HttpGet] + public ActionResult FormClass() + { + return View(); + } + #endregion #region 获取数据 + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageListForClass(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = exam_ExamPlanClassIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageListForRoom(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = exam_ExamPlanRoomIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } /// /// 获取页面显示列表数据 /// @@ -72,8 +124,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); @@ -119,6 +179,18 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return Success("删除成功!"); } /// + /// 审核 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult Check(string keyValue) + { + exam_ExamPlanLessonIBLL.Check(keyValue); + return Success("审核成功!"); + } + /// /// 保存实体数据(新增、修改) /// /// 主键 @@ -130,10 +202,23 @@ 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("保存成功!"); } #endregion 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..2860e1f48 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormClass.js @@ -0,0 +1,128 @@ + +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); + $('#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']); + } + }); + } + }, + { + label: "是否启用", name: "CheckMark", width: 80, align: "center", + formatter: function (cellvalue) { + return cellvalue == true ? "" : ""; + } + }, + { + label: "是否拆分班", name: "IsSeparate", width: 80, align: "center", + formatter: function (cellvalue) { + return cellvalue == true ? "" : ""; + } + } + ], + mainId: 'ClassId', + isPage: true, + isMultiselect: true, + sidx: 'ClassNo', + sord: 'ASC' + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.SqlParameter = " and CheckMark=1"; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + page.search(); + }; + 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..674e5fa2e 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,16 @@
+ 考试日期: + 考试时间:
@@ -50,7 +58,7 @@
班级信息
-
+
 新增  编辑  删除 @@ -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..9bbe86d8d 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,7 @@ var refreshGirdData; //排考记录Id var EPId = request('EPId'); +var EPLId; var bootstrap = function ($, learun) { "use strict"; var page = { @@ -19,19 +20,39 @@ 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 }); } }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); }); - // 新增 - $('#lr_add').on('click', function () { + //设置考试时间 + $('#lr_ExamTime').on('click', function () { + 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("请选择考试课程!"); + } + }); + //班级 新增 + $('#lr_add_Class').on('click', function () { learun.layerForm({ - id: 'form', + id: 'formclass', title: '新增', - url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/Form', + url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/FormClass', width: 600, height: 400, callBack: function (id) { @@ -39,14 +60,14 @@ var bootstrap = function ($, learun) { } }); }); - // 编辑 - $('#lr_edit').on('click', function () { - var keyValue = $('#gridtable').jfGridValue('EPLId'); + // 班级编辑 + $('#lr_edit_Class').on('click', function () { + var keyValue = $('#gridtable_Class').jfGridValue('EPCId'); if (learun.checkrow(keyValue)) { learun.layerForm({ - id: 'form', + id: 'formclass', title: '编辑', - url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/Form?keyValue=' + keyValue, + url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/FormClass?keyValue=' + keyValue, width: 600, height: 400, callBack: function (id) { @@ -55,13 +76,13 @@ var bootstrap = function ($, learun) { }); } }); - // 删除 - $('#lr_delete').on('click', function () { - var keyValue = $('#gridtable').jfGridValue('EPLId'); + // 班级删除 + $('#lr_delete_Class').on('click', function () { + var keyValue = $('#gridtable_Class').jfGridValue('EPCId'); if (learun.checkrow(keyValue)) { 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(); }); } @@ -75,33 +96,54 @@ var bootstrap = function ($, learun) { }, // 初始化列表 initGird: function () { - $('#gridtable').jfGrid({ - url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/GetPageList', + //班级 + $('#gridtable_Class').jfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/GetPageListForClass', headData: [ - { label: "考试日期", name: "ExamDate", width: 100, align: "left" }, - { label: "考试开始时间", name: "ExamTime", width: 100, align: "left" }, - { label: "结束时间", name: "ClassNum", width: 100, align: "left" }, + { label: "班级名称", name: "ClassName", width: 100, align: "left" }, + { label: "班级编号", name: "ClassNo", width: 100, align: "left" }, + { label: "班级人数", name: "ClassStuNum", width: 100, align: "left" }, ], - mainId: 'EPLId', - isPage: true + mainId: 'EPCId', + isPage: true, + isMultiselect: true, + }); + //考场 + $('#gridtable_Room').jfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/GetPageListForRoom', + headData: [ + { 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: '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) }); + $('#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; + $('#examDate').html(learun.formatDate(data.ExamDate, 'yyyy-MM-dd')); + $('#examTime').html(data.ExamTime); + } } }; refreshGirdData = function () { - $('#gridtable').jfGridSet('reload'); + $('#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 4b24be5cd..48cbd7fc2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -996,6 +996,7 @@ + @@ -7648,6 +7649,7 @@ + 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 18748fa3d..190659bf7 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 @@ -577,6 +577,8 @@ + + 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..970324ea5 --- /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,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-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 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); + } + } + } + + #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..e2969da81 --- /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,49 @@ +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); + /// + /// 获取实体数据 + /// + /// 主键 + /// + Exam_ExamPlanClassEntity GetEntity(string keyValue); + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, Exam_ExamPlanClassEntity entity); + #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..1160583f5 --- /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,149 @@ +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-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 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 + { + this.BaseRepository("CollegeMIS").Delete(t=>t.EPCId == keyValue); + } + 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); + } + } + } + + #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..5c09dda96 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) + { + try + { + exam_ExamPlanLessonService.Check(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_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..5e3ba6060 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); 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..d0c278ce4 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) + { + try + { + //未完成 + //this.BaseRepository("CollegeMIS").Delete(t => t.EPLId == keyValue); + } + 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..d826922e1 --- /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,127 @@ +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 Exam_ExamPlanRoomEntity GetEntity(string keyValue) + { + try + { + return exam_ExamPlanRoomService.GetEntity(keyValue); + } + 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); + } + } + } + + #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..e6906f340 --- /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,49 @@ +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); + /// + /// 获取实体数据 + /// + /// 主键 + /// + Exam_ExamPlanRoomEntity GetEntity(string keyValue); + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, Exam_ExamPlanRoomEntity entity); + #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..55a883b8a --- /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,151 @@ +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-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); + } + } + } + + /// + /// 获取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); + } + } + } + + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + this.BaseRepository("CollegeMIS").Delete(t=>t.EPRId == keyValue); + } + 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); + } + } + 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/Learun.Application.TwoDevelopment.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj index 42be35676..6701cd39e 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,8 @@ + +