Browse Source

必修、选修成绩录入导入功能优化

新疆影视学院高职
zhangli 1 year ago
parent
commit
be52ee4bb2
1 changed files with 41 additions and 4 deletions
  1. +41
    -4
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs

+ 41
- 4
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs View File

@@ -2218,7 +2218,10 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad
var Semester = queryParam["Semester"].ToString();
var LessonNo = queryParam["LessonNo"].ToString();
var ClassNo = queryParam["ClassNo"].ToString();
var classInfoEntity = db.FindEntity<ClassInfoEntity>(x => x.ClassNo == ClassNo);
var classInfoList = db.FindList<ClassInfoEntity>();
var lessonInfoList = db.FindList<LessonInfoEntity>();
var classInfoEntity = classInfoList.FirstOrDefault(x => x.ClassNo == ClassNo);
var lessonInfoEntity = lessonInfoList.FirstOrDefault(x => x.LessonNo == LessonNo);

if (classInfoEntity != null)
{
@@ -2241,13 +2244,28 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad
try
{
var stuno = dr["学号"].ToString().Trim();
var academicYearNo_dr = dr["学年"].ToString().Trim();
var semester_dr = dr["学期"].ToString().Trim();
var lessoninfo_dr = dr["课程名称"].ToString().Trim();
var classinfo_dr = dr["班级"].ToString().Trim();
var lessonNo_dr = lessonInfoList.FirstOrDefault(x => x.LessonName == lessoninfo_dr)?.LessonNo;
var classNo_dr = classInfoList.FirstOrDefault(x => x.ClassName == classinfo_dr)?.ClassNo;

if (!string.IsNullOrEmpty(stuno))
{
var item = list.Find(x => x.StuNo == stuno);
if (!academicYearNo_dr.Equals(AcademicYearNo) || !semester_dr.Equals(semester_dr))
{
fnum++;
dr["导入错误"] = "学年学期与查询条件不符!";
failDt.Rows.Add(dr.ItemArray);
continue;
}

var item = list.Find(x => x.StuNo == stuno && x.LessonNo == lessonNo_dr && x.ClassNo == classNo_dr);
if (item == null)
{
fnum++;
dr["导入错误"] = classInfoEntity.ClassName + "找不到学号为" + stuno + "的学生";
dr["导入错误"] = "课程:" + lessonInfoEntity.LessonName + ",班级:" + classInfoEntity.ClassName + "找不到学号为" + stuno + "的学生";
failDt.Rows.Add(dr.ItemArray);
continue;
}
@@ -2330,6 +2348,10 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad
var LessonSection = queryParam["LessonSection"].ToString();
var ClassRoomNo = queryParam["ClassRoomNo"].ToString();

var classRoomList = db.FindList<ClassroomInfoEntity>();
var lessonInfoList = db.FindList<LessonInfoEntity>();
//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);

@@ -2350,9 +2372,24 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad
try
{
var stuno = dr["学号"].ToString().Trim();
var academicYearNo_dr = dr["学年"].ToString().Trim();
var semester_dr = dr["学期"].ToString().Trim();
var lessoninfo_dr = dr["课程名称"].ToString().Trim();
var classRoominfo_dr = dr["教室名称"].ToString().Trim();
var lessonSection_dr = dr["节次"].ToString().Trim();

var lessonNo_dr = lessonInfoList.FirstOrDefault(x => x.LessonName == lessoninfo_dr)?.LessonNo;
var classRoomNo_dr = classRoomList.FirstOrDefault(x => x.ClassroomName == classRoominfo_dr)?.ClassroomNo;
if (!string.IsNullOrEmpty(stuno))
{
var item = list.Find(x => x.StuNo == stuno);
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++;


Loading…
Cancel
Save