|
|
@@ -2202,8 +2202,10 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad |
|
|
|
/// <returns></returns> |
|
|
|
private (DataTable failDt, int snum, int fnum) ExecuteImportExcelForRequired(DataTable dt, string fileGuid, string queryJson) |
|
|
|
{ |
|
|
|
//成功记录数 |
|
|
|
int snum = 0; |
|
|
|
int fnum = 0; |
|
|
|
//总记录数 |
|
|
|
int num = 0; |
|
|
|
var db = this.BaseRepository("CollegeMIS"); |
|
|
|
var msg = ""; |
|
|
|
try |
|
|
@@ -2253,9 +2255,9 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad |
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(stuno)) |
|
|
|
{ |
|
|
|
num++; |
|
|
|
if (!academicYearNo_dr.Equals(AcademicYearNo) || !semester_dr.Equals(semester_dr)) |
|
|
|
{ |
|
|
|
fnum++; |
|
|
|
dr["导入错误"] = "学年学期与查询条件不符!"; |
|
|
|
failDt.Rows.Add(dr.ItemArray); |
|
|
|
continue; |
|
|
@@ -2264,7 +2266,6 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad |
|
|
|
var item = list.Find(x => x.StuNo == stuno && x.LessonNo == lessonNo_dr && x.ClassNo == classNo_dr); |
|
|
|
if (item == null) |
|
|
|
{ |
|
|
|
fnum++; |
|
|
|
dr["导入错误"] = "课程:" + lessonInfoEntity.LessonName + ",班级:" + classInfoEntity.ClassName + "找不到学号为" + stuno + "的学生"; |
|
|
|
failDt.Rows.Add(dr.ItemArray); |
|
|
|
continue; |
|
|
@@ -2302,7 +2303,7 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad |
|
|
|
|
|
|
|
cache.Write<string>(cacheKey + fileGuid, errordt, CacheId.excel); |
|
|
|
} |
|
|
|
snum = list.Count - failDt.Rows.Count; |
|
|
|
snum = (num - failDt.Rows.Count) > 0 ? num - failDt.Rows.Count : 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@@ -2329,8 +2330,11 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad |
|
|
|
/// <returns></returns> |
|
|
|
private (DataTable failDt, int snum, int fnum) ExecuteImportExcelForElective(DataTable dt, string fileGuid, string queryJson) |
|
|
|
{ |
|
|
|
|
|
|
|
//成功记录数 |
|
|
|
int snum = 0; |
|
|
|
int fnum = 0; |
|
|
|
//总记录数 |
|
|
|
int num = 0; |
|
|
|
var db = this.BaseRepository("CollegeMIS"); |
|
|
|
var msg = ""; |
|
|
|
try |
|
|
@@ -2350,7 +2354,7 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad |
|
|
|
|
|
|
|
var classRoomList = db.FindList<ClassroomInfoEntity>(); |
|
|
|
var lessonInfoList = db.FindList<LessonInfoEntity>(); |
|
|
|
//var lessonInfoEntity = lessonInfoList.FirstOrDefault(x => x.LessonNo == LessonNo); |
|
|
|
var lessonInfoEntity = lessonInfoList.FirstOrDefault(x => x.LessonNo == LessonNo); |
|
|
|
|
|
|
|
//成绩比例数据 |
|
|
|
var stuSelectLessonListOfElectiveEntity = this.BaseRepository("CollegeMIS").FindEntity<StuSelectLessonListOfElectiveEntity>(x => x.F_SchoolId == F_SchoolId && x.AcademicYearNo == AcademicYearNo && x.Semester == Semester && x.LessonNo == LessonNo && x.LessonSortNo == "2" && x.ClassRoomNo == ClassRoomNo && x.LessonSection == LessonSection); |
|
|
@@ -2382,18 +2386,17 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad |
|
|
|
var classRoomNo_dr = classRoomList.FirstOrDefault(x => x.ClassroomName == classRoominfo_dr)?.ClassroomNo; |
|
|
|
if (!string.IsNullOrEmpty(stuno)) |
|
|
|
{ |
|
|
|
num++; |
|
|
|
var item = list.Find(x => x.StuNo == stuno && x.LessonNo == lessonNo_dr && x.ClassRoomNo == classRoomNo_dr && x.LessonSection == lessonSection_dr); |
|
|
|
if (!academicYearNo_dr.Equals(AcademicYearNo) || !semester_dr.Equals(semester_dr)) |
|
|
|
{ |
|
|
|
fnum++; |
|
|
|
dr["导入错误"] = "学年学期与查询条件不符!"; |
|
|
|
failDt.Rows.Add(dr.ItemArray); |
|
|
|
continue; |
|
|
|
} |
|
|
|
if (item == null) |
|
|
|
{ |
|
|
|
fnum++; |
|
|
|
dr["导入错误"] = "当前课程在" + LessonSection + "节次找不到学号为" + stuno + "的学生"; |
|
|
|
dr["导入错误"] = "课程:" + lessonInfoEntity.LessonName + "在" + LessonSection + "节次找不到学号为" + stuno + "的学生"; |
|
|
|
failDt.Rows.Add(dr.ItemArray); |
|
|
|
continue; |
|
|
|
} |
|
|
@@ -2430,7 +2433,7 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad |
|
|
|
cache.Write<string>(cacheKey + fileGuid, errordt, CacheId.excel); |
|
|
|
} |
|
|
|
|
|
|
|
snum = list.Count - failDt.Rows.Count; |
|
|
|
snum = (num - failDt.Rows.Count) > 0 ? num - failDt.Rows.Count : 0; |
|
|
|
} |
|
|
|
return (failDt, snum, failDt.Rows.Count); |
|
|
|
} |
|
|
|