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 0fe80a537..9a8722fa3 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 @@ -21,6 +21,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers private Exam_ExamPlanIBLL exam_ExamPlanIBLL = new Exam_ExamPlanBLL(); 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 视图功能 @@ -69,7 +70,6 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } - #endregion #region 获取数据 @@ -322,6 +322,24 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return Success("操作成功!"); } + /// + /// 一键安排考场 + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult PlanRoomByEPId(string keyValue) + { + var res = exam_ExamPlanRoomIBLL.PlanRoomByEPId(keyValue); + if (!res.flag) + { + return Fail(res.str); + } + + return Success("操作成功!"); + } + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamTeacherTimeController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamTeacherTimeController.cs new file mode 100644 index 000000000..fac91a660 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamTeacherTimeController.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-06-13 15:41 + /// 描 述:老师时间管理 + /// + public class Exam_ExamTeacherTimeController : MvcControllerBase + { + private Exam_ExamTeacherTimeIBLL exam_ExamTeacherTimeIBLL = new Exam_ExamTeacherTimeBLL(); + + #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_ExamTeacherTimeIBLL.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_ExamTeacherTimeData = exam_ExamTeacherTimeIBLL.GetExam_ExamTeacherTimeEntity( keyValue ); + var jsonData = new { + Exam_ExamTeacherTime = Exam_ExamTeacherTimeData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + exam_ExamTeacherTimeIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + Exam_ExamTeacherTimeEntity entity = strEntity.ToObject(); + exam_ExamTeacherTimeIBLL.SaveEntity(keyValue,entity); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + #endregion + + } +} 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 index fa9a9fbae..1eba6143f 100644 --- 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 @@ -87,6 +87,18 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers }; return Success(jsonData); } + + /// + /// 获取监考老师数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetList(string AcademicYearNo, int? Semester) + { + var data = exam_InvigilateTeacherIBLL.GetList(AcademicYearNo, Semester); + return Success(data); + } #endregion #region 提交数据 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 31f8989d1..643b5ac7b 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 @@ -54,9 +54,12 @@  打印 +
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ExamTeacherTime/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamTeacherTime/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamTeacherTime/Index.js new file mode 100644 index 000000000..b7bb438a6 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamTeacherTime/Index.js @@ -0,0 +1,142 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2022-06-13 15:41 + * 描 述:老师时间管理 + */ +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: 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' + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamTeacherTime/Form', + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamTeacherTime/Form?keyValue=' + keyValue, + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamTeacherTime/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + // 打印 + $('#lr_print').on('click', function () { + $('#gridtable').jqprintTable(); + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamTeacherTime/GetPageList', + headData: [ + { label: "学年", name: "AcademicYearNo", width: 100, align: "left" }, + { label: "学期", name: "Semester", width: 100, align: "left" }, + { + label: "时间段", name: "ExamTimeStart", width: 300, align: "left", + formatter: function (value, row) { + return value + " - " + row.ExamTimeEnd; + } + }, + { + label: "不能监考的老师", name: "EmpNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + if (value.indexOf(',') != -1) { + var name = ''; + var attr = value.split(','); + for (var i = 0; i < attr.length; i++) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', + key: attr[i], + keyId: 'empno', + callback: function (_data) { + name += _data['empname'] + ","; + } + }); + } + callback(name.substring(0, name.length - 1)); + } else { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', + key: value, + keyId: 'empno', + callback: function (_data) { + callback(_data['empname']); + } + }); + } + } + }, + ], + mainId: 'Id', + 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/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index 1e077356b..20185ec92 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 @@ -832,6 +832,7 @@ + @@ -6544,6 +6545,10 @@ + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/EmpInfoApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/EmpInfoApi.cs index f6ce342f3..20d34f476 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/EmpInfoApi.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/EmpInfoApi.cs @@ -30,19 +30,20 @@ namespace Learun.Application.WebApi /// 注册接口 /// public EmpInfoApi() - : base("/Learun/adms/EducationalAdministration/EmpRegister") + //: base("/Learun/adms/EducationalAdministration/EmpRegister") + : base() { - Get["/pagelist"] = GetPageList; - Get["/list"] = GetList; - Get["/form"] = GetForm; - Get["/formForNo"] = GetFormForNo; - Post["/delete"] = DeleteForm; - Post["/save"] = SaveForm; - Post["/savePhoto"] = GetSavePhoto; - Get["/registerbutton"] = RegisterButton; - Post["/signon"] = Signon; + Get["/Learun/adms/EducationalAdministration/EmpRegister/pagelist"] = GetPageList; + Get["/Learun/adms/EducationalAdministration/EmpRegister/list"] = GetList; + Get["/Learun/adms/EducationalAdministration/EmpRegister/form"] = GetForm; + Get["/Learun/adms/EducationalAdministration/EmpRegister/formForNo"] = GetFormForNo; + Post["/Learun/adms/EducationalAdministration/EmpRegister/delete"] = DeleteForm; + Post["/Learun/adms/EducationalAdministration/EmpRegister/save"] = SaveForm; + Post["/Learun/adms/EducationalAdministration/EmpRegister/savePhoto"] = GetSavePhoto; + Get["/Learun/adms/EducationalAdministration/EmpRegister/registerbutton"] = RegisterButton; + Post["/Learun/adms/EducationalAdministration/EmpRegister/signon"] = Signon; //根据身份证号更新学生和老师的照片 - Post["/updatePhotoByIdCard"] = UpdatePhotoByIdCard; + Post["/EducationalAdministration/EmpRegister/updatePhotoByIdCard"] = UpdatePhotoByIdCard; } private Response Signon(dynamic _) @@ -235,9 +236,9 @@ namespace Learun.Application.WebApi { var pmodel = new ResponseModel() { - IdCard=item.IdCard, - OperateFlag=false, - FailMsg="该身份证号的教师信息不存在!" + IdCard = item.IdCard, + OperateFlag = false, + FailMsg = "该身份证号的教师信息不存在!" }; responseModels.Add(pmodel); } @@ -245,49 +246,63 @@ namespace Learun.Application.WebApi { //图片地址 var imgPath = string.Format("{0}/{1}{2}", directoryPathOfEmp, item.IdCard, FileEextension); - if (!System.IO.File.Exists(imgPath)) + //下载图片到本地 + //WebClient my = new WebClient(); + //byte[] mybyte = my.DownloadData(item.PhotoUrl); + //FileInfo file = new FileInfo(imgPath); + //FileStream fs = file.Create(); + //fs.Write(mybyte, 0, mybyte.Length); + //fs.Close(); + + HttpWebRequest request = (HttpWebRequest)WebRequest.Create(item.PhotoUrl); + request.Timeout = 5000; + long len = 0; + try { - //下载图片到本地 - WebClient my = new WebClient(); - byte[] mybyte = my.DownloadData(item.PhotoUrl); - FileInfo file = new FileInfo(imgPath); - FileStream fs = file.Create(); - fs.Write(mybyte, 0, mybyte.Length); - fs.Close(); - //图片地址保存到LR_Base_AnnexesFile表中 - var folderId = Guid.NewGuid().ToString(); - AnnexesFileEntity fileAnnexesEntity = new AnnexesFileEntity(); - fileAnnexesEntity.F_Id = Guid.NewGuid().ToString(); - fileAnnexesEntity.F_FileName =string.Format("{0}{1}",item.IdCard,FileEextension); - fileAnnexesEntity.F_FilePath = imgPath; - fileAnnexesEntity.F_FileSize = mybyte.Length.ToString(); - fileAnnexesEntity.F_FileExtensions = FileEextension; - fileAnnexesEntity.F_FileType = FileEextension.Replace(".", ""); - annexesFileIBLL.SaveEntity(folderId, fileAnnexesEntity); - //更新EmpInfo表照片字段 - entity.Photo = folderId; - empInfoIBLL.SaveEntity(entity.EmpId, entity); - //回参 - var pmodel = new ResponseModel() - { - IdCard = item.IdCard, - OperateFlag = true - }; - responseModels.Add(pmodel); + var wresp = (HttpWebResponse)request.GetResponse(); + var stream = wresp.GetResponseStream(); + System.Drawing.Image.FromStream(stream).Save(imgPath, System.Drawing.Imaging.ImageFormat.Png); + len = wresp.ContentLength; + stream.Close(); + wresp.Close(); } - else + catch (Exception ex) { - var pmodel = new ResponseModel() + //回参 + var pmodel2 = new ResponseModel() { IdCard = item.IdCard, OperateFlag = false, - FailMsg = "该身份证号的图片已存在!" + FailMsg = "请求图片地址失败!" + ex.Message }; - responseModels.Add(pmodel); + responseModels.Add(pmodel2); + + continue; } + + //图片地址保存到LR_Base_AnnexesFile表中 + var folderId = Guid.NewGuid().ToString(); + AnnexesFileEntity fileAnnexesEntity = new AnnexesFileEntity(); + fileAnnexesEntity.F_Id = Guid.NewGuid().ToString(); + fileAnnexesEntity.F_FileName = string.Format("{0}{1}", item.IdCard, FileEextension); + fileAnnexesEntity.F_FilePath = imgPath; + fileAnnexesEntity.F_FileSize = len.ToString(); + fileAnnexesEntity.F_FileExtensions = FileEextension; + fileAnnexesEntity.F_FileType = FileEextension.Replace(".", ""); + annexesFileIBLL.SaveEntity(folderId, fileAnnexesEntity); + //更新EmpInfo表照片字段 + entity.Photo = folderId; + empInfoIBLL.SaveEntity(entity.EmpId, entity); + //回参 + var pmodel = new ResponseModel() + { + IdCard = item.IdCard, + OperateFlag = true + }; + responseModels.Add(pmodel); } } - else if(item.IdentityFlag == 2)//学生 + else if (item.IdentityFlag == 2)//学生 { var entity = stuInfoBasicIBLL.GetStuInfoBasicEntityByIdCard(item.IdCard); if (entity == null) @@ -304,46 +319,53 @@ namespace Learun.Application.WebApi { //图片地址 var imgPath = string.Format("{0}/{1}{2}", directoryPathOfStu, item.IdCard, FileEextension); - if (!System.IO.File.Exists(imgPath)) + //下载图片到本地 + HttpWebRequest request = (HttpWebRequest)WebRequest.Create(item.PhotoUrl); + request.Timeout = 5000; + long len = 0; + try { - //下载图片到本地 - WebClient my = new WebClient(); - byte[] mybyte = my.DownloadData(item.PhotoUrl); - FileInfo file = new FileInfo(imgPath); - FileStream fs = file.Create(); - fs.Write(mybyte, 0, mybyte.Length); - fs.Close(); - //图片地址保存到LR_Base_AnnexesFile表中 - var folderId = Guid.NewGuid().ToString(); - AnnexesFileEntity fileAnnexesEntity = new AnnexesFileEntity(); - fileAnnexesEntity.F_Id = Guid.NewGuid().ToString(); - fileAnnexesEntity.F_FileName = string.Format("{0}{1}", item.IdCard, FileEextension); - fileAnnexesEntity.F_FilePath = imgPath; - fileAnnexesEntity.F_FileSize = mybyte.Length.ToString(); - fileAnnexesEntity.F_FileExtensions = FileEextension; - fileAnnexesEntity.F_FileType = FileEextension.Replace(".", ""); - annexesFileIBLL.SaveEntity(folderId, fileAnnexesEntity); - //更新StuInfoBasic表照片字段 - entity.Photo = folderId; - stuInfoBasicIBLL.SaveEntity(entity.StuId, entity); - //回参 - var pmodel = new ResponseModel() - { - IdCard = item.IdCard, - OperateFlag = true - }; - responseModels.Add(pmodel); + var wresp = (HttpWebResponse)request.GetResponse(); + var stream = wresp.GetResponseStream(); + System.Drawing.Image.FromStream(stream).Save(imgPath, System.Drawing.Imaging.ImageFormat.Png); + len = wresp.ContentLength; + stream.Close(); + wresp.Close(); } - else + catch (Exception ex) { - var pmodel = new ResponseModel() + //回参 + var pmodel2 = new ResponseModel() { IdCard = item.IdCard, OperateFlag = false, - FailMsg = "该身份证号的图片已存在!" + FailMsg = "请求图片地址失败!" + ex.Message }; - responseModels.Add(pmodel); + responseModels.Add(pmodel2); + + continue; } + + //图片地址保存到LR_Base_AnnexesFile表中 + var folderId = Guid.NewGuid().ToString(); + AnnexesFileEntity fileAnnexesEntity = new AnnexesFileEntity(); + fileAnnexesEntity.F_Id = Guid.NewGuid().ToString(); + fileAnnexesEntity.F_FileName = string.Format("{0}{1}", item.IdCard, FileEextension); + fileAnnexesEntity.F_FilePath = imgPath; + fileAnnexesEntity.F_FileSize = len.ToString(); + fileAnnexesEntity.F_FileExtensions = FileEextension; + fileAnnexesEntity.F_FileType = FileEextension.Replace(".", ""); + annexesFileIBLL.SaveEntity(folderId, fileAnnexesEntity); + //更新StuInfoBasic表照片字段 + entity.Photo = folderId; + stuInfoBasicIBLL.SaveEntity(entity.StuId, entity); + //回参 + var pmodel = new ResponseModel() + { + IdCard = item.IdCard, + OperateFlag = true + }; + responseModels.Add(pmodel); } } else @@ -359,7 +381,7 @@ namespace Learun.Application.WebApi } return Success(responseModels); - + } #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Exam_ExamTeacherTimeMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Exam_ExamTeacherTimeMap.cs new file mode 100644 index 000000000..ce333c4e1 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Exam_ExamTeacherTimeMap.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-06-13 15:41 + /// 描 述:老师时间管理 + /// + public class Exam_ExamTeacherTimeMap : EntityTypeConfiguration + { + public Exam_ExamTeacherTimeMap() + { + #region 表、主键 + //表 + this.ToTable("EXAM_EXAMTEACHERTIME"); + //主键 + this.HasKey(t => t.Id); + #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 8ae322117..719cf7c99 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 @@ -587,6 +587,7 @@ + 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 index b6afaf0d3..5be5c89e9 100644 --- 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 @@ -130,7 +130,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - + /// /// 保存实体数据(新增、修改) @@ -175,6 +175,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + + public (bool flag, string str) PlanRoomByEPId(string EPId) + { + try + { + return exam_ExamPlanRoomService.PlanRoomByEPId(EPId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomIBLL.cs index 21f15eed4..cc7bc85cb 100644 --- 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 @@ -47,6 +47,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 实体 void SaveEntity(string keyValue, Exam_ExamPlanRoomEntity entity); void SaveList (List list); + (bool flag,string str) PlanRoomByEPId(string EPId); #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 index 7a9c0aa77..25cff5d35 100644 --- 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 @@ -128,7 +128,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - return this.BaseRepository("CollegeMIS").FindList(x => x.EPLId == EPLId && x.ClassroomNo == ClassroomNo).Count() > 0 ? true : false; + return this.BaseRepository("CollegeMIS").FindList(x => x.EPLId == EPLId && x.ClassroomNo == ClassroomNo).Count() > 0 ? true : false; } catch (Exception ex) { @@ -269,6 +269,55 @@ where l.EPLId='{EPLId}'"; } } } + + /// + /// 自动安排考场 + /// + /// 考试记录表Id + /// + public (bool flag, string str) PlanRoomByEPId(string EPId) + { + var db = this.BaseRepository("CollegeMIS"); + try + { + db.BeginTrans(); + /* + * 1.查询是否已添加考试课程和班级 + * 2.查询是否生成课程排考时间 + * 3.查询考试课程并循环, + * 根据考试课程的总班级人数和排考时间,随机安排考场(同一时间段考场不能重复) + */ + //考试记录表 + var examPlan = db.FindEntity(EPId); + //考试课程 + var examLessonList = db.FindList(x => x.EPId == EPId).ToList(); + if (examLessonList.Count() <= 0) + { + return (false, "请先添加考试课程!"); + } + if (!examLessonList.Exists(x => x.ExamDate != null)) + { + return (false, "请先设置排考时间!"); + } + //考试班级 + + + + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + 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_ExamTeacherTime/Exam_ExamTeacherTimeBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamTeacherTime/Exam_ExamTeacherTimeBLL.cs new file mode 100644 index 000000000..a370c1c72 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamTeacherTime/Exam_ExamTeacherTimeBLL.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-06-13 15:41 + /// 描 述:老师时间管理 + /// + public class Exam_ExamTeacherTimeBLL : Exam_ExamTeacherTimeIBLL + { + private Exam_ExamTeacherTimeService exam_ExamTeacherTimeService = new Exam_ExamTeacherTimeService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return exam_ExamTeacherTimeService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取Exam_ExamTeacherTime表实体数据 + /// + /// 主键 + /// + public Exam_ExamTeacherTimeEntity GetExam_ExamTeacherTimeEntity(string keyValue) + { + try + { + return exam_ExamTeacherTimeService.GetExam_ExamTeacherTimeEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + exam_ExamTeacherTimeService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, Exam_ExamTeacherTimeEntity entity) + { + try + { + exam_ExamTeacherTimeService.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_ExamTeacherTime/Exam_ExamTeacherTimeEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamTeacherTime/Exam_ExamTeacherTimeEntity.cs new file mode 100644 index 000000000..cb0785d36 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamTeacherTime/Exam_ExamTeacherTimeEntity.cs @@ -0,0 +1,70 @@ +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-06-13 15:41 + /// 描 述:老师时间管理(设置考试时间段不能监考的老师) + /// + public class Exam_ExamTeacherTimeEntity + { + #region 实体成员 + /// + /// Id + /// + [Column("ID")] + public string Id { get; set; } + /// + /// 学年 + /// + [Column("ACADEMICYEARNO")] + public string AcademicYearNo { get; set; } + /// + /// 学期 + /// + [Column("SEMESTER")] + public int? Semester { get; set; } + /// + /// EmpNo + /// + [Column("EMPNO")] + public string EmpNo { get; set; } + /// + /// ExamTimeStart + /// + [Column("EXAMTIMESTART")] + public DateTime? ExamTimeStart { get; set; } + /// + /// ExamTimeEnd + /// + [Column("EXAMTIMEEND")] + public DateTime? ExamTimeEnd { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.Id = Guid.NewGuid().ToString(); + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.Id = keyValue; + } + #endregion + #region 扩展字段 + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamTeacherTime/Exam_ExamTeacherTimeIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamTeacherTime/Exam_ExamTeacherTimeIBLL.cs new file mode 100644 index 000000000..f4d7981b3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamTeacherTime/Exam_ExamTeacherTimeIBLL.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-06-13 15:41 + /// 描 述:老师时间管理 + /// + public interface Exam_ExamTeacherTimeIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取Exam_ExamTeacherTime表实体数据 + /// + /// 主键 + /// + Exam_ExamTeacherTimeEntity GetExam_ExamTeacherTimeEntity(string keyValue); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, Exam_ExamTeacherTimeEntity entity); + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamTeacherTime/Exam_ExamTeacherTimeService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamTeacherTime/Exam_ExamTeacherTimeService.cs new file mode 100644 index 000000000..a0e0005f7 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamTeacherTime/Exam_ExamTeacherTimeService.cs @@ -0,0 +1,153 @@ +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-06-13 15:41 + /// 描 述:老师时间管理 + /// + public class Exam_ExamTeacherTimeService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@"t.* + "); + strSql.Append(" FROM Exam_ExamTeacherTime 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 "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取Exam_ExamTeacherTime表实体数据 + /// + /// 主键 + /// + public Exam_ExamTeacherTimeEntity GetExam_ExamTeacherTimeEntity(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.Id == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, Exam_ExamTeacherTimeEntity 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_InvigilateTeacher/Exam_InvigilateTeacherBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherBLL.cs index b2c9de1a0..96e333c8d 100644 --- 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 @@ -43,6 +43,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + public IEnumerable GetList(string AcademicYearNo, int? Semester) + { + try + { + return exam_InvigilateTeacherService.GetList(AcademicYearNo, Semester); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// /// 获取Exam_InvigilateTeacher表实体数据 /// 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 index 4f8b19d17..875f5211a 100644 --- 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 @@ -21,6 +21,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 查询参数 /// IEnumerable GetPageList(Pagination pagination, string queryJson); + IEnumerable GetList(string AcademicYearNo, int? Semester); /// /// 获取Exam_InvigilateTeacher表实体数据 /// 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 36508d456..a1b2a8942 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 @@ -104,6 +104,31 @@ select EPId from Exam_ExamPlanLesson where EPLId='{queryParam["EPLId"].ToString( } } + /// + /// + /// + /// + /// + /// + public IEnumerable GetList(string AcademicYearNo, int? Semester) + { + try + { + return this.BaseRepository("CollegeMIS").FindList(x => x.AcademicYearNo == AcademicYearNo && x.Semester == Semester); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// /// 获取Exam_InvigilateTeacher表实体数据 /// 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 0f8af682d..d907d81ba 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 @@ -1778,6 +1778,10 @@ + + + +