From a071bf57230c03b7c29d8e77572ea65061bc0ab6 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Sat, 7 May 2022 16:16:06 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E6=88=90=E6=8E=92=E8=80=83=E5=90=8D?= =?UTF-8?q?=E5=8D=95=E5=8F=AA=E4=B8=BA=E5=B7=B2=E5=90=AF=E7=94=A8=E7=9A=84?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E7=94=9F=E6=88=90=EF=BC=9B=E9=9A=8F=E6=9C=BA?= =?UTF-8?q?=E5=AE=89=E6=8E=92=E5=BA=A7=E4=BD=8D=E6=97=B6=E5=BA=A7=E4=BD=8D?= =?UTF-8?q?=E5=8F=B7=E6=8C=89=E9=A1=BA=E5=BA=8F=E6=8E=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/Exam_ExamPlanLesson/FormClass.js | 25 ++++++++++--------- .../Exam_ExamPlan/Exam_ExamPlanService.cs | 5 ++-- .../Exam_ExamStudentEntity.cs | 2 ++ .../Exam_ExamStudentService.cs | 11 ++++---- 4 files changed, 24 insertions(+), 19 deletions(-) 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 de2e32fff..4c35a6d24 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 @@ -30,18 +30,19 @@ var bootstrap = function ($, learun) { headData: [ { label: "学年", name: "AcademicYearNo", width: 100, align: "left" }, { label: "学期", name: "Semester", width: 100, align: "left" }, - { - label: "班级名称", name: "ClassName", width: 200, align: "left", formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', - key: row.ClassNo, - keyId: 'classno', - callback: function (_data) { - callback(_data['classname']); - } - }); - } - }, + //{ + // label: "班级名称", name: "ClassName", width: 200, align: "left", formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('custmerData', { + // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', + // key: row.ClassNo, + // keyId: 'classno', + // callback: function (_data) { + // callback(_data['classname']); + // } + // }); + // } + //}, + { label: "班级名称", name: "ClassName", width: 100, align: "left" }, { label: "班级编号", name: "ClassNo", width: 100, align: "left" }, { label: "学生人数", name: "StuNum", width: 80, align: "left" }, //{ 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 98d10feb6..b79689df8 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 @@ -325,10 +325,12 @@ 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 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}' and LessonNo='{planLesson.LessonNo}')"; + 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 classInfo = db.FindList(); + + itemList = itemList.OrderBy(x => x.SitNumber).OrderBy(x => x.ClassroomNo).ToList(); if (itemList.Count >= stuInfoList.Count()) { //随机安排座位 @@ -350,7 +352,6 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');"); else { //不随机安排座位 - itemList = itemList.OrderBy(x => x.SitNumber).OrderBy(x => x.ClassroomNo).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_ExamStudentEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentEntity.cs index c7eb75789..2bc99622f 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 @@ -81,6 +81,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #region 扩展字段 [NotMapped] public int StuNum { get; set; } + [NotMapped] + public string ClassName { get; set; } #endregion } 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 6e26fbdcd..951809e3b 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 @@ -91,9 +91,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { var strSql = new StringBuilder(); strSql.Append("SELECT "); - strSql.Append(@" ClassNo,count(1) as StuNum,AcademicYearNo,Semester,ESType "); + strSql.Append(@" t.ClassNo,count(1) as StuNum,t.AcademicYearNo,t.Semester,t.ESType,c.ClassName "); strSql.Append(" FROM Exam_ExamStudent t "); - strSql.Append(" WHERE ESEnabled=1 "); + strSql.Append(" left join classinfo c on t.ClassNo=c.ClassNo "); + strSql.Append(" WHERE t.ESEnabled=1 "); var queryParam = queryJson.ToJObject(); // 虚拟参数 var dp = new DynamicParameters(new { }); @@ -115,7 +116,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration if (!queryParam["ClassName"].IsEmpty()) { dp.Add("ClassName", "%" + queryParam["ClassName"].ToString() + "%", DbType.String); - strSql.Append(" AND t.ClassName Like @ClassName "); + strSql.Append(" AND c.ClassName Like @ClassName "); } if (!queryParam["StuNo"].IsEmpty()) { @@ -139,7 +140,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration //排考安排课程表Id if (!queryParam["EPLId"].IsEmpty()) { - strSql.Append($" and classno not in (select ClassNo from Exam_ExamPlanClass where EPLId='{queryParam["EPLId"].ToString()}')"); + strSql.Append($" and t.classno not in (select ClassNo from Exam_ExamPlanClass where EPLId='{queryParam["EPLId"].ToString()}')"); } //排考记录表Id if (!queryParam["EPId"].IsEmpty()) @@ -150,7 +151,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration 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 "); + strSql.Append(" group by t.ClassNo,t.AcademicYearNo,t.Semester,t.ESType,c.ClassName "); return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex)