|
@@ -104,34 +104,41 @@ namespace TEAMModelFunction
|
|
|
}
|
|
|
return "";
|
|
|
}
|
|
|
-
|
|
|
- public static async Task<List<ClassListInfo>> GetClassInfo(CosmosClient client, DingDing _dingDing, List<string> classes, string school)
|
|
|
+ /// <summary>
|
|
|
+ /// 获取行政班接口
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="client"></param>
|
|
|
+ /// <param name="_dingDing"></param>
|
|
|
+ /// <param name="classes"></param>
|
|
|
+ /// <param name="school"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public static async Task<List<ClassInfo>> GetClassInfo(CosmosClient client, DingDing _dingDing, List<string> classes, string school)
|
|
|
{
|
|
|
- List<ClassListInfo> classInfos = new List<ClassListInfo>();
|
|
|
+ List<ClassInfo> classInfos = new List<ClassInfo>();
|
|
|
List<string> sqlList = new List<string>();
|
|
|
classes.ForEach(x => { sqlList.Add($" '{x}' "); });
|
|
|
string sql = string.Join(" , ", sqlList);
|
|
|
if (!string.IsNullOrEmpty(school)) {
|
|
|
- await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<ClassListInfo>(queryText: $"select c.id,c.name from c where c.id in ({sql})",
|
|
|
+ await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<ClassInfo>(queryText: $"select c.id,c.name ,c.periodId,c.year from c where c.id in ({sql})",
|
|
|
requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"Class-{school}") }))
|
|
|
{
|
|
|
- item.from = "ClsStuList";
|
|
|
+
|
|
|
classInfos.Add(item);
|
|
|
}
|
|
|
- await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<ClassListInfo>(queryText: $"select c.id,c.name from c where c.id in ({sql})",
|
|
|
- requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"StuList-{school}") }))
|
|
|
- {
|
|
|
- item.from = "SchStuList";
|
|
|
- classInfos.Add(item);
|
|
|
- }
|
|
|
- }
|
|
|
- List<StuList> tchLists = new List<StuList>();
|
|
|
- await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<ClassListInfo>(queryText: $"select c.id,c.name from c where c.id in ({sql})",
|
|
|
- requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"StuList") }))
|
|
|
- {
|
|
|
- item.from = "TchStuList";
|
|
|
- classInfos.Add(item);
|
|
|
+ //await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<ClassListInfo>(queryText: $"select c.id,c.name from c where c.id in ({sql})",
|
|
|
+ // requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"StuList-{school}") }))
|
|
|
+ //{
|
|
|
+ // item.from = "SchStuList";
|
|
|
+ // classInfos.Add(item);
|
|
|
+ //}
|
|
|
}
|
|
|
+ //List<StuList> tchLists = new List<StuList>();
|
|
|
+ //await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<ClassListInfo>(queryText: $"select c.id,c.name from c where c.id in ({sql})",
|
|
|
+ // requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"StuList") }))
|
|
|
+ //{
|
|
|
+ // item.from = "TchStuList";
|
|
|
+ // classInfos.Add(item);
|
|
|
+ //}
|
|
|
return classInfos;
|
|
|
}
|
|
|
|