From eee893c9eb82c619699bbdc7cdcf0d2f668fd053 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Tue, 26 Apr 2022 18:21:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=92=E8=80=83=E6=B1=87=E6=80=BB=E3=80=81?= =?UTF-8?q?=E6=8E=92=E8=80=83=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Exam_ArrangeExamTermNewController.cs | 50 +++++- .../IndexForClass.cshtml | 51 ++++++ .../Exam_ArrangeExamTermNew/IndexForClass.js | 132 +++++++++++++++ .../Exam_ArrangeExamTermNew/IndexItem.cshtml | 51 ++++++ .../Exam_ArrangeExamTermNew/IndexItem.js | 134 +++++++++++++++ .../Learun.Application.Web.csproj | 4 + .../Exam_ArrangeExamTermItemNewEntity.cs | 19 +++ .../Exam_ArrangeExamTermNewBLL.cs | 73 +++++++++ .../Exam_ArrangeExamTermNewIBLL.cs | 3 + .../Exam_ArrangeExamTermNewService.cs | 155 +++++++++++++++++- .../Exam_ExamPlan/Exam_ExamPlanService.cs | 8 +- 11 files changed, 675 insertions(+), 5 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexForClass.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexForClass.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexItem.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexItem.js 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 cc1b13b0e..dc56adc00 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 @@ -37,10 +37,58 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult IndexForClass() + { + return View(); + } + [HttpGet] + public ActionResult IndexItem() + { + return View(); + } #endregion #region 获取数据 - + [HttpGet] + [AjaxOnly] + public ActionResult GetPageListForClass(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = exam_ArrangeExamTermNewIBLL.GetPageListForClass(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + [HttpGet] + public ActionResult GetClassTree() + { + return Success(exam_ArrangeExamTermNewIBLL.GetClassTree()); + } + [HttpGet] + [AjaxOnly] + public ActionResult GetItemPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = exam_ArrangeExamTermNewIBLL.GetItemPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } /// /// 获取页面显示列表数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexForClass.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexForClass.cshtml new file mode 100644 index 000000000..140f63d8f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexForClass.cshtml @@ -0,0 +1,51 @@ +@{ + ViewBag.Title = "排考2021新"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
班级信息
+
+
+
+
+
+
+ 班级信息 +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  查询 +
+
+
+
+ +
+
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexForClass.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexForClass.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexForClass.js new file mode 100644 index 000000000..bdfac26da --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexForClass.js @@ -0,0 +1,132 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-12-08 12:19 + * 描 述:排考2021新 + */ +var selectedRow; +var refreshGirdData; + +var bootstrap = function ($, learun) { + "use strict"; + var datebegin = ''; + var dateend = ''; + var ClassNo = ''; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + // 初始化左侧树形数据 + $('#dataTree').lrtree({ + url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/GetClassTree', + nodeClick: function (item) { + ClassNo = item.id; + page.search({ ClassNo: item.id }); + } + }); + $('.datetime').each(function () { + $(this).lrdate({ + dfdata: [ + { name: '清空', begin: function () { return '' }, end: function () { return '' } }, + { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + ], + // 月 + mShow: false, + premShow: false, + // 季度 + jShow: false, + prejShow: false, + // 年 + ysShow: false, + yxShow: false, + preyShow: false, + yShow: false, + // 默认 + dfvalue: '0', + selectfn: function (begin, end) { + datebegin = begin; + dateend = end; + } + }); + }); + // 查询 + $('#btn_Search').on('click', function () { + page.search({ ClassNo: ClassNo, AcademicYearNo: $('#AcademicYearNo').lrselectGet(), Semester: $('#Semester').lrselectGet(), LessonNo: $('#LessonNo').lrselectGet(), ClassRoomNo: $('#ClassRoomNo').lrselectGet(), EmpNo: $('#EmpNo').lrselectGet() }); + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + + $('#AcademicYearNo').lrselect({ + placeholder: "学年", + allowSearch: false, + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo', + value: 'value', + text: 'text' + }); + //学期 + $('#Semester').lrselect({ + placeholder: "学期", + allowSearch: false, + url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetSemesterData', + value: 'value', + text: 'text' + }); + //课程 + //$('#LessonNo').lrselect({ + // placeholder: "请选择课程", + // allowSearch: true, + // url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetLessonNoDataOfAllWithNo', + // value: 'value', + // text: 'text' + //}); + $('#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: '请选择教师' }); + }, + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/GetPageListForClass', + headData: [ + { label: '学年', name: 'AcademicYearNo', width: 70, align: "left" }, + { label: '学期', name: 'Semester', width: 60, align: "left" }, + { label: '考试日期', name: 'ExamDate', width: 100, align: "left", formatter: function (v) { + return learun.formatDate(v, "yyyy-MM-dd"); + } }, + { label: '考试时间', name: 'ExamTime', width: 120, align: "left" }, + { label: '课程编号', name: 'LessonNo', width: 100, align: "left" }, + { label: '课程名称', name: 'LessonName', width: 200, align: "left" }, + { label: '监考教师编号', name: 'EmpNo', width: 150, align: "left" }, + { label: '监考教师姓名', name: 'EmpName', width: 150, align: "left" }, + { label: '教室编号', name: 'ClassroomNo', width: 100, align: "left" }, + { label: '教室名称', name: 'ClassroomName', width: 100, align: "left" }, + { label: '班级名称', name: 'ClassName', width: 100, align: "left" }, + { label: '班级人数', name: 'ClassStuNum', width: 60, align: "left" }, + { label: '学号范围', name: 'StuNoRange', width: 200, align: "left" } + ], + mainId: 'AETId', + sidx: 'examdate,examtime,lessonno,classroomname ', + sord:'asc', + isPage: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.StartTime = datebegin; + param.EndTime = dateend; + //console.log(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/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexItem.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexItem.cshtml new file mode 100644 index 000000000..133107ba9 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexItem.cshtml @@ -0,0 +1,51 @@ +@{ + ViewBag.Title = "排考2021新"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
班级信息
+
+
+
+
+
+
+ 班级信息 +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  查询 +
+
+
+
+ +
+
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexItem.js") 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 new file mode 100644 index 000000000..2507f5f7c --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexItem.js @@ -0,0 +1,134 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-12-08 12:19 + * 描 述:排考2021新 + */ +var selectedRow; +var refreshGirdData; + +var bootstrap = function ($, learun) { + "use strict"; + var datebegin = ''; + var dateend = ''; + var ClassNo = ''; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + // 初始化左侧树形数据 + $('#dataTree').lrtree({ + url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/GetClassTree', + nodeClick: function (item) { + ClassNo = item.id; + page.search({ ClassNo: item.id }); + } + }); + $('.datetime').each(function () { + $(this).lrdate({ + dfdata: [ + { name: '清空', begin: function () { return '' }, end: function () { return '' } }, + { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + ], + // 月 + mShow: false, + premShow: false, + // 季度 + jShow: false, + prejShow: false, + // 年 + ysShow: false, + yxShow: false, + preyShow: false, + yShow: false, + // 默认 + dfvalue: '0', + selectfn: function (begin, end) { + datebegin = begin; + dateend = end; + } + }); + }); + // 查询 + $('#btn_Search').on('click', function () { + page.search({ ClassNo: ClassNo, AcademicYearNo: $('#AcademicYearNo').lrselectGet(), Semester: $('#Semester').lrselectGet(), LessonNo: $('#LessonNo').lrselectGet(), ClassRoomNo: $('#ClassRoomNo').lrselectGet(), EmpNo: $('#EmpNo').lrselectGet() }); + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + + $('#AcademicYearNo').lrselect({ + placeholder: "学年", + allowSearch: false, + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo', + value: 'value', + text: 'text' + }); + //学期 + $('#Semester').lrselect({ + placeholder: "学期", + allowSearch: false, + url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetSemesterData', + value: 'value', + text: 'text' + }); + //课程 + //$('#LessonNo').lrselect({ + // placeholder: "请选择课程", + // allowSearch: true, + // url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetLessonNoDataOfAllWithNo', + // value: 'value', + // text: 'text' + //}); + $('#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: '请选择教师' }); + }, + 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: 'ExamDate', width: 100, align: "left", formatter: function (v) { + return learun.formatDate(v, "yyyy-MM-dd"); + } + }, + { label: '考试时间', name: 'ExamTime', width: 120, align: "left" }, + { label: '课程编号', name: 'LessonNo', width: 100, align: "left" }, + { label: '课程名称', name: 'LessonName', width: 200, align: "left" }, + { label: '监考教师编号', name: 'EmpNo', width: 150, align: "left" }, + { label: '监考教师姓名', name: 'EmpName', width: 150, align: "left" }, + { 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" } + ], + mainId: 'AETId', + sidx: 'ExamDate asc, LessonNo asc,ClassRoomNo asc,ClassNo asc,SitNumber asc', + isPage: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.StartTime = datebegin; + param.EndTime = dateend; + console.log(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 aae5037e7..1efd44821 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 @@ -1001,6 +1001,8 @@ + + @@ -7699,6 +7701,8 @@ + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermItemNew/Exam_ArrangeExamTermItemNewEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermItemNew/Exam_ArrangeExamTermItemNewEntity.cs index 2328c5c1d..4bfbe9aa4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermItemNew/Exam_ArrangeExamTermItemNewEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermItemNew/Exam_ArrangeExamTermItemNewEntity.cs @@ -65,6 +65,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration [Column("CLASSROOMNO")] public string ClassroomNo { get; set; } /// + /// 班级 + /// + [Column("CLASSNAME")] + public string ClassName { get; set; } + /// + /// 班级 + /// + [Column("CLASSNO")] + public string ClassNo { get; set; } + /// /// 校区Id /// [Column("F_SCHOOLID")] @@ -104,6 +114,15 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } #endregion #region 扩展字段 + [NotMapped] + public int ClassStuNum { get; set; } + [NotMapped] + public string StuNoRange { get; set; } + [NotMapped] + public string AcademicYearNo { get; set; } + [NotMapped] + public string Semester { get; set; } + #endregion } } 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 a87fd1f80..9d6e2717c 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 @@ -18,6 +18,79 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #region 获取数据 + public List GetClassTree() + { + try + { + var list = exam_ArrangeExamTermNewService.GetClassTree(); + List treeList = new List(); + foreach (var item in list) + { + TreeModel node = new TreeModel + { + id = item.ClassNo, + text = item.ClassName, + value = item.ClassNo, + 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 + { + return exam_ArrangeExamTermNewService.GetPageListForClass(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + + public IEnumerable GetItemPageList(Pagination pagination, string queryJson) + { + try + { + return exam_ArrangeExamTermNewService.GetItemPageList(pagination, queryJson); + } + 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 2e82623eb..1253fa375 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 @@ -15,6 +15,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { #region 获取数据 + List GetClassTree(); + IEnumerable GetPageListForClass(Pagination pagination, string queryJson); + IEnumerable GetItemPageList(Pagination pagination, string queryJson); /// /// 获取页面显示列表数据 /// 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 42cfa9323..21ac3b223 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 @@ -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 @@ -18,6 +19,154 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration public class Exam_ArrangeExamTermNewService : RepositoryFactory { #region 获取数据 + public IEnumerable GetClassTree() + { + try + { + return this.BaseRepository("CollegeMIS").FindList("select ClassNo,ClassName from Exam_ArrangeExamTermItemNew where ClassNo is not null group by ClassNo,ClassName order by ClassNo"); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + public IEnumerable GetPageListForClass(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append(@"select t.EPId,AcademicYearNo, Semester, ExamDate, ExamTime, LessonNo, LessonName,ClassRoomNo,ClassRoomName,EmpNo, EmpName, ClassNo,ClassName, count(StuNo) as ClassStuNum + from [dbo].[Exam_ArrangeExamTermItemNew] t join Exam_ExamPlan e on t.EPId=e.EPId where 1=1 "); + var queryParam = queryJson.ToJObject(); + if (!queryParam["AcademicYearNo"].IsEmpty()) + { + strSql.Append(" and AcademicYearNo='" + queryParam["AcademicYearNo"].ToString() + "' "); + } + if (!queryParam["Semester"].IsEmpty()) + { + strSql.Append(" and Semester='" + queryParam["Semester"].ToString() + "' "); + } + if (!queryParam["LessonNo"].IsEmpty()) + { + strSql.Append(" and LessonNo='" + queryParam["LessonNo"].ToString() + "' "); + } + if (!queryParam["ClassNo"].IsEmpty()) + { + strSql.Append(" and ClassNo='" + queryParam["ClassNo"].ToString() + "' "); + } + if (!queryParam["EmpNo"].IsEmpty()) + { + strSql.Append(" and EmpNo like '%" + queryParam["EmpNo"].ToString() + "%' "); + } + if (!queryParam["ClassRoomNo"].IsEmpty()) + { + strSql.Append(" and ClassRoomNo='" + queryParam["ClassRoomNo"].ToString() + "' "); + } + if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty()) + { + strSql.Append(" AND ( ExamDate >= '" + queryParam["StartTime"].ToString() + "' AND ExamDate <= '" + queryParam["EndTime"].ToString() + "' ) "); + } + strSql.Append(@" group by AcademicYearNo, Semester, ExamDate, ExamTime,LessonNo, LessonName,ClassRoomNo,ClassRoomName,EmpNo, EmpName, ClassNo,ClassName,t.EPId + "); + + var list = this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), pagination).Where(x => x.ClassStuNum > 0); + var stulist = BaseRepository("CollegeMIS").FindList("select * from Exam_ArrangeExamTermItemNew"); + foreach (var item in list) + { + if (item.ClassStuNum > 0) + { + var stunolist = stulist.Where(x => x.EPId == item.EPId && x.ClassNo == item.ClassNo && x.ClassroomNo == item.ClassroomNo).OrderBy(x => x.StuNo);// stulist.Where(m => m.AcademicYearNo == item.AcademicYearNo && m.Semester == item.Semester + //&& m.LessonNo == item.LessonNo && m.ExamDate == item.ExamDate && m.ExamTime == item.ExamTime + //&& m.ClassRoomNo == item.ClassRoomNo && m.EmpNo == item.EmpNo && m.ClassNo == item.ClassNo).OrderBy(m => m.StuNo); + if (stunolist.Count() > 0) + { + item.StuNoRange = stunolist.First().StuNo + "~" + stunolist.Last().StuNo; + } + } + } + return list; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取排考详情 + /// + /// + /// + /// + public IEnumerable GetItemPageList(Pagination pagination, string queryJson) + { + 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 "); + var queryParam = queryJson.ToJObject(); + if (!queryParam["AcademicYearNo"].IsEmpty()) + { + strSql.Append(" and e.AcademicYearNo='" + queryParam["AcademicYearNo"].ToString() + "' "); + } + if (!queryParam["Semester"].IsEmpty()) + { + strSql.Append(" and e.Semester='" + queryParam["Semester"].ToString() + "' "); + } + if (!queryParam["LessonNo"].IsEmpty()) + { + strSql.Append(" and t.LessonNo='" + queryParam["LessonNo"].ToString() + "' "); + } + if (!queryParam["ClassNo"].IsEmpty()) + { + strSql.Append(" and t.ClassNo='" + queryParam["ClassNo"].ToString() + "' "); + } + if (!queryParam["StuNo"].IsEmpty()) + { + strSql.Append(" and t.StuNo='" + queryParam["StuNo"].ToString() + "' "); + } + if (!queryParam["EmpNo"].IsEmpty()) + { + strSql.Append(" and t.EmpNo like '%" + queryParam["EmpNo"].ToString() + "%' "); + } + if (!queryParam["ClassRoomNo"].IsEmpty()) + { + strSql.Append(" and t.ClassRoomNo='" + queryParam["ClassRoomNo"].ToString() + "' "); + } + if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty()) + { + strSql.Append(" AND ( ExamDate >= '" + queryParam["StartTime"].ToString() + "' AND ExamDate <= '" + queryParam["EndTime"].ToString() + "' ) "); + } + + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), null, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } /// /// 获取页面显示列表数据 @@ -49,7 +198,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration var dp = new DynamicParameters(new { }); if (!queryParam["ExamDate"].IsEmpty()) { - dp.Add("ExamDate",queryParam["ExamDate"].ToString(), DbType.String); + dp.Add("ExamDate", queryParam["ExamDate"].ToString(), DbType.String); strSql.Append(" AND t.ExamDate = @ExamDate "); } if (!queryParam["LessonNo"].IsEmpty()) @@ -82,7 +231,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("ClassroomName", "%" + queryParam["ClassroomName"].ToString() + "%", DbType.String); strSql.Append(" AND t.ClassroomName Like @ClassroomName "); } - return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) { @@ -133,7 +282,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - this.BaseRepository("CollegeMIS").Delete(t=>t.EPIId == keyValue); + this.BaseRepository("CollegeMIS").Delete(t => t.EPIId == keyValue); } catch (Exception ex) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanService.cs index 290b07b5c..3e5110464 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanService.cs @@ -295,7 +295,7 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');"); string stuSql = $"select * from StuInfoBasic where checkMark='1' and classno in ('{classnos}') and stuno not in (select StuNo from Exam_ArrangeExamTermItemNew where EPId='{keyValue}')"; //所有考生 var stuInfoList = db.FindList(stuSql).ToList(); - + var classInfo = db.FindList(); if (itemList.Count >= stuInfoList.Count()) { //随机安排座位 @@ -307,6 +307,9 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');"); { itemList[i].StuNo = stuInfoList[i].StuNo; itemList[i].StuName = stuInfoList[i].StuName; + itemList[i].ClassNo = stuInfoList[i].ClassNo; + itemList[i].ClassName = classInfo.Where(x => x.ClassNo == stuInfoList[i].ClassNo) + .Select(x => x.ClassName).FirstOrDefault(); } db.Insert(itemList); @@ -321,6 +324,9 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');"); { itemList[i].StuNo = stuInfoList[i].StuNo; itemList[i].StuName = stuInfoList[i].StuName; + itemList[i].ClassNo = stuInfoList[i].ClassNo; + itemList[i].ClassName = classInfo.Where(x => x.ClassNo == stuInfoList[i].ClassNo) + .Select(x => x.ClassName).FirstOrDefault(); } db.Insert(itemList);