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 9c83633d3..b24ad9ee5 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 @@ -4,6 +4,7 @@ using Learun.Application.TwoDevelopment.EducationalAdministration; using System.Web.Mvc; using System.Collections.Generic; using System; +using System.Linq; namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { @@ -53,6 +54,18 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } + [HttpGet] + public ActionResult FormTeacher() + { + return View(); + } + + [HttpGet] + public ActionResult FormRoomTeacher() + { + return View(); + } + #endregion #region 获取数据 @@ -106,6 +119,19 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers }; return Success(jsonData); } + + [HttpGet] + [AjaxOnly] + public ActionResult GetFormRoom(string keyValue) + { + var data = exam_ExamPlanRoomIBLL.GetEntity(keyValue); + + var jsonData = new + { + Exam_ExamPlanRoom = data, + }; + return Success(jsonData); + } /// /// 获取表单数据 /// @@ -140,6 +166,14 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers var data = exam_ExamPlanLessonIBLL.GetTree(); return Success(data); } + [HttpGet] + [AjaxOnly] + public ActionResult ValidateRoom(string EPLId, string ClassroomNo) + { + var data = exam_ExamPlanRoomIBLL.ValidateRoom(EPLId, ClassroomNo); + return Success(data); + } + #endregion #region 提交数据 @@ -246,16 +280,28 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return Success("保存成功!"); } - [HttpPost] [ValidateAntiForgeryToken] [AjaxOnly] - public ActionResult SaveRoom(List list) + public ActionResult SaveRoomAndTeacher(string keyValue, string strEntity, string Exam_ExamPlanTeacherList) { - exam_ExamPlanRoomIBLL.SaveList(list); + var entity = strEntity.ToObject(); + var teacherList = Exam_ExamPlanTeacherList.ToObject>(); + entity.EmpNo = string.Join(",", teacherList.Select(x => x.EmpNo).ToList()); + entity.EmpName = string.Join(",", teacherList.Select(x => x.EmpName).ToList()); + exam_ExamPlanRoomIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); } + //[HttpPost] + //[ValidateAntiForgeryToken] + //[AjaxOnly] + //public ActionResult SaveRoom(List list) + //{ + // exam_ExamPlanRoomIBLL.SaveList(list); + // return Success("保存成功!"); + //} + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoom.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoom.js index ac8251a07..9b4ec8238 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoom.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoom.js @@ -54,10 +54,10 @@ var bootstrap = function ($, learun) { // } //}, ], - mainId: 'ClassId', + mainId: 'ERId', isPage: true, - isMultiselect: true, - + //isMultiselect: true, + }); page.search(); }, @@ -75,30 +75,32 @@ var bootstrap = function ($, learun) { // 保存数据 acceptClick = function (callBack) { var selectedRow = $('#gridtable').jfGridGet('rowdata'); - var list = []; - $.each(selectedRow, - function (i, item) { - var entity = { - ClassroomName: item.ClassroomName, - ClassroomNo: item.ClassroomNo, - SeatCount: item.SeatCount, - EPRId: learun.newGuid(), - EPLId: EPLId - } - list.push(entity); + learun.layerClose(window.name); + callBack(selectedRow); + //var list = []; + //$.each(selectedRow, + // function (i, item) { + // var entity = { + // ClassroomName: item.ClassroomName, + // ClassroomNo: item.ClassroomNo, + // SeatCount: item.SeatCount, + // EPRId: learun.newGuid(), + // EPLId: EPLId + // } + // list.push(entity); - }); - $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/SaveRoom?EPLId=' + EPLId, - { list: list }), function (res) { - // 保存成功后才回调 - if (!!callBack) { - callBack(); - } - }; - - if (!!callBack) { - callBack(); - } + // }); + //$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/SaveRoom?EPLId=' + EPLId, + // { list: list }), function (res) { + // // 保存成功后才回调 + // if (!!callBack) { + // callBack(); + // } + // }; + + //if (!!callBack) { + // callBack(); + //} }; page.init(); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.cshtml new file mode 100644 index 000000000..b4257ae8d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.cshtml @@ -0,0 +1,28 @@ +@{ + ViewBag.Title = "添加排考考场"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
考场名称*
+ + +
+
+
考场编号
+ +
+
+
考场座位数
+ +
+
+
监考老师
+ + +
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.js new file mode 100644 index 000000000..302f0a453 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.js @@ -0,0 +1,163 @@ + +//考试安排课程表Id +var EPLId = request('EPLId'); +var EPId = request('EPId'); +var keyValue = request('keyValue'); +var acceptClick; +// 设置表单数据 +var setFormData; +// 验证数据是否填写完整 +var validForm; +// 保存数据 +var save; +var refreshGirdData; +var refreshRoomData; +var selectedRow; +var tempdatra = new Array(); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + $("#detailadd").on('click', function () { + selectedRow = null; + learun.layerForm({ + id: 'formitem', + title: '新增明细', + url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/FormTeacher?EPLId=' + EPLId + '&EPRId=' + keyValue, + width: 860, + height: 600, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + $("#detaildel").on('click', function () { + var keyValue = $('#Exam_ExamPlanTeacher').jfGridValue('EmpNo'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res, index) { + if (res) { + $.each(tempdatra, function (key, val) { + if (!!val && val.EmpNo === keyValue) { + tempdatra.splice(key, 1); + } + }); + $('#Exam_ExamPlanTeacher').jfGridSet('refreshdata', tempdatra); + top.layer.close(index); + } + }); + } + }); + page.bind(); + page.initData(); + }, + bind: function () { + $("#selectRoom").on('click', function () { + selectedRow = null; + learun.layerForm({ + id: 'formroom1', + title: '新增考场', + url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/FormRoom?EPLId=' + EPLId, + width: 850, + height: 500, + callBack: function (id) { + return top[id].acceptClick(refreshRoomData); + } + }); + }); + + $('#Exam_ExamPlanTeacher').jfGrid({ + headData: [ + { + label: '编号', name: 'EmpNo', width: 150, align: 'left' + }, + { + label: '姓名', name: 'EmpName', width: 150, align: 'left' + } + ], + height: 400, + mainId: 'AAIId', + reloadSelected: false, + }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm( + top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/GetFormRoom?keyValue=' + keyValue, + function (data) { + tempdatra = []; + for (var id in data) { + if (!!data[id].length && data[id].length > 0) { + $('#' + id).jfGridSet('refreshdata', data[id]); + + } else { + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + var empnoArr = data[id].EmpNo.split(','); + var empnameArr = data[id].EmpName.split(','); + $.each(empnoArr, function (i, val) { + tempdatra.push({ EmpNo: val, EmpName: empnameArr[i] }); + }); + $('#Exam_ExamPlanTeacher').jfGridSet('refreshdata', tempdatra); + } + } + }); + } + } + }; + refreshGirdData = function (temprow) { + //console.log('temprow', temprow); + //求数组并集 + //两数组连接(包括重复值) + var arr3 = tempdatra.concat(temprow); + //var result = []; + var obj = []; + //去重 + tempdatra = arr3.reduce(function (prev, cur, index, arr) { + //console.log(prev, cur); + obj[cur.EmpNo] ? '' : obj[cur.EmpNo] = true && prev.push(cur); + return prev; + }, []); + $('#Exam_ExamPlanTeacher').jfGridSet('refreshdata', tempdatra); + }; + refreshRoomData = function (temprow) { + // console.log('teacherRow', temprow); + learun.httpAsyncGet(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/ValidateRoom?EPLId=' + EPLId + '&ClassroomNo=' + temprow.ClassroomNo, function (res) { + + if (res.data == true) { + return learun.alert.warning("考场不可重复选择!"); + } else { + $("#ClassroomName").val(temprow.ClassroomName); + $('#ClassroomNo').val(temprow.ClassroomNo); + $('#SeatCount').val(temprow.SeatCount); + } + }); + }; + // 验证数据是否填写完整 + validForm = function () { + if (!$('.lr-form-wrap').lrValidform()) { + return false; + } + var datas = $('#Exam_ExamPlanTeacher').jfGridGet('rowdatas'); + if (datas == null || datas.length == 0) { + learun.alert.warning("请先新增监考老师!"); + return false; + } + return true; + }; + // 保存数据 + acceptClick = function (callBack, i) { + var postData = {}; + var formData = $('[data-table="Exam_ExamPlanRoom"]').lrGetFormData(); + formData.EPLId = EPLId; + postData.strEntity = JSON.stringify(formData); + postData.Exam_ExamPlanTeacherList = JSON.stringify($('#Exam_ExamPlanTeacher').jfGridGet('rowdatas')); + + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/SaveRoomAndTeacher?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(res, formData, i); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormTeacher.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormTeacher.cshtml new file mode 100644 index 000000000..7800bb401 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormTeacher.cshtml @@ -0,0 +1,44 @@ +@{ + ViewBag.Title = "添加排考监考老师"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
学年
+
+
+
+
学期
+
+
+
+
教师编号
+ +
+
+
教师姓名
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormTeacher.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormTeacher.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormTeacher.js new file mode 100644 index 000000000..93d2ea740 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormTeacher.js @@ -0,0 +1,105 @@ + +var refreshGirdData; +var acceptClick; +//考试安排课程表Id +var EPLId = request('EPLId'); +//安排考场表Id +var EPRId = request('EPRId'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + $('#AcademicYearNo').lrselect({ + placeholder: "学年", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo', + value: 'value', + text: 'text' + }); + //学期 + $('#Semester').lrselect({ + placeholder: "学期", + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', + value: 'value', + text: 'text' + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/Exam_InvigilateTeacher/GetPageList', + headData: [ + { label: "学年", name: "AcademicYearNo", width: 100, align: "left" }, + { label: "学期", name: "Semester", width: 100, align: "left" }, + { label: "教师编号", name: "EmpNo", width: 100, align: "left" }, + { label: "教师姓名", name: "EmpName", width: 100, align: "left" }, + { + label: "是否启用", name: "ITEnabled", width: 100, align: "left", + formatter: function (cellvalue) { + return cellvalue == 1 ? "" : ""; + } + }, + ], + mainId: 'ITId', + isPage: true, + isMultiselect: true, + }); + page.search(); + }, + search: function (param) { + param = param || {}; + //考试安排课程表Id + param.EPLId = EPLId; + //安排考场表Id + param.EPRId = EPRId; + param.SqlParameter = " and t.ITEnabled=1"; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + page.search(); + }; + // 保存数据 + acceptClick = function (callBack) { + var selectedRow = $('#gridtable').jfGridGet('rowdata'); + learun.layerClose(window.name); + callBack(selectedRow); + //var list = []; + //$.each(selectedRow, + // function (i, item) { + // var entity = { + // ClassroomName: item.ClassroomName, + // ClassroomNo: item.ClassroomNo, + // SeatCount: item.SeatCount, + // EPRId: learun.newGuid(), + // EPLId: EPLId + // } + // list.push(entity); + + // }); + //$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/SaveRoom?EPLId=' + EPLId, + // { list: list }), function (res) { + // // 保存成功后才回调 + // if (!!callBack) { + // callBack(); + // } + // }; + + //if (!!callBack) { + // callBack(); + //} + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Index.cshtml index 3a9ba3fc7..8d6d102b6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Index.cshtml @@ -70,6 +70,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 71a6b8002..44a579921 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Index.js @@ -127,13 +127,12 @@ var bootstrap = function ($, learun) { return learun.alert.warning("该项已审核!"); } learun.layerForm({ - id: 'formroom', + id: 'formteacherRoom', title: '新增考场', - url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/FormRoom?EPLId=' + EPLId + '&EPId=' + EPId, + url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/FormRoomTeacher?EPLId=' + EPLId + '&EPId=' + EPId, width: 850, height: 500, callBack: function (id) { - console.log('新增考场back'); return top[id].acceptClick(refreshGirdData); } }); @@ -141,6 +140,30 @@ var bootstrap = function ($, learun) { return learun.alert.warning("请选择考试课程!"); } }); + + //考场 编辑 + $('#lr_edit_Room').on('click', function () { + if (!!EPLId) { + if (ELCheckMark == 1) { + return learun.alert.warning("该项已审核!"); + } + var keyValue = $('#gridtable_Room').jfGridValue('EPRId'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'formteacherRoom', + title: '编辑考场', + url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/FormRoomTeacher?EPLId=' + EPLId + '&EPId=' + EPId + '&keyValue=' + keyValue, + width: 850, + height: 500, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + } else { + return learun.alert.warning("请选择考试课程!"); + } + }); // 考场删除 $('#lr_delete_Room').on('click', function () { var keyValue = $('#gridtable_Room').jfGridValue('EPRId'); 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 1d93ef5e8..1dd3703a3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -996,6 +996,8 @@ + + @@ -7655,6 +7657,8 @@ + + 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 0b80e27a3..b6afaf0d3 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 @@ -85,8 +85,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - + public bool ValidateRoom(string EPLId, string ClassroomNo) + { + try + { + return exam_ExamPlanRoomService.ValidateRoom(EPLId, ClassroomNo); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } #endregion #region 提交数据 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 ac9dac88c..21f15eed4 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 @@ -29,7 +29,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 主键 /// Exam_ExamPlanRoomEntity GetEntity(string keyValue); - + + bool ValidateRoom(string EPLId, string ClassroomNo); #endregion #region 提交数据 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 6994057dd..c68fc3fc4 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 @@ -124,7 +124,24 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } - + public bool ValidateRoom(string EPLId, string ClassroomNo) + { + try + { + return this.BaseRepository("CollegeMIS").FindList(x => x.EPLId == EPLId && x.ClassroomNo == ClassroomNo).Count() > 0 ? true : false; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion #region 提交数据 @@ -141,9 +158,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration if (keyValue.Contains(",")) { entity = this.BaseRepository("CollegeMIS").FindEntity((keyValue.Split(','))[0]); - + keyValue = string.Join("','", keyValue.Split(',')); - } + } else { entity = this.BaseRepository("CollegeMIS").FindEntity(keyValue); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherService.cs index 38c8c5eb1..d0fb8287d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherService.cs @@ -4,6 +4,7 @@ using Learun.Util; using System; using System.Collections.Generic; using System.Data; +using System.Linq; using System.Text; namespace Learun.Application.TwoDevelopment.EducationalAdministration @@ -59,6 +60,34 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("EmpName", "%" + queryParam["EmpName"].ToString() + "%", DbType.String); strSql.Append(" AND t.EmpName Like @EmpName "); } + if (!queryParam["EPLId"].IsEmpty()) + { + //排考安排课程表Id + var ELEntity = this.BaseRepository("CollegeMIS").FindList($@"select * from Exam_ExamPlan where EPId=( +select EPId from Exam_ExamPlanLesson where EPLId='{queryParam["EPLId"].ToString()}')").FirstOrDefault(); + if (ELEntity != null) + { + strSql.Append($" AND t.AcademicYearNo = '{ELEntity.AcademicYearNo}' "); + strSql.Append($" AND t.Semester = '{ELEntity.Semester}' "); + } + + var empSql = $"select EmpNo from Exam_ExamPlanRoom where EPLId='{queryParam["EPLId"].ToString()}'"; + if (!queryParam["EPRId"].IsEmpty()) + { + empSql += $" and EPRId<>'{queryParam["EPRId"].ToString()}'"; + } + + var obj = this.BaseRepository("CollegeMIS").FindObject(empSql); + if (obj != null) + { + var empNo = string.Join("','", obj.ToString().Split(',')); + strSql.Append($" AND t.EmpNo not in ('{empNo}')"); + } + } + if (!queryParam["SqlParameter"].IsEmpty()) + { + strSql.Append(queryParam["SqlParameter"].ToString()); + } return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex)