From 6ab08f98a1f658b2848013586242cc603d31ddb5 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Thu, 11 Aug 2022 14:50:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=92=E8=80=83=E8=AE=B0=E5=BD=95=E8=A1=A8--?= =?UTF-8?q?=E5=AE=89=E6=8E=92=E7=8F=AD=E7=BA=A7=E5=85=B3=E8=81=94=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E4=BF=A1=E6=81=AF=E8=A1=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Exam_ExamPlanClassService.cs | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassService.cs index 55e623e53..8f6791f3d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassService.cs @@ -327,32 +327,27 @@ where l.EPLId='{EPLId}' //排考记录表 var examPlan = db.FindEntity(EPId); //查询当前考试记录所有考试课程 - var lessonList = db.FindList(x => x.EPId == EPId); + var lessonList = db.FindList($@"select a.*,b.LessonTypeId,b.MajorNo as TeachMajorNo FROM [dbo].[Exam_ExamPlanLesson] a +left join [dbo].[Exam_ExamLesson] b on a.ELId=b.ELId +where a.EPId='{EPId}'"); foreach (var lesson in lessonList) { - var lessonno = lesson.LessonNo; - if (lesson.LessonNo.Contains("(")) - { - lessonno = lesson.LessonNo.Split('(')[0]; - } - //查询课程信息 - var lessoninfo = db.FindList($@"select top 1 t.LessonTypeName,l.* from lessoninfo l - join [dbo].[CdLessonType] t on l.LessonTypeId = t.LTId where l.LessonNo='{lessonno}' ").FirstOrDefault(); - if (lessoninfo != null) + var cdLessonType = db.FindEntity(lesson.LessonTypeId); + if (cdLessonType != null) { - if (lessoninfo.LessonTypeName.Contains("专业")) + if (cdLessonType.LessonTypeName.Contains("专业")) { //专业课添加此专业的所有班级 var addSql = $@"insert into Exam_ExamPlanClass SELECT NEWID(),'{lesson.EPLId}',c.ClassName,t.ClassNo,count(1) as StuNum FROM Exam_ExamStudent t left join classinfo c on t.ClassNo=c.ClassNo WHERE t.ESEnabled=1 and t.AcademicYearNo='{examPlan.AcademicYearNo}' and t.Semester='{examPlan.Semester}' and t.Grade='{lesson.Grade}' -and t.ESType='{examPlan.PlanType}' and c.majorno='{lessoninfo.TeachMajorNo}' +and t.ESType='{examPlan.PlanType}' and c.majorno='{lesson.TeachMajorNo}' and t.ClassNo not in (select ClassNo from [dbo].[Exam_ExamPlanClass] where EPLId='{lesson.EPLId}') group by t.ClassNo,t.AcademicYearNo,t.Semester,t.ESType,c.ClassName "; db.ExecuteBySql(addSql); } - else if (lessoninfo.LessonTypeName.Contains("公共") || lessoninfo.LessonTypeName.Contains("公开")) + else if (cdLessonType.LessonTypeName.Contains("公共") || cdLessonType.LessonTypeName.Contains("公开")) { //公共课添加所有班级 var addSql = $@"insert into Exam_ExamPlanClass