|
@@ -114,6 +114,7 @@ namespace TEAMModelOS.Controllers
|
|
List<Student> grade_students = new List<Student>();
|
|
List<Student> grade_students = new List<Student>();
|
|
List<OverallEducation> grade_overallEducations = new List<OverallEducation>();
|
|
List<OverallEducation> grade_overallEducations = new List<OverallEducation>();
|
|
List<OverallEducation> overallEducations = new List<OverallEducation>();
|
|
List<OverallEducation> overallEducations = new List<OverallEducation>();
|
|
|
|
+ List<OverallEducation> overallEducationsNoData = new List<OverallEducation>();
|
|
HashSet<string> classIds = new HashSet<string>();
|
|
HashSet<string> classIds = new HashSet<string>();
|
|
|
|
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
@@ -183,6 +184,32 @@ namespace TEAMModelOS.Controllers
|
|
grade_students = gradeData.grade_students;
|
|
grade_students = gradeData.grade_students;
|
|
grade_overallEducations = gradeData.overallEducations;
|
|
grade_overallEducations = gradeData.overallEducations;
|
|
overallEducations = gradeData.overallEducations.FindAll(x => students.Select(k => k.id).Contains(x.studentId));
|
|
overallEducations = gradeData.overallEducations.FindAll(x => students.Select(k => k.id).Contains(x.studentId));
|
|
|
|
+ //是否处理没有任何数据的学生。
|
|
|
|
+ if (isClass)
|
|
|
|
+ {
|
|
|
|
+ var nodata_students = students.ExceptBy(overallEducations.Select(z => z.studentId), v => v.id);
|
|
|
|
+ if (nodata_students.Any() && nodata_students.Count()>0)
|
|
|
|
+ {
|
|
|
|
+ foreach (var student in nodata_students)
|
|
|
|
+ {
|
|
|
|
+ overallEducationsNoData.Add(new OverallEducation
|
|
|
|
+ {
|
|
|
|
+ classId= student.classId,
|
|
|
|
+ schoolCode=$"{_school}",
|
|
|
|
+ name= student.name,
|
|
|
|
+ studentId= student.id,
|
|
|
|
+ year= int.Parse($"{_studyYear}"),
|
|
|
|
+ semesterId=$"{_semesterId}",
|
|
|
|
+ picture= student.picture,
|
|
|
|
+ periodId= student.periodId,
|
|
|
|
+ stuYear=student.year,
|
|
|
|
+ code=$"OverallEducation-{_school}",
|
|
|
|
+ pk="OverallEducation",
|
|
|
|
+ id=$"{_studyYear}-{_semesterId}-{student.id}"
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
@@ -444,7 +471,7 @@ namespace TEAMModelOS.Controllers
|
|
});
|
|
});
|
|
dimensionScore.xrate=60;
|
|
dimensionScore.xrate=60;
|
|
dimensionScore.trate=60;
|
|
dimensionScore.trate=60;
|
|
- dimensionScore.grate=60;
|
|
|
|
|
|
+ dimensionScore.zrate=60;
|
|
dimensionScore.prate=60;
|
|
dimensionScore.prate=60;
|
|
dimensionScore.crate=60;
|
|
dimensionScore.crate=60;
|
|
grade_dimensions.Add(dimensionScore);
|
|
grade_dimensions.Add(dimensionScore);
|
|
@@ -736,7 +763,7 @@ namespace TEAMModelOS.Controllers
|
|
virtue=60,
|
|
virtue=60,
|
|
crate=60,
|
|
crate=60,
|
|
xrate=60,
|
|
xrate=60,
|
|
- grate=60,
|
|
|
|
|
|
+ zrate=60,
|
|
prate=60,
|
|
prate=60,
|
|
trate=60,
|
|
trate=60,
|
|
};
|
|
};
|
|
@@ -745,7 +772,7 @@ namespace TEAMModelOS.Controllers
|
|
studentDimension.stuExamScores= stuExamScores;
|
|
studentDimension.stuExamScores= stuExamScores;
|
|
}
|
|
}
|
|
var classDimension = classDimensions.Find(z => z.classId.Equals(student.classId));
|
|
var classDimension = classDimensions.Find(z => z.classId.Equals(student.classId));
|
|
- studentStatistics= new { studentDimension, inClass = classDimension, inGrade = new { grade_gscore_avg, grade_pscore_avg, grade_tscore_avg , grade_xrate_avg =0, grade_crate_avg = 0 , grade_grate_avg= grade_gscore_avg, grade_prate_avg= grade_pscore_avg, grade_trate_avg = grade_tscore_avg, } };
|
|
|
|
|
|
+ studentStatistics= new { studentDimension, inClass = classDimension, inGrade = new { grade_gscore_avg, grade_pscore_avg, grade_tscore_avg , grade_xrate_avg =0, grade_crate_avg = 0 , grade_zrate_avg= grade_gscore_avg, grade_prate_avg= grade_pscore_avg, grade_trate_avg = grade_tscore_avg, } };
|
|
studentOverallEducation = overallEducations.FindAll(x => x.studentId.Equals($"{_studentId}")).FirstOrDefault();
|
|
studentOverallEducation = overallEducations.FindAll(x => x.studentId.Equals($"{_studentId}")).FirstOrDefault();
|
|
if (studentOverallEducation==null)
|
|
if (studentOverallEducation==null)
|
|
{
|
|
{
|
|
@@ -754,8 +781,55 @@ namespace TEAMModelOS.Controllers
|
|
}
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
#endregion
|
|
|
|
+ //补充没有数据的
|
|
|
|
+ foreach (var student in overallEducationsNoData)
|
|
|
|
+ {
|
|
|
|
+ var studentDimension = dimensions.Find(z => z.studentId.Equals(student.id));
|
|
|
|
+ if (studentDimension==null)
|
|
|
|
+ {
|
|
|
|
+ List<ExamDimensionScore> stuExamScores = new List<ExamDimensionScore>();
|
|
|
|
+ exam3Scores.ForEach(z => {
|
|
|
|
+ var stu = z.xdatas.Find(z => z.code.Equals(student.id));
|
|
|
|
+ if (stu!=null)
|
|
|
|
+ {
|
|
|
|
+ stuExamScores.Add(new ExamDimensionScore { examName=z.name, classScore=z.classScore, gradeScore=z.gradeScore, stuScore=stu.value });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ studentDimension=new StudentDimensionScore
|
|
|
|
+ {
|
|
|
|
+ stuExamScores=stuExamScores,
|
|
|
|
+ art=60,
|
|
|
|
+ classId=student.classId,
|
|
|
|
+ className=student.classId,
|
|
|
|
+ classRanking=0,
|
|
|
|
+ exam=60,
|
|
|
|
+ gradeRanking=0,
|
|
|
|
+ gscore=60,
|
|
|
|
+ intelligence=60,
|
|
|
|
+ labour=60,
|
|
|
|
+ level="",
|
|
|
|
+ picture=student.picture,
|
|
|
|
+ pscore=60,
|
|
|
|
+ score=60,
|
|
|
|
+ sports=60,
|
|
|
|
+ studentId=student.studentId,
|
|
|
|
+ studentName=student.name,
|
|
|
|
+ subject_music=0,
|
|
|
|
+ subject_painting=0,
|
|
|
|
+ tscore=60,
|
|
|
|
+ virtue=60,
|
|
|
|
+ crate=60,
|
|
|
|
+ xrate=60,
|
|
|
|
+ zrate=60,
|
|
|
|
+ prate=60,
|
|
|
|
+ trate=60,
|
|
|
|
+ };
|
|
|
|
+ dimensions.Add(studentDimension);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
return Ok(new
|
|
return Ok(new
|
|
{
|
|
{
|
|
|
|
+
|
|
examScores,
|
|
examScores,
|
|
sports_count60,
|
|
sports_count60,
|
|
sports_count90,
|
|
sports_count90,
|
|
@@ -776,7 +850,7 @@ namespace TEAMModelOS.Controllers
|
|
|
|
|
|
grade_prate_avg= grade_pscore_avg,
|
|
grade_prate_avg= grade_pscore_avg,
|
|
grade_trate_avg= grade_tscore_avg,
|
|
grade_trate_avg= grade_tscore_avg,
|
|
- grade_grate_avg= grade_gscore_avg,
|
|
|
|
|
|
+ grade_zrate_avg= grade_gscore_avg,
|
|
grade_xrate_avg = 60,
|
|
grade_xrate_avg = 60,
|
|
grade_crate_avg = 60,
|
|
grade_crate_avg = 60,
|
|
|
|
|
|
@@ -786,7 +860,7 @@ namespace TEAMModelOS.Controllers
|
|
|
|
|
|
prate_avg = pscore_avg,
|
|
prate_avg = pscore_avg,
|
|
trate_avg = tscore_avg,
|
|
trate_avg = tscore_avg,
|
|
- grate_avg = gscore_avg,
|
|
|
|
|
|
+ zrate_avg = gscore_avg,
|
|
xrate_avg =60,
|
|
xrate_avg =60,
|
|
crate_avg=60,
|
|
crate_avg=60,
|
|
classDimensions,
|
|
classDimensions,
|
|
@@ -810,7 +884,8 @@ namespace TEAMModelOS.Controllers
|
|
studentCount = students.Count(),
|
|
studentCount = students.Count(),
|
|
studentOverallEducation,
|
|
studentOverallEducation,
|
|
studentStatistics,
|
|
studentStatistics,
|
|
-
|
|
|
|
|
|
+ overallEducationsNoData,
|
|
|
|
+
|
|
});
|
|
});
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
@@ -850,7 +925,7 @@ namespace TEAMModelOS.Controllers
|
|
public double tscore { get; set; }
|
|
public double tscore { get; set; }
|
|
public double xrate { get; set; }
|
|
public double xrate { get; set; }
|
|
public double crate { get; set; }
|
|
public double crate { get; set; }
|
|
- public double grate { get; set; }
|
|
|
|
|
|
+ public double zrate { get; set; }
|
|
public double prate { get; set; }
|
|
public double prate { get; set; }
|
|
public double trate { get; set; }
|
|
public double trate { get; set; }
|
|
|
|
|
|
@@ -872,7 +947,7 @@ namespace TEAMModelOS.Controllers
|
|
public double pscore { get; set; }
|
|
public double pscore { get; set; }
|
|
public double tscore { get; set; }
|
|
public double tscore { get; set; }
|
|
|
|
|
|
- public double grate { get; set; }
|
|
|
|
|
|
+ public double zrate { get; set; }
|
|
public double prate { get; set; }
|
|
public double prate { get; set; }
|
|
public double trate { get; set; }
|
|
public double trate { get; set; }
|
|
public double crate { get; set; }
|
|
public double crate { get; set; }
|
|
@@ -908,7 +983,7 @@ namespace TEAMModelOS.Controllers
|
|
public double pscore { get; set; }
|
|
public double pscore { get; set; }
|
|
public double tscore { get; set; }
|
|
public double tscore { get; set; }
|
|
|
|
|
|
- public double grate { get; set; }
|
|
|
|
|
|
+ public double zrate { get; set; }
|
|
public double prate { get; set; }
|
|
public double prate { get; set; }
|
|
public double trate { get; set; }
|
|
public double trate { get; set; }
|
|
public double crate { get; set; }
|
|
public double crate { get; set; }
|