From 266ee09b536e15042e511b50a31cd9dd28262dc4 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Thu, 28 Apr 2022 11:10:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E6=8E=92=E8=80=83=E8=AF=95=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E6=96=B0=E5=A2=9E=E7=8F=AD=E7=BA=A7=E3=80=81=E7=94=9F?= =?UTF-8?q?=E6=88=90=E6=8E=92=E8=80=83=E5=90=8D=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Exam_ExamPlanLessonController.cs | 17 +-- .../Views/Exam_ExamLesson/Index.js | 12 +- .../Exam_ExamPlanLesson/FormClass.cshtml | 10 +- .../Views/Exam_ExamPlanLesson/FormClass.js | 136 ++++++++---------- .../Exam_ExamPlanLesson/FormRoomTeacher.js | 1 + .../Views/Exam_ExamPlanLesson/Index.js | 4 +- .../Views/Exam_ExamStudent/Index.js | 2 +- .../Views/Exam_InvigilateTeacher/Index.js | 14 +- .../ClassInfo/ClassInfoService.cs | 12 -- .../Exam_ExamPlan/Exam_ExamPlanService.cs | 53 +++---- .../Exam_ExamStudent/Exam_ExamStudentBLL.cs | 18 +++ .../Exam_ExamStudentEntity.cs | 3 + .../Exam_ExamStudent/Exam_ExamStudentIBLL.cs | 1 + .../Exam_ExamStudentService.cs | 73 ++++++++++ 14 files changed, 216 insertions(+), 140 deletions(-) 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 2dbb1fe89..5dd99a1e8 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 @@ -19,8 +19,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { private Exam_ExamPlanLessonIBLL exam_ExamPlanLessonIBLL = new Exam_ExamPlanLessonBLL(); private Exam_ExamPlanClassIBLL exam_ExamPlanClassIBLL = new Exam_ExamPlanClassBLL(); + private Exam_ExamStudentIBLL exam_ExamStudentIBLL = new Exam_ExamStudentBLL(); private Exam_ExamPlanRoomIBLL exam_ExamPlanRoomIBLL = new Exam_ExamPlanRoomBLL(); - private ClassInfoIBLL classInfoIBLL = new ClassInfoBLL(); private StuInfoBasicIBLL StuInfoBasicIBLL = new StuInfoBasicBLL(); #region 视图功能 @@ -82,12 +82,12 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult GetClassInfoPageList(string pagination, string queryJson) { Pagination paginationobj = pagination.ToObject(); - var data = classInfoIBLL.GetPageList(paginationobj, queryJson); - var stuList = StuInfoBasicIBLL.GetAllList(); - foreach (var item in data) - { - item.StuNum = stuList.Count(x => x.ClassNo == item.ClassNo); - } + var data = exam_ExamStudentIBLL.GetPageListForExam(paginationobj, queryJson); + //var stuList = StuInfoBasicIBLL.GetAllList(); + //foreach (var item in data) + //{ + // item.StuNum = stuList.Count(x => x.ClassNo == item.ClassNo); + //} var jsonData = new { rows = data, @@ -307,8 +307,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpPost] [ValidateAntiForgeryToken] [AjaxOnly] - public ActionResult SaveClass(string EPLId, List list) + public ActionResult SaveClass(string EPLId, string strEntity) { + var list = strEntity.ToObject>(); exam_ExamPlanClassIBLL.SaveList(list); return Success("保存成功!"); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamLesson/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamLesson/Index.js index 17b88e233..5ddc3763c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamLesson/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamLesson/Index.js @@ -55,6 +55,11 @@ var bootstrap = function ($, learun) { return false; } if (learun.checkrow(keyValue)) { + var ELEnabled = $('#gridtable').jfGridValue('ELEnabled'); + if (ELEnabled.indexOf('true') != -1) { + learun.alert.warning("选中记录已启用!"); + return; + } learun.layerForm({ id: 'form', title: '编辑', @@ -101,6 +106,11 @@ var bootstrap = function ($, learun) { $('#lr_delete').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ELId'); if (learun.checkrow(keyValue)) { + var ELEnabled = $('#gridtable').jfGridValue('ELEnabled'); + if (ELEnabled.indexOf('true') != -1) { + learun.alert.warning("选中记录中包含已启用项目!"); + return; + } learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamLesson/DeleteForm', { keyValue: keyValue }, function () { @@ -176,7 +186,7 @@ var bootstrap = function ($, learun) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', key: value, - keyId: 'id', + keyId: 'majorno', callback: function (_data) { callback(_data['majorname']); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormClass.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormClass.cshtml index dd0fbe7c9..1d79f9e86 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormClass.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormClass.cshtml @@ -10,22 +10,22 @@
-
+
班级名称
-
-
班级代码
+
+
班级编号
-
+ @*
系部
专业
-
+
*@
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormClass.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormClass.js index b86d85b55..b3a30d490 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormClass.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormClass.js @@ -28,78 +28,50 @@ var bootstrap = function ($, learun) { $('#gridtable').jfGrid({ url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/GetClassInfoPageList', headData: [ - { label: "班级名称", name: "ClassName", width: 200, align: "left" }, - { label: "班级代码", name: "ClassNo", width: 100, align: "left" }, + { label: "学年", name: "AcademicYearNo", width: 100, align: "left" }, + { label: "学期", name: "Semester", width: 100, align: "left" }, { - label: "系部", name: "DeptNo", width: 200, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { + label: "班级名称", name: "ClassName", width: 200, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', - key: value, - keyId: 'deptno', + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', + key: row.ClassNo, + keyId: 'classno', callback: function (_data) { - callback(_data['deptname']); + callback(_data['classname']); } }); } }, - { - label: "专业", name: "MajorNo", width: 200, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', - key: value, - keyId: 'majorno', - callback: function (_data) { - callback(_data['majorname']); - } - }); - } - }, - { label: "默认教室", name: "SerialNum", width: 100, align: "left" }, - { - label: "班级类型", name: "ClassType", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('dataItem', { - key: value, - code: 'ClassType', - callback: function (_data) { - callback(_data.text); - } - }); - } - - }, - { label: "年级", name: "Grade", width: 80, align: "center" }, + { label: "班级编号", name: "ClassNo", width: 100, align: "left" }, { label: "学生人数", name: "StuNum", width: 80, align: "left" }, - { - label: "班主任", name: "ClassDiredctorNo", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', - key: value, - keyId: 'f_encode', - callback: function (_data) { - callback(_data['f_realname']); - } - }); - } - }, - { - label: "辅导员", name: "ClassTutorNo", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', - key: value, - keyId: 'f_encode', - callback: function (_data) { - callback(_data['f_realname']); - } - }); - } - }, + //{ + // label: "班主任", name: "ClassDiredctorNo", width: 100, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('custmerData', { + // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', + // key: value, + // keyId: 'f_encode', + // callback: function (_data) { + // callback(_data['f_realname']); + // } + // }); + // } + //}, + //{ + // label: "辅导员", name: "ClassTutorNo", width: 100, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('custmerData', { + // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', + // key: value, + // keyId: 'f_encode', + // callback: function (_data) { + // callback(_data['f_realname']); + // } + // }); + // } + //}, ], - mainId: 'ClassId', + mainId: 'ESId', isPage: true, isMultiselect: true, sidx: 'ClassNo', @@ -111,7 +83,7 @@ var bootstrap = function ($, learun) { param = param || {}; //考试安排课程表Id param.EPLId = EPLId; - param.SqlParameter = " and CheckMark=1"; + param.EPId = EPId; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; @@ -119,7 +91,7 @@ var bootstrap = function ($, learun) { page.search(); }; // 保存数据 - acceptClick = function (callBack) { + acceptClick = function (callBack,i) { var selectedRow = $('#gridtable').jfGridGet('rowdata'); if (selectedRow.length == 0) { return learun.alert.warning("请选择班级!"); @@ -127,8 +99,21 @@ var bootstrap = function ($, learun) { var list = []; $.each(selectedRow, function (i, item) { + var name = ''; + if (!!item.ClassNo) { + learun.clientdata.getAsync('custmerData', + { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', + key: item.ClassNo, + keyId: 'classno', + callback: function (_data) { + name = _data['classname']; + } + }); + } + var entity = { - ClassName: item.ClassName, + ClassName: name, ClassNo: item.ClassNo, ClassStuNum: item.StuNum, EPCId: learun.newGuid(), @@ -137,16 +122,15 @@ var bootstrap = function ($, learun) { list.push(entity); }); - $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/SaveClass?EPLId=' + EPLId, - { list: list }), function (res) { - // 保存成功后才回调 - if (!!callBack) { - callBack(); - } - }; - if (!!callBack) { - callBack(); - } + var postData = {}; + postData.strEntity = JSON.stringify(list); + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/SaveClass?EPLId=' + EPLId, postData, function (res) { + console.log(res); + // 保存成功后才回调 + if (!!callBack) { + callBack(res, '', i); + } + }); }; page.init(); } 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 index 44863aeec..72578f4a2 100644 --- 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 @@ -160,6 +160,7 @@ var bootstrap = function ($, learun) { postData.Exam_ExamPlanTeacherList = JSON.stringify($('#Exam_ExamPlanTeacher').jfGridGet('rowdatas')); $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/SaveRoomAndTeacher?keyValue=' + keyValue, postData, function (res) { + console.log(res); // 保存成功后才回调 if (!!callBack) { callBack(res, formData, i); 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 44a579921..5831582b5 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 @@ -260,10 +260,10 @@ var bootstrap = function ($, learun) { }; refreshGirdData = function () { if (!!EPLId) { - $('#gridtable_Class').jfGridSet('reload'); $('#gridtable_Room').jfGridSet('reload'); + $('#gridtable_Class').jfGridSet('reload'); page.show(); - } + } }; page.init(); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/Index.js index 14e0e5b59..d0301f6b0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/Index.js @@ -153,7 +153,7 @@ var bootstrap = function ($, learun) { }, // 初始化列表 initGird: function () { - $('#gridtable').lrAuthorizeJfGrid({ + $('#gridtable').jfGrid({ url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/GetPageList', headData: [ { label: "学年", name: "AcademicYearNo", width: 100, align: "left" }, diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Index.js index ebe5d98dc..ba0df12a6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Index.js @@ -56,6 +56,11 @@ var bootstrap = function ($, learun) { function () { var keyValue = $('#gridtable').jfGridValue('ITId'); if (learun.checkrow(keyValue)) { + var ITEnabled = $('#gridtable').jfGridValue('ITEnabled'); + if (ITEnabled.indexOf('true') != -1) { + learun.alert.warning("选中记录已启用!"); + return; + } learun.layerForm({ id: 'form', title: '编辑', @@ -75,6 +80,11 @@ var bootstrap = function ($, learun) { function () { var keyValue = $('#gridtable').jfGridValue('ITId'); if (learun.checkrow(keyValue)) { + var ITEnabled = $('#gridtable').jfGridValue('ITEnabled'); + if (ITEnabled.indexOf('true') != -1) { + learun.alert.warning("选中记录已启用!"); + return; + } learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { @@ -98,8 +108,8 @@ var bootstrap = function ($, learun) { function () { var keyValue = $('#gridtable').jfGridValue('ITId'); if (learun.checkrow(keyValue)) { - var ELEnabled = $('#gridtable').jfGridValue('ITEnabled'); - if (ELEnabled.indexOf('true') != -1) { + var ITEnabled = $('#gridtable').jfGridValue('ITEnabled'); + if (ITEnabled.indexOf('true') != -1) { learun.alert.warning("选中记录中包含已启用项目!"); return; } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoService.cs index fb44678f2..22f3f3772 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoService.cs @@ -75,18 +75,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration strSql.Append(queryParam["SqlParameter"].ToString()); } - if (!queryParam["EPLId"].IsEmpty()) - { - var elSql = - $"select * from Exam_ExamLesson where ELId=(select ELId from Exam_ExamPlanLesson where EPLId='{queryParam["EPLId"].ToString()}')"; - var entity = this.BaseRepository("CollegeMIS").FindList(elSql).FirstOrDefault(); - if (entity != null) - { - strSql.Append($" and deptno='{entity.DeptNo}' and majorno='{entity.MajorNo}' and grade='{entity.Grade}'"); - strSql.Append($" and classno not in (select ClassNo from Exam_ExamPlanClass where EPLId='{queryParam["EPLId"].ToString()}')"); - - } - } return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } 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 3e5110464..4f9fff17f 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 @@ -233,37 +233,24 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');"); //添加排考安排数据 foreach (var planRoom in planRoomData) { - var ExamTermEntity = db.FindEntity(x => x.ClassroomNo == planRoom.ClassroomNo); + //删除 + db.ExecuteBySql($"delete Exam_ArrangeExamTermNew where EPId='{keyValue}'"); //排考安排表 - if (ExamTermEntity == null) - { - Exam_ArrangeExamTermNewEntity ExamTermNewEntity = new Exam_ArrangeExamTermNewEntity(); - ExamTermNewEntity.Create(); - ExamTermNewEntity.EPId = keyValue; - ExamTermNewEntity.LessonName = planLesson.LessonName; - ExamTermNewEntity.LessonNo = planLesson.LessonNo; - ExamTermNewEntity.ExamDate = planLesson.ExamDate; - ExamTermNewEntity.ExamTime = planLesson.ExamTime; - ExamTermNewEntity.EmpName = planRoom.EmpName; - ExamTermNewEntity.EmpNo = planRoom.EmpNo; - ExamTermNewEntity.ClassroomName = planRoom.ClassroomName; - ExamTermNewEntity.ClassroomNo = planRoom.ClassroomNo; - ExamTermNewEntity.F_SchoolId = LoginUserInfo.Get().companyId; - db.Insert(ExamTermNewEntity); - } - else - { - //修改 - ExamTermEntity.LessonName = planLesson.LessonName; - ExamTermEntity.LessonNo = planLesson.LessonNo; - ExamTermEntity.ExamDate = planLesson.ExamDate; - ExamTermEntity.ExamTime = planLesson.ExamTime; - ExamTermEntity.EmpName = planRoom.EmpName; - ExamTermEntity.EmpNo = planRoom.EmpNo; - ExamTermEntity.ClassroomName = planRoom.ClassroomName; - ExamTermEntity.ClassroomNo = planRoom.ClassroomNo; - db.Update(ExamTermEntity); - } + Exam_ArrangeExamTermNewEntity ExamTermNewEntity = new Exam_ArrangeExamTermNewEntity(); + ExamTermNewEntity.Create(); + ExamTermNewEntity.EPId = keyValue; + ExamTermNewEntity.LessonName = planLesson.LessonName; + ExamTermNewEntity.LessonNo = planLesson.LessonNo; + ExamTermNewEntity.ExamDate = planLesson.ExamDate; + ExamTermNewEntity.ExamTime = planLesson.ExamTime; + ExamTermNewEntity.EmpName = planRoom.EmpName; + ExamTermNewEntity.EmpNo = planRoom.EmpNo; + ExamTermNewEntity.ClassroomName = planRoom.ClassroomName; + ExamTermNewEntity.ClassroomNo = planRoom.ClassroomNo; + ExamTermNewEntity.F_SchoolId = LoginUserInfo.Get().companyId; + db.Insert(ExamTermNewEntity); + + //生成考场随机数 var sealNumArr = getRanNum(planRoom.SeatCount.Value); @@ -292,9 +279,9 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');"); //排考安排班级 var planClassData = db.FindList(x => x.EPLId == planLesson.EPLId); var classnos = string.Join("','", planClassData.Select(x => x.ClassNo).ToList()); - string stuSql = $"select * from StuInfoBasic where checkMark='1' and classno in ('{classnos}') and stuno not in (select StuNo from Exam_ArrangeExamTermItemNew where EPId='{keyValue}')"; + string stuSql = $"select * from Exam_ExamStudent where AcademicYearNo='{examPlan.AcademicYearNo}' and Semester='{examPlan.Semester}' and ESType='{examPlan.PlanType}' and classno in ('{classnos}') and stuno not in (select StuNo from Exam_ArrangeExamTermItemNew where EPId='{keyValue}')"; //所有考生 - var stuInfoList = db.FindList(stuSql).ToList(); + var stuInfoList = db.FindList(stuSql).ToList(); var classInfo = db.FindList(); if (itemList.Count >= stuInfoList.Count()) { @@ -318,7 +305,7 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');"); { //不随机安排座位 itemList = itemList.OrderBy(x => x.SitNumber).OrderBy(x => x.ClassroomNo).ToList(); - stuInfoList = stuInfoList.OrderBy(x =>x.StuNo).OrderBy(x=>x.ClassNo).ToList(); + stuInfoList = stuInfoList.OrderBy(x => x.StuNo).OrderBy(x => x.ClassNo).ToList(); //为考生安排座位 for (int i = 0; i < stuInfoList.Count; i++) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentBLL.cs index 4163d7399..40b6dad4f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentBLL.cs @@ -43,6 +43,24 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + public IEnumerable GetPageListForExam(Pagination pagination, string queryJson) + { + try + { + return exam_ExamStudentService.GetPageListForExam(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } /// /// 获取Exam_ExamStudent表实体数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentEntity.cs index fad00673c..c7eb75789 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentEntity.cs @@ -79,6 +79,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } #endregion #region 扩展字段 + [NotMapped] + public int StuNum { get; set; } + #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentIBLL.cs index 0cda76b96..4fea94b3d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentIBLL.cs @@ -21,6 +21,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 查询参数 /// IEnumerable GetPageList(Pagination pagination, string queryJson); + IEnumerable GetPageListForExam(Pagination pagination, string queryJson); /// /// 获取Exam_ExamStudent表实体数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentService.cs index 04464db5c..e101fdba3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentService.cs @@ -84,6 +84,79 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + + public IEnumerable GetPageListForExam(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" ClassNo,count(1) as StuNum,AcademicYearNo,Semester,ESType "); + strSql.Append(" FROM Exam_ExamStudent t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["AcademicYearNo"].IsEmpty()) + { + dp.Add("AcademicYearNo", queryParam["AcademicYearNo"].ToString(), DbType.String); + strSql.Append(" AND t.AcademicYearNo = @AcademicYearNo "); + } + if (!queryParam["Semester"].IsEmpty()) + { + dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); + strSql.Append(" AND t.Semester = @Semester "); + } + if (!queryParam["ClassNo"].IsEmpty()) + { + dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); + strSql.Append(" AND t.ClassNo = @ClassNo "); + } + if (!queryParam["StuNo"].IsEmpty()) + { + dp.Add("StuNo", "%" + queryParam["StuNo"].ToString() + "%", DbType.String); + strSql.Append(" AND t.StuNo Like @StuNo "); + } + if (!queryParam["StuName"].IsEmpty()) + { + dp.Add("StuName", "%" + queryParam["StuName"].ToString() + "%", DbType.String); + strSql.Append(" AND t.StuName Like @StuName "); + } + if (!queryParam["ESType"].IsEmpty()) + { + dp.Add("ESType", queryParam["ESType"].ToString(), DbType.String); + strSql.Append(" AND t.ESType = @ESType "); + } + if (!queryParam["SqlParameter"].IsEmpty()) + { + strSql.Append(queryParam["SqlParameter"].ToString()); + } + //排考安排课程表Id + if (!queryParam["EPLId"].IsEmpty()) + { + strSql.Append($" and classno not in (select ClassNo from Exam_ExamPlanClass where EPLId='{queryParam["EPLId"].ToString()}')"); + } + //排考记录表Id + if (!queryParam["EPId"].IsEmpty()) + { + var examPlan = this.BaseRepository("CollegeMIS").FindEntity(queryParam["EPId"].ToString()); + strSql.Append($" AND t.AcademicYearNo = '{examPlan.AcademicYearNo}' AND t.Semester = '{examPlan.Semester}' AND t.ESType = '{examPlan.PlanType}' "); + } + strSql.Append(" group by ClassNo,AcademicYearNo,Semester,ESType "); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } /// /// 获取Exam_ExamStudent表实体数据 ///