|
@@ -1,4 +1,5 @@
|
|
|
using Azure.Cosmos;
|
|
|
+using DocumentFormat.OpenXml.Drawing.Charts;
|
|
|
using DocumentFormat.OpenXml.Office2010.Excel;
|
|
|
using MathNet.Numerics.Distributions;
|
|
|
using System;
|
|
@@ -63,7 +64,7 @@ namespace TEAMModelOS.SDK.Models.Service
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static async Task<List<(string name, List<(string classId, double average)> classMore, double total,List<(string studentId, double scores, string classId)>students )>> getGradeScore(CoreAPIHttpService _coreAPIHttpService, DingDing _dingDing, CosmosClient client, List<string> classIds, string periodId, string schooCode, long stime, long etime)
|
|
|
+ public static async Task<List<(string name, List<(string classId, double average)> classMore, double total,List<(string studentId, double scores, string classId)>students )>> getGradeScore(CoreAPIHttpService _coreAPIHttpService, DingDing _dingDing, CosmosClient client, List<string> classIds, string periodId, string schooCode,List<string> examType, long stime, long etime)
|
|
|
{
|
|
|
List<(string name, List<(string classId,double average)> classMore, double total, List<(string studentId, double scores, string classId)> stus)> grades = new();
|
|
|
//List<(string grade, double score)> grades = new();
|
|
@@ -99,14 +100,21 @@ namespace TEAMModelOS.SDK.Models.Service
|
|
|
using var json = await JsonDocument.ParseAsync(response.ContentStream);
|
|
|
sc = json.ToObject<School>();
|
|
|
}
|
|
|
+ StringBuilder stringBuilder = new($"select value(c) from c where c.startTime >= {stime} and c.startTime < {etime} and c.progress = 'finish' and c.period.id = '{periodId}'");
|
|
|
+ if (examType.Any()) {
|
|
|
+ stringBuilder.Append($" and c.examType.name in ({string.Join(",", examType.Select(o => $"'{o}'"))}) ");
|
|
|
+ }
|
|
|
+ stringBuilder.Append("order by c.createTime desc");
|
|
|
//var gradeNames = sc.period.Where(x => x.id.Equals(periodId.ToString()))?.FirstOrDefault().grades;
|
|
|
//var index = gradeNames.IndexOf(gradeName.ToString());
|
|
|
- await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIterator<ExamInfo>(queryText: $"select value(c) from c where c.startTime >= {stime} and c.startTime < {etime} and c.progress = 'finish' order by c.createTime desc", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Exam-{schooCode}") }))
|
|
|
+ await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIterator<ExamInfo>(
|
|
|
+ queryText: stringBuilder.ToString(),
|
|
|
+ requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Exam-{schooCode}") }))
|
|
|
{
|
|
|
exams.Add(item);
|
|
|
}
|
|
|
List<ExamInfo> newExams = new();
|
|
|
- exams = exams.Where(x => x.period.id.Equals(periodId)).ToList();
|
|
|
+ //exams = exams.Where(x => x.period.id.Equals(periodId)).ToList();
|
|
|
foreach (ExamInfo info in exams)
|
|
|
{
|
|
|
bool flag = true;
|