浏览代码

教室、监考老师系部隔离

新疆体育高职分支
liangkun 1年前
父节点
当前提交
75e89f3453
共有 4 个文件被更改,包括 31 次插入15 次删除
  1. +8
    -5
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.js
  2. +16
    -7
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomService.cs
  3. +3
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherEntity.cs
  4. +4
    -3
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherService.cs

+ 8
- 5
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.js 查看文件

@@ -95,11 +95,14 @@ var bootstrap = function ($, learun) {
if (data[id].EmpNo && (data[id].EmpNo).indexOf(',') != -1) {
var empnoArr = data[id].EmpNo.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);
}


+ 16
- 7
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomService.cs 查看文件

@@ -343,7 +343,7 @@ where l.EPLId='{EPLId}'";
//考场座位数
int? seatCount = 0;
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)
{
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();
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>(
@@ -502,14 +502,23 @@ where l.EPLId='{EPLId}'";
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)
{
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();


+ 3
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherEntity.cs 查看文件

@@ -72,6 +72,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
#endregion
#region 扩展字段

[NotMapped] public int times { get; set; }

#endregion
}
}


+ 4
- 3
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherService.cs 查看文件

@@ -88,6 +88,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
strSql.Append($" AND t.AcademicYearNo = '{ELEntity.AcademicYearNo}' ");
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 ";
@@ -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
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();
if (obj.Count() > 0)
{
@@ -113,9 +114,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
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();
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>(


正在加载...
取消
保存