فهرست منبع

调整异常和仲裁返回结果

liqk 3 سال پیش
والد
کامیت
12eb13bcb8
1فایلهای تغییر یافته به همراه5 افزوده شده و 1 حذف شده
  1. 5 1
      TEAMModelOS/Controllers/Common/ExamController.cs

+ 5 - 1
TEAMModelOS/Controllers/Common/ExamController.cs

@@ -1512,6 +1512,7 @@ namespace TEAMModelOS.Controllers
                 if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 if (!requert.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
+                if (!requert.TryGetProperty("type", out JsonElement type)) return BadRequest();
                 if (!requert.TryGetProperty("tmdId", out JsonElement tId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 var redisClient = _azureRedis.GetRedisClient(8);
@@ -1519,7 +1520,7 @@ namespace TEAMModelOS.Controllers
                 List<ExamClassResult> classResults = new();
                 List<SDK.Models.Cosmos.Common.Scoring> attr = new List<SDK.Models.Cosmos.Common.Scoring>();
                 await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<SDK.Models.Cosmos.Common.Scoring>(
-                                    queryText: $"select value(c) from c where c.examId = '{id}' and c.subjectId = '{subjectId}' and array_contains(c.tIds,'{tId}') ",
+                                    queryText: $"select value(c) from c where c.examId = '{id}' and c.subjectId = '{subjectId}' and c.type = {type} and array_contains(c.tIds,'{tId}') ",
                                     requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Scoring-{code}") }))
                 {
                     attr.Add(item);
@@ -1556,6 +1557,9 @@ namespace TEAMModelOS.Controllers
                     }
                 }
                 List<dynamic> objs = new List<dynamic>();
+                if (type.GetInt32() != 1) {
+                    return Ok(new { attr, paper = info.papers[index].blob });
+                }
                 foreach (SDK.Models.Cosmos.Common.Scoring ss in attr)
                 {
                     //var obj = new { stuId = ss.stuId, examId = ss.examId, subjectId = ss.subjectId, };