|
@@ -555,7 +555,7 @@ namespace TEAMModelOS.Controllers
|
|
public async Task<IActionResult> FindSummary(JsonElement requert)
|
|
public async Task<IActionResult> FindSummary(JsonElement requert)
|
|
{
|
|
{
|
|
|
|
|
|
- if (!requert.TryGetProperty("code", out JsonElement school_code)) return BadRequest();
|
|
|
|
|
|
+ if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
|
|
if (!requert.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
|
|
if (!requert.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
|
|
if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
|
|
if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
|
|
try
|
|
try
|
|
@@ -567,19 +567,23 @@ namespace TEAMModelOS.Controllers
|
|
//List<(string id, string code, string name)> listCourse = new List<(string id, string code, string name)>();
|
|
//List<(string id, string code, string name)> listCourse = new List<(string id, string code, string name)>();
|
|
if (scope.ToString().Equals("school", StringComparison.OrdinalIgnoreCase))
|
|
if (scope.ToString().Equals("school", StringComparison.OrdinalIgnoreCase))
|
|
{
|
|
{
|
|
- await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<Course>(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Course-{school_code.GetString()}") }))
|
|
|
|
|
|
+ await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<Course>(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Course-{code}") }))
|
|
{
|
|
{
|
|
courseList.Add(item);
|
|
courseList.Add(item);
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<Course>(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Course-{school_code.GetString()}") }))
|
|
|
|
|
|
+ await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<Course>(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Course-{code}") }))
|
|
{
|
|
{
|
|
courseList.Add(item);
|
|
courseList.Add(item);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (!$"{scope}".Equals("school")) {
|
|
|
|
+ var stulist =courseList.SelectMany(x => x.schedule).Select(z => z.stulist).Where(y => !string.IsNullOrWhiteSpace(y));
|
|
|
|
+
|
|
|
|
+ }
|
|
foreach (Course course in courseList)
|
|
foreach (Course course in courseList)
|
|
{
|
|
{
|
|
dynamic courseExtobj = new ExpandoObject();
|
|
dynamic courseExtobj = new ExpandoObject();
|
|
@@ -621,7 +625,7 @@ namespace TEAMModelOS.Controllers
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
{
|
|
{
|
|
- await _dingDing.SendBotMsg($"CoreAPI2,{_option.Location},course/find-summary()\n{ex.Message}\n{ex.StackTrace}\n", GroupNames.醍摩豆服務運維群組);
|
|
|
|
|
|
+ await _dingDing.SendBotMsg($"IES,{_option.Location},course/find-summary()\n{ex.Message}\n{ex.StackTrace}\n", GroupNames.醍摩豆服務運維群組);
|
|
return BadRequest();
|
|
return BadRequest();
|
|
}
|
|
}
|
|
|
|
|