@@ -95,11 +95,14 @@ var bootstrap = function ($, learun) { | |||||
if (data[id].EmpNo && (data[id].EmpNo).indexOf(',') != -1) { | if (data[id].EmpNo && (data[id].EmpNo).indexOf(',') != -1) { | ||||
var empnoArr = data[id].EmpNo.split(','); | var empnoArr = data[id].EmpNo.split(','); | ||||
var empnameArr = data[id].EmpName.split(','); | var empnameArr = data[id].EmpName.split(','); | ||||
$.each(empnoArr, function (i, val) { | |||||
if (!!val) { | |||||
tempdatra.push({ EmpNo: val, EmpName: empnameArr[i] }); | |||||
} | |||||
}); | |||||
$.each(empnoArr, | |||||
function(i, val) { | |||||
if (!!val) { | |||||
tempdatra.push({ EmpNo: val, EmpName: empnameArr[i] }); | |||||
} | |||||
}); | |||||
} else { | |||||
tempdatra.push({ EmpNo: data[id].EmpNo, EmpName: data[id].EmpName }); | |||||
} | } | ||||
$('#Exam_ExamPlanTeacher').jfGridSet('refreshdata', tempdatra); | $('#Exam_ExamPlanTeacher').jfGridSet('refreshdata', tempdatra); | ||||
} | } | ||||
@@ -278,7 +278,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
string sqldept = ""; | string sqldept = ""; | ||||
if (!string.IsNullOrEmpty(ImportDeptNo)) | if (!string.IsNullOrEmpty(ImportDeptNo)) | ||||
{ | { | ||||
sqldept = $" and t.DeptNo='{ImportDeptNo}'"; | |||||
sqldept = $" and t.DeptNo='{ImportDeptNo}' and LessonTypeId in (select LTId from CdLessonType where LessonTypeCode like 'Professional%') "; | |||||
} | } | ||||
//导入专业开课计划中是必修的(lessonsortno=1)、考核方式是考试的(ExamType='1',2022.6.23新增) | //导入专业开课计划中是必修的(lessonsortno=1)、考核方式是考试的(ExamType='1',2022.6.23新增) | ||||
string sql = $@"insert into Exam_ExamLesson([ELId] | string sql = $@"insert into Exam_ExamLesson([ELId] | ||||
@@ -329,7 +329,7 @@ where l.EPLId='{EPLId}' | |||||
//查询当前考试记录所有考试课程 | //查询当前考试记录所有考试课程 | ||||
var lessonList = db.FindList<Exam_ExamPlanLessonEntity>($@"select a.*,b.MajorNo as TeachMajorNo FROM [dbo].[Exam_ExamPlanLesson] a | var lessonList = db.FindList<Exam_ExamPlanLessonEntity>($@"select a.*,b.MajorNo as TeachMajorNo FROM [dbo].[Exam_ExamPlanLesson] a | ||||
left join [dbo].[Exam_ExamPlan] c on c.epid=a.epid | left join [dbo].[Exam_ExamPlan] c on c.epid=a.epid | ||||
left join [dbo].[Exam_ExamLesson] b on a.lessonno=b.lessonno and b.AcademicYearNo=c.AcademicYearNo and b.Semester=c.Semester and b.Grade=a.Grade | |||||
left join [dbo].[Exam_ExamLesson] b on a.lessonno=b.lessonno and b.AcademicYearNo=c.AcademicYearNo and b.Semester=c.Semester and b.Grade=a.Grade and b.ImportDeptNo=c.ImportDeptNo | |||||
where a.EPId='{EPId}'"); | where a.EPId='{EPId}'"); | ||||
foreach (var lesson in lessonList) | foreach (var lesson in lessonList) | ||||
{ | { | ||||
@@ -337,30 +337,34 @@ where a.EPId='{EPId}'"); | |||||
var cdLessonType = db.FindEntity<CdLessonTypeEntity>(lesson.LessonTypeId); | var cdLessonType = db.FindEntity<CdLessonTypeEntity>(lesson.LessonTypeId); | ||||
if (cdLessonType != null) | if (cdLessonType != null) | ||||
{ | { | ||||
if (cdLessonType.LessonTypeName.Contains("专业")) | |||||
if (cdLessonType.LessonTypeName.Contains("专业") || | |||||
cdLessonType.LessonTypeCode.Contains("Professional")) | |||||
{ | { | ||||
//专业课添加此专业的所有班级 | //专业课添加此专业的所有班级 | ||||
var addSql = $@"insert into Exam_ExamPlanClass | var addSql = $@"insert into Exam_ExamPlanClass | ||||
SELECT NEWID(),'{lesson.EPLId}',c.ClassName,t.ClassNo,count(1) as StuNum FROM Exam_ExamStudent t | 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}' | |||||
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.ImportDeptNo='{examPlan.ImportDeptNo}' | |||||
and t.ESType='{examPlan.PlanType}' and c.majorno='{lesson.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}') | 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 "; | group by t.ClassNo,t.AcademicYearNo,t.Semester,t.ESType,c.ClassName "; | ||||
db.ExecuteBySql(addSql); | db.ExecuteBySql(addSql); | ||||
} | } | ||||
else if (cdLessonType.LessonTypeName.Contains("公共") || cdLessonType.LessonTypeName.Contains("公开")) | |||||
else if (cdLessonType.LessonTypeName.Contains("公共") || | |||||
cdLessonType.LessonTypeName.Contains("公开") || | |||||
cdLessonType.LessonTypeCode.Contains("OpenLesson")) | |||||
{ | { | ||||
//公共课添加所有班级 | //公共课添加所有班级 | ||||
var addSql = $@"insert into Exam_ExamPlanClass | var addSql = $@"insert into Exam_ExamPlanClass | ||||
SELECT NEWID(),'{lesson.EPLId}',c.ClassName,t.ClassNo,count(1) as StuNum FROM Exam_ExamStudent t | 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 t.Grade='{lesson.Grade}' | |||||
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.ImportDeptNo='{examPlan.ImportDeptNo}' | |||||
and t.ClassNo not in (select ClassNo from [dbo].[Exam_ExamPlanClass] where EPLId='{lesson.EPLId}') | 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 "; | group by t.ClassNo,t.AcademicYearNo,t.Semester,t.ESType,c.ClassName "; | ||||
db.ExecuteBySql(addSql); | db.ExecuteBySql(addSql); | ||||
} | } | ||||
} | } | ||||
else | |||||
continue; | |||||
//更新排考安排课程表实排班级数、实排人数和应排班级数、应排人数(如果没有点击【一键安排班级】,应排班级数、应排人数在安排考试页面切换课程时候更新) | //更新排考安排课程表实排班级数、实排人数和应排班级数、应排人数(如果没有点击【一键安排班级】,应排班级数、应排人数在安排考试页面切换课程时候更新) | ||||
string sql = $@"update l | string sql = $@"update l | ||||
set l.RealStuCount=t.RealStuCount,l.RealClassNum=t.RealClassNum,ClassNum=t.RealClassNum,StuCount=t.RealStuCount | set l.RealStuCount=t.RealStuCount,l.RealClassNum=t.RealClassNum,ClassNum=t.RealClassNum,StuCount=t.RealStuCount | ||||
@@ -130,6 +130,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
[NotMapped] | [NotMapped] | ||||
public string LessonTypeName { get; set; } | public string LessonTypeName { get; set; } | ||||
/// <summary> | /// <summary> | ||||
/// 课程类型编号 | |||||
/// </summary> | |||||
[NotMapped] | |||||
public string LessonTypeCode { get; set; } | |||||
/// <summary> | |||||
/// 专业 | /// 专业 | ||||
/// </summary> | /// </summary> | ||||
[NotMapped] | [NotMapped] | ||||
@@ -329,7 +329,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
{ | { | ||||
//必修+'('+grade+')' | //必修+'('+grade+')' | ||||
string sql = $@"insert into Exam_ExamPlanLesson(EPLId,EPId,LessonName,LessonNo,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}' | |||||
select NEWID(),'{EPId}',LessonName,LessonNo,LessonTypeId,grade from Exam_ExamLesson where ELEnabled=1 and AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and Semester='{exam_ExamPlan.Semester}' and ImportDeptNo='{exam_ExamPlan.ImportDeptNo}' | |||||
and LessonNo not in (select LessonNo from Exam_ExamPlanLesson where EPId='{EPId}') | and LessonNo not in (select LessonNo from Exam_ExamPlanLesson where EPId='{EPId}') | ||||
group by LessonNo,grade,LessonName,LessonTypeId,grade"; | group by LessonNo,grade,LessonName,LessonTypeId,grade"; | ||||
this.BaseRepository("CollegeMIS").ExecuteBySql(sql); | this.BaseRepository("CollegeMIS").ExecuteBySql(sql); | ||||
@@ -340,7 +340,7 @@ select NEWID(),'{EPId}',LessonName,LessonNo,LessonTypeId,grade from Exam_ExamLes | |||||
string sql = $@" insert into Exam_ExamPlanLesson(EPLId,EPId,LessonName,LessonNo,LessonTypeId,Grade) | string sql = $@" insert into Exam_ExamPlanLesson(EPLId,EPId,LessonName,LessonNo,LessonTypeId,Grade) | ||||
select NEWID(),'{EPId}',a.lessonname,a.LessonNo,t.LessonTypeId,b.Grade | select NEWID(),'{EPId}',a.lessonname,a.LessonNo,t.LessonTypeId,b.Grade | ||||
from StuScore a left join StuInfoBasic b on b.StuNo=a.StuNo | from StuScore a left join StuInfoBasic b on b.StuNo=a.StuNo | ||||
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 | |||||
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}' and ImportDeptNo='{exam_ExamPlan.ImportDeptNo}' ) 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 | --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)) | 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.ChangeStatus<>'1' or len(b.ChangeStatus)=0 or b.ChangeStatus is null) | and (b.ChangeStatus<>'1' or len(b.ChangeStatus)=0 or b.ChangeStatus is null) | ||||
@@ -355,7 +355,7 @@ and AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and Semester='{exam_ExamPlan | |||||
string sql = $@" insert into Exam_ExamPlanLesson(EPLId,EPId,LessonName,LessonNo,LessonTypeId,Grade) | string sql = $@" insert into Exam_ExamPlanLesson(EPLId,EPId,LessonName,LessonNo,LessonTypeId,Grade) | ||||
select NEWID(),'{EPId}',a.lessonname,a.LessonNo,t.LessonTypeId,b.Grade | select NEWID(),'{EPId}',a.lessonname,a.LessonNo,t.LessonTypeId,b.Grade | ||||
from StuScoreNotPass a left join StuInfoBasic b on b.StuNo=a.StuNo | from StuScoreNotPass a left join StuInfoBasic b on b.StuNo=a.StuNo | ||||
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 | |||||
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}' and ImportDeptNo='{exam_ExamPlan.ImportDeptNo}' ) 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 | --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)) | 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.ChangeStatus<>'1' or len(b.ChangeStatus)=0 or b.ChangeStatus is null) | and (b.ChangeStatus<>'1' or len(b.ChangeStatus)=0 or b.ChangeStatus is null) | ||||
@@ -592,8 +592,8 @@ left join CdLessonType ltype on info.LessonTypeId=ltype.LTId | |||||
return (false, "请先安排考试记录时间!"); | return (false, "请先安排考试记录时间!"); | ||||
} | } | ||||
//考试课程数据 | //考试课程数据 | ||||
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}' | |||||
var EPLessonList = db.FindList<Exam_ExamPlanLessonEntity>($@" select distinct elesson.ExamTime as ExamLength,ltype.LessonTypeCode,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}' and elesson.ImportDeptNo='{examPlan.ImportDeptNo}' | |||||
left join CdLessonType ltype on elesson.LessonTypeId=ltype.LTId | left join CdLessonType ltype on elesson.LessonTypeId=ltype.LTId | ||||
where t.EPId='{EPId}' and elesson.ELEnabled=1 "); | where t.EPId='{EPId}' and elesson.ELEnabled=1 "); | ||||
// if (examPlan.PlanType == "1") | // if (examPlan.PlanType == "1") | ||||
@@ -618,8 +618,9 @@ left join CdLessonType ltype on elesson.LessonTypeId=ltype.LTId | |||||
{ | { | ||||
EPLesson.ExamDate = null; | EPLesson.ExamDate = null; | ||||
EPLesson.ExamTime = null; | EPLesson.ExamTime = null; | ||||
if (!string.IsNullOrEmpty(EPLesson.LessonTypeName) && (EPLesson.LessonTypeName.Contains("公共") || EPLesson.LessonTypeName.Contains("公开"))) | |||||
if (!string.IsNullOrEmpty(EPLesson.LessonTypeName) && (EPLesson.LessonTypeName.Contains("公共") || EPLesson.LessonTypeName.Contains("公开")||EPLesson.LessonTypeCode.Contains("OpenLesson"))) | |||||
{ | { | ||||
//获取公共课时间安排 | |||||
var EPTimes = EPTimeList.Where(x => x.ExamType == "2" && x.ExamTimeLength == EPLesson.ExamLength).ToList(); | var EPTimes = EPTimeList.Where(x => x.ExamType == "2" && x.ExamTimeLength == EPLesson.ExamLength).ToList(); | ||||
foreach (var EPTime in EPTimes) | foreach (var EPTime in EPTimes) | ||||
{ | { | ||||
@@ -627,7 +628,7 @@ left join CdLessonType ltype on elesson.LessonTypeId=ltype.LTId | |||||
//不存在同专业同时间段的考试课程,修改考试时间 | //不存在同专业同时间段的考试课程,修改考试时间 | ||||
if (!EPLessonList.ToList().Exists(x => | if (!EPLessonList.ToList().Exists(x => | ||||
x.TeachMajorNo == EPLesson.TeachMajorNo && x.ExamLength == EPTime.ExamTimeLength && x.ExamDate != null && | x.TeachMajorNo == EPLesson.TeachMajorNo && x.ExamLength == EPTime.ExamTimeLength && x.ExamDate != null && | ||||
x.ExamDate == EPTime.ExamDate && x.ExamTime == time)) | |||||
x.ExamDate == EPTime.ExamDate && x.ExamTime == time&&x.Grade==EPLesson.Grade)) | |||||
{ | { | ||||
EPLesson.ExamDate = EPTime.ExamDate; | EPLesson.ExamDate = EPTime.ExamDate; | ||||
EPLesson.ExamTime = time; | EPLesson.ExamTime = time; | ||||
@@ -652,7 +653,7 @@ left join CdLessonType ltype on elesson.LessonTypeId=ltype.LTId | |||||
//不存在同专业同时间段的考试课程,修改考试时间 | //不存在同专业同时间段的考试课程,修改考试时间 | ||||
if (!EPLessonList.ToList().Exists(x => | if (!EPLessonList.ToList().Exists(x => | ||||
x.TeachMajorNo == EPLesson.TeachMajorNo && x.ExamLength == EPTime.ExamTimeLength && x.ExamDate != null && | x.TeachMajorNo == EPLesson.TeachMajorNo && x.ExamLength == EPTime.ExamTimeLength && x.ExamDate != null && | ||||
x.ExamDate == EPTime.ExamDate && x.ExamTime == time)) | |||||
x.ExamDate == EPTime.ExamDate && x.ExamTime == time && x.Grade == EPLesson.Grade)) | |||||
{ | { | ||||
EPLesson.ExamDate = EPTime.ExamDate; | EPLesson.ExamDate = EPTime.ExamDate; | ||||
@@ -343,7 +343,7 @@ where l.EPLId='{EPLId}'"; | |||||
//考场座位数 | //考场座位数 | ||||
int? seatCount = 0; | int? seatCount = 0; | ||||
var roomListSql = | var roomListSql = | ||||
$"select * from Exam_ExamRoom where AcademicYearNo='{examPlan.AcademicYearNo}' and Semester='{examPlan.Semester}' and EREnabled=1 "; | |||||
$"select * from Exam_ExamRoom where AcademicYearNo='{examPlan.AcademicYearNo}' and Semester='{examPlan.Semester}' and ImportDeptNo='{examPlan.ImportDeptNo}' and EREnabled=1 "; | |||||
if (conflictRoom.Count() > 0) | if (conflictRoom.Count() > 0) | ||||
{ | { | ||||
var classroomNo = string.Join("','", conflictRoom.ToList()); | var classroomNo = string.Join("','", conflictRoom.ToList()); | ||||
@@ -461,9 +461,9 @@ where l.EPLId='{EPLId}'"; | |||||
} | } | ||||
//查询课程信息 | //查询课程信息 | ||||
var lessoninfo = db.FindList<LessonInfoEntity>($@"select top 1 t.LessonTypeName,l.* from lessoninfo l | |||||
var lessoninfo = db.FindList<LessonInfoEntity>($@"select top 1 t.LessonTypeName,t.LessonTypeCode,l.* from lessoninfo l | |||||
join [dbo].[CdLessonType] t on l.LessonTypeId = t.LTId where l.LessonNo='{LessonNo}' ").FirstOrDefault(); | join [dbo].[CdLessonType] t on l.LessonTypeId = t.LTId where l.LessonNo='{LessonNo}' ").FirstOrDefault(); | ||||
if (lessoninfo != null && !lessoninfo.LessonTypeName.Contains("公共") && !lessoninfo.LessonTypeName.Contains("公开")) | |||||
if (lessoninfo != null && !lessoninfo.LessonTypeName.Contains("公共") && !lessoninfo.LessonTypeName.Contains("公开")&&!lessoninfo.LessonTypeCode.Contains("OpenLesson")) | |||||
{ | { | ||||
//如果是专业课,监考老师不能添加这门课的代课老师 | //如果是专业课,监考老师不能添加这门课的代课老师 | ||||
var teachClass = db.FindList<TeachClassEntity>( | var teachClass = db.FindList<TeachClassEntity>( | ||||
@@ -502,14 +502,23 @@ where l.EPLId='{EPLId}'"; | |||||
empnos.Add(examRoom.EmpNo); | empnos.Add(examRoom.EmpNo); | ||||
} | } | ||||
} | } | ||||
var sql = $@"select * from Exam_InvigilateTeacher where AcademicYearNo='{examPlan.AcademicYearNo}' and Semester='{examPlan.Semester}' and ITEnabled=1 "; | |||||
//20230614增加已排监考次数算法 | |||||
//排过监考的老师顺序往后调整 | |||||
//var sql = $@"select * from Exam_InvigilateTeacher where AcademicYearNo='{examPlan.AcademicYearNo}' and Semester='{examPlan.Semester}' and ImportDeptNo='{examPlan.ImportDeptNo}' and ITEnabled=1 "; | |||||
var sql = $@"select aa.EmpName,aa.EmpNo,count(b.EmpNo) as times from Exam_InvigilateTeacher aa | |||||
left join(select EPRId, SUBSTRING(a.EmpNo, number, CHARINDEX(',',a.EmpNo + ',',number)-number) as EmpNo | |||||
from[Exam_ExamPlanRoom] a with(nolock) ,master..spt_values with(nolock) | |||||
where number>= 1 and number<len(a.EmpNo) and type = 'p' | |||||
and sUBSTRING(',' + a.EmpNo , number,1)= ',' and eplid in ({string.Join(",", examLessonList.Select(m=>"'"+m.EPLId+"'"))}) | |||||
) b on aa.empno = b.empno | |||||
where aa.AcademicYearNo = '{examPlan.AcademicYearNo}' and aa.Semester = '{examPlan.Semester}' and aa.ImportDeptNo = '{examPlan.ImportDeptNo}' and aa.ITEnabled = 1"; | |||||
if (empnos.Count() > 0) | if (empnos.Count() > 0) | ||||
{ | { | ||||
string nos = string.Join("','", empnos); | string nos = string.Join("','", empnos); | ||||
sql += $" and EmpNo not in ('{nos}')"; | |||||
sql += $" and aa.EmpNo not in ('{nos}')"; | |||||
} | } | ||||
var Exam_InvigilateTeacher = db.FindList<Exam_InvigilateTeacherEntity>(sql).OrderBy(x => Guid.NewGuid()).ToList(); | |||||
sql += " group by aa.EmpName,aa.EmpNo order by times"; | |||||
var Exam_InvigilateTeacher = db.FindList<Exam_InvigilateTeacherEntity>(sql).OrderBy(x => Guid.NewGuid()).OrderBy(x=>x.times).ToList(); | |||||
//查询考场 | //查询考场 | ||||
var examPlanRooms = db.FindList<Exam_ExamPlanRoomEntity>(x => x.EPLId == epLesson.EPLId).ToList(); | var examPlanRooms = db.FindList<Exam_ExamPlanRoomEntity>(x => x.EPLId == epLesson.EPLId).ToList(); | ||||
@@ -45,7 +45,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
[Column("EXAMTIMELENGTH")] | [Column("EXAMTIMELENGTH")] | ||||
public double? ExamTimeLength { get; set; } | public double? ExamTimeLength { get; set; } | ||||
/// <summary> | /// <summary> | ||||
/// 排考名称 | |||||
/// 课程类型 | |||||
/// </summary> | /// </summary> | ||||
[Column("EXAMTYPE")] | [Column("EXAMTYPE")] | ||||
public string ExamType { get; set; } | public string ExamType { get; set; } | ||||
@@ -84,6 +84,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
{ | { | ||||
strSql.Append($" AND t.AcademicYearNo = '{ELEntity.AcademicYearNo}' "); | strSql.Append($" AND t.AcademicYearNo = '{ELEntity.AcademicYearNo}' "); | ||||
strSql.Append($" AND t.Semester = '{ELEntity.Semester}' "); | strSql.Append($" AND t.Semester = '{ELEntity.Semester}' "); | ||||
strSql.Append($" AND t.ImportDeptNo = '{ELEntity.ImportDeptNo}' "); | |||||
} | } | ||||
strSql.Append($" AND t.ClassroomNo not in (select ClassroomNo from Exam_ExamPlanRoom where EPLId='{queryParam["EPLId"].ToString()}') "); | strSql.Append($" AND t.ClassroomNo not in (select ClassroomNo from Exam_ExamPlanRoom where EPLId='{queryParam["EPLId"].ToString()}') "); | ||||
@@ -117,6 +117,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
strSql.Append(@" t.ClassNo,count(1) as StuNum,t.AcademicYearNo,t.Semester,t.ESType,c.ClassName "); | strSql.Append(@" t.ClassNo,count(1) as StuNum,t.AcademicYearNo,t.Semester,t.ESType,c.ClassName "); | ||||
strSql.Append(" FROM Exam_ExamStudent t "); | strSql.Append(" FROM Exam_ExamStudent t "); | ||||
strSql.Append(" left join classinfo c on t.ClassNo=c.ClassNo "); | strSql.Append(" left join classinfo c on t.ClassNo=c.ClassNo "); | ||||
strSql.Append(" left join Exam_ExamPlan d on t.ImportDeptNo=d.ImportDeptNo "); | |||||
strSql.Append(" WHERE t.ESEnabled=1 "); | strSql.Append(" WHERE t.ESEnabled=1 "); | ||||
var queryParam = queryJson.ToJObject(); | var queryParam = queryJson.ToJObject(); | ||||
// 虚拟参数 | // 虚拟参数 | ||||
@@ -151,19 +152,19 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
dp.Add("StuName", "%" + queryParam["StuName"].ToString() + "%", DbType.String); | dp.Add("StuName", "%" + queryParam["StuName"].ToString() + "%", DbType.String); | ||||
strSql.Append(" AND t.StuName Like @StuName "); | strSql.Append(" AND t.StuName Like @StuName "); | ||||
} | } | ||||
if (!queryParam["ImportDeptNo"].IsEmpty()) | |||||
{ | |||||
if (queryParam["ImportDeptNo"].ToString() == "0") | |||||
{ | |||||
strSql.Append(" AND t.ImportDeptNo='' "); | |||||
} | |||||
else | |||||
{ | |||||
dp.Add("ImportDeptNo", queryParam["ImportDeptNo"].ToString(), DbType.String); | |||||
strSql.Append(" AND t.ImportDeptNo = @ImportDeptNo "); | |||||
} | |||||
//if (!queryParam["ImportDeptNo"].IsEmpty()) | |||||
//{ | |||||
// if (queryParam["ImportDeptNo"].ToString() == "0") | |||||
// { | |||||
// strSql.Append(" AND t.ImportDeptNo='' "); | |||||
// } | |||||
// else | |||||
// { | |||||
// dp.Add("ImportDeptNo", queryParam["ImportDeptNo"].ToString(), DbType.String); | |||||
// strSql.Append(" AND t.ImportDeptNo = @ImportDeptNo "); | |||||
// } | |||||
} | |||||
//} | |||||
if (!queryParam["ESType"].IsEmpty()) | if (!queryParam["ESType"].IsEmpty()) | ||||
{ | { | ||||
dp.Add("ESType", queryParam["ESType"].ToString(), DbType.String); | dp.Add("ESType", queryParam["ESType"].ToString(), DbType.String); | ||||
@@ -184,7 +185,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
var examPlan = this.BaseRepository("CollegeMIS").FindEntity<Exam_ExamPlanEntity>(queryParam["EPId"].ToString()); | var examPlan = this.BaseRepository("CollegeMIS").FindEntity<Exam_ExamPlanEntity>(queryParam["EPId"].ToString()); | ||||
if (examPlan != null) | if (examPlan != null) | ||||
{ | { | ||||
strSql.Append($" AND t.AcademicYearNo = '{examPlan.AcademicYearNo}' AND t.Semester = '{examPlan.Semester}' AND t.ESType = '{examPlan.PlanType}' "); | |||||
strSql.Append($" AND t.AcademicYearNo = '{examPlan.AcademicYearNo}' AND t.Semester = '{examPlan.Semester}' AND t.ESType = '{examPlan.PlanType}' and t.ImportDeptNo='{examPlan.ImportDeptNo}' "); | |||||
} | } | ||||
} | } | ||||
strSql.Append(" group by t.ClassNo,t.AcademicYearNo,t.Semester,t.ESType,c.ClassName "); | strSql.Append(" group by t.ClassNo,t.AcademicYearNo,t.Semester,t.ESType,c.ClassName "); | ||||
@@ -72,6 +72,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
#endregion | #endregion | ||||
#region 扩展字段 | #region 扩展字段 | ||||
[NotMapped] public int times { get; set; } | |||||
#endregion | #endregion | ||||
} | } | ||||
} | } | ||||
@@ -88,6 +88,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
{ | { | ||||
strSql.Append($" AND t.AcademicYearNo = '{ELEntity.AcademicYearNo}' "); | strSql.Append($" AND t.AcademicYearNo = '{ELEntity.AcademicYearNo}' "); | ||||
strSql.Append($" AND t.Semester = '{ELEntity.Semester}' "); | strSql.Append($" AND t.Semester = '{ELEntity.Semester}' "); | ||||
strSql.Append($" AND t.ImportDeptNo = '{ELEntity.ImportDeptNo}' "); | |||||
} | } | ||||
//同一考试课程下考场的监考老师不重复 | //同一考试课程下考场的监考老师不重复 | ||||
var empSql = "SELECT STUFF( (SELECT ',' + empno FROM Exam_ExamPlanRoom WHERE 1=1 "; | var empSql = "SELECT STUFF( (SELECT ',' + empno FROM Exam_ExamPlanRoom WHERE 1=1 "; | ||||
@@ -97,7 +98,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
empSql += $@" and EPLId = T.EPLId FOR XML PATH('') ), 1, 1, '') AS empno FROM Exam_ExamPlanRoom AS T | empSql += $@" and EPLId = T.EPLId FOR XML PATH('') ), 1, 1, '') AS empno FROM Exam_ExamPlanRoom AS T | ||||
where EPLId ='{queryParam["EPLId"].ToString()}'"; | |||||
where EPLId ='{queryParam["EPLId"].ToString()}' and empno is not null "; | |||||
var obj = this.BaseRepository("CollegeMIS").FindList<Exam_ExamPlanRoomEntity>(empSql).Select(x => x.EmpNo).Distinct().ToList(); | var obj = this.BaseRepository("CollegeMIS").FindList<Exam_ExamPlanRoomEntity>(empSql).Select(x => x.EmpNo).Distinct().ToList(); | ||||
if (obj.Count() > 0) | if (obj.Count() > 0) | ||||
{ | { | ||||
@@ -113,9 +114,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
LessonNo = LessonNo.Split('(')[0]; | LessonNo = LessonNo.Split('(')[0]; | ||||
} | } | ||||
//查询课程信息 | //查询课程信息 | ||||
var lessoninfo = this.BaseRepository("CollegeMIS").FindList<LessonInfoEntity>($@"select top 1 t.LessonTypeName,l.* from lessoninfo l | |||||
var lessoninfo = this.BaseRepository("CollegeMIS").FindList<LessonInfoEntity>($@"select top 1 t.LessonTypeName,t.LessonTypeCode,l.* from lessoninfo l | |||||
join [dbo].[CdLessonType] t on l.LessonTypeId = t.LTId where l.LessonNo='{LessonNo}' ").FirstOrDefault(); | join [dbo].[CdLessonType] t on l.LessonTypeId = t.LTId where l.LessonNo='{LessonNo}' ").FirstOrDefault(); | ||||
if (lessoninfo != null && !lessoninfo.LessonTypeName.Contains("公共") && !lessoninfo.LessonTypeName.Contains("公开")) | |||||
if (lessoninfo != null && !lessoninfo.LessonTypeName.Contains("公共") && !lessoninfo.LessonTypeName.Contains("公开")&&!lessoninfo.LessonTypeCode.Contains("OpenLesson")) | |||||
{ | { | ||||
//如果是专业课,监考老师不能添加这门课的代课老师 | //如果是专业课,监考老师不能添加这门课的代课老师 | ||||
var teachClass = this.BaseRepository("CollegeMIS").FindList<TeachClassEntity>( | var teachClass = this.BaseRepository("CollegeMIS").FindList<TeachClassEntity>( | ||||