@@ -56,7 +56,7 @@ var bootstrap = function ($, learun) { | |||
selectedRow = null; | |||
learun.layerForm({ | |||
id: 'formroom1', | |||
title: '新增考场', | |||
title: '选择考场', | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/FormRoom?EPLId=' + EPLId, | |||
width: 850, | |||
height: 500, | |||
@@ -92,11 +92,13 @@ var bootstrap = function ($, learun) { | |||
} else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
var empnoArr = data[id].EmpNo.split(','); | |||
var empnameArr = data[id].EmpName.split(','); | |||
$.each(empnoArr, function (i, val) { | |||
tempdatra.push({ EmpNo: val, EmpName: empnameArr[i] }); | |||
}); | |||
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) { | |||
tempdatra.push({ EmpNo: val, EmpName: empnameArr[i] }); | |||
}); | |||
} | |||
$('#Exam_ExamPlanTeacher').jfGridSet('refreshdata', tempdatra); | |||
} | |||
} | |||
@@ -146,7 +148,7 @@ var bootstrap = function ($, learun) { | |||
} | |||
var datas = $('#Exam_ExamPlanTeacher').jfGridGet('rowdatas'); | |||
if (datas == null || datas.length == 0) { | |||
learun.alert.warning("请先新增监考老师!"); | |||
learun.alert.warning("请新增监考老师!"); | |||
return false; | |||
} | |||
return true; | |||
@@ -169,14 +171,14 @@ var bootstrap = function ($, learun) { | |||
'/EducationalAdministration/Exam_ExamPlanLesson/SaveRoomAndTeacher?keyValue=' + | |||
keyValue, | |||
postData, | |||
function(res) { | |||
function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(res, formData, i); | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
page.init(); | |||
} |
@@ -129,12 +129,16 @@ var bootstrap = function ($, learun) { | |||
if (ELCheckMark == 1) { | |||
return learun.alert.warning("该项已审核!"); | |||
} | |||
var param ={}; | |||
var param = {}; | |||
param.EPId = EPId; | |||
param.EPLId = EPLId; | |||
//判断是否已设置考试时间 | |||
if (!$('#examDate').html() || !$('#examTime').html()) { | |||
return learun.alert.warning("请先设置考试时间!"); | |||
} | |||
//判断是否已新增班级 | |||
var data= learun.httpGet(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/GetListForClass?queryJson='+JSON.stringify(param)); | |||
var data = learun.httpGet(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/GetListForClass?queryJson=' + JSON.stringify(param)); | |||
if (data.data.length > 0) { | |||
learun.layerForm({ | |||
id: 'formteacherRoom', | |||
@@ -149,7 +153,7 @@ var bootstrap = function ($, learun) { | |||
} else { | |||
return learun.alert.warning("请先添加班级!"); | |||
} | |||
} else { | |||
return learun.alert.warning("请选择考试课程!"); | |||
} | |||
@@ -303,7 +303,7 @@ where l.EPLId='{EPLId}'"; | |||
var EPLIds = examLessonList.Select(y => y.EPLId).ToList(); | |||
if (db.FindList<Exam_ExamPlanClassEntity>(x => EPLIds.Contains(x.EPLId)).Count() <= 0) | |||
{ | |||
return (false, "请先添加考试班级!"); | |||
return (false, "请先新增考试班级!"); | |||
} | |||
List<Exam_ExamPlanRoomEntity> list = new List<Exam_ExamPlanRoomEntity>(); | |||
@@ -59,15 +59,57 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
if (!queryParam["EPLId"].IsEmpty()) | |||
{ | |||
var examLesson = this.BaseRepository("CollegeMIS").FindEntity<Exam_ExamPlanLessonEntity>(queryParam["EPLId"].ToString()); | |||
//排考安排课程表Id | |||
var ELEntity = this.BaseRepository("CollegeMIS").FindList<Exam_ExamPlanEntity>($@"select * from Exam_ExamPlan where EPId=( | |||
select EPId from Exam_ExamPlanLesson where EPLId='{queryParam["EPLId"].ToString()}')").FirstOrDefault(); | |||
var ELEntity = this.BaseRepository("CollegeMIS").FindEntity<Exam_ExamPlanEntity>(examLesson.EPId); | |||
if (ELEntity != null) | |||
{ | |||
strSql.Append($" AND t.AcademicYearNo = '{ELEntity.AcademicYearNo}' "); | |||
strSql.Append($" AND t.Semester = '{ELEntity.Semester}' "); | |||
} | |||
strSql.Append($" AND t.ClassroomNo not in (select ClassroomNo from Exam_ExamPlanRoom where EPLId='{queryParam["EPLId"].ToString()}') "); | |||
//查询与考试课程的考试时间在同一天的考场,如果存在考试时间冲突的考场 则排除此考场 | |||
if (examLesson.ExamDate != null && examLesson.ExamTime.Contains("-") && examLesson.RealStuCount > 0) | |||
{ | |||
//当前考试课程考试时间 | |||
var examtimeStart = | |||
Convert.ToDateTime(examLesson.ExamDate.Value.ToString("yyyy-MM-dd") + " " + | |||
(examLesson.ExamTime).Split('-')[0]); | |||
var examtimeEnd = Convert.ToDateTime(examLesson.ExamDate.Value.ToString("yyyy-MM-dd") + " " + | |||
examLesson.ExamTime.Split('-')[1]); | |||
List<string> conflictRoom = new List<string>(); | |||
var examRoomByDateSql = | |||
$@"select a.ClassroomNo,b.ExamDate,b.ExamTime from [dbo].[Exam_ExamPlanRoom] a | |||
join Exam_ExamPlanLesson b on a.EPLId = b.EPLId | |||
where ExamDate = '{examLesson.ExamDate}'"; | |||
var examRoomsByDate = this.BaseRepository("CollegeMIS") | |||
.FindList<Exam_ExamPlanRoomEntity>(examRoomByDateSql).ToList(); | |||
foreach (var examRoom in examRoomsByDate) | |||
{ | |||
var examRoomTime1 = Convert.ToDateTime( | |||
examRoom.ExamDate.Value.ToString("yyyy-MM-dd") + " " + examRoom.ExamTime.Split('-')[0]); | |||
var examRoomTime2 = Convert.ToDateTime( | |||
examRoom.ExamDate.Value.ToString("yyyy-MM-dd") + " " + examRoom.ExamTime.Split('-')[1]); | |||
//此处判断当前考场时间是否在考试课程排考时间的开始前30分钟到结束后30分钟 | |||
if ((examRoomTime1 >= examtimeStart.AddMinutes(-30) && | |||
examRoomTime1 <= examtimeEnd.AddMinutes(30)) || | |||
(examRoomTime2 >= examtimeStart.AddMinutes(-30) && | |||
examRoomTime2 <= examtimeEnd.AddMinutes(30))) | |||
{ | |||
conflictRoom.Add(examRoom.ClassroomNo); | |||
} | |||
} | |||
if (conflictRoom.Count() > 0) | |||
{ | |||
var classroomNo = string.Join("','", conflictRoom.ToList()); | |||
strSql.Append($" AND t.ClassroomNo not in ('{classroomNo}') "); | |||
} | |||
} | |||
} | |||
if (!queryParam["SqlParameter"].IsEmpty()) | |||
@@ -799,6 +799,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
if (classInfoEntity != null) | |||
{ | |||
db.ExecuteBySql("update StuSelectLessonListOfElective set OrdinaryScoreScale=" + entity.OrdinaryScoreScale + ",TermInScoreScale=" + entity.TermInScoreScale + ",TermEndScoreScale=" + entity.TermEndScoreScale + ",OtherScoreScale=" + entity.OtherScoreScale + " where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonSection='" + LessonSection + "' and ClassroomNo='" + classInfoEntity.ClassroomNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='2' "); | |||
db.ExecuteBySql("update OpenLessonPlanOfElective set OrdinaryScoreScale=" + entity.OrdinaryScoreScale + ",TermInScoreScale=" + entity.TermInScoreScale + ",TermEndScoreScale=" + entity.TermEndScoreScale + ",OtherScoreScale=" + entity.OtherScoreScale + " where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonSection='" + LessonSection + "' and ClassroomNo='" + classInfoEntity.ClassroomNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='2' "); | |||
//修改StuScore中的成绩 | |||
var beforeList = db.FindList<StuScoreEntity>(x => x.F_SchoolId == F_SchoolId && x.AcademicYearNo == AcademicYearNo && x.Semester == Semester && x.ClassRoomNo == classInfoEntity.ClassroomNo && x.LessonNo == LessonNo && x.LessonSortNo == "2" && x.LessonSection == LessonSection); | |||