|
@@ -60,9 +60,9 @@ namespace TEAMModelOS.Controllers.Research
|
|
// }
|
|
// }
|
|
// teachers.Add(item);
|
|
// teachers.Add(item);
|
|
//}
|
|
//}
|
|
- List<TchList> tchLists = new List<TchList>();
|
|
|
|
- await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<TchList>(queryText: $"SELECT value(c) FROM c join A1 in c.teachers where A1='{_tmdid}'",
|
|
|
|
- requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"TchList-{_school}") }))
|
|
|
|
|
|
+ List<GroupList> tchLists = new List<GroupList>();
|
|
|
|
+ await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<GroupList>(queryText: $"SELECT value(c) FROM c join A1 in c.teachers where c.type='research' and A1='{_tmdid}'",
|
|
|
|
+ requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"GroupList-{_school}") }))
|
|
{
|
|
{
|
|
tchLists.Add(item);
|
|
tchLists.Add(item);
|
|
}
|
|
}
|
|
@@ -71,13 +71,15 @@ namespace TEAMModelOS.Controllers.Research
|
|
{
|
|
{
|
|
ids.Add("default");
|
|
ids.Add("default");
|
|
}
|
|
}
|
|
- (List<TmdInfo> tmdInfos, List<ClassListInfo> classInfos) = await TriggerStuActivity.GetTchList(client, _dingDing, ids, $"{_school}");
|
|
|
|
|
|
+ (List<RMember> tmdInfos, List<RGroupList> classInfos) = await GroupListService.GetStutmdidListids(client, _dingDing, ids, $"{_school}");
|
|
|
|
+ // (List<TmdInfo> tmdInfos, List<ClassListInfo> classInfos) = await TriggerStuActivity.GetTchList(client, _dingDing, ids, $"{school}");
|
|
|
|
+ //(List<TmdInfo> tmdInfos, List<ClassListInfo> classInfos) = await TriggerStuActivity.GetTchList(client, _dingDing, ids, $"{_school}");
|
|
if (classInfos.IsNotEmpty())
|
|
if (classInfos.IsNotEmpty())
|
|
{
|
|
{
|
|
List<dynamic> groupMembers = new List<dynamic>();
|
|
List<dynamic> groupMembers = new List<dynamic>();
|
|
foreach (var classinfo in classInfos)
|
|
foreach (var classinfo in classInfos)
|
|
{
|
|
{
|
|
- foreach (var t in classinfo.tmdInfos)
|
|
|
|
|
|
+ foreach (var t in classinfo.members)
|
|
{
|
|
{
|
|
//排除自己
|
|
//排除自己
|
|
if (t.id.Equals($"{_tmdid}")) { continue; }
|
|
if (t.id.Equals($"{_tmdid}")) { continue; }
|
|
@@ -193,9 +195,9 @@ namespace TEAMModelOS.Controllers.Research
|
|
//{
|
|
//{
|
|
// teachers.Add(item);
|
|
// teachers.Add(item);
|
|
//}
|
|
//}
|
|
- List<TchList> tchLists = new List<TchList>();
|
|
|
|
- await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<TchList>(queryText: $"SELECT value(c) FROM c",
|
|
|
|
- requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"TchList-{_school}") }))
|
|
|
|
|
|
+ List<GroupList> tchLists = new List<GroupList>();
|
|
|
|
+ await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<GroupList>(queryText: $"SELECT value(c) FROM c where c.type='research' ",
|
|
|
|
+ requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"GroupList-{_school}") }))
|
|
{
|
|
{
|
|
tchLists.Add(item);
|
|
tchLists.Add(item);
|
|
}
|
|
}
|
|
@@ -203,16 +205,18 @@ namespace TEAMModelOS.Controllers.Research
|
|
if (!ids.IsNotEmpty()) {
|
|
if (!ids.IsNotEmpty()) {
|
|
ids.Add("default");
|
|
ids.Add("default");
|
|
}
|
|
}
|
|
- (List<TmdInfo> tmdInfos,List<ClassListInfo> classInfos ) = await TriggerStuActivity.GetTchList(client, _dingDing, ids, $"{_school}");
|
|
|
|
|
|
+ (List<RMember> tmdInfos, List<RGroupList> classInfos) = await GroupListService.GetStutmdidListids(client, _dingDing, ids, $"{_school}");
|
|
|
|
+ // (List<TmdInfo> tmdInfos, List<ClassListInfo> classInfos) = await TriggerStuActivity.GetTchList(client, _dingDing, ids, $"{school}");
|
|
|
|
+ //(List<TmdInfo> tmdInfos,List<ClassListInfo> classInfos ) = await TriggerStuActivity.GetTchList(client, _dingDing, ids, $"{_school}");
|
|
List<dynamic> classVideos = new();
|
|
List<dynamic> classVideos = new();
|
|
string code = $"ClassVideo-{_school}";
|
|
string code = $"ClassVideo-{_school}";
|
|
foreach (var listInfo in classInfos) {
|
|
foreach (var listInfo in classInfos) {
|
|
try
|
|
try
|
|
{
|
|
{
|
|
await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Teacher")
|
|
await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Teacher")
|
|
- .GetItemQueryIterator<ClassVideo>(queryText: $"select value(c) from c where c.id in ({string.Join(",", listInfo.tmdInfos.Select(o => $"'{o.id}'"))})", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey(code) }))
|
|
|
|
|
|
+ .GetItemQueryIterator<ClassVideo>(queryText: $"select value(c) from c where c.id in ({string.Join(",", listInfo.members.Select(o => $"'{o.id}'"))})", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey(code) }))
|
|
{
|
|
{
|
|
- TmdInfo info= listInfo.tmdInfos.Find(x => x.id.Equals(item.id));
|
|
|
|
|
|
+ RMember info= listInfo.members.Find(x => x.id.Equals(item.id));
|
|
if (info != null) {
|
|
if (info != null) {
|
|
dynamic t = new { id=info.id,name=info.name, picture=info.picture, groupId= listInfo.id, groupName=listInfo.name };
|
|
dynamic t = new { id=info.id,name=info.name, picture=info.picture, groupId= listInfo.id, groupName=listInfo.name };
|
|
foreach (var vids in item.files)
|
|
foreach (var vids in item.files)
|