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 83ec5e56b..1ddf2952e 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 @@ -178,6 +178,7 @@ var bootstrap = function ($, learun) { }, { label: "学生编号", name: "StuNo", width: 100, align: "left" }, { label: "学生姓名", name: "StuName", width: 100, align: "left" }, + { label: "年级", name: "Grade", width: 100, align: "left" }, { label: "考试类型", name: "ESType", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { 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 7c2e4c8dd..55e623e53 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 @@ -346,7 +346,8 @@ where l.EPLId='{EPLId}' //专业课添加此专业的所有班级 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.ESType='{examPlan.PlanType}' and c.majorno='{lessoninfo.TeachMajorNo}' + 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.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); @@ -356,7 +357,7 @@ where l.EPLId='{EPLId}' //公共课添加所有班级 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.ESType='{examPlan.PlanType}' + 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.ESType='{examPlan.PlanType}' and t.Grade='{lesson.Grade}' 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); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonBLL.cs index b69de675b..2e12aef31 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonBLL.cs @@ -139,7 +139,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration TreeModel node = new TreeModel { id = item["eplid"].ToString(), - text = item["lessonname"].ToString(), + text = item["lessonname"].ToString() + "(" + item["grade"].ToString() + ")", value = item["lessonno"].ToString(), showcheck = false, checkstate = 0, @@ -340,7 +340,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } - + public (bool flag, string str) CheckAllPlanLesson(string EPId) { try diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonEntity.cs index c2e3971d9..4baa5d04c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonEntity.cs @@ -11,7 +11,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 日 期:2022-04-15 15:03 /// 描 述:排考安排课程 /// - public class Exam_ExamPlanLessonEntity + public class Exam_ExamPlanLessonEntity { #region 实体成员 /// @@ -29,7 +29,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// [Column("ELID")] public string ELId { get; set; } - + + /// + /// 年级 + /// + [Column("GRADE")] + public int? Grade { get; set; } /// /// LessonName /// @@ -45,7 +50,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// [Column("LESSONTYPEID")] public string LessonTypeId { get; set; } - + /// /// 考试日期 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonService.cs index 86eb859b4..75cab56f9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonService.cs @@ -229,7 +229,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - var sql = $@"select distinct t.EPLId,t.LessonName,a.ltorder,t.LessonNo from Exam_ExamPlanLesson t + var sql = $@"select distinct t.EPLId,t.LessonName,t.Grade,a.ltorder,t.LessonNo from Exam_ExamPlanLesson t join CdLessonType a on t.LessonTypeId=a.ltid where EPId='{EPId}' order by a.ltorder, t.LessonNo"; @@ -327,39 +327,41 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration var exam_ExamPlan = this.BaseRepository("CollegeMIS").FindEntity(x => x.EPId == EPId); if (exam_ExamPlan.PlanType == "1") { - //必修 - string sql = $@"insert into Exam_ExamPlanLesson(EPLId,EPId,LessonName,LessonNo,LessonTypeId) -select NEWID(),'{EPId}',LessonName+'('+grade+')',LessonNo+'('+grade+')',LessonTypeId from Exam_ExamLesson where ELEnabled=1 and AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and Semester='{exam_ExamPlan.Semester}' - and LessonNo+'('+grade+')' not in (select LessonNo from Exam_ExamPlanLesson where EPId='{EPId}') - group by LessonNo,grade,LessonName,LessonTypeId"; + //必修+'('+grade+')' + string sql = $@"insert into Exam_ExamPlanLesson(EPLId,EPId,LessonName,LessonNo,LessonTypeId,Grade) +select NEWID(),'{EPId}',LessonName,LessonNo,LessonTypeId,grade from Exam_ExamLesson where ELEnabled=1 and AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and Semester='{exam_ExamPlan.Semester}' + and LessonNo not in (select LessonNo from Exam_ExamPlanLesson where EPId='{EPId}') + group by LessonNo,grade,LessonName,LessonTypeId,grade"; this.BaseRepository("CollegeMIS").ExecuteBySql(sql); } else if (exam_ExamPlan.PlanType == "2") { //补考 - string sql = $@" insert into Exam_ExamPlanLesson(EPLId,EPId,LessonName,LessonNo,LessonTypeId) - select NEWID(),'{EPId}',a.lessonname,a.LessonNo,t.LessonTypeId + string sql = $@" insert into Exam_ExamPlanLesson(EPLId,EPId,LessonName,LessonNo,LessonTypeId,Grade) + select NEWID(),'{EPId}',a.lessonname,a.LessonNo,t.LessonTypeId,b.Grade from StuScore a left join StuInfoBasic b on b.StuNo=a.StuNo -left join (select l.lessonno,l.LessonTypeId,lt.ltorder from lessoninfo l left join CdLessonType lt on l.LessonTypeId=lt.ltid ) t on a.lessonno=t.lessonno + join (select l.lessonno,l.LessonTypeId,lt.ltorder from Exam_ExamLesson l left join CdLessonType lt on l.LessonTypeId=lt.ltid where l.elenabled=1 and l.AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and l.Semester='{exam_ExamPlan.Semester}' ) t on a.lessonno=t.lessonno +--left join (select l.lessonno,l.LessonTypeId,lt.ltorder from lessoninfo l left join CdLessonType lt on l.LessonTypeId=lt.ltid ) t on a.lessonno=t.lessonno where 1=1 and a.LessonSortNo='1' and ((a.Score>=0 and a.Score<60) or a.Score=(-5) or a.Score=(-10)) and (b.AbmormityMoveMark<>'1' or len(b.AbmormityMoveMark)=0 or b.AbmormityMoveMark is null) and AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and Semester='{exam_ExamPlan.Semester}' and a.LessonNo not in (select LessonNo from Exam_ExamPlanLesson where EPId='{EPId}') - group by t.ltorder,a.LessonNo,a.lessonname,t.LessonTypeId"; + group by t.ltorder,a.LessonNo,a.lessonname,t.LessonTypeId,b.Grade"; this.BaseRepository("CollegeMIS").ExecuteBySql(sql); } else if (exam_ExamPlan.PlanType == "3") { //重修 - string sql = $@" insert into Exam_ExamPlanLesson(EPLId,EPId,LessonName,LessonNo,LessonTypeId) - select NEWID(),'{EPId}',a.lessonname,a.LessonNo,t.LessonTypeId + string sql = $@" insert into Exam_ExamPlanLesson(EPLId,EPId,LessonName,LessonNo,LessonTypeId,Grade) + select NEWID(),'{EPId}',a.lessonname,a.LessonNo,t.LessonTypeId,b.Grade from StuScoreNotPass a left join StuInfoBasic b on b.StuNo=a.StuNo -left join (select l.lessonno,l.LessonTypeId,lt.ltorder from lessoninfo l left join CdLessonType lt on l.LessonTypeId=lt.ltid ) t on a.lessonno=t.lessonno + join (select l.lessonno,l.LessonTypeId,lt.ltorder from Exam_ExamLesson l left join CdLessonType lt on l.LessonTypeId=lt.ltid where l.elenabled=1 and l.AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and l.Semester='{exam_ExamPlan.Semester}' ) t on a.lessonno=t.lessonno +--left join (select l.lessonno,l.LessonTypeId,lt.ltorder from lessoninfo l left join CdLessonType lt on l.LessonTypeId=lt.ltid ) t on a.lessonno=t.lessonno where 1=1 and a.LessonSortNo='1' and ((a.Score>=0 and a.Score<60) or a.Score=(-5) or a.Score=(-10)) and (b.AbmormityMoveMark<>'1' or len(b.AbmormityMoveMark)=0 or b.AbmormityMoveMark is null) and AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and Semester='{exam_ExamPlan.Semester}' and LessonNo not in (select LessonNo from Exam_ExamPlanLesson where EPId='{EPId}') - group by t.ltorder,a.LessonNo,a.lessonname,t.LessonTypeId "; + group by t.ltorder,a.LessonNo,a.lessonname,t.LessonTypeId,b.Grade "; this.BaseRepository("CollegeMIS").ExecuteBySql(sql); } @@ -592,19 +594,17 @@ left join CdLessonType ltype on info.LessonTypeId=ltype.LTId //考试课程数据 var EPLessonList = db.FindList($@" select distinct elesson.ExamTime as ExamLength,ltype.LessonTypeName,elesson.MajorNo as TeachMajorNo,t.* from Exam_ExamPlanLesson t join Exam_ExamLesson elesson on t.LessonNo=elesson.LessonNo and [AcademicYearNo]='{examPlan.AcademicYearNo}' and [Semester]='{examPlan.Semester}' ---left join Exam_ExamLesson info on left(t.LessonNo,charindex('(',t.LessonNo)-1)=info.LessonNo left join CdLessonType ltype on elesson.LessonTypeId=ltype.LTId where t.EPId='{EPId}' and elesson.ELEnabled=1 "); - if (examPlan.PlanType == "1") - { - //必修 - EPLessonList = db.FindList($@" select distinct elesson.ExamTime as ExamLength,ltype.LessonTypeName,elesson.MajorNo as TeachMajorNo,t.* from Exam_ExamPlanLesson t -join Exam_ExamLesson elesson on left(t.LessonNo,charindex('(',t.LessonNo)-1)=elesson.LessonNo and [AcademicYearNo]='{examPlan.AcademicYearNo}' and [Semester]='{examPlan.Semester}' ---left join Exam_ExamLesson info on left(t.LessonNo,charindex('(',t.LessonNo)-1)=info.LessonNo -left join CdLessonType ltype on elesson.LessonTypeId=ltype.LTId - where t.EPId='{EPId}' and elesson.ELEnabled=1 - "); - } +// if (examPlan.PlanType == "1") +// { +// //必修 +// EPLessonList = db.FindList($@" select distinct elesson.ExamTime as ExamLength,ltype.LessonTypeName,elesson.MajorNo as TeachMajorNo,t.* from Exam_ExamPlanLesson t +//join Exam_ExamLesson elesson on left(t.LessonNo,charindex('(',t.LessonNo)-1)=elesson.LessonNo and [AcademicYearNo]='{examPlan.AcademicYearNo}' and [Semester]='{examPlan.Semester}' +//left join CdLessonType ltype on elesson.LessonTypeId=ltype.LTId +// where t.EPId='{EPId}' and elesson.ELEnabled=1 +// "); +// } if (EPLessonList.ToList().Exists(x => x.ExamLength == null || x.ExamLength <= 0)) { 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 2bc99622f..c0239280f 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 @@ -35,6 +35,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration [Column("SEMESTER")] public int? Semester { get; set; } /// + /// 年级 + /// + [Column("GRADE")] + public int? Grade { get; set; } + /// /// 学生编码 /// [Column("STUNO")] 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 88cd8d87b..bad441961 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 @@ -33,7 +33,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { var strSql = new StringBuilder(); strSql.Append("SELECT "); - strSql.Append(@" * "); + strSql.Append(@" t.* "); strSql.Append(" FROM Exam_ExamStudent t "); strSql.Append(" WHERE 1=1 "); var queryParam = queryJson.ToJObject(); @@ -360,14 +360,14 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration if (ESType == "1") { strSql.Append( - $@"insert into Exam_ExamStudent(ESId,ClassNo,AcademicYearNo,Semester,StuNo,StuName,ESType,ESEnabled) - select newid(), a.classno, '{AcademicYearNo}', '{Semester}', a.stuno, a.stuname, '{ESType}', 1 from StuInfoBasic a where CheckMark = '1' and stuno not in (select stuno from Exam_ExamStudent where AcademicYearNo = '{AcademicYearNo}' and Semester = '{Semester}' and ESType = '1' union + $@"insert into Exam_ExamStudent(ESId,ClassNo,AcademicYearNo,Semester,StuNo,StuName,ESType,ESEnabled,Grade) + select newid(), a.classno, '{AcademicYearNo}', '{Semester}', a.stuno, a.stuname, '{ESType}', 1,a.Grade from StuInfoBasic a where CheckMark = '1' and stuno not in (select stuno from Exam_ExamStudent where AcademicYearNo = '{AcademicYearNo}' and Semester = '{Semester}' and ESType = '1' union select StuNo from StuInfoBasicChange where StuChangeType in ('04','05','06') and CheckStatus='1')"); } else { - strSql.Append(@" insert into Exam_ExamStudent(ESId,ClassNo,AcademicYearNo,Semester,StuNo,StuName,ESType,ESEnabled) "); - strSql.Append($"select newid(),a.classno,'{AcademicYearNo}','{Semester}',a.stuno,a.stuname,'{ESType}',1 from "); + strSql.Append(@" insert into Exam_ExamStudent(ESId,ClassNo,AcademicYearNo,Semester,StuNo,StuName,ESType,ESEnabled,Grade) "); + strSql.Append($"select newid(),a.classno,'{AcademicYearNo}','{Semester}',a.stuno,a.stuname,'{ESType}',1,b.Grade from "); if (ESType == "2") { strSql.Append(" StuScore "); @@ -382,7 +382,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration strSql.Append(" and (b.AbmormityMoveMark<>'1' or len(b.AbmormityMoveMark)=0 or b.AbmormityMoveMark is null) "); strSql.Append($@" and a.stuno not in (select stuno from Exam_ExamStudent where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and ESType='{ESType}' union select StuNo from StuInfoBasicChange where StuChangeType in ('04','05','06') and CheckStatus='1' ) "); - strSql.Append(" group by a.stuno,a.stuname,a.classno"); + strSql.Append(" group by a.stuno,a.stuname,a.classno,b.Grade"); } return this.BaseRepository("CollegeMIS").ExecuteBySql(strSql.ToString()); }