From 7ce14e3886e229f64790c7316708f888f9a0509a Mon Sep 17 00:00:00 2001 From: ndbs Date: Tue, 4 Apr 2023 16:55:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E5=8A=A1=E7=AE=A1=E7=90=86-=E6=8E=92?= =?UTF-8?q?=E8=80=83=E6=98=8E=E7=BB=86-=E5=BA=A7=E4=BD=8D=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_ArrangeExamTermNewController.cs | 50 ++++++- .../Exam_ArrangeExamTermNew/IndexItem.cshtml | 9 +- .../Exam_ArrangeExamTermNew/IndexItem.js | 138 +++++++++++++++--- .../Learun.Application.Web.csproj | 2 + .../Exam_ArrangeExamTermNewBLL.cs | 57 ++++++++ .../Exam_ArrangeExamTermNewIBLL.cs | 3 + .../Exam_ArrangeExamTermNewService.cs | 65 ++++++++- 7 files changed, 291 insertions(+), 33 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ArrangeExamTermNewController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ArrangeExamTermNewController.cs index 23d942e08..1f7b1ecce 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ArrangeExamTermNewController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ArrangeExamTermNewController.cs @@ -16,6 +16,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public class Exam_ArrangeExamTermNewController : MvcControllerBase { private Exam_ArrangeExamTermNewIBLL exam_ArrangeExamTermNewIBLL = new Exam_ArrangeExamTermNewBLL(); + private Exam_ExamRoomIBLL exam_ExamRoomIBLL = new Exam_ExamRoomBLL(); #region 视图功能 @@ -26,7 +27,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult Index() { - return View(); + return View(); } /// /// 表单页 @@ -35,7 +36,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult Form() { - return View(); + return View(); } /// /// 表单页 @@ -51,6 +52,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } + + /// + /// 表单页 + /// + /// + public ActionResult SeatForm() + { + return View(); + } #endregion #region 获取数据 @@ -69,14 +79,23 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers }; return Success(jsonData); } - + [HttpGet] public ActionResult GetClassTree() { return Success(exam_ArrangeExamTermNewIBLL.GetClassTree()); } + /// + /// 考场数据 + /// + /// [HttpGet] [AjaxOnly] + public ActionResult GetClassRoomTree(string AcademicYearNo, string Semester) + { + return Success(exam_ArrangeExamTermNewIBLL.GetClassRoomTree(AcademicYearNo, Semester)); + } + [HttpGet] public ActionResult GetItemPageList(string pagination, string queryJson) { Pagination paginationobj = pagination.ToObject(); @@ -120,12 +139,31 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [AjaxOnly] public ActionResult GetFormData(string keyValue) { - var ArrangeExamTermNewData = exam_ArrangeExamTermNewIBLL.GetExam_ArrangeExamTermNewEntity( keyValue ); - var jsonData = new { + var ArrangeExamTermNewData = exam_ArrangeExamTermNewIBLL.GetExam_ArrangeExamTermNewEntity(keyValue); + var jsonData = new + { ArrangeExamTermNew = ArrangeExamTermNewData, }; return Success(jsonData); } + + /// + /// + /// + /// + /// + /// + /// + public ActionResult GetSeatData(string ClassRoomNo, string AcademicYearNo, int? Semester) + { + return Success(exam_ExamRoomIBLL.GetEntityByClassroomNo(ClassRoomNo, AcademicYearNo, Semester)); + } + + public ActionResult GetSeatStuList(string ClassRoomNo, string AcademicYearNo, int? Semester) + { + var data = exam_ArrangeExamTermNewIBLL.GetStuList(AcademicYearNo, Semester, ClassRoomNo); + return Success(data); + } #endregion #region 提交数据 @@ -154,7 +192,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult SaveForm(string keyValue, string strEntity) { Exam_ArrangeExamTermNewEntity entity = strEntity.ToObject(); - exam_ArrangeExamTermNewIBLL.SaveEntity(keyValue,entity); + exam_ArrangeExamTermNewIBLL.SaveEntity(keyValue, entity); if (string.IsNullOrEmpty(keyValue)) { } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexItem.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexItem.cshtml index 133107ba9..afbcc92bf 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexItem.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexItem.cshtml @@ -5,14 +5,14 @@
-
班级信息
+
考场信息
- 班级信息 + 考场信息
@@ -25,9 +25,9 @@
-
+ @*
-
+
*@
@@ -41,6 +41,7 @@
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexItem.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexItem.js index 2507f5f7c..f29e9513d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexItem.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexItem.js @@ -11,7 +11,9 @@ var bootstrap = function ($, learun) { "use strict"; var datebegin = ''; var dateend = ''; - var ClassNo = ''; + //var ClassNo = ''; + var ClassRoomNo = ''; + var page = { init: function () { page.initGird(); @@ -20,10 +22,11 @@ var bootstrap = function ($, learun) { bind: function () { // 初始化左侧树形数据 $('#dataTree').lrtree({ - url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/GetClassTree', + url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/GetClassRoomTree', nodeClick: function (item) { - ClassNo = item.id; - page.search({ ClassNo: item.id }); + ClassRoomNo = item.id; + page.search({ ClassRoomNo: item.id, AcademicYearNo: $('#AcademicYearNo').lrselectGet(), Semester: $('#Semester').lrselectGet(), LessonNo: $('#LessonNo').lrselectGet(), EmpNo: $('#EmpNo').lrselectGet() }); + $('#titleinfo').html(item.text); } }); $('.datetime').each(function () { @@ -56,7 +59,7 @@ var bootstrap = function ($, learun) { }); // 查询 $('#btn_Search').on('click', function () { - page.search({ ClassNo: ClassNo, AcademicYearNo: $('#AcademicYearNo').lrselectGet(), Semester: $('#Semester').lrselectGet(), LessonNo: $('#LessonNo').lrselectGet(), ClassRoomNo: $('#ClassRoomNo').lrselectGet(), EmpNo: $('#EmpNo').lrselectGet() }); + page.search({ ClassRoomNo: ClassRoomNo, AcademicYearNo: $('#AcademicYearNo').lrselectGet(), Semester: $('#Semester').lrselectGet(), LessonNo: $('#LessonNo').lrselectGet(), EmpNo: $('#EmpNo').lrselectGet() }); }); // 刷新 $('#lr_refresh').on('click', function () { @@ -78,30 +81,121 @@ var bootstrap = function ($, learun) { value: 'value', text: 'text' }); - //课程 - //$('#LessonNo').lrselect({ - // placeholder: "请选择课程", - // allowSearch: true, - // url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetLessonNoDataOfAllWithNo', - // value: 'value', - // text: 'text' - //}); + + $('#AcademicYearNo').bind('change', function () { + var AcademicYearNo = ''; + var Semester = ''; + if ($('#AcademicYearNo').lrselectGet()) { + AcademicYearNo = $('#AcademicYearNo').lrselectGet() + } + if ($('#Semester').lrselectGet()) { + var Semester = $('#Semester').lrselectGet(); + } + if (Semester != '' && AcademicYearNo != '') { + $('#dataTree').lrtree({ + url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/GetClassRoomTree?AcademicYearNo = ' + AcademicYearNo + ' &Semester=' + Semester, + nodeClick: function (item) { + ClassRoomNo = item.value; + page.search({ ClassRoomNo: item.value, AcademicYearNo: $('#AcademicYearNo').lrselectGet(), Semester: $('#Semester').lrselectGet(), LessonNo: $('#LessonNo').lrselectGet(), EmpNo: $('#EmpNo').lrselectGet() }); + } + }); + } + }); + $('#Semester').bind('change', function () { + var AcademicYearNo = ''; + var Semester = ''; + if ($('#AcademicYearNo').lrselectGet()) { + AcademicYearNo = $('#AcademicYearNo').lrselectGet() + } + if ($('#Semester').lrselectGet()) { + var Semester = $('#Semester').lrselectGet(); + } + if (Semester != '' && AcademicYearNo != '') { + $('#dataTree').lrtree({ + url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/GetClassRoomTree?AcademicYearNo = ' + AcademicYearNo + ' &Semester=' + Semester, + nodeClick: function (item) { + ClassRoomNo = item.value; + page.search({ ClassRoomNo: item.value, AcademicYearNo: $('#AcademicYearNo').lrselectGet(), Semester: $('#Semester').lrselectGet(), LessonNo: $('#LessonNo').lrselectGet(), EmpNo: $('#EmpNo').lrselectGet() }); + } + }); + } + }); + $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname', placeholder: '请选择课程' }); $('#ClassRoomNo').lrDataSourceSelect({ code: 'ClassRoomInfo', value: 'classroomno', text: 'classroomname', placeholder: '请选择教室' }); $('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname', placeholder: '请选择教师' }); + $('#lr_view').on('click', function () { + var AcademicYearNo = ''; + var Semester = ''; + if (!ClassRoomNo) { + learun.alert.warning("请选择考场"); + return; + } + if ($('#AcademicYearNo').lrselectGet()) { + AcademicYearNo = '22-23'//$('#AcademicYearNo').lrselectGet(); + + } + if ($('#Semester').lrselectGet()) { + Semester = '2'//$('#Semester').lrselectGet(); + } + + ////弹框文件名字SeatForm + + if (Semester != '' && AcademicYearNo != '') { + ///学生数据 + //$.ajax({ + // url: '/EducationalAdministration/Exam_ArrangeExamTermNew/GetSeatStuList', + // data: { ClassRoomNo: ClassRoomNo, AcademicYearNo: AcademicYearNo, Semester, Semester }, + // type: "Post", + // dataType: "json", + // async: true, + // cache: false, + // success: function (data) { + // console.log(data) + // }, + // error: function (XMLHttpRequest, textStatus, errorThrown) { + // }, + // beforeSend: function () { + // }, + // complete: function () { + // } + //}); + //座位数据 + // + //$.ajax({ + // url: '/EducationalAdministration/Exam_ArrangeExamTermNew/GetSeatData', + // data: { ClassRoomNo: ClassRoomNo, AcademicYearNo: AcademicYearNo, Semester, Semester }, + // type: "Post", + // dataType: "json", + // async: true, + // cache: false, + // success: function (data) { + //console.log(data1) + + // }, + // error: function (XMLHttpRequest, textStatus, errorThrown) { + // }, + // beforeSend: function () { + // }, + // complete: function () { + // } + //}); + } + + }); }, initGird: function () { $('#gridtable').jfGrid({ url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/GetItemPageList', headData: [ - { label: '学年', name: 'AcademicYearNo', width: 70, align: "left" }, - { label: '学期', name: 'Semester', width: 60, align: "left" }, + { label: '学年', name: 'AcademicYearNo', width: 60, align: "left" }, + { label: '学期', name: 'Semester', width: 45, align: "left" }, { - label: '考试日期', name: 'ExamDate', width: 100, align: "left", formatter: function (v) { + label: '考试日期', name: 'ExamDate', width: 90, align: "left", formatter: function (v) { return learun.formatDate(v, "yyyy-MM-dd"); } }, - { label: '考试时间', name: 'ExamTime', width: 120, align: "left" }, + { label: '考试时间', name: 'ExamTime', width: 90, align: "left" }, { label: '课程编号', name: 'LessonNo', width: 100, align: "left" }, { label: '课程名称', name: 'LessonName', width: 200, align: "left" }, { label: '监考教师编号', name: 'EmpNo', width: 150, align: "left" }, @@ -109,12 +203,12 @@ var bootstrap = function ($, learun) { { label: '教室编号', name: 'ClassroomNo', width: 100, align: "left" }, { label: '教室名称', name: 'ClassroomName', width: 100, align: "left" }, { label: '班级名称', name: 'ClassName', width: 100, align: "left" }, - { label: '学生编号', name: 'StuNo', width: 100, align: "left" }, - { label: '学生姓名', name: 'StuName', width: 200, align: "left" }, - { label: '座位编号', name: 'SitNumber', width: 100, aligndd: "left" } + { label: '学生编号', name: 'StuNo', width: 130, align: "left" }, + { label: '学生姓名', name: 'StuName', width: 100, align: "left" }, + { label: '座位编号', name: 'SitNumber', width: 80, aligndd: "left" } ], mainId: 'AETId', - sidx: 'ExamDate asc, LessonNo asc,ClassRoomNo asc,ClassNo asc,SitNumber asc', + sidx: ' AcademicYearNo desc,Semester desc,ExamDate desc, LessonNo desc,ClassRoomNo desc,ClassRoomNo desc,SitNumber asc ', isPage: true }); page.search(); @@ -123,7 +217,7 @@ var bootstrap = function ($, learun) { param = param || {}; param.StartTime = datebegin; param.EndTime = dateend; - console.log(param); + param.ClassRoomNo = ClassRoomNo; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; 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 a6dead558..b71708db4 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 @@ -1092,6 +1092,7 @@ + @@ -1336,6 +1337,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewBLL.cs index 9d6e2717c..d791bdfb2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewBLL.cs @@ -53,6 +53,44 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 考场 + /// + /// + public List GetClassRoomTree(string AcademicYearNo, string Semester) + { + try + { + var list = exam_ArrangeExamTermNewService.GetClassRoomTree(AcademicYearNo, Semester); + List treeList = new List(); + foreach (var item in list) + { + TreeModel node = new TreeModel + { + id = item.ClassroomNo, + text = item.ClassroomName, + value = item.ClassroomNo, + showcheck = false, + checkstate = 0, + isexpand = true, + parentId = "0" + }; + treeList.Add(node); + } + return treeList.ToTree(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } public IEnumerable GetPageListForClass(Pagination pagination, string queryJson) { try @@ -91,6 +129,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + public IEnumerable GetStuList(string AcademicYearNo, int? Semester, string ClassRoomNo) + { + try + { + return exam_ArrangeExamTermNewService.GetStuList(AcademicYearNo, Semester, ClassRoomNo); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// /// 获取页面显示列表数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewIBLL.cs index 1253fa375..c920e8155 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewIBLL.cs @@ -16,8 +16,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #region 获取数据 List GetClassTree(); + List GetClassRoomTree(string AcademicYearNo, string Semester); IEnumerable GetPageListForClass(Pagination pagination, string queryJson); IEnumerable GetItemPageList(Pagination pagination, string queryJson); + + IEnumerable GetStuList(string AcademicYearNo, int? Semester, string ClassRoomNo); /// /// 获取页面显示列表数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewService.cs index 4e2a5049d..f3ff59986 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewService.cs @@ -37,7 +37,43 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - + + /// + /// 考场数据去重 + /// + /// + public IEnumerable GetClassRoomTree(string AcademicYearNo, string Semester) + { + try + { + + var sql = @" select e.ClassroomNo,e.ClassroomName from Exam_ArrangeExamTermItemNew e join ( + select ClassroomNo, ClassroomName from Exam_ExamRoom where 1 = 1 "; + if (!AcademicYearNo.IsEmpty()) + { + sql += $" and AcademicYearNo ='{AcademicYearNo}' "; + } + if (!Semester.IsEmpty()) + { + sql += $" and Semester ={Semester} "; + } + sql += @" ) a on e.ClassroomName=a.ClassroomName and e.ClassroomNo =a.ClassroomNo + group by e.ClassroomNo,e.ClassroomName"; + return this.BaseRepository("CollegeMIS").FindList(sql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + public IEnumerable GetPageListForClass(Pagination pagination, string queryJson) { try @@ -280,6 +316,33 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 获取排考详情 + /// + /// + /// + /// + public IEnumerable GetStuList(string AcademicYearNo, int? Semester, string ClassRoomNo) + { + try + { + var strSql = new StringBuilder(); + strSql.Append(@"select t.*,e.AcademicYearNo,e.Semester from Exam_ArrangeExamTermItemNew t join Exam_ExamPlan e on t.EPId=e.EPId where 1=1 and t.ClassNo is not null + and e.AcademicYearNo ='" + AcademicYearNo + "' and e.Semester='" + Semester + "' and Classroomno= '" + ClassRoomNo + "' "); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion #region 提交数据