|
@@ -1103,7 +1103,7 @@ namespace TEAMModelOS.Controllers
|
|
List<object> courses = new List<object>();
|
|
List<object> courses = new List<object>();
|
|
List<(string id, string name, string scope)> teacherCourse = new();
|
|
List<(string id, string name, string scope)> teacherCourse = new();
|
|
List<(string id, string name, string scope)> tcCourse = new();
|
|
List<(string id, string name, string scope)> tcCourse = new();
|
|
- List<(string name, string scope,List<(string id, string name)> stuName)> ps = new();
|
|
|
|
|
|
+ List<(string id, string name,string scope,List<(string id, string name, string type)> stuName)> ps = new();
|
|
var query = $"select c.id,c.name,c.scope from c";
|
|
var query = $"select c.id,c.name,c.scope from c";
|
|
|
|
|
|
await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Course-{code.GetString()}") }))
|
|
await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Course-{code.GetString()}") }))
|
|
@@ -1121,7 +1121,7 @@ namespace TEAMModelOS.Controllers
|
|
}
|
|
}
|
|
foreach ((string s, string n,string sc) in teacherCourse)
|
|
foreach ((string s, string n,string sc) in teacherCourse)
|
|
{
|
|
{
|
|
- List<(string id, string name)> sName = new();
|
|
|
|
|
|
+ List<(string id, string name,string type)> sName = new();
|
|
List<Schedule> schedules = new List<Schedule>();
|
|
List<Schedule> schedules = new List<Schedule>();
|
|
var querySc = $"SELECT A0.room,A0.classId,A0.teacherId,A0.stulist,A0.time FROM c join A0 in c.schedule where c.id = '{s}'";
|
|
var querySc = $"SELECT A0.room,A0.classId,A0.teacherId,A0.stulist,A0.time FROM c join A0 in c.schedule where c.id = '{s}'";
|
|
await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<Schedule>(queryText: querySc, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Course-{code.GetString()}") }))
|
|
await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<Schedule>(queryText: querySc, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Course-{code.GetString()}") }))
|
|
@@ -1138,11 +1138,11 @@ namespace TEAMModelOS.Controllers
|
|
while (accounts.MoveNext())
|
|
while (accounts.MoveNext())
|
|
{
|
|
{
|
|
JsonElement account = accounts.Current;
|
|
JsonElement account = accounts.Current;
|
|
- sName.Add((account.GetProperty("id").GetString(), account.GetProperty("name").GetString()));
|
|
|
|
|
|
+ sName.Add((account.GetProperty("id").GetString(), account.GetProperty("name").GetString(),"stuList"));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- ps.Add((n,sc, sName));
|
|
|
|
|
|
+ ps.Add((s,n,sc, sName));
|
|
}
|
|
}
|
|
if (requert.TryGetProperty("schoolId", out JsonElement schoolId))
|
|
if (requert.TryGetProperty("schoolId", out JsonElement schoolId))
|
|
{
|
|
{
|
|
@@ -1168,7 +1168,7 @@ namespace TEAMModelOS.Controllers
|
|
{
|
|
{
|
|
schedules.Add(item);
|
|
schedules.Add(item);
|
|
}
|
|
}
|
|
- List<(string id, string name)> sName = new();
|
|
|
|
|
|
+ List<(string id, string name,string type)> sName = new();
|
|
var queryInfo = $"select c.id ,c.name from c where c.id in ({string.Join(",", schedules.Select(o => $"'{o.stulist}'"))})";
|
|
var queryInfo = $"select c.id ,c.name from c where c.id in ({string.Join(",", schedules.Select(o => $"'{o.stulist}'"))})";
|
|
await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: queryInfo, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"StuList-{schoolId.GetString()}") }))
|
|
await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: queryInfo, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"StuList-{schoolId.GetString()}") }))
|
|
{
|
|
{
|
|
@@ -1179,7 +1179,7 @@ namespace TEAMModelOS.Controllers
|
|
while (accounts.MoveNext())
|
|
while (accounts.MoveNext())
|
|
{
|
|
{
|
|
JsonElement account = accounts.Current;
|
|
JsonElement account = accounts.Current;
|
|
- sName.Add((account.GetProperty("id").GetString(), account.GetProperty("name").GetString()));
|
|
|
|
|
|
+ sName.Add((account.GetProperty("id").GetString(), account.GetProperty("name").GetString(), "stuList"));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1193,11 +1193,11 @@ namespace TEAMModelOS.Controllers
|
|
while (accounts.MoveNext())
|
|
while (accounts.MoveNext())
|
|
{
|
|
{
|
|
JsonElement account = accounts.Current;
|
|
JsonElement account = accounts.Current;
|
|
- sName.Add((account.GetProperty("id").GetString(), account.GetProperty("name").GetString()));
|
|
|
|
|
|
+ sName.Add((account.GetProperty("id").GetString(), account.GetProperty("name").GetString(),"class"));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- ps.Add((n, sc,sName));
|
|
|
|
|
|
+ ps.Add((s,n, sc,sName));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1205,9 +1205,10 @@ namespace TEAMModelOS.Controllers
|
|
|
|
|
|
var obj = ps.Select(p => new
|
|
var obj = ps.Select(p => new
|
|
{
|
|
{
|
|
|
|
+ p.id,
|
|
p.name,
|
|
p.name,
|
|
p.scope,
|
|
p.scope,
|
|
- classes = p.stuName.Select(s => new { s.id, s.name })
|
|
|
|
|
|
+ classes = p.stuName.Select(s => new { s.id, s.name,s.type })
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|