diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoom.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoom.js index e65b06d4e..bfb3411e7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoom.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoom.js @@ -44,10 +44,10 @@ var bootstrap = function ($, learun) { { label: "学期", name: "Semester", width: 100, align: "left" }, { label: "考场编号", name: "ClassroomNo", width: 100, align: "left" }, { label: "考场名称", name: "ClassroomName", width: 200, align: "left" }, - { label: "座位行数", name: "SeatRows", width: 100, align: "left" }, - { label: "座位列数", name: "SeatColumns", width: 100, align: "left" }, - { label: "考场座位数", name: "SeatCount", width: 100, align: "left" }, - { label: "可用座位数", name: "ActualNum", width: 100, align: "left" }, + { label: "座位行数", name: "SeatRows", width: 60, align: "left" }, + { label: "座位列数", name: "SeatColumns", width: 60, align: "left" }, + { label: "考场座位数", name: "SeatCount", width: 60, align: "left" }, + { label: "可用座位数", name: "ActualNum", width: 60, align: "left" }, //{ // label: "是否启用", name: "EREnabled", width: 100, align: "left", // formatter: function (cellvalue) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.cshtml index 24727f853..a4d7b26d5 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.cshtml @@ -15,6 +15,7 @@
考场座位数
+
监考老师
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 4f1041d01..88af61d36 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 @@ -135,6 +135,7 @@ var bootstrap = function ($, learun) { $("#ClassroomName").val(temprow.ClassroomName); $('#ClassroomNo').val(temprow.ClassroomNo); $('#ActualNum').val(temprow.ActualNum); + $('#SeatCount').val(temprow.SeatCount); } }); }; 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 1f59b908c..d61cb0e32 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 @@ -153,6 +153,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { + var Entity = this.BaseRepository("CollegeMIS").FindEntity(keyValue); + this.BaseRepository("CollegeMIS").ExecuteBySql($"update Exam_ExamRoom set isedit =1 where AcademicYearNo='{Entity.AcademicYearNo}' and Semester='{Entity.Semester}' "); this.BaseRepository("CollegeMIS").Delete(t => t.EPId == keyValue); } catch (Exception ex) @@ -349,7 +351,17 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');"); //排考安排考场 var planRoomData = db.FindList(x => x.EPLId == planLesson.EPLId).ToList(); - + #region 允许有空的考场 + var newclassroomno = new List(); + foreach (var item in planRoomData) + { + if (item.SeatCount != item.ActualNum) + { + newclassroomno.Add(item); + } + } + var ClassroomNoDisable = string.Join("','", newclassroomno.Select(x => x.ClassroomNo)); + #endregion //添加排考安排数据 foreach (var planRoom in planRoomData) { @@ -384,7 +396,7 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');"); item.EmpNo = planRoom.EmpNo; item.ClassroomName = planRoom.ClassroomName; item.ClassroomNo = planRoom.ClassroomNo; - item.F_SchoolId = LoginUserInfo.Get().userId; + item.F_SchoolId = LoginUserInfo.Get().companyId; item.SitNumber = sealNumArr[n].ToString().PadLeft(3, '0'); itemList.Add(item); } @@ -396,8 +408,35 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');"); string stuSql = $"select * from Exam_ExamStudent where ESEnabled=1 and 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}' and LessonNo='{planLesson.LessonNo}')"; //所有考生 var stuInfoList = db.FindList(stuSql).ToList(); - + //从此获取到 同学年学期考场禁用+本次考试并且可以做编号 + var DisableNumber = db.FindList + (x => x.ECEnabled == true && x.AcademicYearNo == examPlan.AcademicYearNo && x.Semester == examPlan.Semester && ClassroomNoDisable.Contains(x.ClassRoomNo)).ToList(); + foreach (var item in DisableNumber) + { + item.ECSOrder = item.ECOrder.ToString().PadLeft(3, '0'); + } itemList = itemList.OrderBy(x => x.SitNumber).OrderBy(x => x.ClassroomNo).ToList(); + List newitemList = itemList.Where(x => ClassroomNoDisable.Contains(x.ClassroomNo)).ToList(); + foreach (var item in newitemList) + { + itemList.Remove(item); + } + int s = 0; + if (itemList.Count() > 0) + { + for (int i = 0; i < DisableNumber.Count(); i++) + { + for (int j = 0; j < newitemList.Count(); j++) + { + if (DisableNumber[i].ECSOrder == newitemList[j].SitNumber && DisableNumber[i].ClassRoomNo == newitemList[j].ClassroomNo) + { + itemList.Add(newitemList[j]); + s = s + 1; + } + } + } + } + var a = s; if (itemList.Count >= stuInfoList.Count()) { //随机安排座位 @@ -507,6 +546,7 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');"); entity.EPStuCount = 0; this.BaseRepository("CollegeMIS").Insert(entity); } + this.BaseRepository("CollegeMIS").ExecuteBySql($"update Exam_ExamRoom set isedit =0 where AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' "); } catch (Exception ex) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomEntity.cs index 65cfb9f90..ecc1915c1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomEntity.cs @@ -61,7 +61,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// [Column("ACTUALNUM")] - public string ActualNum { get; set; } + public int? ActualNum { get; set; } #endregion #region 扩展操作 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomService.cs index 8ab318b1f..bb4a7bda5 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomService.cs @@ -341,8 +341,9 @@ where l.EPLId='{EPLId}'"; } //考场座位数 - int? seatCount = 0; - var roomListSql = + int? seatCount = 0; + int? ActualNum = 0; + var roomListSql = $"select * from Exam_ExamRoom where AcademicYearNo='{examPlan.AcademicYearNo}' and Semester='{examPlan.Semester}' and EREnabled=1 "; if (conflictRoom.Count() > 0) { @@ -364,18 +365,20 @@ where l.EPLId='{EPLId}'"; EPRoom.EPLId = examLesson.EPLId; EPRoom.ClassroomName = room.ClassroomName; EPRoom.ClassroomNo = room.ClassroomNo; - EPRoom.SeatCount = room.ActualNum; + EPRoom.SeatCount = room.SeatCount; + EPRoom.ActualNum = room.ActualNum; db.Insert(EPRoom); - seatCount += room.ActualNum; + seatCount += room.SeatCount; + ActualNum += room.ActualNum; room.IsEdit = false; - if (seatCount >= examLesson.RealStuCount) + if (ActualNum >= examLesson.RealStuCount) { break; } } db.Update(examRoomList); db.ExecuteBySql( - $"update Exam_ExamPlanLesson set SeatCount='{seatCount}' where EPLId='{examLesson.EPLId}'"); + $"update Exam_ExamPlanLesson set SeatCount='{seatCount}',SeatCount='{seatCount}'ActualNum='{ActualNum}' where EPLId='{examLesson.EPLId}'"); } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoomDetail/Exam_ExamRoomDetailEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoomDetail/Exam_ExamRoomDetailEntity.cs index a1157cf4c..192621ccb 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoomDetail/Exam_ExamRoomDetailEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoomDetail/Exam_ExamRoomDetailEntity.cs @@ -127,6 +127,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// [NotMapped] public string ExamTime { get; set; } + + /// + /// ECSOrder + /// + [NotMapped] + public string ECSOrder { get; set; } } }