|
@@ -1,12 +1,4 @@
|
|
|
using Azure.Cosmos;
|
|
|
-using DocumentFormat.OpenXml.Drawing.Charts;
|
|
|
-using DocumentFormat.OpenXml.Office2010.Excel;
|
|
|
-using DocumentFormat.OpenXml.Office2013.Drawing.Chart;
|
|
|
-using DocumentFormat.OpenXml.Office2013.Drawing.ChartStyle;
|
|
|
-using DocumentFormat.OpenXml.Office2016.Drawing.ChartDrawing;
|
|
|
-using DocumentFormat.OpenXml.Spreadsheet;
|
|
|
-using DocumentFormat.OpenXml.VariantTypes;
|
|
|
-using DocumentFormat.OpenXml.Wordprocessing;
|
|
|
using HTEXLib.COMM.Helpers;
|
|
|
using MathNet.Numerics.Distributions;
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
@@ -21,6 +13,7 @@ using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
using System.Reflection;
|
|
|
+using System.Security.Claims;
|
|
|
using System.Text;
|
|
|
using System.Text.Json;
|
|
|
using System.Threading.Tasks;
|
|
@@ -32,6 +25,7 @@ using TEAMModelOS.SDK.Extension;
|
|
|
using TEAMModelOS.SDK.Models;
|
|
|
using TEAMModelOS.SDK.Models.Cosmos;
|
|
|
using TEAMModelOS.SDK.Models.Cosmos.Common;
|
|
|
+using TEAMModelOS.SDK.Models.Service;
|
|
|
using TEAMModelOS.SDK.Services;
|
|
|
using static TEAMModelOS.Controllers.OverallEducationController;
|
|
|
using static TEAMModelOS.SDK.Models.Cosmos.Student.StudentAnalysis;
|
|
@@ -126,11 +120,13 @@ namespace TEAMModelOS.Controllers
|
|
|
{
|
|
|
years.Add(studentYear);
|
|
|
}
|
|
|
+ Period period = school.period.Find(z => z.id.Equals($"{_periodId}")); ;
|
|
|
+ Semester semester = period.semesters.Find(x => x.id.Equals($"{_semesterId}"));
|
|
|
if (!years.Any())
|
|
|
{
|
|
|
- var period = school.period.Find(z => z.id.Equals($"{_periodId}"));
|
|
|
if (period != null && period.grades.IsNotEmpty())
|
|
|
{
|
|
|
+
|
|
|
List<int> grades = new List<int>();
|
|
|
period.grades.Select((z, index) => index).ToList().ForEach(t => { grades.Add(t); });
|
|
|
var yearsdata = SchoolService.GetYears(school, $"{_periodId}", grades);
|
|
@@ -355,8 +351,9 @@ namespace TEAMModelOS.Controllers
|
|
|
{
|
|
|
dimensionScore.art = Math.Round(sumScore * 1.0 / item.art.Count,2);
|
|
|
}
|
|
|
- var subject_music = art.itemScore.Find(x => x.id.Equals("subject_music"));
|
|
|
- var subject_painting = art.itemScore.Find(x => x.id.Equals("subject_painting"));
|
|
|
+
|
|
|
+ var subject_music = art.itemScore.Find(x => !string.IsNullOrWhiteSpace(x.id)?x.id.Equals("subject_music"): x.type.Equals("subject_music"));
|
|
|
+ var subject_painting = art.itemScore.Find(x => !string.IsNullOrWhiteSpace(x.id) ? x.id.Equals("subject_painting") : x.type.Equals("subject_painting"));
|
|
|
if (subject_music != null)
|
|
|
{
|
|
|
dimensionScore.subject_music = Math.Round(subject_music.score * 1.0 / subject_music.totalScore *100,2);
|
|
@@ -554,9 +551,62 @@ namespace TEAMModelOS.Controllers
|
|
|
if (!string.IsNullOrWhiteSpace($"{_studentId}")) {
|
|
|
studentOverallEducation = overallEducations.FindAll(x => x.studentId.Equals($"{_studentId}")).FirstOrDefault();
|
|
|
}
|
|
|
+ var studyYear = int.Parse($"{_studyYear}");
|
|
|
+
|
|
|
+ var semesterData= SchoolService.GetSemester(period, time: SchoolService.GetOpensByStudyYearAndSemester(period.semesters,studyYear,$"{_semesterId}"));
|
|
|
+ var examData = await ExamService.getGradeScore(_coreAPIHttpService, _dingDing,_azureCosmos.GetCosmosClient(), grade_classes.Select(x=>x.id).ToList(), $"{_periodId}", school.id, semesterData.date.ToUnixTimeMilliseconds(), semesterData.nextSemester.ToUnixTimeMilliseconds());
|
|
|
+
|
|
|
+ var groupExam= examData.GroupBy(x => x.name).Select(y => new { key = y.Key, list = y });
|
|
|
+ List<Exam3Score> exam3Scores = new List<Exam3Score>();
|
|
|
+ foreach (var item in examData) {
|
|
|
+
|
|
|
+ if (!string.IsNullOrWhiteSpace($"{_studentId}"))
|
|
|
+ {
|
|
|
+ var student = students.Find(x => x.id.Equals($"{_studentId}"));
|
|
|
+ Exam3Score exam3Score = new Exam3Score();
|
|
|
+ exam3Score.name = item.name;
|
|
|
+ exam3Score.gradeScore=item.total;
|
|
|
+ exam3Score.xdatas= new List<CodeDouble>
|
|
|
+ {
|
|
|
+ new CodeDouble
|
|
|
+ {
|
|
|
+ code=student.id,
|
|
|
+ name= student.name,
|
|
|
+ value=item.students.Find(x=>x.studentId.Equals(student.id)).scores
|
|
|
+ }
|
|
|
+ };
|
|
|
+ exam3Score.classScore=item.classMore.Find(x=>x.classId.Equals(student.classId)).average;
|
|
|
+ exam3Scores.Add(exam3Score);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (isClass)
|
|
|
+ {
|
|
|
+ Class clazz = classes.First();
|
|
|
+ Exam3Score exam3Score = new Exam3Score();
|
|
|
+ exam3Score.name = item.name;
|
|
|
+ exam3Score.gradeScore=item.total;
|
|
|
+ exam3Score.classScore=item.classMore.Find(x => x.classId.Equals(clazz.id)).average;
|
|
|
+ exam3Score.xdatas= item.students.Where(y=>y.classId.Equals(clazz.id)).Select(x=>new CodeDouble { code=x.studentId,name= students.Find(z=>z.id.Equals(x.studentId))?.name,value=x.scores }).ToList();
|
|
|
+ exam3Scores.Add(exam3Score);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Exam3Score exam3Score = new Exam3Score();
|
|
|
+ exam3Score.name = item.name;
|
|
|
+ exam3Score.gradeScore=item.total;
|
|
|
+ exam3Score.classScore=-1;
|
|
|
+ exam3Score.xdatas= item.classMore.Select(x => new CodeDouble { code=x.classId, name= grade_classes.Find(z => z.id.Equals(x.classId))?.name, value=x.average }).ToList();
|
|
|
+ exam3Scores.Add(exam3Score);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
#endregion
|
|
|
return Ok(new
|
|
|
{
|
|
|
+ exam3Scores,
|
|
|
+ examData,
|
|
|
sports_count60,
|
|
|
sports_count90,
|
|
|
labour_count60,
|
|
@@ -605,6 +655,14 @@ namespace TEAMModelOS.Controllers
|
|
|
}
|
|
|
return Ok();
|
|
|
}
|
|
|
+ public class Exam3Score {
|
|
|
+
|
|
|
+ public double gradeScore { get; set; }
|
|
|
+ public double classScore { get; set; }
|
|
|
+ public string name { get; set; }
|
|
|
+ public List<CodeDouble> xdatas = new List<CodeDouble>();
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 素养
|
|
|
/// </summary>
|