|
@@ -63,14 +63,14 @@ namespace TEAMModelOS.SDK.Models.Service
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static async Task<List<(string name, List<(string className, double average)> classMore, double total,List<(string sname, double scores)>)>> getGradeScore(CoreAPIHttpService _coreAPIHttpService, DingDing _dingDing, CosmosClient client, int gradeId, string gradeName, string periodId, string schooCode, long stime, long etime)
|
|
|
+ public static async Task<List<(string name, List<(string className, double average)> classMore, double total,List<(string sname, double scores)>)>> getGradeScore(CoreAPIHttpService _coreAPIHttpService, DingDing _dingDing, CosmosClient client, List<string> classIds, string periodId, string schooCode, long stime, long etime)
|
|
|
{
|
|
|
List<(string name, List<(string className,double average)> classMore, double total, List<(string sname, double scores)> stus)> grades = new();
|
|
|
//List<(string grade, double score)> grades = new();
|
|
|
try
|
|
|
{
|
|
|
//获取该年级所有班级ID
|
|
|
- List<string> classIds = new();
|
|
|
+ /*List<string> classIds = new();
|
|
|
await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: $"select c.id from c where c.year = {gradeId} and c.pk = 'Class' and c.periodId = '{periodId}' ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Class-{schooCode}") }))
|
|
|
{
|
|
|
using var jsonTask = await JsonDocument.ParseAsync(item.ContentStream);
|
|
@@ -83,7 +83,7 @@ namespace TEAMModelOS.SDK.Models.Service
|
|
|
classIds.Add(account.GetProperty("id").GetString());
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
if (classIds.Count == 0)
|
|
|
{
|
|
|
return grades;
|
|
@@ -101,7 +101,7 @@ namespace TEAMModelOS.SDK.Models.Service
|
|
|
}
|
|
|
//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 join A0 in c.grades where A0.name = '{gradeName}' and c.startTime >= {stime} and c.startTime < {etime} 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: $"select value(c) from c where c.startTime >= {stime} and c.startTime < {etime} order by c.createTime desc", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Exam-{schooCode}") }))
|
|
|
{
|
|
|
exams.Add(item);
|
|
|
}
|