|
@@ -1149,7 +1149,8 @@ namespace TEAMModelOS.Controllers
|
|
|
activity.sStatus = 1;
|
|
|
tasks.Add(client.GetContainer(Constant.TEAMModelOS, "Student").ReplaceItemAsync(activity, activity.id, new PartitionKey($"{activity.code}")));
|
|
|
|
|
|
- }else
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
List<string> scode = new();
|
|
|
await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Student").GetItemQueryStreamIterator(queryText: $"select distinct c.id,c.shoolId from c where c.id = '{s.id}' and c.pk = 'Base'"))
|
|
@@ -1173,10 +1174,10 @@ namespace TEAMModelOS.Controllers
|
|
|
}
|
|
|
}
|
|
|
//StuActivity activity = await client.GetContainer(Constant.TEAMModelOS, "Student").ReadItemAsync<StuActivity>(id.ToString(), new PartitionKey($"Activity-{result.school}-{s.id}"));
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
- {
|
|
|
+ {
|
|
|
await _dingDing.SendBotMsg($"{_option.Location}\n{ex.Message}\n{ex.StackTrace}\n,id:{id},code:{s.id},school:{result?.school}", GroupNames.成都开发測試群組);
|
|
|
}
|
|
|
}
|
|
@@ -1281,9 +1282,11 @@ namespace TEAMModelOS.Controllers
|
|
|
examClassResults.Add(item);
|
|
|
}
|
|
|
List<string> ids = new();
|
|
|
+ List<string> codes = new();
|
|
|
foreach (ExamClassResult result in examClassResults)
|
|
|
{
|
|
|
ids.AddRange(result.studentIds);
|
|
|
+ codes.AddRange(result.scIds);
|
|
|
}
|
|
|
///获取真实的名称
|
|
|
List<ufo> ufos = new();
|
|
@@ -1293,26 +1296,31 @@ namespace TEAMModelOS.Controllers
|
|
|
List<string> sIds = new();
|
|
|
List<string> tIds = new();
|
|
|
List<ufo> students = new List<ufo>();
|
|
|
- await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Student").GetItemQueryStreamIterator(queryText: $"select distinct c.id,c.name from c where c.id in ({string.Join(",", ids.Select(o => $"'{o}'"))}) and c.pk = 'Base'"))
|
|
|
+ foreach (var s in ids)
|
|
|
{
|
|
|
- using var stuJson = await JsonDocument.ParseAsync(item.ContentStream);
|
|
|
- if (stuJson.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
|
|
|
+ int index = ids.IndexOf(s);
|
|
|
+ await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Student").GetItemQueryStreamIterator(queryText: $"select distinct c.id,c.name from c where c.id = {s}", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-{codes[index]}") }))
|
|
|
{
|
|
|
- var accounts = stuJson.RootElement.GetProperty("Documents").EnumerateArray();
|
|
|
- while (accounts.MoveNext())
|
|
|
+ using var stuJson = await JsonDocument.ParseAsync(item.ContentStream);
|
|
|
+ if (stuJson.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
|
|
|
{
|
|
|
- JsonElement account = accounts.Current;
|
|
|
- ufo fo = new()
|
|
|
+ var accounts = stuJson.RootElement.GetProperty("Documents").EnumerateArray();
|
|
|
+ while (accounts.MoveNext())
|
|
|
{
|
|
|
- id = account.GetProperty("id").GetString(),
|
|
|
- name = account.GetProperty("name").GetString(),
|
|
|
- //schoolId = account.GetProperty("schoolId").GetString(),
|
|
|
- type = 2
|
|
|
- };
|
|
|
- students.Add(fo);
|
|
|
+ JsonElement account = accounts.Current;
|
|
|
+ ufo fo = new()
|
|
|
+ {
|
|
|
+ id = account.GetProperty("id").GetString(),
|
|
|
+ name = account.GetProperty("name").GetString(),
|
|
|
+ //schoolId = account.GetProperty("schoolId").GetString(),
|
|
|
+ type = 2
|
|
|
+ };
|
|
|
+ students.Add(fo);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
if (students.Count > 0)
|
|
|
{
|
|
|
ufos.AddRange(students);
|