diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeExamTermNewController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeExamTermNewController.cs index 7a33ebd0a..f07ac3db4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeExamTermNewController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeExamTermNewController.cs @@ -30,10 +30,21 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return View(); } [HttpGet] + public ActionResult IndexForLesson() + { + return View(); + } + [HttpGet] public ActionResult IndexItem() { return View(); } + + [HttpGet] + public ActionResult IndexForClass() + { + return View(); + } [HttpGet] public ActionResult SyncByConditionForm() { @@ -86,6 +97,22 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return Success(jsonData); } + [HttpGet] + [AjaxOnly] + public ActionResult GetPageListForLesson(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = arrangeExamTermNewIBLL.GetPageListForLesson(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + [HttpGet] [AjaxOnly] public ActionResult GetItemPageList(string pagination, string queryJson) @@ -101,6 +128,22 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers }; return Success(jsonData); } + + [HttpGet] + [AjaxOnly] + public ActionResult GetPageListForClass(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = arrangeExamTermNewIBLL.GetPageListForClass(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/ArrangeExamTermNew/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/Index.js index 6a9334e9c..43d8b80b2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/Index.js @@ -90,7 +90,11 @@ var bootstrap = function ($, learun) { headData: [ { label: '学年', name: 'AcademicYearNo', width: 80, align: "left" }, { label: '学期', name: 'Semester', width: 80, align: "left" }, - { label: '考试日期', name: 'ExamDate', width: 100, align: "left" }, + { + label: '考试日期', name: 'ExamDate', width: 100, align: "left", formatter: function (v) { + return learun.formatDate(v, "yyyy-MM-dd"); + } + }, { label: '考试时间', name: 'ExamTime', width: 100, align: "left" }, //{ label: '班级编号', name: 'ClassNo', width: 200, align: "left" }, //{ label: '班级名称', name: 'ClassName', width: 200, align: "left" }, diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexForClass.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexForClass.cshtml new file mode 100644 index 000000000..7be84f7f0 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexForClass.cshtml @@ -0,0 +1,51 @@ +@{ + ViewBag.Title = "排考2021新"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
班级信息
+
+
+
+
+
+
+ 班级信息 +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  查询 +
+
+
+
+ +
+
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexForClass.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexForClass.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexForClass.js new file mode 100644 index 000000000..a0de3e198 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/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/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').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/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/ArrangeExamTermNew/IndexForLesson.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexForLesson.cshtml new file mode 100644 index 000000000..ae98199b2 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexForLesson.cshtml @@ -0,0 +1,39 @@ +@{ + ViewBag.Title = "排考2021新"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  查询 +
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexForLesson.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexForLesson.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexForLesson.js new file mode 100644 index 000000000..2d16b8c18 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexForLesson.js @@ -0,0 +1,119 @@ +/* * 版 本 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 page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + $('.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({ AcademicYearNo: $('#AcademicYearNo').lrselectGet(), Semester: $('#Semester').lrselectGet(), LessonNo: $('#LessonNo').lrselectGet()}); + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + //排考数据同步 + $('#lr_arrange').on('click', function () { + learun.layerForm({ + id: 'SyncByConditionForm', + title: '按条件同步排考数据', + url: top.$.rootUrl + '/EducationalAdministration/ArrangeExamTermNew/SyncByConditionForm', + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + $('#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').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname', placeholder:'请选择课程' }); + }, + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/ArrangeExamTermNew/GetPageListForLesson', + headData: [ + { label: '学年', name: 'AcademicYearNo', width: 80, align: "left" }, + { label: '学期', name: 'Semester', width: 80, align: "left" }, + { + label: '考试日期', name: 'ExamDate', width: 100, align: "left", formatter: function (v) { + return learun.formatDate(v, "yyyy-MM-dd"); + } + }, + { label: '考试时间', name: 'ExamTime', width: 100, align: "left" }, + { label: '课程编号', name: 'LessonNo', width: 100, align: "left" }, + { label: '课程名称', name: 'LessonName', width: 200, align: "left" } + ], + mainId: 'AETId', + sidx: 'ExamDate ,ExamTime,LessonNo', + isPage: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.StartTime = datebegin; + param.EndTime = dateend; + $('#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 8b1fa0e0d..7fd8034ef 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 @@ -1,4 +1,4 @@ - + @@ -930,6 +930,8 @@ + + @@ -7477,6 +7479,8 @@ + + @@ -7601,10 +7605,10 @@ False - True - 20472 + True + 20472 / - http://localhost:20873/ + http://localhost:20873/ False False diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeExamTermItemNew/ArrangeExamTermItemNewEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeExamTermItemNew/ArrangeExamTermItemNewEntity.cs index 91e88c9a7..a474c6cf1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeExamTermItemNew/ArrangeExamTermItemNewEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeExamTermItemNew/ArrangeExamTermItemNewEntity.cs @@ -122,6 +122,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration [NotMapped] public string EndDate { get; set; } + [NotMapped] + public int ClassStuNum { get; set; } + [NotMapped] + public string StuNoRange { get; set; } + #endregion #region 扩展操作 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeExamTermNew/ArrangeExamTermNewBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeExamTermNew/ArrangeExamTermNewBLL.cs index f3d4459a4..32ce5107a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeExamTermNew/ArrangeExamTermNewBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeExamTermNew/ArrangeExamTermNewBLL.cs @@ -196,6 +196,44 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + public IEnumerable GetPageListForClass(Pagination pagination, string queryJson) + { + try + { + return arrangeExamTermNewService.GetPageListForClass(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public IEnumerable GetPageListForLesson(Pagination pagination, string queryJson) + { + try + { + return arrangeExamTermNewService.GetPageListForLesson(pagination, queryJson); + } + 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/ArrangeExamTermNew/ArrangeExamTermNewIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeExamTermNew/ArrangeExamTermNewIBLL.cs index 2a7018854..d1b5ef022 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeExamTermNew/ArrangeExamTermNewIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeExamTermNew/ArrangeExamTermNewIBLL.cs @@ -53,5 +53,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #endregion List GetClassTree(); + IEnumerable GetPageListForClass(Pagination pagination, string queryJson); + IEnumerable GetPageListForLesson(Pagination pagination, string queryJson); } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeExamTermNew/ArrangeExamTermNewService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeExamTermNew/ArrangeExamTermNewService.cs index 4ce6b0d75..6753de87d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeExamTermNew/ArrangeExamTermNewService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeExamTermNew/ArrangeExamTermNewService.cs @@ -295,5 +295,121 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + + public IEnumerable GetPageListForClass(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append(@"select AcademicYearNo, Semester, ExamDate, ExamTime, LessonNo, LessonName,ClassRoomNo,ClassRoomName,EmpNo, EmpName, ClassNo,ClassName, count(StuNo) as ClassStuNum + from [dbo].[ArrangeExamTermItemNew] 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 + "); + + var list= this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), pagination); + var stulist = BaseRepository("CollegeMIS").FindList("select * from ArrangeExamTermItemNew"); + foreach (var item in list) + { + if (item.ClassStuNum>0) + { + var stunolist = 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 GetPageListForLesson(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT AcademicYearNo,Semester,ExamDate,ExamTime,LessonNo,LessonName "); + strSql.Append(" FROM ArrangeExamTermNew t where 1=1 "); + var queryParam = queryJson.ToJObject(); + var dp = new DynamicParameters(new { }); + if (!queryParam["AcademicYearNo"].IsEmpty()) + { + strSql.Append(" and t.AcademicYearNo=@AcademicYearNo "); + dp.Add("AcademicYearNo", queryParam["AcademicYearNo"].ToString(), DbType.String); + } + if (!queryParam["Semester"].IsEmpty()) + { + strSql.Append(" and t.Semester=@Semester "); + dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); + } + if (!queryParam["LessonNo"].IsEmpty()) + { + strSql.Append(" and t.LessonNo=@LessonNo "); + dp.Add("LessonNo", queryParam["LessonNo"].ToString(), DbType.String); + } + if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty()) + { + dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime); + dp.Add("endTime", queryParam["EndTime"].ToDate(), DbType.DateTime); + strSql.Append(" AND ( ExamDate >= @startTime AND ExamDate <= @endTime ) "); + } + + strSql.Append(" group by AcademicYearNo,Semester,ExamDate,ExamTime,LessonNo,LessonName"); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } } }