|
@@ -411,7 +411,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
//直接修改 |
|
|
//直接修改 |
|
|
//判断是否冲突(新时间是否存在课程) |
|
|
//判断是否冲突(新时间是否存在课程) |
|
|
if (db.FindList<ArrangeLessonTermEntity>(x => |
|
|
if (db.FindList<ArrangeLessonTermEntity>(x => |
|
|
x.LessonDate == lessonDateNew && x.LessonTime == lessiontimeNow&&x.CheckMark=="1" && x.ALTId != keyValue).Count() > 0) |
|
|
|
|
|
|
|
|
x.LessonDate == lessonDateNew && x.LessonTime == lessiontimeNow && x.CheckMark == "1" && x.ALTId != keyValue).Count() > 0) |
|
|
{ |
|
|
{ |
|
|
return "第" + weektime + "周当前课程冲突!"; |
|
|
return "第" + weektime + "周当前课程冲突!"; |
|
|
} |
|
|
} |
|
@@ -994,43 +994,70 @@ WHERE (AcademicYearNo = '" + strAcademicYear + "') and semester='" + strSemest |
|
|
foreach (var item in LessonList) |
|
|
foreach (var item in LessonList) |
|
|
{ |
|
|
{ |
|
|
var classinfo = classData.FirstOrDefault(m => m.ClassNo == item.classnumber); |
|
|
var classinfo = classData.FirstOrDefault(m => m.ClassNo == item.classnumber); |
|
|
|
|
|
|
|
|
var insertData = new ArrangeLessonTermEntity |
|
|
|
|
|
{ |
|
|
|
|
|
ALTId = Guid.NewGuid().ToString(), |
|
|
|
|
|
LessonDate = DateTime.Parse(item.timetext), |
|
|
|
|
|
AcademicYearNo = item.year, |
|
|
|
|
|
Semester = item.semester, |
|
|
|
|
|
DeptNo = classinfo?.DeptNo, |
|
|
|
|
|
MajorNo = classinfo?.MajorNo, |
|
|
|
|
|
LessonNo = item.curriculunNumber, |
|
|
|
|
|
LessonName = item.curriculunName, |
|
|
|
|
|
TeachClassNo = classinfo?.ClassNo, |
|
|
|
|
|
EmpNo = item.teacherNumber, |
|
|
|
|
|
EmpName = item.teachername, |
|
|
|
|
|
LessonSortNo = lessonData.FirstOrDefault(m => m.LessonNo == item.curriculunNumber)?.LessonSortNo, |
|
|
|
|
|
ClassroomNo = classroomData.FirstOrDefault(m => m.ClassroomNo == item.ClassroomNo)?.ClassroomNo, |
|
|
|
|
|
LessonTime = item.week + "-" + item.section, |
|
|
|
|
|
CheckMark = "1", |
|
|
|
|
|
F_SchoolId = entity.F_SchoolId |
|
|
|
|
|
}; |
|
|
|
|
|
if (oldArrangeLessonTermList.Count(m => m.AcademicYearNo == insertData.AcademicYearNo && m.Semester == insertData.Semester |
|
|
|
|
|
&& m.LessonNo == insertData.LessonNo && m.LessonDate == insertData.LessonDate |
|
|
|
|
|
&& m.MajorNo == insertData.MajorNo |
|
|
|
|
|
&& m.TeachClassNo == insertData.TeachClassNo && m.EmpNo == insertData.EmpNo |
|
|
|
|
|
&& m.ClassroomNo == insertData.ClassroomNo && m.LessonTime == insertData.LessonTime |
|
|
|
|
|
&& m.F_SchoolId == insertData.F_SchoolId) == 0 |
|
|
|
|
|
&& insertDataList.Count(m => m.AcademicYearNo == insertData.AcademicYearNo && m.Semester == insertData.Semester |
|
|
|
|
|
&& m.LessonNo == insertData.LessonNo && m.LessonDate == insertData.LessonDate |
|
|
|
|
|
&& m.MajorNo == insertData.MajorNo |
|
|
|
|
|
&& m.TeachClassNo == insertData.TeachClassNo && m.EmpNo == insertData.EmpNo |
|
|
|
|
|
&& m.ClassroomNo == insertData.ClassroomNo && m.LessonTime == insertData.LessonTime |
|
|
|
|
|
&& m.F_SchoolId == insertData.F_SchoolId) == 0) |
|
|
|
|
|
|
|
|
var timesArr = item.timetext.Substring(0, item.timetext.Length - 1).Split(','); |
|
|
|
|
|
foreach (var timesItem in timesArr) |
|
|
{ |
|
|
{ |
|
|
insertDataList.Add(insertData); |
|
|
|
|
|
|
|
|
var insertData = new ArrangeLessonTermEntity |
|
|
|
|
|
{ |
|
|
|
|
|
ALTId = Guid.NewGuid().ToString(), |
|
|
|
|
|
LessonDate = DateTime.Parse(timesItem), |
|
|
|
|
|
AcademicYearNo = item.year, |
|
|
|
|
|
Semester = item.semester, |
|
|
|
|
|
DeptNo = classinfo?.DeptNo, |
|
|
|
|
|
MajorNo = classinfo?.MajorNo, |
|
|
|
|
|
LessonNo = item.curriculunNumber, |
|
|
|
|
|
LessonName = item.curriculunName, |
|
|
|
|
|
TeachClassNo = classinfo?.ClassNo, |
|
|
|
|
|
EmpNo = item.teacherNumber, |
|
|
|
|
|
EmpName = item.teachername, |
|
|
|
|
|
LessonSortNo = lessonData.FirstOrDefault(m => m.LessonNo == item.curriculunNumber) |
|
|
|
|
|
?.LessonSortNo, |
|
|
|
|
|
ClassroomNo = classroomData.FirstOrDefault(m => m.ClassroomNo == item.ClassroomNo) |
|
|
|
|
|
?.ClassroomNo, |
|
|
|
|
|
LessonTime = item.week + "-" + item.section, |
|
|
|
|
|
CheckMark = "1", |
|
|
|
|
|
F_SchoolId = entity.F_SchoolId |
|
|
|
|
|
}; |
|
|
|
|
|
if (oldArrangeLessonTermList.Count(m => |
|
|
|
|
|
m.AcademicYearNo == insertData.AcademicYearNo && m.Semester == |
|
|
|
|
|
insertData.Semester |
|
|
|
|
|
&& m.LessonNo == |
|
|
|
|
|
insertData.LessonNo && |
|
|
|
|
|
m.LessonDate == |
|
|
|
|
|
insertData.LessonDate |
|
|
|
|
|
&& m.MajorNo == insertData.MajorNo |
|
|
|
|
|
&& m.TeachClassNo == |
|
|
|
|
|
insertData.TeachClassNo && |
|
|
|
|
|
m.EmpNo == insertData.EmpNo |
|
|
|
|
|
&& m.ClassroomNo == |
|
|
|
|
|
insertData.ClassroomNo && |
|
|
|
|
|
m.LessonTime == |
|
|
|
|
|
insertData.LessonTime |
|
|
|
|
|
&& m.F_SchoolId == |
|
|
|
|
|
insertData.F_SchoolId) == 0 |
|
|
|
|
|
&& insertDataList.Count(m => |
|
|
|
|
|
m.AcademicYearNo == insertData.AcademicYearNo && m.Semester == |
|
|
|
|
|
insertData.Semester |
|
|
|
|
|
&& m.LessonNo == |
|
|
|
|
|
insertData.LessonNo && |
|
|
|
|
|
m.LessonDate == |
|
|
|
|
|
insertData.LessonDate |
|
|
|
|
|
&& m.MajorNo == insertData.MajorNo |
|
|
|
|
|
&& m.TeachClassNo == |
|
|
|
|
|
insertData.TeachClassNo && |
|
|
|
|
|
m.EmpNo == insertData.EmpNo |
|
|
|
|
|
&& m.ClassroomNo == |
|
|
|
|
|
insertData.ClassroomNo && |
|
|
|
|
|
m.LessonTime == |
|
|
|
|
|
insertData.LessonTime |
|
|
|
|
|
&& m.F_SchoolId == |
|
|
|
|
|
insertData.F_SchoolId) == 0) |
|
|
|
|
|
{ |
|
|
|
|
|
insertDataList.Add(insertData); |
|
|
|
|
|
await BaseRepository("CollegeMIS").InsertAsync(insertDataList); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
await BaseRepository("CollegeMIS").InsertAsync(insertDataList); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|