From fa9c5f09c2680bf659e56e3c4edf25a4a2a7424e Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Thu, 14 Apr 2022 17:42:25 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=91=E8=80=83=E8=80=81=E5=B8=88=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Exam_InvigilateTeacherController.cs | 175 +++++++++++ .../Views/Exam_InvigilateTeacher/Form.cshtml | 31 ++ .../Views/Exam_InvigilateTeacher/Form.js | 69 +++++ .../FormYearSemester.cshtml | 15 + .../FormYearSemester.js | 83 +++++ .../Views/Exam_InvigilateTeacher/Index.cshtml | 54 ++++ .../Views/Exam_InvigilateTeacher/Index.js | 209 +++++++++++++ .../Learun.Application.Web.csproj | 7 + .../Exam_InvigilateTeacherMap.cs | 29 ++ .../Learun.Application.Mapping.csproj | 1 + .../Exam_InvigilateTeacherBLL.cs | 196 ++++++++++++ .../Exam_InvigilateTeacherEntity.cs | 75 +++++ .../Exam_InvigilateTeacherIBLL.cs | 54 ++++ .../Exam_InvigilateTeacherService.cs | 283 ++++++++++++++++++ .../Learun.Application.TwoDevelopment.csproj | 4 + 15 files changed, 1285 insertions(+) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_InvigilateTeacherController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Form.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Form.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/FormYearSemester.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/FormYearSemester.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Index.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Index.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Exam_InvigilateTeacherMap.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherEntity.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherIBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherService.cs diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_InvigilateTeacherController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_InvigilateTeacherController.cs new file mode 100644 index 000000000..fa9a9fbae --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_InvigilateTeacherController.cs @@ -0,0 +1,175 @@ +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-14 09:49 + /// 描 述:监考老师 + /// + public class Exam_InvigilateTeacherController : MvcControllerBase + { + private Exam_InvigilateTeacherIBLL exam_InvigilateTeacherIBLL = new Exam_InvigilateTeacherBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult FormYearSemester() + { + return View(); + } + + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = exam_InvigilateTeacherIBLL.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_InvigilateTeacherData = exam_InvigilateTeacherIBLL.GetExam_InvigilateTeacherEntity( keyValue ); + var jsonData = new { + Exam_InvigilateTeacher = Exam_InvigilateTeacherData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + exam_InvigilateTeacherIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + Exam_InvigilateTeacherEntity entity = strEntity.ToObject(); + //判断教师编号有无重复 + var model = exam_InvigilateTeacherIBLL.GetEntityByWhere(entity.AcademicYearNo, entity.Semester,entity.EmpNo); + if (model != null && string.IsNullOrEmpty(keyValue)) + { + return Fail("教师编号重复!"); + } + else if (model != null && !string.IsNullOrEmpty(keyValue) && keyValue != model.ITId) + { + return Fail("教师编号重复!"); + } + exam_InvigilateTeacherIBLL.SaveEntity(keyValue,entity); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + + /// + /// 启用/停用 + /// + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult Lock(string keyValue, int ITEnabled) + { + exam_InvigilateTeacherIBLL.Lock(keyValue, ITEnabled); + return Success("操作成功!"); + } + + /// + /// 导入教师基础数据 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult Import(string AcademicYearNo, string Semester) + { + int res = exam_InvigilateTeacherIBLL.Import(AcademicYearNo, Semester); + return Success("导入" + res + "条数据!"); + } + /// + /// 按条件清空数据 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteWhere(string AcademicYearNo, string Semester) + { + int res = exam_InvigilateTeacherIBLL.DeleteWhere(AcademicYearNo, Semester); + return Success("清空" + res + "条数据!"); + } + + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Form.cshtml new file mode 100644 index 000000000..3b4264d51 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Form.cshtml @@ -0,0 +1,31 @@ +@{ + ViewBag.Title = "监考老师"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
学年*
+
+
+
+
学期*
+
+
+
+
教师编号*
+ +
+
+
教师姓名*
+ +
+
+
排序号
+ +
+
+
是否启用
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Form.js new file mode 100644 index 000000000..77b4f45b6 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Form.js @@ -0,0 +1,69 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2022-04-14 09:50 + * 描 述:监考老师 + */ +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#AcademicYearNo').lrselect({ + placeholder: "学年", + allowSearch: false, + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo', + value: 'value', + text: 'text' + }); + //学期 + $('#Semester').lrselect({ + placeholder: "学期", + allowSearch: false, + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', + value: 'value', + text: 'text' + }); + $('#ITEnabled').lrRadioCheckbox({ + type: 'radio', + code: 'YesOrNoBit', + }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/Exam_InvigilateTeacher/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_InvigilateTeacher/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_InvigilateTeacher/FormYearSemester.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/FormYearSemester.cshtml new file mode 100644 index 000000000..74924978e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/FormYearSemester.cshtml @@ -0,0 +1,15 @@ +@{ + ViewBag.Title = "考试课程表"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
学年*
+
+
+
+
学期*
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/FormYearSemester.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/FormYearSemester.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/FormYearSemester.js new file mode 100644 index 000000000..7172be57e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/FormYearSemester.js @@ -0,0 +1,83 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2022-04-12 15:47 + * 描 述:考试课程表 + */ +var acceptClick; +var type = request('type'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + //page.initData(); + }, + bind: function () { + $('#AcademicYearNo').lrselect({ + placeholder: "学年", + allowSearch: false, + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo', + value: 'value', + text: 'text', + maxHeight: 200, + }); + //学期 + $('#Semester').lrselect({ + placeholder: "学期", + allowSearch: false, + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', + value: 'value', + text: 'text' + }); + + }, + initData: function () { + //if (!!keyValue) { + // $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamLesson/GetFormData?keyValue=' + keyValue, function (data) { + // for (var id in data) { + // if (!!data[id].length && data[id].length > 0) { + // $('#' + id ).jfGridSet('refreshdata', data[id]); + // } + // else { + // $('[data-table="' + id + '"]').lrSetFormData(data[id]); + // } + // } + // }); + //} + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var postData = { + AcademicYearNo: $('#AcademicYearNo').lrselectGet(), + Semester: $('#Semester').lrselectGet() + }; + //导入 + if (type == 1) { + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_InvigilateTeacher/Import', postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + } else if (type == 2) { + //按条件清空数据 + learun.layerConfirm('是否确认清空!', function (res) { + if (res) { + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_InvigilateTeacher/DeleteWhere', postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + } + }); + } + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Index.cshtml new file mode 100644 index 000000000..c3939ac7d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Index.cshtml @@ -0,0 +1,54 @@ +@{ + ViewBag.Title = "监考老师"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
学年
+
+
+
+
学期
+
+
+
+
教师编号
+ +
+
+
教师姓名
+ +
+
+
+
+
+ +
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Index.js new file mode 100644 index 000000000..ebe5d98dc --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Index.js @@ -0,0 +1,209 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2022-04-14 09:50 + * 描 述:监考老师 + */ +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); + $('#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(); + }); + // 新增 + $('#lr_add').on('click', + function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/EducationalAdministration/Exam_InvigilateTeacher/Form', + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', + function () { + var keyValue = $('#gridtable').jfGridValue('ITId'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + + '/EducationalAdministration/Exam_InvigilateTeacher/Form?keyValue=' + + keyValue, + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', + function () { + var keyValue = $('#gridtable').jfGridValue('ITId'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', + function (res) { + if (res) { + learun.deleteForm( + top.$.rootUrl + '/EducationalAdministration/Exam_InvigilateTeacher/DeleteForm', + { keyValue: keyValue }, + function () { + refreshGirdData(); + }); + } + }); + } + }); + // 打印 + $('#lr_print').on('click', + function () { + $('#gridtable').jqprintTable(); + }); + //启用 + $('#lr_lock').on('click', + function () { + var keyValue = $('#gridtable').jfGridValue('ITId'); + if (learun.checkrow(keyValue)) { + var ELEnabled = $('#gridtable').jfGridValue('ITEnabled'); + if (ELEnabled.indexOf('true') != -1) { + learun.alert.warning("选中记录中包含已启用项目!"); + return; + } + learun.layerConfirm('是否确认启用选中记录!', + function (res) { + if (res) { + learun.deleteForm( + top.$.rootUrl + '/EducationalAdministration/Exam_InvigilateTeacher/Lock', + { keyValue: keyValue, ITEnabled: 1 }, + function () { + refreshGirdData(); + }); + } + }); + } + }); + //禁用 + $('#lr_unlock').on('click', + function () { + var keyValue = $('#gridtable').jfGridValue('ITId'); + if (learun.checkrow(keyValue)) { + var ELEnabled = $('#gridtable').jfGridValue('ITEnabled'); + if (ELEnabled.indexOf('false') != -1) { + learun.alert.warning("选中记录中包含已停用项目!"); + return; + } + learun.layerConfirm('是否确认停用选中记录!', + function (res) { + if (res) { + learun.deleteForm( + top.$.rootUrl + '/EducationalAdministration/Exam_InvigilateTeacher/Lock', + { keyValue: keyValue, ITEnabled: 0 }, + function () { + refreshGirdData(); + }); + } + }); + } + }); + // 导入 + $('#lr_importByBasic').on('click', + function () { + learun.layerForm({ + id: 'form_import', + title: '导入', + url: top.$.rootUrl + + '/EducationalAdministration/Exam_InvigilateTeacher/FormYearSemester?type=1', + width: 500, + height: 300, + btn: ['一键导入', '关闭'], + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + + // 按条件清空数据 + $('#lr_emptyWhere').on('click', + function () { + learun.layerForm({ + id: 'form_empty', + title: '清空数据', + url: top.$.rootUrl + + '/EducationalAdministration/Exam_InvigilateTeacher/FormYearSemester?type=2', + width: 500, + height: 300, + btn: ['清空', '关闭'], + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + + }, + // 初始化列表 + 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', + isMultiselect: true, + isPage: true, + sidx: 'AcademicYearNo desc,Semester desc,ITOrder asc' + }); + 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/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index fb58b7f0e..567de8888 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 @@ -834,6 +834,7 @@ + @@ -992,6 +993,7 @@ + @@ -6355,6 +6357,10 @@ + + + + @@ -7614,6 +7620,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Exam_InvigilateTeacherMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Exam_InvigilateTeacherMap.cs new file mode 100644 index 000000000..caf559166 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Exam_InvigilateTeacherMap.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 09:49 + /// 描 述:监考老师 + /// + public class Exam_InvigilateTeacherMap : EntityTypeConfiguration + { + public Exam_InvigilateTeacherMap() + { + #region 表、主键 + //表 + this.ToTable("EXAM_INVIGILATETEACHER"); + //主键 + this.HasKey(t => t.ITId); + #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 9b2895229..a7f292386 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 @@ -572,6 +572,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherBLL.cs new file mode 100644 index 000000000..b2c9de1a0 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherBLL.cs @@ -0,0 +1,196 @@ +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-14 09:49 + /// 描 述:监考老师 + /// + public class Exam_InvigilateTeacherBLL : Exam_InvigilateTeacherIBLL + { + private Exam_InvigilateTeacherService exam_InvigilateTeacherService = new Exam_InvigilateTeacherService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return exam_InvigilateTeacherService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取Exam_InvigilateTeacher表实体数据 + /// + /// 主键 + /// + public Exam_InvigilateTeacherEntity GetExam_InvigilateTeacherEntity(string keyValue) + { + try + { + return exam_InvigilateTeacherService.GetExam_InvigilateTeacherEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + public Exam_InvigilateTeacherEntity GetEntityByWhere(string AcademicYearNo, int? Semester, string EmpNo) + { + try + { + return exam_InvigilateTeacherService.GetEntityByWhere(AcademicYearNo, Semester, EmpNo); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + exam_InvigilateTeacherService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, Exam_InvigilateTeacherEntity entity) + { + try + { + exam_InvigilateTeacherService.SaveEntity(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public void Lock(string keyValue, int ITEnabled) + { + try + { + exam_InvigilateTeacherService.Lock(keyValue, ITEnabled); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + public int Import(string AcademicYearNo, string Semester) + { + try + { + return exam_InvigilateTeacherService.Import(AcademicYearNo, Semester); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + public int DeleteWhere(string AcademicYearNo, string Semester) + { + try + { + return exam_InvigilateTeacherService.DeleteWhere(AcademicYearNo, Semester); + } + 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_InvigilateTeacher/Exam_InvigilateTeacherEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherEntity.cs new file mode 100644 index 000000000..5ca90ec91 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherEntity.cs @@ -0,0 +1,75 @@ +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-14 09:49 + /// 描 述:监考老师 + /// + public class Exam_InvigilateTeacherEntity + { + #region 实体成员 + /// + /// 主键 + /// + [Column("ITID")] + public string ITId { get; set; } + /// + /// 学年 + /// + [Column("ACADEMICYEARNO")] + public string AcademicYearNo { get; set; } + /// + /// 学期 + /// + [Column("SEMESTER")] + public int? Semester { get; set; } + /// + /// 课程类型名称 + /// + [Column("EMPNAME")] + public string EmpName { get; set; } + /// + /// 课程类型编号 + /// + [Column("EMPNO")] + public string EmpNo { get; set; } + /// + /// 排序号 + /// + [Column("ITORDER")] + public int? ITOrder { get; set; } + /// + /// 是否启用 + /// + [Column("ITENABLED")] + public bool? ITEnabled { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.ITId = Guid.NewGuid().ToString(); + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.ITId = keyValue; + } + #endregion + #region 扩展字段 + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherIBLL.cs new file mode 100644 index 000000000..4f8b19d17 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherIBLL.cs @@ -0,0 +1,54 @@ +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-14 09:49 + /// 描 述:监考老师 + /// + public interface Exam_InvigilateTeacherIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取Exam_InvigilateTeacher表实体数据 + /// + /// 主键 + /// + Exam_InvigilateTeacherEntity GetExam_InvigilateTeacherEntity(string keyValue); + Exam_InvigilateTeacherEntity GetEntityByWhere(string AcademicYearNo, int? Semester, string EmpNo); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, Exam_InvigilateTeacherEntity entity); + + void Lock(string keyValue, int ITEnabled); + int Import(string AcademicYearNo, string Semester); + int DeleteWhere(string AcademicYearNo, string Semester); + + #endregion + + } +} 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 new file mode 100644 index 000000000..0c92192b2 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherService.cs @@ -0,0 +1,283 @@ +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-14 09:49 + /// 描 述:监考老师 + /// + public class Exam_InvigilateTeacherService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.* + "); + strSql.Append(" FROM Exam_InvigilateTeacher t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["AcademicYearNo"].IsEmpty()) + { + dp.Add("AcademicYearNo", queryParam["AcademicYearNo"].ToString(), DbType.String); + strSql.Append(" AND t.AcademicYearNo = @AcademicYearNo "); + } + if (!queryParam["Semester"].IsEmpty()) + { + dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); + strSql.Append(" AND t.Semester = @Semester "); + } + 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 "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取Exam_InvigilateTeacher表实体数据 + /// + /// 主键 + /// + public Exam_InvigilateTeacherEntity GetExam_InvigilateTeacherEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + + /// + /// 获取Exam_InvigilateTeacher表实体数据 + /// + /// 主键 + /// + public Exam_InvigilateTeacherEntity GetEntityByWhere(string AcademicYearNo, int? Semester, string EmpNo) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(x => x.AcademicYearNo == AcademicYearNo && x.Semester == Semester && x.EmpNo == EmpNo); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + if (keyValue.Contains(",")) + { + keyValue = string.Join("','", keyValue.Split(',')); + } + + string sql = $"delete Exam_InvigilateTeacher where ITId in ('{keyValue}')"; + this.BaseRepository("CollegeMIS").ExecuteBySql(sql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, Exam_InvigilateTeacherEntity 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 Lock(string keyValue, int ITEnabled) + { + try + { + if (keyValue.Contains(",")) + { + keyValue = string.Join("','", keyValue.Split(',')); + } + + string sql = $"update Exam_InvigilateTeacher set ITEnabled='{ITEnabled}' where ITId in ('{keyValue}')"; + this.BaseRepository("CollegeMIS").ExecuteBySql(sql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 导入 + /// + /// + /// + /// + public int Import(string AcademicYearNo, string Semester) + { + try + { + string sql = $@"INSERT INTO [dbo].[Exam_InvigilateTeacher] + ([ITId] + ,[AcademicYearNo] + ,[Semester] + ,[EmpName] + ,[EmpNo] + ,[ITOrder] + ,[ITEnabled]) +select newid(),'{AcademicYearNo}','{Semester}',empname,empno,0,1 from empinfo where checkmark=1 +"; + return this.BaseRepository("CollegeMIS").ExecuteBySql(sql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 清空数据 + /// + /// + /// + /// + public int DeleteWhere(string AcademicYearNo, string Semester) + { + try + { + string sql = $"delete Exam_InvigilateTeacher where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}'"; + return 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/Learun.Application.TwoDevelopment.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj index 3a8197ec9..9c192f2ee 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 @@ -1767,6 +1767,10 @@ + + + +