|
@@ -677,33 +677,24 @@ WHERE (AcademicYearNo = '" + strAcademicYear + "') and semester='" + strSemest |
|
|
if (entity.SyncType == "1") |
|
|
if (entity.SyncType == "1") |
|
|
{ |
|
|
{ |
|
|
var LessonList = BaseRepository("paikeDbString").FindList<paikeList>( |
|
|
var LessonList = BaseRepository("paikeDbString").FindList<paikeList>( |
|
|
@"SELECT a.week AS 'week', |
|
|
|
|
|
a.section AS 'section', |
|
|
|
|
|
a.timetext AS 'timetext', |
|
|
|
|
|
c.name AS 'classname', |
|
|
|
|
|
c.number AS 'classnumber', |
|
|
|
|
|
r.name AS 'roomname', |
|
|
|
|
|
r.number AS 'classRoomSid', |
|
|
|
|
|
t.name AS 'teachername', |
|
|
|
|
|
t.number AS 'teacherNumber', |
|
|
|
|
|
cu.name AS 'curriculunName', |
|
|
|
|
|
cu.number AS 'curriculunNumber', |
|
|
|
|
|
s.year AS 'year', |
|
|
|
|
|
s.number AS 'semester' |
|
|
|
|
|
FROM tb_paike a |
|
|
|
|
|
LEFT JOIN tb_clazz c ON c.id= a.`clazzid` |
|
|
|
|
|
LEFT JOIN tb_classroom r ON r.id =a.`classroomid` |
|
|
|
|
|
LEFT JOIN tb_teacher t ON t.id =a.`teacherid` |
|
|
|
|
|
LEFT JOIN tb_curriculum cu ON cu.id=a.`curriculunid` |
|
|
|
|
|
LEFT JOIN tb_semester s ON s.id=a.`semester` |
|
|
|
|
|
WHERE 1=1 AND s.year = '" + entity.AcademicYearNo + "' AND s.number ='" + entity.Semester + "'"); //AND a.school='" + entity.F_SchoolId + " '"); |
|
|
|
|
|
|
|
|
@"SELECT a.week AS 'week', a.section AS 'section',a.timetext AS 'timetext',c.name AS 'classname',c.number AS 'classnumber', |
|
|
|
|
|
r.name AS 'roomname',r.number AS 'ClassroomNo',t.name AS 'teachername',t.number AS 'teacherNumber', cu.name AS 'curriculunName', |
|
|
|
|
|
cu.number AS 'curriculunNumber', s.year AS 'year', s.number AS 'semester', sc.name AS 'schoolname', sc.sid AS 'schoolno' |
|
|
|
|
|
FROM tb_paike a |
|
|
|
|
|
LEFT JOIN tb_clazz c ON c.id= a.`clazzid` |
|
|
|
|
|
LEFT JOIN tb_classroom r ON r.id =a.`classroomid` |
|
|
|
|
|
LEFT JOIN tb_teacher t ON t.id =a.`teacherid` |
|
|
|
|
|
LEFT JOIN tb_curriculum cu ON cu.id=a.`curriculunid` |
|
|
|
|
|
LEFT JOIN tb_semester s ON s.id=a.`semester` |
|
|
|
|
|
LEFT JOIN tb_school sc ON sc.`id`= a.`school` |
|
|
|
|
|
WHERE 1=1 AND s.year = '" + entity.AcademicYearNo + "' AND s.number ='" + entity.Semester + "'AND sc.sid = '" + entity.F_SchoolId + " '"); |
|
|
if (LessonList.Count() > 0) |
|
|
if (LessonList.Count() > 0) |
|
|
{ |
|
|
{ |
|
|
var oldArrangeLessonTermList = (await BaseRepository("CollegeMIS").FindListAsync<ArrangeLessonTermEntity>()).ToList(); |
|
|
var oldArrangeLessonTermList = (await BaseRepository("CollegeMIS").FindListAsync<ArrangeLessonTermEntity>()).ToList(); |
|
|
var insertDataList = new List<ArrangeLessonTermEntity>(); |
|
|
var insertDataList = new List<ArrangeLessonTermEntity>(); |
|
|
foreach (var item in LessonList) |
|
|
foreach (var item in LessonList) |
|
|
{ |
|
|
{ |
|
|
var classinfo = classData.FirstOrDefault(m => m.ClassId == item.classnumber); |
|
|
|
|
|
|
|
|
var classinfo = classData.FirstOrDefault(m => m.ClassNo == item.classnumber); |
|
|
|
|
|
|
|
|
var insertData = new ArrangeLessonTermEntity |
|
|
var insertData = new ArrangeLessonTermEntity |
|
|
{ |
|
|
{ |
|
@@ -711,17 +702,18 @@ WHERE (AcademicYearNo = '" + strAcademicYear + "') and semester='" + strSemest |
|
|
LessonDate = DateTime.Parse(item.timetext), |
|
|
LessonDate = DateTime.Parse(item.timetext), |
|
|
AcademicYearNo = item.year, |
|
|
AcademicYearNo = item.year, |
|
|
Semester = item.semester, |
|
|
Semester = item.semester, |
|
|
|
|
|
DeptNo = classinfo?.DeptNo, |
|
|
MajorNo = classinfo?.MajorNo, |
|
|
MajorNo = classinfo?.MajorNo, |
|
|
LessonNo = item.curriculunNumber, |
|
|
LessonNo = item.curriculunNumber, |
|
|
LessonName = item.curriculunName, |
|
|
LessonName = item.curriculunName, |
|
|
TeachClassNo = item.curriculunName + classinfo?.ClassNo, |
|
|
TeachClassNo = item.curriculunName + classinfo?.ClassNo, |
|
|
EmpNo = item.teacherNumber, |
|
|
EmpNo = item.teacherNumber, |
|
|
EmpName = item.teachername, |
|
|
EmpName = item.teachername, |
|
|
LessonSortNo = lessonData.FirstOrDefault(m => m.LessonId == item.curriculunNumber)?.LessonSortNo, |
|
|
|
|
|
ClassroomNo = classroomData.FirstOrDefault(m => m.ClassroomId == item.classRoomSid)?.ClassroomNo, |
|
|
|
|
|
|
|
|
LessonSortNo = lessonData.FirstOrDefault(m => m.LessonNo == item.curriculunNumber)?.LessonSortNo, |
|
|
|
|
|
ClassroomNo = classroomData.FirstOrDefault(m => m.ClassroomNo == item.ClassroomNo)?.ClassroomNo, |
|
|
LessonTime = item.week + item.section, |
|
|
LessonTime = item.week + item.section, |
|
|
CheckMark = "1", |
|
|
CheckMark = "1", |
|
|
F_SchoolId = item.schoolid |
|
|
|
|
|
|
|
|
F_SchoolId = item.schoolno |
|
|
}; |
|
|
}; |
|
|
if (oldArrangeLessonTermList.Count(m => m.AcademicYearNo == insertData.AcademicYearNo && m.Semester == insertData.Semester |
|
|
if (oldArrangeLessonTermList.Count(m => m.AcademicYearNo == insertData.AcademicYearNo && m.Semester == insertData.Semester |
|
|
&& m.LessonNo == insertData.LessonNo && m.LessonDate == insertData.LessonDate |
|
|
&& m.LessonNo == insertData.LessonNo && m.LessonDate == insertData.LessonDate |
|
@@ -765,8 +757,8 @@ WHERE (AcademicYearNo = '" + strAcademicYear + "') and semester='" + strSemest |
|
|
LEFT JOIN tb_classroom room ON room.id = a.classroom |
|
|
LEFT JOIN tb_classroom room ON room.id = a.classroom |
|
|
LEFT JOIN tb_teacher teacher ON teacher.id = a.teacher |
|
|
LEFT JOIN tb_teacher teacher ON teacher.id = a.teacher |
|
|
WHERE semester.year = '" + entity.AcademicYearNo |
|
|
WHERE semester.year = '" + entity.AcademicYearNo |
|
|
+ "' AND semester.number = '" |
|
|
|
|
|
+ entity.Semester + "'"); |
|
|
|
|
|
|
|
|
+ "' AND semester.number = '" |
|
|
|
|
|
+ entity.Semester + "'"); |
|
|
var TeachClassData = (await BaseRepository("CollegeMIS").FindListAsync<TeachClassEntity>(@"SELECT * |
|
|
var TeachClassData = (await BaseRepository("CollegeMIS").FindListAsync<TeachClassEntity>(@"SELECT * |
|
|
FROM TeachClass |
|
|
FROM TeachClass |
|
|
WHERE (AcademicYearNo = '" + entity.AcademicYearNo + "') and semester='" + entity.Semester + "' and F_SchoolId='" + entity.F_SchoolId + "' ")).ToList(); |
|
|
WHERE (AcademicYearNo = '" + entity.AcademicYearNo + "') and semester='" + entity.Semester + "' and F_SchoolId='" + entity.F_SchoolId + "' ")).ToList(); |
|
@@ -834,28 +826,28 @@ WHERE (AcademicYearNo = '" + strAcademicYear + "') and semester='" + strSemest |
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
var TeachList = BaseRepository("paikeDbString").FindList<TeachClassEntity>( |
|
|
var TeachList = BaseRepository("paikeDbString").FindList<TeachClassEntity>( |
|
|
@"select m.name AS 'MajorName', m.number AS 'MajorNo', tt.EmpNo AS 'EmpNo', |
|
|
|
|
|
tt.EmpName AS 'EmpName', sc.name AS 'F_SchoolName', sc.id AS 'F_SchoolId', |
|
|
|
|
|
p.grade AS 'Grade', p.classhour AS 'classhour', curr.name AS 'LessonName', curr.number AS 'LessonNo', |
|
|
|
|
|
s.year AS 'AcademicYearNo', s.number AS 'Semester' FROM tb_major_plan p |
|
|
|
|
|
LEFT JOIN ( |
|
|
|
|
|
SELECT |
|
|
|
|
|
t.teacher, |
|
|
|
|
|
GROUP_CONCAT(DISTINCT c.`name`) AS 'EmpName', |
|
|
|
|
|
GROUP_CONCAT(DISTINCT c.number) AS 'EmpNo' |
|
|
|
|
|
FROM |
|
|
|
|
|
tb_major_plan t |
|
|
|
|
|
LEFT JOIN tb_teacher c ON FIND_IN_SET(c.id, t.teacher) > 0 |
|
|
|
|
|
GROUP BY |
|
|
|
|
|
t.teacher |
|
|
|
|
|
) tt ON tt.teacher = p.teacher |
|
|
|
|
|
LEFT JOIN tb_semester s ON s.id=p.`semester` |
|
|
|
|
|
LEFT JOIN tb_school sc ON sc.`id`= p.`school` |
|
|
|
|
|
LEFT JOIN tb_major m ON m.id=p.major |
|
|
|
|
|
LEFT JOIN tb_course cour ON cour.id= p.`course` |
|
|
|
|
|
LEFT JOIN tb_curriculum curr ON curr.id=cour.`course` |
|
|
|
|
|
WHERE s.year = '" + entity.AcademicYearNo + "' AND s.number = '" |
|
|
|
|
|
+ entity.Semester + "' ORDER BY p.`major` "); // AND semester.number = '"+ entity.F_SchoolId + "' ORDER BY p.`major` "); |
|
|
|
|
|
|
|
|
@"select m.name AS 'MajorName', m.number AS 'MajorNo', tt.EmpNo AS 'EmpNo', |
|
|
|
|
|
tt.EmpName AS 'EmpName', sc.name AS 'F_SchoolName', sc.sid AS 'F_SchoolId', |
|
|
|
|
|
p.grade AS 'Grade', p.classhour AS 'classhour', curr.name AS 'LessonName', curr.number AS 'LessonNo', |
|
|
|
|
|
s.year AS 'AcademicYearNo', s.number AS 'Semester' FROM tb_major_plan p |
|
|
|
|
|
LEFT JOIN ( |
|
|
|
|
|
SELECT |
|
|
|
|
|
t.teacher, |
|
|
|
|
|
GROUP_CONCAT(DISTINCT c.`name`) AS 'EmpName', |
|
|
|
|
|
GROUP_CONCAT(DISTINCT c.number) AS 'EmpNo' |
|
|
|
|
|
FROM |
|
|
|
|
|
tb_major_plan t |
|
|
|
|
|
LEFT JOIN tb_teacher c ON FIND_IN_SET(c.id, t.teacher) > 0 |
|
|
|
|
|
GROUP BY |
|
|
|
|
|
t.teacher |
|
|
|
|
|
) tt ON tt.teacher = p.teacher |
|
|
|
|
|
LEFT JOIN tb_semester s ON s.id=p.`semester` |
|
|
|
|
|
LEFT JOIN tb_school sc ON sc.`id`= p.`school` |
|
|
|
|
|
LEFT JOIN tb_major m ON m.id=p.major |
|
|
|
|
|
LEFT JOIN tb_course cour ON cour.id= p.`course` |
|
|
|
|
|
LEFT JOIN tb_curriculum curr ON curr.id=cour.`course` |
|
|
|
|
|
WHERE s.year = '" + entity.AcademicYearNo + "' AND s.number = '" + entity.Semester |
|
|
|
|
|
+ "' AND sc.sid = '" + entity.F_SchoolId + "' ORDER BY p.`major` "); |
|
|
var majorData = (await BaseRepository("CollegeMIS").FindListAsync<CdMajorEntity>()).ToList(); |
|
|
var majorData = (await BaseRepository("CollegeMIS").FindListAsync<CdMajorEntity>()).ToList(); |
|
|
var lessonData = (await BaseRepository("CollegeMIS").FindListAsync<LessonInfoEntity>()).ToList(); |
|
|
var lessonData = (await BaseRepository("CollegeMIS").FindListAsync<LessonInfoEntity>()).ToList(); |
|
|
if (TeachList.Count() > 0) |
|
|
if (TeachList.Count() > 0) |
|
@@ -888,7 +880,7 @@ WHERE (AcademicYearNo = '" + strAcademicYear + "') and semester='" + strSemest |
|
|
EndWeek = item.EndWeek, |
|
|
EndWeek = item.EndWeek, |
|
|
CheckStyleNo = "1", |
|
|
CheckStyleNo = "1", |
|
|
ScoreRecordStyleNo = "1", |
|
|
ScoreRecordStyleNo = "1", |
|
|
TeachDeptNo = majorData.FirstOrDefault(m => m.ID == item.MajorNo)?.DeptNo, |
|
|
|
|
|
|
|
|
TeachDeptNo = majorData.FirstOrDefault(m => m.MajorNo == item.MajorNo)?.DeptNo, |
|
|
StudyScore = 0, |
|
|
StudyScore = 0, |
|
|
AmendDate = now, |
|
|
AmendDate = now, |
|
|
ClassroomType = 1, |
|
|
ClassroomType = 1, |
|
@@ -2673,14 +2665,14 @@ group by AcademicYearNo,Semester,DeptNo,MajorNo,LessonNo,TeachClassNo,EmpNo,Les |
|
|
public string classname { get; set; } |
|
|
public string classname { get; set; } |
|
|
public string classnumber { get; set; } |
|
|
public string classnumber { get; set; } |
|
|
public string roomname { get; set; } |
|
|
public string roomname { get; set; } |
|
|
public string classRoomSid { get; set; } |
|
|
|
|
|
|
|
|
public string ClassroomNo { get; set; } |
|
|
public string teachername { get; set; } |
|
|
public string teachername { get; set; } |
|
|
public string teacherNumber { get; set; } |
|
|
public string teacherNumber { get; set; } |
|
|
public string curriculunName { get; set; } |
|
|
public string curriculunName { get; set; } |
|
|
public string curriculunNumber { get; set; } |
|
|
public string curriculunNumber { get; set; } |
|
|
public string year { get; set; } |
|
|
public string year { get; set; } |
|
|
public string semester { get; set; } |
|
|
public string semester { get; set; } |
|
|
public string schoolid { get; set; } |
|
|
|
|
|
|
|
|
public string schoolno { get; set; } |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#endregion |
|
|
#endregion |
|
|