|
|
@@ -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<Exam_ExamPlanEntity>(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<Exam_ExamPlanLessonEntity>($@" 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<Exam_ExamPlanLessonEntity>($@" 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<Exam_ExamPlanLessonEntity>($@" 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)) |
|
|
|
{ |
|
|
|