Selaa lähdekoodia

Merge branch 'develop' into develop-rc

CrazyIter_Bin 2 vuotta sitten
vanhempi
commit
c240cdc841
51 muutettua tiedostoa jossa 919 lisäystä ja 673 poistoa
  1. 11 9
      TEAMModelBI/Controllers/BIBlob/AnalyseFileController.cs
  2. 14 10
      TEAMModelBI/Controllers/BIHome/OnLineController.cs
  3. 155 65
      TEAMModelBI/Controllers/BITest/TestController.cs
  4. 2 1
      TEAMModelBI/Controllers/Census/ActivitySticsController.cs
  5. BIN
      TEAMModelBI/JsonFile/Core/ip2region.db
  6. 3 0
      TEAMModelBI/Startup.cs
  7. 3 3
      TEAMModelOS.FunctionV4/CosmosDB/TriggerHomework.cs
  8. 2 2
      TEAMModelOS.FunctionV4/CosmosDB/TriggerVote.cs
  9. 1 0
      TEAMModelOS.FunctionV4/ServiceBus/ActiveTaskTopic.cs
  10. 39 1
      TEAMModelOS.FunctionV4/TimeTrigger/IESTimerTrigger.cs
  11. 24 0
      TEAMModelOS.SDK/Models/Cosmos/Common/LessonRecord.cs
  12. 24 0
      TEAMModelOS.SDK/Models/Cosmos/Student/ErrorItems.cs
  13. 16 6
      TEAMModelOS.SDK/Models/Service/BI/BILogAnalyseService.cs
  14. 19 7
      TEAMModelOS.SDK/Models/Service/StudentService.cs
  15. 1 1
      TEAMModelOS/ClientApp/public/lang/en-US.js
  16. 1 1
      TEAMModelOS/ClientApp/public/lang/zh-CN.js
  17. 1 1
      TEAMModelOS/ClientApp/public/lang/zh-TW.js
  18. 0 3
      TEAMModelOS/ClientApp/src/api/schoolSetting.js
  19. 1 1
      TEAMModelOS/ClientApp/src/view/auth/Serial.vue
  20. 9 3
      TEAMModelOS/ClientApp/src/view/classrecord/ClassRecord.less
  21. 33 0
      TEAMModelOS/ClientApp/src/view/classrecord/ClassRecord.vue
  22. 31 5
      TEAMModelOS/ClientApp/src/view/classrecord/eventchart/Exam.vue
  23. 6 5
      TEAMModelOS/ClientApp/src/view/classrecord/eventchart/ExamGrade.vue
  24. 7 6
      TEAMModelOS/ClientApp/src/view/classrecord/eventchart/ExamQu.vue
  25. 1 34
      TEAMModelOS/ClientApp/src/view/classrecord/eventchart/ExamTable.vue
  26. 3 1
      TEAMModelOS/ClientApp/src/view/syllabus/Syllabus.vue
  27. 14 14
      TEAMModelOS/Controllers/Analysis/ClassAnalysisController.cs
  28. 55 55
      TEAMModelOS/Controllers/Both/CourseController.cs
  29. 8 8
      TEAMModelOS/Controllers/Both/PaperController.cs
  30. 2 2
      TEAMModelOS/Controllers/Client/AClassONEController.cs
  31. 2 2
      TEAMModelOS/Controllers/Client/HiTeachController.cs
  32. 24 24
      TEAMModelOS/Controllers/Common/AreaController.cs
  33. 117 117
      TEAMModelOS/Controllers/Common/ExamController.cs
  34. 14 14
      TEAMModelOS/Controllers/Common/ExamLiteController.cs
  35. 29 29
      TEAMModelOS/Controllers/Common/LearnController.cs
  36. 14 14
      TEAMModelOS/Controllers/Common/StudyController.cs
  37. 10 10
      TEAMModelOS/Controllers/Common/SurveyController.cs
  38. 11 11
      TEAMModelOS/Controllers/Common/VoteController.cs
  39. 14 14
      TEAMModelOS/Controllers/Common/WorkController.cs
  40. 1 1
      TEAMModelOS/Controllers/OpenApi/Init/OpenApiConfigController.cs
  41. 65 82
      TEAMModelOS/Controllers/School/ClassController.cs
  42. 8 8
      TEAMModelOS/Controllers/School/CorrectController.cs
  43. 17 17
      TEAMModelOS/Controllers/School/NoticeController.cs
  44. 9 9
      TEAMModelOS/Controllers/School/RoomController.cs
  45. 2 2
      TEAMModelOS/Controllers/School/SchoolController.cs
  46. 23 4
      TEAMModelOS/Controllers/Student/StudentController.cs
  47. 6 6
      TEAMModelOS/Controllers/System/OpenApiController.cs
  48. 5 5
      TEAMModelOS/Controllers/Teacher/FavoriteController.cs
  49. 10 8
      TEAMModelOS/Controllers/Teacher/InitController.cs
  50. 51 51
      TEAMModelOS/Controllers/Teacher/TeacherCommonController.cs
  51. 1 1
      TEAMModelOS/Startup.cs

+ 11 - 9
TEAMModelBI/Controllers/BIBlob/AnalyseFileController.cs

@@ -61,18 +61,20 @@ namespace TEAMModelBI.Controllers.BIBlob
 
             await foreach (BlobItem blobItem in blobCilent.GetBlobsAsync(BlobTraits.None, BlobStates.None, $"visitCnt/{day}"))
             {
-                BlobClient tempClient = blobCilent.GetBlobClient(blobItem.Name);
-                if (await tempClient.ExistsAsync())
+                if (blobItem.Name.EndsWith(".json") && !blobItem.Name.EndsWith("/days.json"))
                 {
-                    using (var meomoryStream = new MemoryStream())
+                    BlobClient tempClient = blobCilent.GetBlobClient(blobItem.Name);
+                    if (await tempClient.ExistsAsync())
                     {
-                        var response = blobCilent.GetBlobClient($"{blobItem.Name}").DownloadTo(meomoryStream);
-                        //var response = await blob.GetBlobClient($"{blobItem.Name}").DownloadToAsync(meomoryStream);
-
-                        RecCnt recCnt = Encoding.UTF8.GetString(meomoryStream.ToArray()).ToString().ToObject<RecCnt>();
+                        using (var meomoryStream = new MemoryStream())
+                        {
+                            var response = blobCilent.GetBlobClient($"{blobItem.Name}").DownloadTo(meomoryStream);
+                            //var response = await blob.GetBlobClient($"{blobItem.Name}").DownloadToAsync(meomoryStream);
 
-                        string name = stringSuffix.MidStrEx(blobItem.Name, "/", ".");
-                        days.Add(name, recCnt);
+                            RecCnt recCnt = Encoding.UTF8.GetString(meomoryStream.ToArray()).ToString().ToObject<RecCnt>();
+                            string name = stringSuffix.MidStrEx(blobItem.Name, "/", ".");
+                            days.Add(name, recCnt);
+                        }
                     }
                 }
             }

+ 14 - 10
TEAMModelBI/Controllers/BIHome/OnLineController.cs

@@ -43,13 +43,13 @@ namespace TEAMModelBI.Controllers.BIHome
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [HttpPost("get-count")]
-        public async Task<IActionResult> GetCount(JsonElement jsonElement) 
+        public async Task<IActionResult> GetCount(JsonElement jsonElement)
         {
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var table = _azureStorage.GetCloudTableClient().GetTableReference("IESLogin");
             var blobClient = _azureStorage.GetBlobContainerClient($"0-public");
             jsonElement.TryGetProperty("site", out JsonElement site);
-            if ($"{site}".Equals(BIConst.Global)) 
+            if ($"{site}".Equals(BIConst.Global))
             {
                 cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
                 table = _azureStorage.GetCloudTableClient(BIConst.Global).GetTableReference("IESLogin");
@@ -61,9 +61,9 @@ namespace TEAMModelBI.Controllers.BIHome
 
             var (daySt, dayEt) = TimeHelper.GetStartOrEnd(dateTime);  //今天开始时间    13位
             var (daySf, dayEf) = TimeHelper.GetStartOrEnd(dateTime, dateLenth: false);  //今天开始时间  10位
-            
+
             var (lastDayS, lastdayE) = TimeHelper.GetStartOrEnd(dateTime.AddDays(-1));   //昨天开始时间
-            
+
             var near7S = dateTime.AddDays(-7).ToUnixTimeMilliseconds();  //前七天的开始时间
             var near7E = dateTime.ToUnixTimeMilliseconds();     //当前结束时间
             long hour1 = dateTime.AddHours(-1).ToUnixTimeMilliseconds(); //一小时前时间戳
@@ -101,15 +101,19 @@ namespace TEAMModelBI.Controllers.BIHome
             List<RecCnt> recCnts = new();
             await foreach (BlobItem blobItem in blobClient.GetBlobsAsync(BlobTraits.None, BlobStates.None, $"visitCnt/{cDay}"))
             {
-                BlobClient tempBlobClient = blobClient.GetBlobClient(blobItem.Name);
-                if (await tempBlobClient.ExistsAsync())
+                if (blobItem.Name.EndsWith(".json") && !blobItem.Name.EndsWith("/days.json"))
                 {
-                    using (var meomoryStream = new MemoryStream())
+                    BlobClient tempBlobClient = blobClient.GetBlobClient(blobItem.Name);
+                    if (await tempBlobClient.ExistsAsync())
                     {
-                        var response = blobClient.GetBlobClient($"{blobItem.Name}").DownloadTo(meomoryStream);
-                        RecCnt recCnt = Encoding.UTF8.GetString(meomoryStream.ToArray()).ToString().ToObject<RecCnt>();
-                        recCnts.Add(recCnt);
+                        using (var meomoryStream = new MemoryStream())
+                        {
+                            var response = blobClient.GetBlobClient($"{blobItem.Name}").DownloadTo(meomoryStream);
+                            RecCnt recCnt = Encoding.UTF8.GetString(meomoryStream.ToArray()).ToString().ToObject<RecCnt>();
+                            recCnts.Add(recCnt);
+                        }
                     }
+
                 }
             }
             apiCnt = recCnts.Select(x => x.apiCnt.Select(s => s.count).Sum()).Sum();

+ 155 - 65
TEAMModelBI/Controllers/BITest/TestController.cs

@@ -51,6 +51,7 @@ using TEAMModelOS.SDK.Context.Constant;
 using Azure.Storage.Blobs.Models;
 using Azure.Storage.Blobs;
 using Azure.Storage.Blobs.Specialized;
+using System.Web;
 
 namespace TEAMModelBI.Controllers.BITest
 {
@@ -70,7 +71,7 @@ namespace TEAMModelBI.Controllers.BITest
         private readonly CoreAPIHttpService _coreAPIHttpService;
         private readonly HttpClient _httpClient;
         private IPSearcher _ipSearcher;
-        public TestController(IPSearcher ipSearcher,AzureCosmosFactory azureCosmos, AzureStorageFactory azureStorage, AzureRedisFactory azureRedis, DingDing dingDing, IOptionsSnapshot<Option> option, IWebHostEnvironment hostingEnvironment, IConfiguration configuration, CoreAPIHttpService coreAPIHttpService, HttpClient httpClient)
+        public TestController(IPSearcher ipSearcher, AzureCosmosFactory azureCosmos, AzureStorageFactory azureStorage, AzureRedisFactory azureRedis, DingDing dingDing, IOptionsSnapshot<Option> option, IWebHostEnvironment hostingEnvironment, IConfiguration configuration, CoreAPIHttpService coreAPIHttpService, HttpClient httpClient)
         {
             _azureCosmos = azureCosmos;
             _azureStorage = azureStorage;
@@ -280,7 +281,7 @@ namespace TEAMModelBI.Controllers.BITest
 
             //access_token的有效期为7200秒(2小时),有效期内重复获取会返回相同结果并自动续期,过期后获取会返回新的access_token
             string access_token = response.AccessToken;
-            
+
             IDingTalkClient quitStaffClient = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/smartwork/hrm/employee/querydimission");
             OapiSmartworkHrmEmployeeQuerydimissionRequest reqDimission = new() { Offset = 0L, Size = 50L };
             OapiSmartworkHrmEmployeeQuerydimissionResponse rspDimission = quitStaffClient.Execute(reqDimission, access_token);
@@ -356,7 +357,7 @@ namespace TEAMModelBI.Controllers.BITest
         /// </summary>
         /// <returns></returns>
         [HttpPost("get-onthejob")]
-        public async Task<IActionResult> GetOnTheJob() 
+        public async Task<IActionResult> GetOnTheJob()
         {
 
             string appKey = _configuration["DingDingAuth:appKey"];
@@ -396,10 +397,10 @@ namespace TEAMModelBI.Controllers.BITest
             {
                 return Ok(new { state = 200, msg = jobrsp.SubErrMsg });
             }
-                foreach (var item in jobrsp.Result.DataList)
-                {
-                    
-                }
+            foreach (var item in jobrsp.Result.DataList)
+            {
+
+            }
 
             var ser = jobrsp.Result.DataList;  // jobrsp.Body.GetEnumerator("result");
 
@@ -583,28 +584,28 @@ namespace TEAMModelBI.Controllers.BITest
         /// </summary>
         /// <returns></returns>
         [HttpPost("set-rolesorperm")]
-        public async Task<IActionResult> SetRolesOrPermissions() 
+        public async Task<IActionResult> SetRolesOrPermissions()
         {
             var table = _azureStorage.GetCloudTableClient().GetTableReference("BIDDUserInfo");
             List<DingDingUserInfo> ddUserId = await table.FindListByDict<DingDingUserInfo>(new Dictionary<string, object> { { "PartitionKey", "continent" } });
             List<string> read = new() { "abilitystandard-read", "batcharea-read", "batchschool-read", "orgusers-read" };
             List<DingDingUserInfo> tempUserInfo = new();
-            foreach (var user in ddUserId) 
+            foreach (var user in ddUserId)
             {
-                if (string.IsNullOrEmpty(user.roles)) 
+                if (string.IsNullOrEmpty(user.roles))
                 {
                     user.roles = "assist";
                 }
 
-                if (string.IsNullOrEmpty(user.permissions)) 
+                if (string.IsNullOrEmpty(user.permissions))
                 {
                     user.permissions = string.Join(",", read);
                 }
                 List<string> tempRead = new(user.permissions.Split(","));
 
-                foreach (var temp in read) 
+                foreach (var temp in read)
                 {
-                    if (!tempRead.Contains(temp)) 
+                    if (!tempRead.Contains(temp))
                     {
                         tempRead.Add(temp);
                     }
@@ -694,7 +695,7 @@ namespace TEAMModelBI.Controllers.BITest
             {
                 ste = new DateTime(ere.Year, ere.Month - 4, 1);
             }
-            else 
+            else
             {
                 ste = new DateTime(ere.Year - 1, ere.Month, 1);
             }
@@ -714,7 +715,7 @@ namespace TEAMModelBI.Controllers.BITest
             //return Ok(new { strList, dateTime, year, start, end, endList, endList1, endList2 });
 
 
-            return Ok(new { day7, day30, datetime7, start1, end1, start2, end2, start3, end3, start4, end4 , start5, end5 , start6, end6 , start7, end7 });
+            return Ok(new { day7, day30, datetime7, start1, end1, start2, end2, start3, end3, start4, end4, start5, end5, start6, end6, start7, end7 });
         }
 
         public static List<string> monthsOfYear(string yearMonth)
@@ -723,11 +724,11 @@ namespace TEAMModelBI.Controllers.BITest
             int year = dateTime.Year;
             int month = dateTime.Month;
             List<string> months = new List<string>();
-            while (year > dateTime.Year - 1 || month > dateTime.Month) 
+            while (year > dateTime.Year - 1 || month > dateTime.Month)
             {
                 months.Add($"{year}-{(month < 10 ? "0" : "") + month}");
                 month -= 1;
-                if (month <= 0) 
+                if (month <= 0)
                 {
                     year -= 1;
                     month = 12;
@@ -903,10 +904,10 @@ namespace TEAMModelBI.Controllers.BITest
         /// <param name="jsonElement"></param>
         /// <returns></returns>
         [HttpPost("get-repeat")]
-        public async Task<IActionResult> GetRepeat(JsonElement jsonElement) 
+        public async Task<IActionResult> GetRepeat(JsonElement jsonElement)
         {
             jsonElement.TryGetProperty("datetime", out JsonElement _datetime);
-            Dictionary<string, string> prodict = new() { { "YMPCVCIM", "学情分析模组" }, { "IPDYZYLC", "智慧学校管理服务" }, { "3CLYJ6NP", "AClass ONE智慧学伴" }, { "IPALJ6NY", "数据储存服务空间" },{ "VABAJ6NV", "卷卡合一阅卷系统" } };
+            Dictionary<string, string> prodict = new() { { "YMPCVCIM", "学情分析模组" }, { "IPDYZYLC", "智慧学校管理服务" }, { "3CLYJ6NP", "AClass ONE智慧学伴" }, { "IPALJ6NY", "数据储存服务空间" }, { "VABAJ6NV", "卷卡合一阅卷系统" } };
             var ste = prodict["IPDYZYLC"];
 
             List<string> str_str = new() { "12", "20", "13", "13", "14", "16" };
@@ -926,7 +927,7 @@ namespace TEAMModelBI.Controllers.BITest
             int pydays = (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) ? 366 : 365;
             //int pydays = DateTimeHelper.getDays(year);
 
-            return Ok(new { state = 200, pydays, days, strends , str_strend1, str_strend2 , ste  });
+            return Ok(new { state = 200, pydays, days, strends, str_strend1, str_strend2, ste });
         }
 
         /// <summary>
@@ -935,7 +936,7 @@ namespace TEAMModelBI.Controllers.BITest
         /// <param name="jsonElement"></param>
         /// <returns></returns>
         [HttpPost("get-dateday")]
-        public async Task<IActionResult> GetDateDay(JsonElement jsonElement) 
+        public async Task<IActionResult> GetDateDay(JsonElement jsonElement)
         {
             jsonElement.TryGetProperty("year", out JsonElement _year);
             jsonElement.TryGetProperty("moth", out JsonElement _moth);
@@ -968,29 +969,29 @@ namespace TEAMModelBI.Controllers.BITest
                         if (item <= 8 && item >= 3)
                             years = year;
                         else
-                            years = year+1;
+                            years = year + 1;
 
-                        if (years % 4 == 0 && year % 100 != 0 || year % 400 == 0)                        
-                            days = 29;                        
+                        if (years % 4 == 0 && year % 100 != 0 || year % 400 == 0)
+                            days = 29;
                         else
                             days = 28;
-                        break;                        
+                        break;
                 }
 
                 day += days;
             }
 
             return Ok(new { state = 200, day });
-            
+
         }
-        
+
         /// <summary>
         /// 测试CosmosDB分页查询  SQL语句分页
         /// </summary>
         /// <param name="jsonElement"></param>
         /// <returns></returns>
         [HttpPost("get-page")]
-        public async Task<IActionResult> cosmosDBPage(JsonElement jsonElement) 
+        public async Task<IActionResult> cosmosDBPage(JsonElement jsonElement)
         {
             if (!jsonElement.TryGetProperty("pageSize", out JsonElement pageSize)) return BadRequest();
             if (!jsonElement.TryGetProperty("endPosition", out JsonElement endPosition)) return BadRequest();
@@ -998,7 +999,7 @@ namespace TEAMModelBI.Controllers.BITest
             List<School> schools = new List<School>();
             //string sqlTxt = $"SELECT * FROM c where c.code='Base' order by c.id offset {endPosition} limit {pageSize}";
             string sqlTxt = $"SELECT * FROM c order by c.id offset {pageSize} limit {endPosition}";
-            await foreach (var tempPage in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: sqlTxt, requestOptions:new QueryRequestOptions { PartitionKey = new PartitionKey("Base") }))
+            await foreach (var tempPage in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: sqlTxt, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey("Base") }))
             {
                 using var json = await JsonDocument.ParseAsync(tempPage.ContentStream);
                 if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetInt16() > 0)
@@ -1028,9 +1029,9 @@ namespace TEAMModelBI.Controllers.BITest
             int? pageSize = null;
             string continuationToken = string.Empty;
             string pageToken = default;
-            if (jsonElement.TryGetProperty("pageSize", out JsonElement jsonPageSize)) 
+            if (jsonElement.TryGetProperty("pageSize", out JsonElement jsonPageSize))
             {
-                if (!jsonPageSize.ValueKind.Equals(JsonValueKind.Undefined) && !jsonPageSize.ValueKind.Equals(JsonValueKind.Null) && jsonPageSize.TryGetInt32(out int tempPageSize)) 
+                if (!jsonPageSize.ValueKind.Equals(JsonValueKind.Undefined) && !jsonPageSize.ValueKind.Equals(JsonValueKind.Null) && jsonPageSize.TryGetInt32(out int tempPageSize))
                 {
                     pageSize = tempPageSize;
                 }
@@ -1051,14 +1052,14 @@ namespace TEAMModelBI.Controllers.BITest
             await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: "select value(c) from c", continuationToken: pageToken, requestOptions: new QueryRequestOptions() { MaxItemCount = pageSize, PartitionKey = new PartitionKey("Base") }))
             {
                 using var json = await JsonDocument.ParseAsync(item.ContentStream);
-                if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0) 
+                if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                 {
                     foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
                     {
                         schools.Add(obj.ToObject<School>());
                     }
 
-                    if (iscontinuation) 
+                    if (iscontinuation)
                     {
                         continuationToken = item.GetContinuationToken();
                         break;
@@ -1095,7 +1096,7 @@ namespace TEAMModelBI.Controllers.BITest
             list2.Add(new Test { score = 100, name = "010" });
 
             //list3 return 2
-            List<Test> list3 = list1.Where(x => !list2.Any(x2 => x.score == x2.score && x.name==x2.name)).ToList();
+            List<Test> list3 = list1.Where(x => !list2.Any(x2 => x.score == x2.score && x.name == x2.name)).ToList();
             //list4 return 2
             List<Test> list4 = list1.Where(x => list2.All(x2 => x.score != x2.score)).ToList();
 
@@ -1120,8 +1121,8 @@ namespace TEAMModelBI.Controllers.BITest
             var ss = DateTime.Now.AddDays(0 - Convert.ToInt16(DateTime.Now.DayOfWeek) - 7).ToString("yyyy-MM-dd");//上周日
             var sss = DateTime.Now.AddDays(6 - Convert.ToInt16(DateTime.Now.DayOfWeek) - 7).ToString("yyyy-MM-dd");//上周六
 
-            var ssss = DateTime.Now.AddDays(1 - Convert.ToInt16(DateTime.Now.DayOfWeek) - 7+1).ToString("yyyy-MM-dd");//上周一
-            var sssss = DateTime.Now.AddDays(7 - Convert.ToInt16(DateTime.Now.DayOfWeek) - 7+1).ToString("yyyy-MM-dd");//上周日
+            var ssss = DateTime.Now.AddDays(1 - Convert.ToInt16(DateTime.Now.DayOfWeek) - 7 + 1).ToString("yyyy-MM-dd");//上周一
+            var sssss = DateTime.Now.AddDays(7 - Convert.ToInt16(DateTime.Now.DayOfWeek) - 7 + 1).ToString("yyyy-MM-dd");//上周日
 
             //计算上周
             var date = DateTime.Now;
@@ -1132,7 +1133,7 @@ namespace TEAMModelBI.Controllers.BITest
 
             var (lastWeekStart, lastWeekEnd) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow, "lastweek");
 
-            return Ok(new { state = 200, Mon,Sun, ss, sss, ssss, sssss, lastWeekStart, lastWeekEnd, have, en2, bingji, cha, jiaoji, chaji, list3, list4, temp, list1 });
+            return Ok(new { state = 200, Mon, Sun, ss, sss, ssss, sssss, lastWeekStart, lastWeekEnd, have, en2, bingji, cha, jiaoji, chaji, list3, list4, temp, list1 });
         }
 
         /// <summary>
@@ -1141,11 +1142,11 @@ namespace TEAMModelBI.Controllers.BITest
         /// <param name="jsonElement"></param>
         /// <returns></returns>
         [HttpPost("get-tablepage")]
-        public async Task<IActionResult> GetTablePage(JsonElement jsonElement) 
+        public async Task<IActionResult> GetTablePage(JsonElement jsonElement)
         {
             jsonElement.TryGetProperty("page", out JsonElement jpage);
             jsonElement.TryGetProperty("size", out JsonElement jsize);
-            int page = string.IsNullOrEmpty($"{jsize}") ?1: int.Parse($"{jpage}");
+            int page = string.IsNullOrEmpty($"{jsize}") ? 1 : int.Parse($"{jpage}");
             int size = string.IsNullOrEmpty($"{jsize}") ? 2 : int.Parse($"{jsize}");
             var table = _azureStorage.GetCloudTableClient().GetTableReference("BIOptLog");
 
@@ -1182,7 +1183,7 @@ namespace TEAMModelBI.Controllers.BITest
             Console.WriteLine(sw.Elapsed);
 
             HttpContext.Response.ContentType = "text/plain";
-            
+
             StreamWriter writer;
             //using (writer = new StreamWriter(HttpContext.Response.Body))
             //    for (int i = 0; i < 100; i++)
@@ -1191,21 +1192,21 @@ namespace TEAMModelBI.Controllers.BITest
             //    }
             //    //await writer.FlushAsync("Hello World");
 
-            return Ok(new { state = 200});
+            return Ok(new { state = 200 });
         }
 
         [HttpPost("get-linqcount")]
-        public async Task<IActionResult> GetLinqCount() 
+        public async Task<IActionResult> GetLinqCount()
         {
             List<linqTest> linqTests = new();
             for (int i = 0; i < 10; i++)
             {
-                linqTest linqt = new() { id = $"qwe{i}",name=$"名字{i}" ,linq1s = new List<linq1> { new linq1 { id =$"abc{i}",times = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()}, new linq1 { id = $"def{i}", times = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() } } };
+                linqTest linqt = new() { id = $"qwe{i}", name = $"名字{i}", linq1s = new List<linq1> { new linq1 { id = $"abc{i}", times = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() }, new linq1 { id = $"def{i}", times = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() } } };
                 linqTests.Add(linqt);
             }
 
             //var set = linqTests.Select((x, y) => x.linq1s.Find(l => l.id.Equals($"abc0"))).ToList();
-            var set = linqTests.Where(x=> !string.IsNullOrEmpty(x.linq1s.Find(l => l.id.Equals($"abc0")).ToString()) );
+            var set = linqTests.Where(x => !string.IsNullOrEmpty(x.linq1s.Find(l => l.id.Equals($"abc0")).ToString()));
             //var tem220p = linqTests.ForEach(x => {
             //    var coreUser = linqTests.Find(c => c.id.Equals("abc0"));
             //   });  //.Except(linqTests.Select(y => y.linq1s.Find(n => n.times.Equals("abc0"))));
@@ -1256,7 +1257,7 @@ namespace TEAMModelBI.Controllers.BITest
             }
             var redisGl = _azureRedis.GetRedisClient(dbnum: 0, name: "Global");
 
-            var temps= await _azureRedis.GetRedisClient(dbnum: 0, name: "Global").SortedSetIncrementAsync($"Login:IES:Test", $"1", 1);//一天24小时  小时为单位
+            var temps = await _azureRedis.GetRedisClient(dbnum: 0, name: "Global").SortedSetIncrementAsync($"Login:IES:Test", $"1", 1);//一天24小时  小时为单位
 
             var cosmosDefaulat = _azureCosmos.GetCosmosClient(); //默认数据库
             List<School> schools = new();
@@ -1321,7 +1322,7 @@ namespace TEAMModelBI.Controllers.BITest
         /// <param name="jsonElement"></param>
         /// <returns></returns>
         [HttpPost("get-loganalyse")]
-        public async Task<IActionResult> GetLogAnalyse(JsonElement jsonElement) 
+        public async Task<IActionResult> GetLogAnalyse(JsonElement jsonElement)
         {
             if (!jsonElement.TryGetProperty("path", out JsonElement path)) return BadRequest();
 
@@ -1342,11 +1343,100 @@ namespace TEAMModelBI.Controllers.BITest
             //    }
             //}
 
-            var (an, saveUrl) = await BILogAnalyseService.GetPathAnalyse(_azureStorage,_ipSearcher,_dingDing, $"{path}", BIConst.LogGlobal);
+            var (an, saveUrl) = await BILogAnalyseService.GetPathAnalyse(_azureStorage, _ipSearcher, _dingDing, $"{path}", BIConst.LogChina);
 
             return Ok(new { state = RespondCode.Ok, cnt = filename.Count, filename, an, saveUrl });
         }
 
+        /// <summary>
+        /// 小时/天读取防火墙文件,分析;
+        /// </summary>
+        /// <param name="jsonElement"></param>
+        /// <returns></returns>
+        [HttpPost("get-savefile")]
+        public async Task<IActionResult> GetSaveFile(JsonElement jsonElement)
+        {
+            if (!jsonElement.TryGetProperty("time", out JsonElement time)) return BadRequest();
+
+            long str = time.GetInt64();
+            DateTimeOffset dateTimeJ = TimeHelper.GetDateTime(str);
+
+            var datetime = dateTimeJ.AddHours(-1);
+            var y = datetime.Year;
+            var m = datetime.Month >= 10 ? $"{datetime.Month}" : $"0{datetime.Month}";
+            var d = datetime.Day >= 10 ? $"{datetime.Day}" : $"0{datetime.Day}";
+            var h = datetime.Hour >= 10 ? $"{datetime.Hour}" : $"0{datetime.Hour}";
+
+            string path = $"resourceId=/SUBSCRIPTIONS/73B7F9EF-D8B7-4444-9E8D-D80B43BF3CD4/RESOURCEGROUPS/TEAMMODELCHENGDU/PROVIDERS/MICROSOFT.NETWORK/APPLICATIONGATEWAYS/OSFIREWARE/y={y}/m={m}/d={d}/h={h}/m=00/PT1H.json";
+            var retn = await BILogAnalyseService.GetPathAnalyse(_azureStorage, _ipSearcher, _dingDing, path, BIConst.LogChina);
+            if (retn.recCnts.IsNotEmpty())
+            {
+                //https://teammodelos.blob.core.chinacloudapi.cn/0-public/pie-borderRadius.html
+                string publishUrl = $"https://teammodelos.blob.core.chinacloudapi.cn/0-public/api-count.html?url={HttpUtility.UrlEncode(retn.saveUrls.First(), Encoding.UTF8)}&time={HttpUtility.UrlEncode(datetime.AddHours(8).ToString("yyyy年MM月dd日 HH时"), Encoding.UTF8)}";
+                string ulrs = $"https://teammodelos.blob.core.chinacloudapi.cn/0-public/api-count.html?url={retn.saveUrls.First()}&time={datetime.AddHours(8).ToString("yyyy年MM月dd日 HH时")}";
+                string ulr = $"http://cdhabook.teammodel.cn:8805/screen/screenshot-png?width=1920&height=1450&url={HttpUtility.UrlEncode(ulrs, Encoding.UTF8)}&delay=6000";
+                string image = "";
+
+                try
+                {
+                    string strs = await _httpClient.GetStringAsync(ulr);
+                    if (!string.IsNullOrWhiteSpace(strs))
+                    {
+                        JsonElement json = strs.ToObject<JsonElement>();
+                        json.TryGetProperty("url", out JsonElement base64);
+                        using (MemoryStream ms = new MemoryStream(Convert.FromBase64String($"{base64}")))
+                        {
+                            image = await _azureStorage.GetBlobContainerClient("0-public").UploadFileByContainer(ms, $"visitCnt/{y}{m}{d}", $"{y}{m}{d}{h}.png", false);
+                        }
+                    }
+                }
+                catch (Exception ex)
+                {
+
+                }
+                await _dingDing.SendBotMarkdown("防火墙日志记录", $"#### 测试(小时)-防火墙日志记录\n> 记录时间:{datetime.AddHours(8).ToString("yyyy-MM-dd HH")}\n> ![screenshot]({image})\n> ###### 发布时间:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}" +
+                    $" [发布地址]({publishUrl}) \n", GroupNames.醍摩豆服務運維群組);
+            }
+            List<RecCnt> recCnts = new();
+            List<string> saveUrls = new();
+
+            if (h.Equals("00"))
+            {
+                var pastTime = datetime.AddHours(-1);
+                var ptY = pastTime.Year;
+                var ptM = pastTime.Month >= 10 ? $"{pastTime.Month}" : $"0{pastTime.Month}";
+                var ptD = pastTime.Day >= 10 ? $"{pastTime.Day}" : $"0{pastTime.Day}";
+
+                string dayPath = $"resourceId=/SUBSCRIPTIONS/73B7F9EF-D8B7-4444-9E8D-D80B43BF3CD4/RESOURCEGROUPS/TEAMMODELCHENGDU/PROVIDERS/MICROSOFT.NETWORK/APPLICATIONGATEWAYS/OSFIREWARE/y={ptY}/m={ptM}/d={ptD}";
+                (recCnts, saveUrls) = await BILogAnalyseService.GetPathAnalyse(_azureStorage, _ipSearcher, _dingDing, dayPath, BIConst.LogChina);
+
+                if (recCnts.IsNotEmpty())
+                {
+                    //一天的统计
+                    string dayPublishUrl = $"https://teammodelos.blob.core.chinacloudapi.cn/0-public/api-count.html?url={HttpUtility.UrlEncode(saveUrls.First(), Encoding.UTF8)}&time={HttpUtility.UrlEncode(pastTime.ToString("yyyy年MM月dd日"), Encoding.UTF8)}";
+                    string dayUrls = $"https://teammodelos.blob.core.chinacloudapi.cn/0-public/api-count.html?url={saveUrls.First()}&time={pastTime.ToString("yyyy年MM月dd日")}";
+                    string dayUrl = $"http://cdhabook.teammodel.cn:8805/screen/screenshot-png?width=1920&height=1450&url={HttpUtility.UrlEncode(dayUrls, Encoding.UTF8)}&delay=6000";
+                    string dayImage = "";
+
+                    string dayStr = await _httpClient.GetStringAsync(dayUrl);
+                    if (!string.IsNullOrWhiteSpace(dayStr))
+                    {
+                        JsonElement dayJson = dayStr.ToObject<JsonElement>();
+                        dayJson.TryGetProperty("url", out JsonElement dayBase64);
+                        using (MemoryStream dayMs = new(Convert.FromBase64String($"{dayBase64}")))
+                        {
+                            dayImage = await _azureStorage.GetBlobContainerClient("0-public").UploadFileByContainer(dayMs, $"visitCnt/{ptY}{ptM}{ptD}", "days.png", false);
+                        }
+                    }
+
+                    await _dingDing.SendBotMarkdown("测试-防火墙日志记录", $"#### 测试(天)-防火墙日志记录\n> 记录时间:{pastTime.ToString("yyyy-MM-dd")}\n> ![screenshot]({dayImage})\n> ###### 发布时间:{pastTime.ToString("yyyy-MM-dd HH:mm:ss")}" +$" [发布地址]({dayPublishUrl}) \n", GroupNames.成都开发測試群組);
+
+                }
+            }
+
+            return Ok(new { state = 200, recCnts });
+        }
+
 
         /// <summary>
         /// 测试研究table 表分页的问题
@@ -1354,34 +1444,34 @@ namespace TEAMModelBI.Controllers.BITest
         /// <param name="jsonElement"></param>
         /// <returns></returns>
         [HttpPost("get-logrec")]
-        public async Task<IActionResult> GetLogRec(JsonElement jsonElement) 
-        {
-            int takeCount = 500;
-            var table = _azureStorage.GetCloudTableClient().GetTableReference("BIOptLog");
-            var table1 = _azureStorage.GetCloudTableClient();
-            int pagesize = 10;
-            int pageNum = 2;
+            public async Task<IActionResult> GetLogRec(JsonElement jsonElement)
+            {
+                int takeCount = 500;
+                var table = _azureStorage.GetCloudTableClient().GetTableReference("BIOptLog");
+                var table1 = _azureStorage.GetCloudTableClient();
+                int pagesize = 10;
+                int pageNum = 2;
 
-            var query = (from entity in table.CreateQuery<BIOptLog>()
-                          select entity).ToList().Skip(pagesize * (pageNum - 1)).Take(pagesize);
+                var query = (from entity in table.CreateQuery<BIOptLog>()
+                             select entity).ToList().Skip(pagesize * (pageNum - 1)).Take(pagesize);
 
-            //var query = (from entity in table.CreateQuery<BIOptLog>()
-            //             orderby entity.time descending
-            //             select  entity).Skip(pagesize * (pageNum - 1)).Take(pagesize);
-            //var ster = AzureStorageTableExtensions.GetTablePage<BIOptLog>(table1, "BIOptLog", 10, 1);
-            return Ok(new { state = 200 , query });
+                //var query = (from entity in table.CreateQuery<BIOptLog>()
+                //             orderby entity.time descending
+                //             select  entity).Skip(pagesize * (pageNum - 1)).Take(pagesize);
+                //var ster = AzureStorageTableExtensions.GetTablePage<BIOptLog>(table1, "BIOptLog", 10, 1);
+                return Ok(new { state = 200, query });
 
-        }
+            }
 
 
         public class linqTest
         {
-            public string id{ get; set; }
+            public string id { get; set; }
             public string name { get; set; }
             public List<linq1> linq1s { get; set; }
         }
 
-        public class linq1 
+        public class linq1
         {
             public string id { get; set; }
             public long times { get; set; }
@@ -1422,7 +1512,7 @@ namespace TEAMModelBI.Controllers.BITest
 
         }
 
-        public static long GetMonthEnd(DateTimeOffset dt) 
+        public static long GetMonthEnd(DateTimeOffset dt)
         {
             DateTime dtNew = new DateTime(dt.Year, dt.Month, 1);
             var ste = dtNew.AddMonths(1).AddDays(-1).Day;

+ 2 - 1
TEAMModelBI/Controllers/Census/ActivitySticsController.cs

@@ -486,7 +486,8 @@ namespace TEAMModelBI.Controllers.Census
             scCount = await CommonFind.GetSqlValueCount(cosmosClient, "School", commSql,  "Base");
             tecCount = await CommonFind.GetSqlValueCount(cosmosClient, "Teacher", commSql,"Base");
             stuCount = await CommonFind.GetSqlValueCount(cosmosClient, "Student", commSql,  "Base");
-            allSize = await CommonFind.GetSqlValueCount(cosmosClient, "School", commSql,  "Base");
+            string sizeSql = "select value(sum(c.size)) from c";
+            allSize = await CommonFind.GetSqlValueCount(cosmosClient, "School", sizeSql,  "Base");
 
 
             weekScCnt = await CommonFind.GetSqlValueCount(cosmosClient, "School", $"{commSql} where c.createTime >= {weekStart} and c.createTime <= {weekEnd}", "Base");

BIN
TEAMModelBI/JsonFile/Core/ip2region.db


+ 3 - 0
TEAMModelBI/Startup.cs

@@ -137,6 +137,9 @@ namespace TEAMModelBI
             services.AddHttpContextAccessor();
             services.Configure<Option>(options => Configuration.GetSection("Option").Bind(options));
             services.AddControllers();
+
+            string path = $"{ environment.ContentRootPath}/JsonFile/Core";
+            services.AddIPSearcher(path);
             services.AddSpaStaticFiles(configuration =>
             {
                 configuration.RootPath = "ClientApp";

+ 3 - 3
TEAMModelOS.FunctionV4/CosmosDB/TriggerHomework.cs

@@ -196,7 +196,7 @@ namespace TEAMModelOS.FunctionV4
                     {
                         z.members.ForEach(y =>
                         {
-                            if (y.id.Equals(x) && y.type == 1)
+                            if (y.id.Equals(x.id) && y.type == 1)
                             {
                                 classIds.Add(z.id);
                             }
@@ -243,7 +243,7 @@ namespace TEAMModelOS.FunctionV4
                     {
                         z.members.ForEach(y =>
                         {
-                            if (y.id.Equals(x) && y.code.Equals(work.school) && y.type == 2)
+                            if (y.id.Equals(x.id) && y.code.Equals(work.school) && y.type == 2)
                             {
                                 classIds.Add(z.id);
                             }
@@ -301,7 +301,7 @@ namespace TEAMModelOS.FunctionV4
                     {
                         z.members.ForEach(y =>
                         {
-                            if (y.id.Equals(x) && y.type == 1)
+                            if (y.id.Equals(x.id) && y.type == 1)
                             {
                                 classIds.Add(z.id);
                             }

+ 2 - 2
TEAMModelOS.FunctionV4/CosmosDB/TriggerVote.cs

@@ -172,7 +172,7 @@ namespace TEAMModelOS.FunctionV4
                                     HashSet<string> classIds = new HashSet<string>();
                                     classLists.ForEach(z => {
                                         z.members.ForEach(y => {
-                                            if (y.id.Equals(x) && y.code.Equals(vote.school) && y.type == 2)
+                                            if (y.id.Equals(x.id) && y.code.Equals(vote.school) && y.type == 2)
                                             {
                                                 classIds.Add(z.id);
                                             }
@@ -217,7 +217,7 @@ namespace TEAMModelOS.FunctionV4
                                     HashSet<string> classIds = new HashSet<string>();
                                     classInfos.ForEach(z => {
                                         z.members.ForEach(y => {
-                                            if (y.id.Equals(x) && y.type == 1)
+                                            if (y.id.Equals(x.id) && y.type == 1)
                                             {
                                                 classIds.Add(z.id);
                                             }

+ 1 - 0
TEAMModelOS.FunctionV4/ServiceBus/ActiveTaskTopic.cs

@@ -1389,6 +1389,7 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
                                         lessonRecord.clientInteractionAverge = lessonBase.summary.clientInteractionAverge;
                                         lessonRecord.examCount = lessonBase.summary.examCount;
                                         lessonRecord.totalInteractPoint = lessonBase.summary.totalInteractPoint;
+                                        lessonRecord.learningCategory = lessonBase.summary.learningCategory;
                                         if (!string.IsNullOrWhiteSpace(lessonRecord.school))
                                         {
                                             lessonBase.student.ForEach(x =>

+ 39 - 1
TEAMModelOS.FunctionV4/TimeTrigger/IESTimerTrigger.cs

@@ -106,9 +106,47 @@ namespace TEAMModelOS.FunctionV4.TimeTrigger
                         catch (Exception ex) { 
                           
                         }
-                        await _dingDing.SendBotMarkdown("防火墙日志记录", $"#### 防火墙日志记录\n> 记录时间:{datetime.AddHours(8).ToString("yyyy-MM-dd HH")}\n> ![screenshot]({image})\n> ###### 发布时间:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}" +
+                        await _dingDing.SendBotMarkdown("防火墙日志记录", $"#### 防火墙日志记录(小时)\n> 记录时间:{datetime.AddHours(8).ToString("yyyy-MM-dd HH")}\n> ![screenshot]({image})\n> ###### 发布时间:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}" +
                             $" [发布地址]({publishUrl}) \n", GroupNames.醍摩豆服務運維群組);
                     }
+
+                    //处理昨天的防火墙日志
+                    if (h.Equals("00"))
+                    {
+                        var pastTime = datetime.AddHours(-1);
+                        var ptY = pastTime.Year;
+                        var ptM = pastTime.Month >= 10 ? $"{pastTime.Month}" : $"0{pastTime.Month}";
+                        var ptD = pastTime.Day >= 10 ? $"{pastTime.Day}" : $"0{pastTime.Day}";
+
+                        string dayPath = $"resourceId=/SUBSCRIPTIONS/73B7F9EF-D8B7-4444-9E8D-D80B43BF3CD4/RESOURCEGROUPS/TEAMMODELCHENGDU/PROVIDERS/MICROSOFT.NETWORK/APPLICATIONGATEWAYS/OSFIREWARE/y={ptY}/m={ptM}/d={ptD}";
+                        var retnDay = await BILogAnalyseService.GetPathAnalyse(_azureStorage, _ipSearcher, _dingDing, dayPath, "LogStorage");
+
+                        if (retn.recCnts.IsNotEmpty()) 
+                        {
+                            //一天的统计
+                            string dayPublishUrl = $"https://teammodelos.blob.core.chinacloudapi.cn/0-public/api-count.html?url={HttpUtility.UrlEncode(retnDay.saveUrls.First(), Encoding.UTF8)}&time={HttpUtility.UrlEncode(pastTime.ToString("yyyy年MM月dd日"), Encoding.UTF8)}";
+                            string dayUrls = $"https://teammodelos.blob.core.chinacloudapi.cn/0-public/api-count.html?url={retnDay.saveUrls.First()}&time={pastTime.ToString("yyyy年MM月dd日")}";
+                            string dayUrl = $"http://cdhabook.teammodel.cn:8805/screen/screenshot-png?width=1920&height=1450&url={HttpUtility.UrlEncode(dayUrls, Encoding.UTF8)}&delay=6000";
+                            string dayImage = "";
+
+                            try
+                            {
+                                string dayStr = await _httpClient.GetStringAsync(dayUrl);
+                                if (!string.IsNullOrWhiteSpace(dayStr)) 
+                                {
+                                    JsonElement dayJson = dayStr.ToObject<JsonElement>();
+                                    dayJson.TryGetProperty("utl", out JsonElement dayBase64);
+                                    using (MemoryStream dayMs = new(Convert.FromBase64String($"{dayBase64}"))) 
+                                    {
+                                        dayImage = await _azureStorage.GetBlobContainerClient("0-public").UploadFileByContainer(dayMs, $"visitCnt/{ptY}{ptM}{ptD}", "days.png", false);
+                                    }
+                                }
+                            }
+                            catch (Exception ex) { }
+
+                            await _dingDing.SendBotMarkdown("防火墙日志记录", $"#### 防火墙日志记录(天)\n> 记录时间:{pastTime.ToString("yyyy-MM-dd")}\n> ![screenshot]({dayImage})\n> ###### 发布时间:{pastTime.ToString("yyyy-MM-dd HH:mm:ss")}" + $" [发布地址]({dayPublishUrl}) \n", GroupNames.成都开发測試群組);
+                        }
+                    }
                 }
                 else if (location.Contains("Global"))
                 {

+ 24 - 0
TEAMModelOS.SDK/Models/Cosmos/Common/LessonRecord.cs

@@ -200,6 +200,29 @@ namespace TEAMModelOS.SDK.Models
         /// 默认未上传
         /// </summary>
         public int upload { get; set; }
+        public LearningCategory learningCategory { get; set; }
+    }
+    public class LearningCategory {
+        /// <summary>
+        /// //合作學習
+        /// </summary>
+        public int cooperation { get; set; }
+        /// <summary>
+        /// 互動學習
+        /// </summary>
+        public int interaction { get; set; }
+        /// <summary>
+        /// 任務學習
+        /// </summary>
+        public int task { get; set; }
+        /// <summary>
+        /// 測驗學習
+        /// </summary>
+        public int exam { get; set; }
+        /// <summary>
+        /// 差異化學習
+        /// </summary>
+        public int diffential { get; set; }
     }
     public class LessonTC
     {
@@ -337,6 +360,7 @@ namespace TEAMModelOS.SDK.Models
         /// </summary>
         public double clientInteractionAverge { get; set; } = 0;
         public int examCount { get; set; }
+        public LearningCategory learningCategory { get; set; }
     }
 
     public class QuizSummaryList

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 24 - 0
TEAMModelOS.SDK/Models/Cosmos/Student/ErrorItems.cs


+ 16 - 6
TEAMModelOS.SDK/Models/Service/BI/BILogAnalyseService.cs

@@ -102,6 +102,9 @@ namespace TEAMModelOS.SDK.Models.Service.BI
             List<RecCnt> recCnts = new();
             List<string> urls = new();
 
+            DateTimeOffset dtime = DateTimeOffset.UtcNow;
+            string cDay = dtime.ToString("yyyyMMdd");
+
             try {
                 var blobClient = _azureStorage.GetBlobContainerClient($"insights-logs-applicationgatewayfirewalllog", name: connectName);
                 await foreach (BlobItem blobItem in blobClient.GetBlobsAsync(BlobTraits.None, BlobStates.None, path))
@@ -149,13 +152,13 @@ namespace TEAMModelOS.SDK.Models.Service.BI
                     //        aGInfos.Add(item);
                     //}
 
-                    DateTimeOffset dtime = DateTimeOffset.UtcNow;
                     string cHour = dtime.ToString("yyyyMMddHH");
-                    string cDay = dtime.ToString("yyyyMMdd");
+                    string cHH = dtime.ToString("HH");
                     if (aGInfos.Count > 0)
                     {
                         cHour = aGInfos.Select(s => DateTimeOffset.Parse(s.time).ToString("yyyyMMddHH")).First();
                         cDay = aGInfos.Select(s => DateTimeOffset.Parse(s.time).ToString("yyyyMMdd")).First();
+                        cHH = aGInfos.Select(s => DateTimeOffset.Parse(s.time).ToString("HH")).First();
                     }
 
                     RecCnt saveCnts = new();
@@ -180,15 +183,16 @@ namespace TEAMModelOS.SDK.Models.Service.BI
                             if (dis.Length >= 2)
                             {
                                 x.code = dis[dis.Length - 1];
-                                x.name = dis[dis.Length - 2];
-                                
+                                x.name = dis[dis.Length - 2];  // 不保留省份
+                                //x.name = region.Substring(0, region.LastIndexOf("·"));  //保留省份
                             }
                             else {
                                 var disrs = Regex.Split(region.TrimStart().TrimEnd(), @"\s+");
                                 if (disrs.Length >= 2)
                                 {
                                     x.code = disrs[disrs.Length - 1];
-                                    x.name = disrs[disrs.Length - 2];
+                                    x.name = disrs[disrs.Length - 2];   //不保留省份
+                                    //x.name = region.Substring(0, region.LastIndexOf("·")); //保留省份
                                 }
                                 else {
                                     x.code = region;
@@ -208,10 +212,16 @@ namespace TEAMModelOS.SDK.Models.Service.BI
                     saveCnts.regionCnts = regionCnts;
                     recCnts.Add(saveCnts);
                     //保存存至Blob文件
-                    var url = await _azureStorage.GetBlobContainerClient("0-public").UploadFileByContainer(saveCnts.ToJsonString(), $"visitCnt/{cDay}", $"{cHour}.json");
+                    var url = await _azureStorage.GetBlobContainerClient("0-public").UploadFileByContainer(saveCnts.ToJsonString(), $"visitCnt/{cDay}", $"{cHH}.json");
                     urls.Add(url);
                 }
 
+                if (recCnts.Count > 1) 
+                {
+                    //保存一天的数据至Blob文件
+                    var daysUrl = await _azureStorage.GetBlobContainerClient("0-public").UploadFileByContainer(recCnts.ToJsonString(), $"visitCnt/{cDay}", $"days.json");
+                }
+                
                 var azureClient = _azureStorage.GetBlobContainerClient("0-public");//获取容器连接地址
                 int expireTime = int.Parse(DateTimeOffset.UtcNow.AddDays(-180).ToString("yyyyMMdd"));
                 await foreach (var blobItem in azureClient.GetBlobsAsync(BlobTraits.None, BlobStates.None, prefix: "visitCnt"))

+ 19 - 7
TEAMModelOS.SDK/Models/Service/StudentService.cs

@@ -1396,16 +1396,16 @@ namespace TEAMModelOS.SDK
         /// </summary>
         /// <param name="schoolId"></param>
         /// <returns> [{id,name,picture,year,no,classId,classNo,className,gradeId,periodId},{id,name,picture,..}..]</returns>
-        public static async Task<List<object>> getAllStudent(AzureCosmosFactory _azureCosmos, DingDing _dingDing, Option _option, string schoolId)
+        public static async Task<List<object>> getAllStudent(AzureCosmosFactory _azureCosmos, DingDing _dingDing, Option _option, string schoolId,int inyear ,int graduate=0 )
         {
             try
             {
                 //TODO : 進階查詢選項調整、部分地方可用並行處理
                 //以學校學生角度去抓資料
-                Dictionary<string, List<(string id, string name, string picture, int year, string no, string periodId, string irs,string imei,string gender, List<StudentGuardian> guardians)>> dicClassStuds =
-                    new Dictionary<string, List<(string id, string name, string picture, int year, string no, string periodId, string irs, string imei, string gender, List<StudentGuardian> guardians)>>();
-                List<(string id, string name, string picture, int year, string no, string periodId, string irs, string imei, string gender, List<StudentGuardian> guardians)> notJoinClassStuds = 
-                    new List<(string id, string name, string picture, int year, string no, string periodId, string irs, string imei, string gender, List<StudentGuardian> guardians)>();
+                Dictionary<string, List<(string id, string name, string picture, int year, string no, string periodId, string irs,string imei,string gender,int graduate, List<StudentGuardian> guardians)>> dicClassStuds =
+                    new Dictionary<string, List<(string id, string name, string picture, int year, string no, string periodId, string irs, string imei, string gender, int graduate, List<StudentGuardian> guardians)>>();
+                List<(string id, string name, string picture, int year, string no, string periodId, string irs, string imei, string gender, int graduate, List<StudentGuardian> guardians)> notJoinClassStuds = 
+                    new List<(string id, string name, string picture, int year, string no, string periodId, string irs, string imei, string gender, int graduate, List<StudentGuardian> guardians)>();
 
 
                 List<Imei> imeis= new List<Imei>();
@@ -1414,7 +1414,15 @@ namespace TEAMModelOS.SDK
                    .GetItemQueryIterator<Imei>(queryText:imeiQueryText,requestOptions:new QueryRequestOptions { PartitionKey= new PartitionKey("Imei")})){
                     imeis.Add(item);
                 }
-                string queryText = $"SELECT  *  FROM c WHERE c.code = 'Base-{schoolId}'";
+                string queryText = "";
+                if (graduate == 0)
+                {
+                    queryText = $"SELECT  *  FROM c WHERE c.code = 'Base-{schoolId}' and (c.graduate = 0 or IS_DEFINED(c.graduate) = false )";
+                }
+                else {
+                    queryText = $"SELECT  *  FROM c WHERE c.code = 'Base-{schoolId}' and  c.graduate = 1 and c.year ={inyear} ";
+                }
+                 
 
                 //回傳用ContinuationToken
                 string continuationToken = string.Empty;
@@ -1464,6 +1472,7 @@ namespace TEAMModelOS.SDK
                                             $"{irs}",
                                             imeiObj?.id,//imei
                                             acc.TryGetProperty("gender", out JsonElement _gender) && _gender.ValueKind.Equals(JsonValueKind.String) ? _gender.GetString() : null,
+                                              acc.TryGetProperty("graduate", out JsonElement _graduate) && _graduate.ValueKind.Equals(JsonValueKind.Number) ? int.Parse($"{_graduate}"): 0,
                                             guardians
                                         )
                                     );
@@ -1482,6 +1491,7 @@ namespace TEAMModelOS.SDK
                                                 $"{irs}",
                                                 imeiObj?.id,//imei
                                                 acc.TryGetProperty("gender", out JsonElement _gender) && _gender.ValueKind.Equals(JsonValueKind.String) ? _gender.GetString() : null,
+                                                  acc.TryGetProperty("graduate", out JsonElement _graduate) && _graduate.ValueKind.Equals(JsonValueKind.Number) ? int.Parse($"{_graduate}") : 0,
                                                 guardians
                                             )
                                         );
@@ -1489,7 +1499,7 @@ namespace TEAMModelOS.SDK
                                 else
                                 {
                                     dicClassStuds.Add(classId,
-                                            new List<(string id, string name, string picture, int year, string no, string periodId, string irs,string imei,string gender, List<StudentGuardian> guardians)>()
+                                            new List<(string id, string name, string picture, int year, string no, string periodId, string irs,string imei,string gender,int graduate, List<StudentGuardian> guardians)>()
                                             {
                                                 (
                                                     acc.GetProperty("id").GetString(),
@@ -1500,6 +1510,7 @@ namespace TEAMModelOS.SDK
                                                     $"{irs}"  ,
                                                     imeiObj?.id,//imei
                                                     acc.TryGetProperty("gender", out JsonElement _gender) && _gender.ValueKind.Equals(JsonValueKind.String) ? _gender.GetString() : null,
+                                                      acc.TryGetProperty("graduate", out JsonElement _graduate) && _graduate.ValueKind.Equals(JsonValueKind.Number) ? int.Parse($"{_graduate}"): 0,
                                                     guardians
                                                 )
                                             }
@@ -1553,6 +1564,7 @@ namespace TEAMModelOS.SDK
                                          irs = o.irs,
                                          imei=o.imei,
                                          gender = o.gender,
+                                         graduate=   o.graduate,
                                          guardians =o.guardians,
                                      });
                     ret.AddRange(tmp);

+ 1 - 1
TEAMModelOS/ClientApp/public/lang/en-US.js

@@ -6019,7 +6019,7 @@ const LANG_EN_US = {
 
         // ExamList.vue
         newest: 'Newest Exams',
-        more: 'View More',
+        more: 'View Report',
 
         // index.vue
         module1: 'Score Analysis',

+ 1 - 1
TEAMModelOS/ClientApp/public/lang/zh-CN.js

@@ -6023,7 +6023,7 @@ const LANG_ZH_CN = {
 
         // ExamList.vue
         newest: '最新测验',
-        more: '查看更多',
+        more: '查看报告',
 
         // index.vue
         module1: '成绩分析',

+ 1 - 1
TEAMModelOS/ClientApp/public/lang/zh-TW.js

@@ -6024,7 +6024,7 @@ const LANG_ZH_TW = {
 
         // ExamList.vue
         newest: '最新評量',
-        more: '查看更多',
+        more: '查看報告',
 
         // index.vue
         module1: '成績分析',

+ 0 - 3
TEAMModelOS/ClientApp/src/api/schoolSetting.js

@@ -6,9 +6,6 @@ export default {
     findSchoolSystem: function (data) {
         return post('/school/init/find', data)
     },
-    findClassInfo: function (data) {
-        return post('/school/classroom/find', data)
-    },
     findSchoolBase: function(schoolCode) {
         let format = {
             "school_code": schoolCode

+ 1 - 1
TEAMModelOS/ClientApp/src/view/auth/Serial.vue

@@ -553,7 +553,7 @@ export default {
                     item.es = 2
                 }
                 //可使用
-                else if (item.expireStatus == "S" || item.expireStatus == "A") {
+                else if (item.endDate != 0 && (item.expireStatus == "S" || item.expireStatus == "A")) {
                     item.es = 3
                 }
                 //永久授權

+ 9 - 3
TEAMModelOS/ClientApp/src/view/classrecord/ClassRecord.less

@@ -180,12 +180,12 @@
 
 .interaction-record-wrap {
     width: 100%;
-    box-shadow: 5px 5px 500px #f0f0f0 inset;
+    // box-shadow: 5px 5px 500px #f0f0f0 inset;
     border-radius: 4px;
     border: 1px solid #f0f0f0;
     margin-bottom: 10px;
     position: relative;
-    background: #f9f9f9;
+    background: #fcfcfc;
     min-height: 300px;
 }
 
@@ -285,7 +285,7 @@
     font-size: 14px;
     width: 110px;
     padding: 3px 10px;
-    border-radius: 4px;
+    border-radius: 3px;
     cursor: pointer;
     height: fit-content;
     transition: background 0.3s;
@@ -469,4 +469,10 @@
 
 .custom-next {
     right: 10px;
+}
+.class-time{
+    color: #a5a5a5;
+}
+.class-time-value{
+    font-size: 13px;
 }

+ 33 - 0
TEAMModelOS/ClientApp/src/view/classrecord/ClassRecord.vue

@@ -100,6 +100,10 @@
                                         </span>
                                         <!-- 课件缩略图 -->
                                         <img class="page-mini-img" @click="openViewer(item.img)" :src="item.img" />
+                                        <p class="class-time">
+                                            <!-- <Icon size="16" type="md-time" /> -->
+                                            <span class="class-time-value">{{item.time}}</span>
+                                        </p>
                                         <!-- <Timeline style="margin-top:10px;margin-left:-5px">
                                             <TimelineItem v-for="(rtItem, rtIndex) in item.pageData" :key="rtIndex +''+index">
                                                 <Icon type="md-arrow-dropright" slot="dot" />
@@ -330,6 +334,31 @@ export default {
             this.curPage = event.pageIndex + 1
             this.$refs.videoPlayer.player.currentTime(event.Time)
         },
+        /**
+         * 处理TimeLine的异常
+         * 页面重复的IRS作答
+         */
+        fixEventData() {
+            this.pageEvents = this.pageEvents.filter((item, index) => {
+                if (item.Event == 'PopQuesLoad') {
+                    let firstIndex = this.pageEvents.findIndex(i => i.Pgid == item.Pgid && item.Event == i.Event)
+                    return firstIndex == index
+                } else {
+                    return true
+                }
+            })
+        },
+        //小于10 补0
+        fullZero(n) {
+            return n < 10 ? `0${n}` : `${n}`
+        },
+        formatTime(time) {
+            let h = Math.floor(time / (60 * 60))
+            time = time % (60 * 60)
+            let m = Math.floor(time / 60)
+            let s = Math.floor(time % 60)
+            return `${this.fullZero(h)}:${this.fullZero(m)}:${this.fullZero(s)}`
+        },
         //根据SokratesRecords.json处理page数据
         async getPageList() {
             this.pageList = []
@@ -344,6 +373,7 @@ export default {
                 this.sokratesRecords = JSON.parse(res)
                 this.pageIds = this.sokratesRecords.PgIdList || []
                 this.pageEvents = this.sokratesRecords.events || []
+                this.fixEventData()
             } catch (e) {
                 hasTimeLine = false
             }
@@ -357,6 +387,8 @@ export default {
                     let pageidEvent = resJson.find(item => item.Event == 'PgidList')
                     this.pageIds = pageidEvent && pageidEvent.PgIdList ? pageidEvent.PgIdList : []
                     this.pageEvents = resJson.filter(item => this.events.includes(item.Event))
+                    this.fixEventData()
+
                     this.sokratesRecords = {
                         events: this.pageEvents,
                         PgIdList: this.pageIds
@@ -425,6 +457,7 @@ export default {
                 page.page = index + 1
                 //当前页面对应的功能事件
                 page.pageData = this.pageEvents.filter(record => record.Pgid === item && this.fnEvents.includes(record.Event))
+                page.time = this.formatTime(page.pageData[0]?.Time)
                 page.pageData.forEach(e => {
                     e.pageIndex = index
                     e.eventName = this.hiTeachEvent[e.Event]?.text

+ 31 - 5
TEAMModelOS/ClientApp/src/view/classrecord/eventchart/Exam.vue

@@ -9,12 +9,14 @@
             <Icon type="md-podium" style="margin-right:5px" />
             {{$t('cusMgt.rcd.evt2')}}
         </div>
-        <div v-else class="exam-chart-wrap">
-            <ExamGrade :pieData="scoreSegment" style="margin-right:50px"></ExamGrade>
-            <ExamQu :quData="correctData[0] ? correctData[0].data : []" style="margin-right:50px"></ExamQu>
-            <ExamTable :examInfo="examDetaiInfo" :recordInfo="recordInfo"></ExamTable>
+        <div v-else>
+            <h3 @click="toEvDetail" class="exam-title">{{examDetaiInfo.name}}</h3>
+            <div class="exam-chart-wrap">
+                <ExamTable class="exam-chart-item" :examInfo="examDetaiInfo" :recordInfo="recordInfo"></ExamTable>
+                <ExamGrade class="exam-chart-item" :pieData="scoreSegment"></ExamGrade>
+                <ExamQu class="exam-chart-item" :quData="correctData[0] ? correctData[0].data : []"></ExamQu>
+            </div>
         </div>
-
     </div>
 </template>
 <script>
@@ -49,6 +51,15 @@ export default {
         }
     },
     methods: {
+        toEvDetail() {
+            this.$router.push({
+                path: '/home/evDetail',
+                query: {
+                    examId: this.examDetaiInfo.id,
+                    code: `Exam-${this.$store.state.userInfo.TEAMModelId}`
+                }
+            })
+        },
         //获取评测简要数据分析
         findSimpleAna() {
             this.simpleData = {}
@@ -300,6 +311,21 @@ export default {
 }
 </script>
 <style lang="less" scoped>
+.exam-title{
+    display: block;
+    // width: 600px;
+    // text-align: center;
+    margin-bottom: 10px;
+    color: #2b85e4;
+    cursor: pointer;
+    &:hover{
+        text-decoration: underline;
+    }
+}
+.exam-chart-item {
+    margin-bottom: 15px;
+    margin-right: 15px;
+}
 .exam-wrap {
     display: flex;
 }

+ 6 - 5
TEAMModelOS/ClientApp/src/view/classrecord/eventchart/ExamGrade.vue

@@ -48,15 +48,15 @@ export default {
                             formatter: '{b} : {c}' + this.$t('unit.text7')
                         },
                         grid: {
-                            left: 24,
+                            left: 34,
                             right: 20,
-                            top: 25,
-                            bottom: 20
+                            top: 35,
+                            bottom: 30
                         },
                         title: {
                             "text": `${this.isTotal ? this.$t('learnActivity.simple.total') : ''}${this.$t('learnActivity.simple.scoreMat')}`,
                             "left": "center",
-                            "top": 0,
+                            "top": 8,
                             "textStyle": {
                                 // "color": "#303030",
                                 fontSize: 12
@@ -110,7 +110,8 @@ export default {
 <style scoped lang="less">
 .ev-score-matrix {
     width: 260px;
-    height: 150px;
+    height: 155px;
+    box-shadow: 0px 2px 5px #e9e9e9;
 }
 </style>
 <style>

+ 7 - 6
TEAMModelOS/ClientApp/src/view/classrecord/eventchart/ExamQu.vue

@@ -48,15 +48,15 @@ export default {
                             formatter: '{b} : {c}' + this.$t('unit.text7')
                         },
                         grid: {
-                            left: 30,
+                            left: 35,
                             right: 20,
-                            top: 25,
-                            bottom: 50
+                            top: 35,
+                            bottom: 30
                         },
                         title: {
                             "text": this.$t('learnActivity.simple.quCorrectRate'),
                             "left": "center",
-                            "top": 0,
+                            "top": 10,
                             "textStyle": {
                                 fontSize: 12
                             }
@@ -145,7 +145,7 @@ export default {
                     this.option.xAxis.data = this.quData.map(item => item.quLabel)
                     // if (this.quData.length) this.option.yAxis.max = this.quData[0].correct + this.quData[0].wrong
                     if (this.quData.length) this.option.yAxis.max = 100 //计算比例不算人数
-                    if (this.quData.length > 8) {
+                    if (this.quData.length > 10) {
                         this.option.dataZoom = [
                             {
                                 show: true,
@@ -200,8 +200,9 @@ export default {
 </script>
 <style scoped lang="less">
 .qu-score-count {
-    width: 260px;
+    width: 575px;
     height: 180px;
+    box-shadow: 0px 2px 5px #e9e9e9;
 }
 </style>
 <style>

+ 1 - 34
TEAMModelOS/ClientApp/src/view/classrecord/eventchart/ExamTable.vue

@@ -54,38 +54,6 @@
                 {{ $t("totalAnalysis.more") }}
             </p>
         </div>
-        <Modal v-model="viewTableStatus" className="ed-name-modal" footer-hide :width="1000">
-            <div slot="header" class="modal-header">
-                详细作答数据
-            </div>
-            <div class="edit-name-content" style="padding-bottom:50px">
-                <Table ref="score-table" class="score-box" border :columns="tableColumn" :data="tableData" :no-data-text="$t('learnActivity.score.classNoStu')">
-                    <template slot-scope="{ row,index }" :slot="'qu'+qIndex" v-for="(item,qIndex) in quCount">
-                        <div :key="'qu'+qIndex" @click="getStuScore(row,qIndex)" style="cursor:pointer;">
-                            <span v-if="row.data[qIndex] == -1 && row.status == 1">- -</span>
-                            <Icon size="20" type="ios-create-outline" color="#2db7f5" v-else-if="row.data[qIndex] == -1 && row.status !== 1" />
-                            <span style="color:#2db7f5;" v-else>{{row.data[qIndex]}}</span>
-                        </div>
-                    </template>
-                    <template slot-scope="{ row }" slot="total">
-                        <span style="color:#2db7f5;">{{ row.total }}</span>
-                    </template>
-                    <template slot-scope="{ row }" slot="name">
-                        <span style="color:#2db7f5;cursor: pointer;" :title="row.id">{{ row.name}}</span>
-                    </template>
-                    <!-- 1: 未作答 2:未评分 3:已评分 4:缺考 5:补考中 -->
-                    <template slot-scope="{ row,index }" slot="status">
-                        <span class="stu-status-tag" :style="{'background':row.statusColor}">
-                            {{row.statusText}}
-                        </span>
-                    </template>
-                    <Loading slot="loading" :top="-50"></Loading>
-                </Table>
-                <div class="page-wrap">
-                    <Page show-total size="small" :current="currentPage" :total="studentScore.length" :page-size="pageSize" :page-size-opts="pageSizeOpts" @on-change="pageChange" @on-page-size-change="pageSizeChange" show-sizer />
-                </div>
-            </div>
-        </Modal>
     </div>
 </template>
 <script>
@@ -109,7 +77,6 @@ export default {
             currentPage: 1,
             pageSize: 10,
             pageSizeOpts: [5, 10, 20, 30, 40],
-            viewTableStatus: false,
             dataLoading: true,
             overviewInfo: {
                 total: 0,
@@ -158,7 +125,7 @@ export default {
                     examId: this.examInfo.id,
                     code: `Exam-${this.$store.state.userInfo.TEAMModelId}`
                 }
-            })  
+            })
         },
         getStatusInfo(answer, score, status) {
             //评测设置学生可以补考

+ 3 - 1
TEAMModelOS/ClientApp/src/view/syllabus/Syllabus.vue

@@ -2354,7 +2354,9 @@ export default {
       return this.$store.state.userInfo.name
     },
     getDefaultVolumeName() {
-      return this.hasSchool && this.isSchool ? this.subjectList[this.activeSubjectIndex].name + this.gradeList[this.addVolumeForm.grade] + this.semesterList[this.addVolumeForm.semester].name : ''
+      let isEnUs = localStorage.getItem('local') === 'en-us'
+      // 如果是英文语系状态下 自动拼接的课纲名称中间需要添加空格
+      return this.hasSchool && this.isSchool ? this.subjectList[this.activeSubjectIndex].name + (isEnUs ? ' ' : '') + this.gradeList[this.addVolumeForm.grade] + (isEnUs ? ' ' : '') + this.semesterList[this.addVolumeForm.semester].name : ''
     },
     getGradeName() {
       return index => {

+ 14 - 14
TEAMModelOS/Controllers/Analysis/ClassAnalysisController.cs

@@ -52,16 +52,16 @@ namespace TEAMModelOS.Controllers.Analysis
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("analysis-recod")]
-        public async Task<IActionResult> analysisRecod(JsonElement requert)
+        public async Task<IActionResult> analysisRecod(JsonElement request)
         {
             try
             {
                 //区级Id
-                //if (!requert.TryGetProperty("time", out JsonElement time)) return BadRequest();
-                if (!requert.TryGetProperty("stime", out JsonElement stime)) return BadRequest();
-                if (!requert.TryGetProperty("etime", out JsonElement etime)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-                if (!requert.TryGetProperty("periodId", out JsonElement pId)) return BadRequest();
+                //if (!request.TryGetProperty("time", out JsonElement time)) return BadRequest();
+                if (!request.TryGetProperty("stime", out JsonElement stime)) return BadRequest();
+                if (!request.TryGetProperty("etime", out JsonElement etime)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("periodId", out JsonElement pId)) return BadRequest();
                 long st = stime.GetInt64();
                 long et = etime.GetInt64();
                 //获取当前学期所有的课程记录
@@ -69,7 +69,7 @@ namespace TEAMModelOS.Controllers.Analysis
                 var client = _azureCosmos.GetCosmosClient();
                 var queryClass = $"select value(c) from c where c.periodId = '{pId}'";
                 string tId = string.Empty;
-                if (requert.TryGetProperty("tmdId", out JsonElement tmdId))
+                if (request.TryGetProperty("tmdId", out JsonElement tmdId))
                 {
                     queryClass = $"select value(c) from c where c.tmdid = '{tmdId}' and c.periodId = '{pId}'";
                     tId = tmdId.GetString();
@@ -215,16 +215,16 @@ namespace TEAMModelOS.Controllers.Analysis
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("analysis-recod-teacher")]
-        public async Task<IActionResult> analysisRecordTeacher(JsonElement requert)
+        public async Task<IActionResult> analysisRecordTeacher(JsonElement request)
         {
             try
             {
                 //区级Id
-                //if (!requert.TryGetProperty("time", out JsonElement time)) return BadRequest();
-                if (!requert.TryGetProperty("stime", out JsonElement stime)) return BadRequest();
-                if (!requert.TryGetProperty("etime", out JsonElement etime)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-                //if (!requert.TryGetProperty("periodId", out JsonElement pId)) return BadRequest();
+                //if (!request.TryGetProperty("time", out JsonElement time)) return BadRequest();
+                if (!request.TryGetProperty("stime", out JsonElement stime)) return BadRequest();
+                if (!request.TryGetProperty("etime", out JsonElement etime)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                //if (!request.TryGetProperty("periodId", out JsonElement pId)) return BadRequest();
                 long st = 0;
                 long et = 0;
                 try
@@ -247,7 +247,7 @@ namespace TEAMModelOS.Controllers.Analysis
                 var client = _azureCosmos.GetCosmosClient();
                 var queryClass = $"select value(c) from c ";
                 string tId = string.Empty;
-                if (requert.TryGetProperty("tmdId", out JsonElement tmdId))
+                if (request.TryGetProperty("tmdId", out JsonElement tmdId))
                 {
                     queryClass = $"select value(c) from c where c.tmdid = '{tmdId}'";
                     tId = tmdId.GetString();

+ 55 - 55
TEAMModelOS/Controllers/Both/CourseController.cs

@@ -68,16 +68,16 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
 #endif
 
-        public async Task<IActionResult> upsert(JsonElement requert)
+        public async Task<IActionResult> upsert(JsonElement request)
         {
             try
             {
                 (string id, _, _, string school) = HttpContext.GetAuthTokenInfo();
-                if (!requert.TryGetProperty("option", out JsonElement option)) return BadRequest();
-                if (!requert.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
+                if (!request.TryGetProperty("option", out JsonElement option)) return BadRequest();
+                if (!request.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
                 Course course = null; 
                 var client = _azureCosmos.GetCosmosClient();
-                if (requert.TryGetProperty("course", out JsonElement _course)) {
+                if (request.TryGetProperty("course", out JsonElement _course)) {
                     course = _course.ToObject<Course>();
 
                     course.pk = typeof(Course).Name;
@@ -136,7 +136,7 @@ namespace TEAMModelOS.Controllers
                         return Ok(new { course });
                 }
                 else if ($"{option}".Equals("import")  && $"{scope}".Equals("school", StringComparison.OrdinalIgnoreCase)) {
-                    if (!requert.TryGetProperty("courses", out JsonElement _courses)) return BadRequest();
+                    if (!request.TryGetProperty("courses", out JsonElement _courses)) return BadRequest();
                     List<Course> courses = _courses.ToObject<List<Course>>();
                     if (courses.IsNotEmpty())
                     {
@@ -398,11 +398,11 @@ namespace TEAMModelOS.Controllers
         //[AuthToken(Roles = "teacher")]
         [HttpPost("find")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> Find(JsonElement requert)
+        public async Task<IActionResult> Find(JsonElement request)
         {
-            if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-            if (!requert.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
-            requert.TryGetProperty("period", out JsonElement _period) ;
+            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            if (!request.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
+            request.TryGetProperty("period", out JsonElement _period) ;
             try
             {
                 var client = _azureCosmos.GetCosmosClient();
@@ -412,14 +412,14 @@ namespace TEAMModelOS.Controllers
                 string token = default;
                 //是否需要进行分页查询,默认不分页
                 //bool iscontinuation = false;
-                if (requert.TryGetProperty("token", out JsonElement token_1))
+                if (request.TryGetProperty("token", out JsonElement token_1))
                 {
                     token = token_1.GetString();
                     //iscontinuation = true;
                 };
                 //默认不指定返回大小
                 int? topcout = null;
-                if (requert.TryGetProperty("count", out JsonElement jcount))
+                if (request.TryGetProperty("count", out JsonElement jcount))
                 {
                     if (!jcount.ValueKind.Equals(JsonValueKind.Undefined) && !jcount.ValueKind.Equals(JsonValueKind.Null) && jcount.TryGetInt32(out int data))
                     {
@@ -464,7 +464,7 @@ namespace TEAMModelOS.Controllers
                         }
                         //break;
                     }
-                    if (requert.TryGetProperty("schoolId", out JsonElement schoolId))
+                    if (request.TryGetProperty("schoolId", out JsonElement schoolId))
                     {
                         var querySchool = $"select distinct c.code,c.id,c.no,c.name,c.period,c.subject,c.scope from c join A0 in c.schedule where A0.teacherId = '{code}'";
                          
@@ -513,11 +513,11 @@ namespace TEAMModelOS.Controllers
         //[AuthToken(Roles = "teacher")]
         [HttpPost("find-all-by-teacher")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> FindByTeacher(JsonElement requert)
+        public async Task<IActionResult> FindByTeacher(JsonElement request)
         {
-            if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-            //if (!requert.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
-            //if (!requert.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
+            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            //if (!request.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
+            //if (!request.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
 
             try
             {
@@ -560,7 +560,7 @@ namespace TEAMModelOS.Controllers
                     }
                     ps.Add((s, n, sc, sName));
                 }
-                if (requert.TryGetProperty("schoolId", out JsonElement schoolId))
+                if (request.TryGetProperty("schoolId", out JsonElement schoolId))
                 {
                     var querySchool = $"select distinct c.code,c.id,c.no,c.name,c.scope from c join A0 in c.schedule where A0.teacherId = '{code}'";
                     await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: querySchool, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Course-{schoolId.GetString()}") }))
@@ -642,13 +642,13 @@ namespace TEAMModelOS.Controllers
 #if !DEBUG
         [Authorize(Roles = "IES")]
 #endif
-        public async Task<IActionResult> DelStulistRmvRelCourse(JsonElement requert) {
+        public async Task<IActionResult> DelStulistRmvRelCourse(JsonElement request) {
             //教师编码
-            if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
             //课程id 
-            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
             //名单id 
-            if (!requert.TryGetProperty("stulist", out JsonElement stulist)) return BadRequest();
+            if (!request.TryGetProperty("stulist", out JsonElement stulist)) return BadRequest();
             try {
                 var client = _azureCosmos.GetCosmosClient();
                 List<Course> courses = new List<Course>();
@@ -690,12 +690,12 @@ namespace TEAMModelOS.Controllers
 #if !DEBUG
         [Authorize(Roles = "IES")]
 #endif
-        public async Task<IActionResult> FindSummary(JsonElement requert)
+        public async Task<IActionResult> FindSummary(JsonElement request)
         {
 
-            if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-            if (!requert.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
-            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            if (!request.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
+            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
             try
             {
                 var client = _azureCosmos.GetCosmosClient();
@@ -944,26 +944,26 @@ namespace TEAMModelOS.Controllers
         //[ProducesDefaultResponseType]
         ////[AuthToken(Roles = "Teacher")]
         //[HttpPost("upsert-management")]
-        //public async Task<IActionResult> upsertCourseManagement(CourseManagement requert)
+        //public async Task<IActionResult> upsertCourseManagement(CourseManagement request)
         //{
         //    try
         //    {
         //        CourseManagement course = new CourseManagement();
         //        //course = room.ToObject<CourseManagement>();
         //        var client = _azureCosmos.GetCosmosClient();
-        //        string code = requert.code;
-        //        requert.code = "CourseManagement-" + requert.code;
-        //        /*                if (requert.scope.Equals) { 
+        //        string code = request.code;
+        //        request.code = "CourseManagement-" + request.code;
+        //        /*                if (request.scope.Equals) { 
 
         //                        }*/
-        //        var response = await client.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(requert.id, new PartitionKey($"CourseManagement-{code}"));
+        //        var response = await client.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(request.id, new PartitionKey($"CourseManagement-{code}"));
         //        if (response.Status == 200)
         //        {
-        //            course = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").ReplaceItemAsync(requert, requert.id, new PartitionKey($"CourseManagement-{code}"));
+        //            course = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").ReplaceItemAsync(request, request.id, new PartitionKey($"CourseManagement-{code}"));
         //        }
         //        else
         //        {
-        //            course = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync(requert, new PartitionKey($"CourseManagement-{code}"));
+        //            course = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync(request, new PartitionKey($"CourseManagement-{code}"));
         //        }
         //        return Ok(new { course });
         //    }
@@ -983,16 +983,16 @@ namespace TEAMModelOS.Controllers
         //[ProducesDefaultResponseType]
         ////[AuthToken(Roles = "Teacher")]
         //[HttpPost("find-management")]
-        //public async Task<IActionResult> FindManagement(JsonElement requert)
+        //public async Task<IActionResult> FindManagement(JsonElement request)
         //{
-        //    //if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-        //    if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+        //    //if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+        //    if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
         //    var client = _azureCosmos.GetCosmosClient();
         //    List<object> courses = new List<object>();
         //    StringBuilder sql = new StringBuilder();
         //    sql.Append("select c.code,c.id,c.name,c.courses,c.scope,c.teacher from c ");
         //    Dictionary<string, object> dict = new Dictionary<string, object>();
-        //    var emobj = requert.EnumerateObject();
+        //    var emobj = request.EnumerateObject();
         //    while (emobj.MoveNext())
         //    {
         //        dict[emobj.Current.Name] = emobj.Current.Value;
@@ -1019,10 +1019,10 @@ namespace TEAMModelOS.Controllers
         //[ProducesDefaultResponseType]
         ////[AuthToken(Roles = "Teacher")]
         //[HttpPost("find-course")]
-        //public async Task<IActionResult> FindCourse(JsonElement requert)
+        //public async Task<IActionResult> FindCourse(JsonElement request)
         //{
-        //    if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-        //    if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+        //    if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+        //    if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
         //    var client = _azureCosmos.GetCosmosClient();
         //    List<object> courses = new List<object>();
         //    var query = $"select c.code,c.id,c.name,A0.course.id courseId,A0.course.name courseName ,A0.course.notice notice ,A1,c.scope,c.teacher from c  join A0  in c.courses join A1  in A0.teachers where A1.id = '{id}' ";
@@ -1043,11 +1043,11 @@ namespace TEAMModelOS.Controllers
         //[AuthToken(Roles = "teacher")]
         [HttpPost("find-course-by-room")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> FindCourseByRoom(JsonElement requert)
+        public async Task<IActionResult> FindCourseByRoom(JsonElement request)
         {
-            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-            if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-            if (!requert.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
+            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            if (!request.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
             var client = _azureCosmos.GetCosmosClient();
             HashSet<Course> courseList = new HashSet<Course>();
             List<object> courses = new List<object>();
@@ -1131,13 +1131,13 @@ namespace TEAMModelOS.Controllers
         //[ProducesDefaultResponseType]
         ////[AuthToken(Roles = "Teacher")]
         //[HttpPost("upsert-notice")]
-        //public async Task<IActionResult> upsertNotice(JsonElement requert)
+        //public async Task<IActionResult> upsertNotice(JsonElement request)
         //{
-        //    if (!requert.TryGetProperty("courseId", out JsonElement courseId)) return BadRequest();
-        //    if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-        //    if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-        //    if (!requert.TryGetProperty("notice", out JsonElement notice)) return BadRequest();
-        //    if (!requert.TryGetProperty("A1", out JsonElement teacherInfo)) return BadRequest();
+        //    if (!request.TryGetProperty("courseId", out JsonElement courseId)) return BadRequest();
+        //    if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+        //    if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+        //    if (!request.TryGetProperty("notice", out JsonElement notice)) return BadRequest();
+        //    if (!request.TryGetProperty("A1", out JsonElement teacherInfo)) return BadRequest();
         //    Teachers teachers = teacherInfo.ToObject<Teachers>();
         //    var client = _azureCosmos.GetCosmosClient();
         //    List<CourseManagement> courseManagements = new List<CourseManagement>();
@@ -1183,13 +1183,13 @@ namespace TEAMModelOS.Controllers
         //[AuthToken(Roles = "teacher")]
         [HttpPost("upsert-teacher-course")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> upsertCourse(JsonElement requert)
+        public async Task<IActionResult> upsertCourse(JsonElement request)
         {
             try
             {
                 TeacherCourse course = new TeacherCourse();
-                if (!requert.TryGetProperty("course", out JsonElement room)) return BadRequest();
-                if (!requert.TryGetProperty("option", out JsonElement option)) return BadRequest();
+                if (!request.TryGetProperty("course", out JsonElement room)) return BadRequest();
+                if (!request.TryGetProperty("option", out JsonElement option)) return BadRequest();
                 course = room.ToObject<TeacherCourse>();
                 var client = _azureCosmos.GetCosmosClient();
                 course.pk = typeof(Course).Name;
@@ -1283,10 +1283,10 @@ namespace TEAMModelOS.Controllers
         //[AuthToken(Roles = "teacher")]
         [HttpPost("find-teacher-course")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> FindTeacherCourse(JsonElement requert)
+        public async Task<IActionResult> FindTeacherCourse(JsonElement request)
         {
-            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-            //if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+            //if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
             var client = _azureCosmos.GetCosmosClient();
             List<object> courses = new List<object>();
             var query = $"select c.code,c.id,c.name,c.subjectId,c.periodId,c.scope,c.notice,c.classes from c ";

+ 8 - 8
TEAMModelOS/Controllers/Both/PaperController.cs

@@ -89,11 +89,11 @@ namespace TEAMModelOS.Controllers
         //[AuthToken(Roles = "teacher")]
         [HttpPost("find-summary")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> findSummary(JsonElement requert)
+        public async Task<IActionResult> findSummary(JsonElement request)
         {
             //ResponseBuilder builder = ResponseBuilder.custom();
-            if (!requert.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
-            if (!requert.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
+            if (!request.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
+            if (!request.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
             var jwt = new JwtSecurityToken(id_token.GetString());
             var id = jwt.Payload.Sub;
             var client = _azureCosmos.GetCosmosClient();
@@ -134,16 +134,16 @@ namespace TEAMModelOS.Controllers
         //[AuthToken(Roles = "teacher")]
         [HttpPost("find")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> Find(JsonElement requert)
+        public async Task<IActionResult> Find(JsonElement request)
         {
             //ResponseBuilder builder = ResponseBuilder.custom();
-            //if (!requert.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
-            if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-            if (!requert.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
+            //if (!request.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
+            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            if (!request.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
             var client = _azureCosmos.GetCosmosClient();
             StringBuilder sql = new StringBuilder();
             Dictionary<string, object> dict = new Dictionary<string, object>();
-            var emobj = requert.EnumerateObject();
+            var emobj = request.EnumerateObject();
             while (emobj.MoveNext())
             {
                 dict[emobj.Current.Name] = emobj.Current.Value;

+ 2 - 2
TEAMModelOS/Controllers/Client/AClassONEController.cs

@@ -285,13 +285,13 @@ namespace TEAMModelOS.Controllers
         [ProducesDefaultResponseType]
         //[Authorize(Roles = "AClassONE")]
         [HttpPost("find-activity")]
-        public async Task<IActionResult> FindExam(JsonElement requert)
+        public async Task<IActionResult> FindExam(JsonElement request)
         {
             try
             {
                 //var client = _azureCosmos.GetCosmosClient();
                 var (id, name, pic, school) = HttpContext.GetAuthTokenInfo();
-                (List<StuActivity> datas, string continuationToken) = await ActivityStudentService.FindActivity(requert, id, school, _azureCosmos, _azureRedis);
+                (List<StuActivity> datas, string continuationToken) = await ActivityStudentService.FindActivity(request, id, school, _azureCosmos, _azureRedis);
                 return Ok(new { datas, continuationToken });
 
 

+ 2 - 2
TEAMModelOS/Controllers/Client/HiTeachController.cs

@@ -628,14 +628,14 @@ namespace TEAMModelOS.Controllers.Client
 
         [ProducesDefaultResponseType]
         [HttpPost("get-school-info")]
-        public async Task<IActionResult> GetSchoolInfo(JsonElement requert)
+        public async Task<IActionResult> GetSchoolInfo(JsonElement request)
         {
             try
             {
                 string id_token = HttpContext.GetXAuth("IdToken");
                 (string ip, string region) = await LoginService.LoginIp(HttpContext, _searcher);
                 if (string.IsNullOrEmpty(id_token)) return BadRequest();
-                if (!requert.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
+                if (!request.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
                 var jwt = new JwtSecurityToken(id_token);
                 if (!jwt.Payload.Iss.Equals("account.teammodel", StringComparison.Ordinal)) return BadRequest();
                 var id = jwt.Payload.Sub;

+ 24 - 24
TEAMModelOS/Controllers/Common/AreaController.cs

@@ -58,12 +58,12 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-group")]
-        public async Task<IActionResult> Find(JsonElement requert)
+        public async Task<IActionResult> Find(JsonElement request)
         {
             try
             {
                 //区级Id
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 //获取区级以下所有学校编码和基础信息
                 List<string> baseIds = new();
@@ -128,12 +128,12 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher,admin")]
         [HttpPost("find")]
-        public async Task<IActionResult> FindGroup(JsonElement requert)
+        public async Task<IActionResult> FindGroup(JsonElement request)
         {
             try
             {
                 //区级Id
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 //获取区级以下所有学校编码和基础信息
                 List<string> baseIds = new();
@@ -389,12 +389,12 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-all-study")]
-        public async Task<IActionResult> FindAllStudy(JsonElement requert)
+        public async Task<IActionResult> FindAllStudy(JsonElement request)
         {
             try
             {
                 //区级Id
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 // List<string> baseIds = await getId(client, id.GetString());
                 List<object> studies = new();
@@ -429,13 +429,13 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-all-study-teachers")]
-        public async Task<IActionResult> FindAllStudyTeacher(JsonElement requert)
+        public async Task<IActionResult> FindAllStudyTeacher(JsonElement request)
         {
             try
             {
                 //区级活动Id
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 List<(string id, string name)> baseIds = await getId(client, areaId.GetString());
                 List<Study> studies = new();
@@ -546,12 +546,12 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-all-vote")]
-        public async Task<IActionResult> FindAllVote(JsonElement requert)
+        public async Task<IActionResult> FindAllVote(JsonElement request)
         {
             try
             {
                 //区级Id
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 //List<string> baseIds = await getId(client, id.GetString());
                 List<object> votes = new();
@@ -583,13 +583,13 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-vote-id")]
-        public async Task<IActionResult> FindAllVoteTeacher(JsonElement requert)
+        public async Task<IActionResult> FindAllVoteTeacher(JsonElement request)
         {
             try
             {
                 //区级活动Id
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 List<(string id, string name)> baseIds = await getId(client, areaId.GetString());
                 //List<object> votes = new();
@@ -641,12 +641,12 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-all-survey")]
-        public async Task<IActionResult> FindAllSurvey(JsonElement requert)
+        public async Task<IActionResult> FindAllSurvey(JsonElement request)
         {
             try
             {
                 //区级Id
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 //List<string> baseIds = await getId(client, id.GetString());
                 List<object> surveys = new();
@@ -680,12 +680,12 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-survey-id")]
-        public async Task<IActionResult> FindAllSurveyTeacher(JsonElement requert)
+        public async Task<IActionResult> FindAllSurveyTeacher(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 List<(string id, string name)> baseIds = await getId(client, areaId.GetString());
                 List<object> surveys = new();
@@ -735,12 +735,12 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-all-Exam")]
-        public async Task<IActionResult> FindAllExam(JsonElement requert)
+        public async Task<IActionResult> FindAllExam(JsonElement request)
         {
             try
             {
                 //区级Id
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 //List<string> baseIds = await getId(client, id.GetString());
                 List<object> exams = new();
@@ -775,13 +775,13 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-all-exam-teachers")]
-        public async Task<IActionResult> FindAllExamTeacher(JsonElement requert)
+        public async Task<IActionResult> FindAllExamTeacher(JsonElement request)
         {
             try
             {
                 //区级活动Id
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 List<(string id, string name)> baseIds = await getId(client, areaId.GetString());
                 List<object> exams = new();

+ 117 - 117
TEAMModelOS/Controllers/Common/ExamController.cs

@@ -423,14 +423,14 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find")]
-        public async Task<IActionResult> Find(JsonElement requert)
+        public async Task<IActionResult> Find(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 StringBuilder stringBuilder = new($"select c.id,c.name,c.code,c.period,c.startTime,c.endTime,c.stuCount,c.type,c.progress,c.examType,c.createTime,c.source, c.subjects, c.grades,c.owner, c.scope,c.classes, c.stuLists, c.sRate,c.lostStu,c.sStatus,c.qamode,c.school from c where (c.status<>404 or IS_DEFINED(c.status) = false) ");
-                if (requert.TryGetProperty("classIds", out JsonElement classIds))
+                if (request.TryGetProperty("classIds", out JsonElement classIds))
                 {
                     List<string> ids = classIds.ToObject<List<string>>();
                     HashSet<string> strs = new HashSet<string>();
@@ -449,19 +449,19 @@ namespace TEAMModelOS.Controllers
                     string ss = string.Join(" or ", strs);
                     stringBuilder.Append($" and {ss}");
                 };
-                if (requert.TryGetProperty("period", out JsonElement period) && !string.IsNullOrWhiteSpace($"{period}"))
+                if (request.TryGetProperty("period", out JsonElement period) && !string.IsNullOrWhiteSpace($"{period}"))
                 {
                     stringBuilder.Append($" and c.period.id = '{period}' ");
                 }
-                if (requert.TryGetProperty("name", out JsonElement name) && !string.IsNullOrWhiteSpace($"{name}"))
+                if (request.TryGetProperty("name", out JsonElement name) && !string.IsNullOrWhiteSpace($"{name}"))
                 {
                     stringBuilder.Append($" and Contains( c.name , '{name}') =  true ");
                 }
-                if (requert.TryGetProperty("progress", out JsonElement progress) && !string.IsNullOrWhiteSpace($"{progress}"))
+                if (request.TryGetProperty("progress", out JsonElement progress) && !string.IsNullOrWhiteSpace($"{progress}"))
                 {
                     stringBuilder.Append($" and c.progress = '{progress}' ");
                 }
-                if (requert.TryGetProperty("source", out JsonElement source) && !string.IsNullOrWhiteSpace($"{source}"))
+                if (request.TryGetProperty("source", out JsonElement source) && !string.IsNullOrWhiteSpace($"{source}"))
                 {
                     stringBuilder.Append($" and c.source = '{source}' ");
                 }
@@ -470,7 +470,7 @@ namespace TEAMModelOS.Controllers
                 string token = default;
                 //默认不指定返回大小
                 int? topcout = null;
-                if (requert.TryGetProperty("count", out JsonElement jcount))
+                if (request.TryGetProperty("count", out JsonElement jcount))
                 {
                     if (!jcount.ValueKind.Equals(JsonValueKind.Undefined) && !jcount.ValueKind.Equals(JsonValueKind.Null) && jcount.TryGetInt32(out int data))
                     {
@@ -484,7 +484,7 @@ namespace TEAMModelOS.Controllers
                     iscontinuation = true;
                 }
                 //如果指定了返回大小
-                if (requert.TryGetProperty("token", out JsonElement token_1))
+                if (request.TryGetProperty("token", out JsonElement token_1))
                 {
                     if (!token_1.ValueKind.Equals(JsonValueKind.Null) && token_1.ValueKind.Equals(JsonValueKind.String))
                     {
@@ -527,11 +527,11 @@ namespace TEAMModelOS.Controllers
 /*        [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]*/
         [HttpPost("find-by-analysis")]
-        public async Task<IActionResult> FindByAnalysis(JsonElement requert)
+        public async Task<IActionResult> FindByAnalysis(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 var table = _azureStorage.GetCloudTableClient().GetTableReference("SchoolYear");
                 List<SchoolYear> years = await table.FindListByDict<SchoolYear>(new Dictionary<string, object>() { { "RowKey", code }, { "PartitionKey", "Exam" } });
@@ -589,49 +589,49 @@ namespace TEAMModelOS.Controllers
                 }
                 string sub = string.Empty;
                 string subject = string.Empty;
-                if (requert.TryGetProperty("subjectId", out JsonElement subjectId) && !string.IsNullOrWhiteSpace($"{subjectId}"))
+                if (request.TryGetProperty("subjectId", out JsonElement subjectId) && !string.IsNullOrWhiteSpace($"{subjectId}"))
                 {
                     sub = $" join A0 in c.subjects ";
                     subject = $" and A0.id = '{subjectId}'";
                 }
                 string grade = string.Empty;
                 string grades = string.Empty;
-                if (requert.TryGetProperty("grades", out JsonElement gs) && !string.IsNullOrWhiteSpace($"{gs}"))
+                if (request.TryGetProperty("grades", out JsonElement gs) && !string.IsNullOrWhiteSpace($"{gs}"))
                 {
                     grade = $" join A1 in c.grades ";
                     grades = $" and A1.id = '{gs}'";
                 }
                 StringBuilder stringBuilder = new StringBuilder($"select c.id,c.name,c.code,c.period,c.startTime,c.endTime,c.stuCount,c.type,c.progress,c.examType,c.createTime,c.source, c.subjects, c.grades,c.owner, c.scope,c.classes,c.sRate,c.lostStu,c.sStatus,c.qamode,c.school from c {sub} {grade}" +
                     $"where (c.status<>404 or IS_DEFINED(c.status) = false) and c.scope = 'school' and c.school = '{code}' and c.pk = 'Exam' {subject} {grades}");
-                if (requert.TryGetProperty("period", out JsonElement period) && !string.IsNullOrWhiteSpace($"{period}"))
+                if (request.TryGetProperty("period", out JsonElement period) && !string.IsNullOrWhiteSpace($"{period}"))
                 {
                     stringBuilder.Append($" and c.period.id = '{period}' ");
                 }
-                if (requert.TryGetProperty("owner", out JsonElement owner) && !string.IsNullOrWhiteSpace($"{owner}"))
+                if (request.TryGetProperty("owner", out JsonElement owner) && !string.IsNullOrWhiteSpace($"{owner}"))
                 {
                     stringBuilder.Append($" and c.owner= '{owner}' ");
                 }
                 
-                if (requert.TryGetProperty("year", out JsonElement yy) && !string.IsNullOrWhiteSpace($"{yy}"))
+                if (request.TryGetProperty("year", out JsonElement yy) && !string.IsNullOrWhiteSpace($"{yy}"))
                 {
                     int end = yy.GetInt32() + 1;
                     long stime = DateTimeOffset.Parse($"{yy.GetInt32()}-1-1").ToUnixTimeMilliseconds();
                     long etime = DateTimeOffset.Parse($"{end}-1-1").ToUnixTimeMilliseconds();
                     stringBuilder.Append($" and c.startTime >= {stime} and c.startTime < {etime} ");
                 }
-                if (requert.TryGetProperty("name", out JsonElement name) && !string.IsNullOrWhiteSpace($"{name}"))
+                if (request.TryGetProperty("name", out JsonElement name) && !string.IsNullOrWhiteSpace($"{name}"))
                 {
                     stringBuilder.Append($" and Contains( c.name , '{name}') =  true ");
                 }
-                if (requert.TryGetProperty("examType", out JsonElement examType) && !string.IsNullOrWhiteSpace($"{examType}"))
+                if (request.TryGetProperty("examType", out JsonElement examType) && !string.IsNullOrWhiteSpace($"{examType}"))
                 {
                     stringBuilder.Append($" and c.examType.id = '{examType}' ");
                 }
-                if (requert.TryGetProperty("progress", out JsonElement progress) && !string.IsNullOrWhiteSpace($"{progress}"))
+                if (request.TryGetProperty("progress", out JsonElement progress) && !string.IsNullOrWhiteSpace($"{progress}"))
                 {
                     stringBuilder.Append($" and c.progress = '{progress}' ");
                 }
-                if (requert.TryGetProperty("source", out JsonElement source) && !string.IsNullOrWhiteSpace($"{source}"))
+                if (request.TryGetProperty("source", out JsonElement source) && !string.IsNullOrWhiteSpace($"{source}"))
                 {
                     stringBuilder.Append($" and c.source = '{source}' ");
                 }
@@ -639,13 +639,13 @@ namespace TEAMModelOS.Controllers
                 string token = default;
                 //是否需要进行分页查询,默认不分页
                 bool iscontinuation = false;
-                if (requert.TryGetProperty("token", out JsonElement token_1))
+                if (request.TryGetProperty("token", out JsonElement token_1))
                 {
                     token = token_1.GetString();
                 };
                 //默认不指定返回大小
                 int? topcout = null;
-                if (requert.TryGetProperty("count", out JsonElement jcount))
+                if (request.TryGetProperty("count", out JsonElement jcount))
                 {
                     if (!jcount.ValueKind.Equals(JsonValueKind.Undefined) && !jcount.ValueKind.Equals(JsonValueKind.Null) && jcount.TryGetInt32(out int data))
                     {
@@ -703,12 +703,12 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-summary")]
-        public async Task<IActionResult> FindSummary(JsonElement requert)
+        public async Task<IActionResult> FindSummary(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
 
                 var client = _azureCosmos.GetCosmosClient();
                 List<ExamInfo> examInfo = new List<ExamInfo>();
@@ -1347,14 +1347,14 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-summary-record")]
-        public async Task<IActionResult> findSummaryRecord(JsonElement requert)
+        public async Task<IActionResult> findSummaryRecord(JsonElement request)
         {
             //var (id, school) = HttpContext.GetAuthTokenInfo();
-            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-            //if (!requert.TryGetProperty("code", out JsonElement school_code)) return BadRequest();
-            if (!requert.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
-            if (!requert.TryGetProperty("code", out JsonElement school_code)) return BadRequest();
-            if (!requert.TryGetProperty("classId", out JsonElement classId)) return BadRequest();
+            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+            //if (!request.TryGetProperty("code", out JsonElement school_code)) return BadRequest();
+            if (!request.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
+            if (!request.TryGetProperty("code", out JsonElement school_code)) return BadRequest();
+            if (!request.TryGetProperty("classId", out JsonElement classId)) return BadRequest();
             try
             {
                 // 如果只有学生id则返回学生参加过的考试 只返回相关摘要信息
@@ -1484,7 +1484,7 @@ namespace TEAMModelOS.Controllers
                 //List<ufo> students = new List<ufo>();
 
 
-                /*if (StringHelper.getKeyCount(requert) == 1 && requert.TryGetProperty("code", out JsonElement code))
+                /*if (StringHelper.getKeyCount(request) == 1 && request.TryGetProperty("code", out JsonElement code))
                 {
                     List<object> props = new List<object>();
                     await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Student").GetItemQueryStreamIterator(queryText: $"select c.id, c.code, c.examCode, c.status ,c.mark, c.score from c where c.id = {id}", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ExamRecord-{school_code}") }))
@@ -1502,7 +1502,7 @@ namespace TEAMModelOS.Controllers
                 }
                 else
                 {
-                    if (requert.TryGetProperty("examCode", out JsonElement _))
+                    if (request.TryGetProperty("examCode", out JsonElement _))
                     {
                         //List<string> props = new List<string> { "id", "code", "examCode", "status", "mark", "score" };
                         //List<ExamRecord> examRecords = await _azureCosmos.FindByDict<ExamRecord>(request, props);
@@ -1536,15 +1536,15 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "student,teacher,admin")]
         [HttpPost("find-summary-by-student")]
-        public async Task<IActionResult> findSummaryStudent(JsonElement requert)
+        public async Task<IActionResult> findSummaryStudent(JsonElement request)
         {
             //ResponseBuilder builder = ResponseBuilder.custom();
             //var (id, school) = HttpContext.GetAuthTokenInfo();
-            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-            if (!requert.TryGetProperty("cIds", out JsonElement cIds)) return BadRequest();
-            if (!requert.TryGetProperty("studentId", out JsonElement studentId)) return BadRequest();
-            if (!requert.TryGetProperty("code", out JsonElement school)) return BadRequest();
-            if (!requert.TryGetProperty("scode", out JsonElement scode)) return BadRequest();
+            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+            if (!request.TryGetProperty("cIds", out JsonElement cIds)) return BadRequest();
+            if (!request.TryGetProperty("studentId", out JsonElement studentId)) return BadRequest();
+            if (!request.TryGetProperty("code", out JsonElement school)) return BadRequest();
+            if (!request.TryGetProperty("scode", out JsonElement scode)) return BadRequest();
             try
             {
                 var client = _azureCosmos.GetCosmosClient();
@@ -1916,14 +1916,14 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "student")]
         [HttpPost("find-all-by-student")]
-        public async Task<IActionResult> findAllStudent(JsonElement requert)
+        public async Task<IActionResult> findAllStudent(JsonElement request)
         {
             //ResponseBuilder builder = ResponseBuilder.custom();
             //var (id, school) = HttpContext.GetAuthTokenInfo();
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("studentId", out JsonElement studentId)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("studentId", out JsonElement studentId)) return BadRequest();
                 List<string> resultIds = new List<string>();
                 var client = _azureCosmos.GetCosmosClient();
                 //查询校本班级ID
@@ -1975,7 +1975,7 @@ namespace TEAMModelOS.Controllers
                     //builder.Append($" array_contains(c.targetClassIds,'{ssr}')");
                 }
                 string ss = string.Join(" or ", strs);
-                //if (!requert.TryGetProperty("school", out JsonElement school)) return BadRequest();
+                //if (!request.TryGetProperty("school", out JsonElement school)) return BadRequest();
 
                 var query = $"select c.id,c.code,c.name,c.startTime,c.endTime,c.type,c.progress,c.school,c.scope from c where ({ss}) and c.progress != 'pending' ";
                 List<object> props = new List<object>();
@@ -2030,14 +2030,14 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "student")]
         [HttpPost("find-score-by-student")]
-        public async Task<IActionResult> findScoreByStudent(JsonElement requert)
+        public async Task<IActionResult> findScoreByStudent(JsonElement request)
         {
             //ResponseBuilder builder = ResponseBuilder.custom();
             //var (id, school) = HttpContext.GetAuthTokenInfo();
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                //if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                //if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 var query = $"select c.examId,c.subjectId,c.studentScores from c where array_contains(c.studentIds,'{id}') ";
                 List<object> props = new List<object>();
@@ -2069,14 +2069,14 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("finish")]
-        public async Task<IActionResult> finish(JsonElement requert)
+        public async Task<IActionResult> finish(JsonElement request)
         {
             //ResponseBuilder builder = ResponseBuilder.custom();
             //var (id, school) = HttpContext.GetAuthTokenInfo();
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 ExamInfo info = await client.GetContainer(Constant.TEAMModelOS, "Common").ReadItemAsync<ExamInfo>(id.ToString(), new PartitionKey($"Exam-{code}"));
                 info.progress = "finish";
@@ -2122,15 +2122,15 @@ namespace TEAMModelOS.Controllers
         [ProducesDefaultResponseType]
         //[AuthToken(Roles = "Student")]
         [HttpPost("scoring")]
-        public async Task<IActionResult> Scoring(JsonElement requert)
+        public async Task<IActionResult> Scoring(JsonElement request)
         {
             //ResponseBuilder builder = ResponseBuilder.custom();
             //var (id, school) = HttpContext.GetAuthTokenInfo();
             try
             {
-                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 (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 ExamInfo info = await client.GetContainer(Constant.TEAMModelOS, "Common").ReadItemAsync<ExamInfo>(id.ToString(), new PartitionKey($"Exam-{code}"));
                 int index = 0;
@@ -2207,18 +2207,18 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("scoring")]
-        public async Task<IActionResult> scoring(JsonElement requert)
+        public async Task<IActionResult> scoring(JsonElement request)
         {
             //ResponseBuilder builder = ResponseBuilder.custom();
             //var (id, school) = HttpContext.GetAuthTokenInfo();
             try
             {
-                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();
-                if (!requert.TryGetProperty("count", out JsonElement scount)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
+                //if (!request.TryGetProperty("type", out JsonElement type)) return BadRequest();
+                if (!request.TryGetProperty("tmdId", out JsonElement tId)) return BadRequest();
+                if (!request.TryGetProperty("count", out JsonElement scount)) return BadRequest();
 
                 var client = _azureCosmos.GetCosmosClient();
                 //var redisClient = _azureRedis.GetRedisClient(8);
@@ -2329,7 +2329,7 @@ namespace TEAMModelOS.Controllers
                 }
                 else
                 {
-                    if (requert.TryGetProperty("stuId", out JsonElement stuId))
+                    if (request.TryGetProperty("stuId", out JsonElement stuId))
                     {
                         objs = await Review(attrSc, id.GetString(), code.GetString(), subjectId.GetString(), scount.GetInt32(), tId.GetString(), stuId.GetString());
                     }
@@ -2356,16 +2356,16 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-err")]
-        public async Task<IActionResult> findErr(JsonElement requert)
+        public async Task<IActionResult> findErr(JsonElement request)
         {
             //ResponseBuilder builder = ResponseBuilder.custom();
             //var (id, school) = HttpContext.GetAuthTokenInfo();
             try
             {
-                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("tmdId", out JsonElement tId)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
+                //if (!request.TryGetProperty("tmdId", out JsonElement tId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 var response = await client.GetContainer(Constant.TEAMModelOS, "Common").ReadItemStreamAsync(id.ToString(), new PartitionKey($"Exam-{code}"));
                 if (response.Status == 200)
@@ -2424,17 +2424,17 @@ namespace TEAMModelOS.Controllers
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-arb")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> findArb(JsonElement requert)
+        public async Task<IActionResult> findArb(JsonElement request)
         {
             //ResponseBuilder builder = ResponseBuilder.custom();
             //var (id, school) = HttpContext.GetAuthTokenInfo();
             try
             {
-                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("et", out JsonElement et)) return BadRequest();
-                //if (!requert.TryGetProperty("tmdId", out JsonElement tId)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
+                if (!request.TryGetProperty("et", out JsonElement et)) return BadRequest();
+                //if (!request.TryGetProperty("tmdId", out JsonElement tId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 long time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
                 if (et.GetInt64() > time)
@@ -2694,20 +2694,20 @@ namespace TEAMModelOS.Controllers
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("sub-result")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> SubResult(JsonElement requert)
+        public async Task<IActionResult> SubResult(JsonElement request)
         {
             //ResponseBuilder builder = ResponseBuilder.custom();
             //var (id, school) = HttpContext.GetAuthTokenInfo();
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("stuId", out JsonElement sId)) return BadRequest();
-                if (!requert.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
-                if (!requert.TryGetProperty("tmdId", out JsonElement tId)) return BadRequest();
-                if (!requert.TryGetProperty("score", out JsonElement score)) return BadRequest();
-                if (!requert.TryGetProperty("count", out JsonElement count)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-                requert.TryGetProperty("mark", out JsonElement mark);
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("stuId", out JsonElement sId)) return BadRequest();
+                if (!request.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
+                if (!request.TryGetProperty("tmdId", out JsonElement tId)) return BadRequest();
+                if (!request.TryGetProperty("score", out JsonElement score)) return BadRequest();
+                if (!request.TryGetProperty("count", out JsonElement count)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                request.TryGetProperty("mark", out JsonElement mark);
                 var client = _azureCosmos.GetCosmosClient();
                 var (userid, name, _, school) = HttpContext.GetAuthTokenInfo();
                 //取得学校基本信息
@@ -2738,7 +2738,7 @@ namespace TEAMModelOS.Controllers
                     {
                         int itemIndex = 0;
                         //int tIdIndex = scoring.tIds.IndexOf(tId.GetString());
-                        if (requert.TryGetProperty("qu", out JsonElement qu))
+                        if (request.TryGetProperty("qu", out JsonElement qu))
                         {
                             List<int> nos = qu.ToObject<List<int>>();
                             foreach (int number in nos)
@@ -2953,14 +2953,14 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-scoring")]
-        public async Task<IActionResult> findScoring(JsonElement requert)
+        public async Task<IActionResult> findScoring(JsonElement request)
         {
-            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-            if (!requert.TryGetProperty("stuId", out JsonElement sId)) return BadRequest();
-            if (!requert.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
-            if (!requert.TryGetProperty("tmdId", out JsonElement tId)) return BadRequest();
-            if (!requert.TryGetProperty("type", out JsonElement type)) return BadRequest();
-            if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+            if (!request.TryGetProperty("stuId", out JsonElement sId)) return BadRequest();
+            if (!request.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
+            if (!request.TryGetProperty("tmdId", out JsonElement tId)) return BadRequest();
+            if (!request.TryGetProperty("type", out JsonElement type)) return BadRequest();
+            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
             var client = _azureCosmos.GetCosmosClient();
             List<SDK.Models.Cosmos.Common.Scoring> attr = new();
             await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<SDK.Models.Cosmos.Common.Scoring>(
@@ -2977,13 +2977,13 @@ namespace TEAMModelOS.Controllers
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("save-err")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> saveErr(JsonElement requert)
+        public async Task<IActionResult> saveErr(JsonElement request)
         {
-            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-            if (!requert.TryGetProperty("err", out JsonElement err)) return BadRequest();
-            if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-            if (!requert.TryGetProperty("index", out JsonElement index)) return BadRequest();
-            if (!requert.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
+            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+            if (!request.TryGetProperty("err", out JsonElement err)) return BadRequest();
+            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            if (!request.TryGetProperty("index", out JsonElement index)) return BadRequest();
+            if (!request.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
             var client = _azureCosmos.GetCosmosClient();
             var (userid, name, _, school) = HttpContext.GetAuthTokenInfo();
             //取得学校基本信息
@@ -3056,13 +3056,13 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("fd-err")]
-        public async Task<IActionResult> fdErr(JsonElement requert)
+        public async Task<IActionResult> fdErr(JsonElement request)
         {
-            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-            if (!requert.TryGetProperty("improve", out JsonElement improve)) return BadRequest();
-            if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-            if (!requert.TryGetProperty("index", out JsonElement index)) return BadRequest();
-            //if (!requert.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
+            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+            if (!request.TryGetProperty("improve", out JsonElement improve)) return BadRequest();
+            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            if (!request.TryGetProperty("index", out JsonElement index)) return BadRequest();
+            //if (!request.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
             var client = _azureCosmos.GetCosmosClient();
             SDK.Models.Cosmos.Common.Scoring scoring = await client.GetContainer(Constant.TEAMModelOS, "Teacher").ReadItemAsync<SDK.Models.Cosmos.Common.Scoring>(id.GetString(), new PartitionKey($"Scoring-{code}"));
             if (null != scoring)
@@ -3094,12 +3094,12 @@ namespace TEAMModelOS.Controllers
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("save-arb")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> saveArb(JsonElement requert)
+        public async Task<IActionResult> saveArb(JsonElement request)
         {
-            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-            if (!requert.TryGetProperty("score", out JsonElement score)) return BadRequest();
-            if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-            if (!requert.TryGetProperty("index", out JsonElement indexScore)) return BadRequest();
+            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+            if (!request.TryGetProperty("score", out JsonElement score)) return BadRequest();
+            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            if (!request.TryGetProperty("index", out JsonElement indexScore)) return BadRequest();
             var client = _azureCosmos.GetCosmosClient();
             //List<double> scs = score.ToObject<List<double>>();
             List<ExamClassResult> classResults = new();
@@ -3140,11 +3140,11 @@ namespace TEAMModelOS.Controllers
         [AuthToken(Roles = "teacher,admin,student")]
         [HttpPost("score")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> score(JsonElement requert)
+        public async Task<IActionResult> score(JsonElement request)
         {
-            if (!requert.TryGetProperty("courseId", out JsonElement courseId)) return BadRequest();
-            if (!requert.TryGetProperty("cId", out JsonElement cId)) return BadRequest();
-            //if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            if (!request.TryGetProperty("courseId", out JsonElement courseId)) return BadRequest();
+            if (!request.TryGetProperty("cId", out JsonElement cId)) return BadRequest();
+            //if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
             var client = _azureCosmos.GetCosmosClient();
             List<(string eId, string cId, string cname, List<string> sIds, List<double> sum)> classResults = new();
             List<string> eIds = new();
@@ -3182,7 +3182,7 @@ namespace TEAMModelOS.Controllers
                 }
             }
             string sub = string.Empty;
-            if (requert.TryGetProperty("subjectId", out JsonElement subjectId))
+            if (request.TryGetProperty("subjectId", out JsonElement subjectId))
             {
                 sub = subjectId.GetString();
                 await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryStreamIterator(
@@ -3265,7 +3265,7 @@ namespace TEAMModelOS.Controllers
                 papers = exam.Where(e => e.id.Equals(x.eId)).FirstOrDefault().points,
                 sum = x.sum
             });
-            if (requert.TryGetProperty("stuId", out JsonElement stuId))
+            if (request.TryGetProperty("stuId", out JsonElement stuId))
             {
                 var info = scores.Where(x => !string.IsNullOrEmpty(x.examName) && x.studentIds.Contains(stuId.GetString())).Select(x => new
                 {
@@ -3307,14 +3307,14 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("analysis-scoring")]
-        public async Task<IActionResult> Analysis(JsonElement requert)
+        public async Task<IActionResult> Analysis(JsonElement request)
         {
             try
             {
-                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("tmdId", out JsonElement tId)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                //if (!request.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
+                //if (!request.TryGetProperty("tmdId", out JsonElement tId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 var queryTeacher = $"select c.id,c.name from c ";
                 //List<object> props = new List<object>();

+ 14 - 14
TEAMModelOS/Controllers/Common/ExamLiteController.cs

@@ -195,25 +195,25 @@ namespace TEAMModelOS.Controllers.Common
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find")]
-        public async Task<IActionResult> Find(JsonElement requert)
+        public async Task<IActionResult> Find(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 var query = $"select c.id,c.name,c.createTime from c where (c.status<>404 or IS_DEFINED(c.status) = false )   ";
                 string continuationToken = string.Empty;
                 string token = default;
                 //是否需要进行分页查询,默认不分页
                 bool iscontinuation = false;
-                if (requert.TryGetProperty("token", out JsonElement token_1))
+                if (request.TryGetProperty("token", out JsonElement token_1))
                 {
                     token = token_1.GetString();
                     iscontinuation = true;
                 };
                 //默认不指定返回大小
                 int? topcout = null;
-                if (requert.TryGetProperty("count", out JsonElement jcount))
+                if (request.TryGetProperty("count", out JsonElement jcount))
                 {
                     if (!jcount.ValueKind.Equals(JsonValueKind.Undefined) && !jcount.ValueKind.Equals(JsonValueKind.Null) && jcount.TryGetInt32(out int data))
                     {
@@ -254,12 +254,12 @@ namespace TEAMModelOS.Controllers.Common
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-summary")]
-        public async Task<IActionResult> FindSummary(JsonElement requert)
+        public async Task<IActionResult> FindSummary(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 List<ExamLite> trExams = new();
                 ExamLite examLite = await client.GetContainer(Constant.TEAMModelOS, "Common").ReadItemAsync<ExamLite>(id.GetString(), new PartitionKey($"ExamLite-{code}"));
@@ -290,12 +290,12 @@ namespace TEAMModelOS.Controllers.Common
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-by-teacher")]
-        public async Task<IActionResult> FindByTeacher(JsonElement requert)
+        public async Task<IActionResult> FindByTeacher(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-                if (!requert.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 var query = $"select c.id,c.name,c.createTime,A0.time from c join A0 in c.teachers where (c.status<>404 or IS_DEFINED(c.status) = false ) and  A0.id = '{tId}'";
                 List<object> exams = new();
@@ -325,13 +325,13 @@ namespace TEAMModelOS.Controllers.Common
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-summary-by-teacher")]
-        public async Task<IActionResult> FindSummaryByTeacher(JsonElement requert)
+        public async Task<IActionResult> FindSummaryByTeacher(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-                if (!requert.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 List<object> exams = new();
                 await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: $"select value(c) from c join A0 in c.teachers where (c.status<>404 or IS_DEFINED(c.status) = false ) and  A0.id = '{tId}' and c.id = '{id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ExamLite-{code}") }))

+ 29 - 29
TEAMModelOS/Controllers/Common/LearnController.cs

@@ -34,9 +34,9 @@ namespace TEAMModelOS.Controllers.Learn
 //        [HttpPost("upsert-task")]
 //        public async Task<IActionResult> UpsertTask(LearnTask request)
 //        {
-//            /*//if (!requert.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
-//            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-//            if (!requert.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
+//            /*//if (!request.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
+//            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+//            if (!request.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
 //           *//* var jwt = new JwtSecurityToken(id_token.GetString());
 //            if (!jwt.Payload.Iss.Equals("account.teammodel", StringComparison.Ordinal)) return BadRequest();
 //            var id = jwt.Payload.Sub;*//*
@@ -51,12 +51,12 @@ namespace TEAMModelOS.Controllers.Learn
 //            else
 //            {
 //                //如果沒有,則初始化LearnTask
-//                requert.TryGetProperty("endTime", out JsonElement endTime);
-//                requert.TryGetProperty("status", out JsonElement status);
-//                requert.TryGetProperty("type", out JsonElement type);
-//                requert.TryGetInt64(out long createTime);
-//                requert.TryGetProperty("stage", out JsonElement stage);
-//                requert.TryGetProperty("passScore", out JsonElement passScore);
+//                request.TryGetProperty("endTime", out JsonElement endTime);
+//                request.TryGetProperty("status", out JsonElement status);
+//                request.TryGetProperty("type", out JsonElement type);
+//                request.TryGetInt64(out long createTime);
+//                request.TryGetProperty("stage", out JsonElement stage);
+//                request.TryGetProperty("passScore", out JsonElement passScore);
 
 //                if (createTime <= 0)
 //                {
@@ -127,13 +127,13 @@ namespace TEAMModelOS.Controllers.Learn
 //        /// <returns></returns>
 //        [ProducesDefaultResponseType]
 //        [HttpPost("find-task")]
-//        public async Task<IActionResult> FindTask(JsonElement requert)
+//        public async Task<IActionResult> FindTask(JsonElement request)
 //        {
 
 //            var client = _azureCosmos.GetCosmosClient();
-//            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+//            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
 //            //var (id, name, picture, _) = HttpContext.GetAuthTokenInfo();
-///*            if (!requert.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
+///*            if (!request.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
 //            var jwt = new JwtSecurityToken(id_token.GetString());
 //            if (!jwt.Payload.Iss.Equals("account.teammodel", StringComparison.Ordinal)) return BadRequest();
 //            var id = jwt.Payload.Sub;*/
@@ -207,8 +207,8 @@ namespace TEAMModelOS.Controllers.Learn
 //            }
 
 //            return Ok(new { learnUnit });
-//            /*if (!requert.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
-//            if (!requert.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
+//            /*if (!request.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
+//            if (!request.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
 //            var jwt = new JwtSecurityToken(id_token.GetString());
 //            if (!jwt.Payload.Iss.Equals("account.teammodel", StringComparison.Ordinal)) return BadRequest();
 //            var id = jwt.Payload.Sub;
@@ -223,12 +223,12 @@ namespace TEAMModelOS.Controllers.Learn
 //            else
 //            {
 //                //如果沒有,則初始化LearnTask
-//                requert.TryGetProperty("endTime", out JsonElement endTime);
-//                requert.TryGetProperty("status", out JsonElement status);
-//                requert.TryGetProperty("type", out JsonElement type);
-//                //requert.TryGetInt64(out long createTime);
-//                requert.TryGetProperty("stage", out JsonElement stage);
-//                requert.TryGetProperty("passScore", out JsonElement passScore);
+//                request.TryGetProperty("endTime", out JsonElement endTime);
+//                request.TryGetProperty("status", out JsonElement status);
+//                request.TryGetProperty("type", out JsonElement type);
+//                //request.TryGetInt64(out long createTime);
+//                request.TryGetProperty("stage", out JsonElement stage);
+//                request.TryGetProperty("passScore", out JsonElement passScore);
 //                long createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
 //                using var stream = new MemoryStream();
 //                using var writer = new Utf8JsonWriter(stream); //new JsonWriterOptions() { Indented = true }
@@ -272,13 +272,13 @@ namespace TEAMModelOS.Controllers.Learn
 //        /// <returns></returns>
 //        [ProducesDefaultResponseType]
 //        [HttpPost("find-unit")]
-//        public async Task<IActionResult> FindUnit(JsonElement requert)
+//        public async Task<IActionResult> FindUnit(JsonElement request)
 //        {
 
 //            var client = _azureCosmos.GetCosmosClient();
-//            if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+//            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
 //            //var (id, name, picture, _) = HttpContext.GetAuthTokenInfo();
-///*            if (!requert.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
+///*            if (!request.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
 //            var jwt = new JwtSecurityToken(id_token.GetString());
 //            if (!jwt.Payload.Iss.Equals("account.teammodel", StringComparison.Ordinal)) return BadRequest();
 //            var id = jwt.Payload.Sub;*/
@@ -359,13 +359,13 @@ namespace TEAMModelOS.Controllers.Learn
 //        /// <returns></returns>
 //        [ProducesDefaultResponseType]
 //        [HttpPost("find-process")]
-//        public async Task<IActionResult> FindProcess(JsonElement requert)
+//        public async Task<IActionResult> FindProcess(JsonElement request)
 //        {
 
 //            var client = _azureCosmos.GetCosmosClient();
-//            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+//            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
 //            //var (id, name, picture, _) = HttpContext.GetAuthTokenInfo();
-///*            if (!requert.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
+///*            if (!request.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
 //            var jwt = new JwtSecurityToken(id_token.GetString());
 //            if (!jwt.Payload.Iss.Equals("account.teammodel", StringComparison.Ordinal)) return BadRequest();
 //            var id = jwt.Payload.Sub;*/
@@ -444,13 +444,13 @@ namespace TEAMModelOS.Controllers.Learn
 //        /// <returns></returns>
 //        [ProducesDefaultResponseType]
 //        [HttpPost("find-record")]
-//        public async Task<IActionResult> FindRecord(JsonElement requert)
+//        public async Task<IActionResult> FindRecord(JsonElement request)
 //        {
 
 //            var client = _azureCosmos.GetCosmosClient();
-//            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+//            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
 //            //var (id, name, picture, _) = HttpContext.GetAuthTokenInfo();
-///*            if (!requert.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
+///*            if (!request.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
 //            var jwt = new JwtSecurityToken(id_token.GetString());
 //            if (!jwt.Payload.Iss.Equals("account.teammodel", StringComparison.Ordinal)) return BadRequest();
 //            var id = jwt.Payload.Sub;*/

+ 14 - 14
TEAMModelOS/Controllers/Common/StudyController.cs

@@ -410,25 +410,25 @@ namespace TEAMModelOS.Controllers.Common
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find")]
-        public async Task<IActionResult> Find(JsonElement requert)
+        public async Task<IActionResult> Find(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 var query = $"select c.id,c.img,c.name,c.type,c.startTime,c.endTime,c.presenter,c.topic,c.address,c.owner,c.progress,c.groupLists from c where (c.status<>404 or IS_DEFINED(c.status) = false )    ";
                 string continuationToken = string.Empty;
                 string token = default;
                 //是否需要进行分页查询,默认不分页
                 bool iscontinuation = false;
-                if (requert.TryGetProperty("token", out JsonElement token_1))
+                if (request.TryGetProperty("token", out JsonElement token_1))
                 {
                     token = token_1.GetString();
                     iscontinuation = true;
                 };
                 //默认不指定返回大小
                 int? topcout = null;
-                if (requert.TryGetProperty("count", out JsonElement jcount))
+                if (request.TryGetProperty("count", out JsonElement jcount))
                 {
                     if (!jcount.ValueKind.Equals(JsonValueKind.Undefined) && !jcount.ValueKind.Equals(JsonValueKind.Null) && jcount.TryGetInt32(out int data))
                     {
@@ -469,12 +469,12 @@ namespace TEAMModelOS.Controllers.Common
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-summary")]
-        public async Task<IActionResult> FindSummary(JsonElement requert)
+        public async Task<IActionResult> FindSummary(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 Study study = await client.GetContainer(Constant.TEAMModelOS, "Common").ReadItemAsync<Study>(id.GetString(), new PartitionKey($"Study-{code}"));
                 if (study != null)
@@ -556,12 +556,12 @@ namespace TEAMModelOS.Controllers.Common
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-by-teacher")]
-        public async Task<IActionResult> FindByTeacher(JsonElement requert)
+        public async Task<IActionResult> FindByTeacher(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-                if (!requert.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 var query = $"select c.id,c.img,c.name,c.startTime,c.type,c.endTime,c.presenter,c.topic,c.address,c.owner from c join A0 in c.teachers where A0.id = '{tId}'";
                 List<object> studies = new();
@@ -591,13 +591,13 @@ namespace TEAMModelOS.Controllers.Common
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-summary-by-teacher")]
-        public async Task<IActionResult> FindSummaryByTeacher(JsonElement requert)
+        public async Task<IActionResult> FindSummaryByTeacher(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-                if (!requert.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 List<object> studies = new();
                 await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: $"select value(c) from c join A0 in c.teachers where A0.id = '{tId}' and c.id = '{id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Study-{code}") }))

+ 10 - 10
TEAMModelOS/Controllers/Common/SurveyController.cs

@@ -208,15 +208,15 @@ namespace TEAMModelOS.Controllers
         [HttpPost("find")]
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin,student", Permissions = "schoolAc-read,schoolAc-upd")]
-        public async Task<IActionResult> Find(JsonElement requert)
+        public async Task<IActionResult> Find(JsonElement request)
         {
             try {
                 var (userid, _, _, school) = HttpContext.GetAuthTokenInfo();
                 //必须有学校或者教师编码
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 //开始时间,
                 var stimestamp ="";
-                if (requert.TryGetProperty("stime", out JsonElement stime))
+                if (request.TryGetProperty("stime", out JsonElement stime))
                 {
                     if (long.TryParse($"{stime}",out long data))
                     {
@@ -227,7 +227,7 @@ namespace TEAMModelOS.Controllers
                 };
                 //默认当前时间
                 var etimestamp ="";
-                if (requert.TryGetProperty("etime", out JsonElement etime))
+                if (request.TryGetProperty("etime", out JsonElement etime))
                 {
                     if (long.TryParse($"{etime}",out long data))
                     {
@@ -235,7 +235,7 @@ namespace TEAMModelOS.Controllers
                     };
                 };
                 var progresssql = "";
-                if (requert.TryGetProperty("progress", out JsonElement progress))
+                if (request.TryGetProperty("progress", out JsonElement progress))
                 {
 
                     if (!progress.ValueKind.Equals(JsonValueKind.Undefined) && !progress.ValueKind.Equals(JsonValueKind.Null) && progress.ValueKind.Equals(JsonValueKind.String))
@@ -246,7 +246,7 @@ namespace TEAMModelOS.Controllers
                 string continuationToken = null;
                 //默认不指定返回大小
                 int? topcout = null;
-                if (requert.TryGetProperty("count", out JsonElement jcount))
+                if (request.TryGetProperty("count", out JsonElement jcount))
                 {
                     if (int.TryParse($"{jcount}",out int data))
                     {
@@ -256,7 +256,7 @@ namespace TEAMModelOS.Controllers
                 //是否需要进行分页查询,默认不分页
                 bool iscontinuation = false;
                 //如果指定了返回大小
-                if (requert.TryGetProperty("continuationToken", out JsonElement continuation))
+                if (request.TryGetProperty("continuationToken", out JsonElement continuation))
                 {
                     //指定了cancellationToken 表示需要进行分页
                     if (!continuation.ValueKind.Equals(JsonValueKind.Null) && !continuation.ValueKind.Equals(JsonValueKind.Undefined))
@@ -330,13 +330,13 @@ namespace TEAMModelOS.Controllers
         [HttpPost("find-id")]
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin,student", Permissions = "schoolAc-read,schoolAc-upd")]
-        public async Task<IActionResult> FindById(JsonElement requert)
+        public async Task<IActionResult> FindById(JsonElement request)
         {
             Survey survey = null;
             //活动id
-            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
             //活动分区
-            if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
             try
             {
                 var client = _azureCosmos.GetCosmosClient();

+ 11 - 11
TEAMModelOS/Controllers/Common/VoteController.cs

@@ -200,16 +200,16 @@ namespace TEAMModelOS.Controllers
         [HttpPost("find")]
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin", Permissions = "schoolAc-read,schoolAc-upd")]
-        public async Task<IActionResult> Find(JsonElement requert)
+        public async Task<IActionResult> Find(JsonElement request)
         {
             try
             {
                 var (userid, _, _, school) = HttpContext.GetAuthTokenInfo();
                 //必须有学校或者教师编码
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 //开始时间,
                 var stimestamp = "";
-                if (requert.TryGetProperty("stime", out JsonElement stime))
+                if (request.TryGetProperty("stime", out JsonElement stime))
                 {
                     if (long.TryParse($"{stime}", out long data))
                     {
@@ -220,7 +220,7 @@ namespace TEAMModelOS.Controllers
                 };
                 //默认当前时间
                 var etimestamp = "";
-                if (requert.TryGetProperty("etime", out JsonElement etime))
+                if (request.TryGetProperty("etime", out JsonElement etime))
                 {
                     if (long.TryParse($"{etime}", out long data))
                     {
@@ -228,7 +228,7 @@ namespace TEAMModelOS.Controllers
                     };
                 };
                 var progresssql = "";
-                if (requert.TryGetProperty("progress", out JsonElement progress))
+                if (request.TryGetProperty("progress", out JsonElement progress))
                 {
 
                     if (!progress.ValueKind.Equals(JsonValueKind.Undefined) && !progress.ValueKind.Equals(JsonValueKind.Null) && progress.ValueKind.Equals(JsonValueKind.String))
@@ -239,7 +239,7 @@ namespace TEAMModelOS.Controllers
                 string continuationToken = null;
                 //默认不指定返回大小
                 int? topcout=null;
-                if (requert.TryGetProperty("count", out JsonElement jcount)) {
+                if (request.TryGetProperty("count", out JsonElement jcount)) {
                     if (int.TryParse($"{jcount}", out int data))
                     {
                         topcout = data;
@@ -248,7 +248,7 @@ namespace TEAMModelOS.Controllers
                 //是否需要进行分页查询,默认不分页
                // bool iscontinuation = false;
                 //如果指定了返回大小
-                if (requert.TryGetProperty("continuationToken", out JsonElement continuation))
+                if (request.TryGetProperty("continuationToken", out JsonElement continuation))
                 {
                     //指定了cancellationToken 表示需要进行分页
                     if (!continuation.ValueKind.Equals(JsonValueKind.Null) && !continuation.ValueKind.Equals(JsonValueKind.Undefined))
@@ -306,13 +306,13 @@ namespace TEAMModelOS.Controllers
         [HttpPost("find-id")]
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin,student", Permissions = "schoolAc-read,schoolAc-upd")]
-        public async Task<IActionResult> FindById(JsonElement requert)
+        public async Task<IActionResult> FindById(JsonElement request)
         {
             Vote vote = null;
             //活动id
-            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
             //活动分区
-            if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
             try
             {
                 var client = _azureCosmos.GetCosmosClient();
@@ -330,7 +330,7 @@ namespace TEAMModelOS.Controllers
             }
             catch (Exception ex)
             {
-                await _dingDing.SendBotMsg($"OS,{_option.Location},common/vote/find-id()\n{ex.Message}\n{ex.StackTrace}\n\n{requert.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
+                await _dingDing.SendBotMsg($"OS,{_option.Location},common/vote/find-id()\n{ex.Message}\n{ex.StackTrace}\n\n{request.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
                 return Ok(new { vote,status=404 });
             }
 

+ 14 - 14
TEAMModelOS/Controllers/Common/WorkController.cs

@@ -194,25 +194,25 @@ namespace TEAMModelOS.Controllers.Common
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher")]
         [HttpPost("find")]
-        public async Task<IActionResult> Find(JsonElement requert)
+        public async Task<IActionResult> Find(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 var query = $"select c.id,c.name,c.createTime,c.startTime,c.endTime,c.allowSupply,c.allowComment from c where (c.status<>404 or IS_DEFINED(c.status) = false ) ";
                 string continuationToken = string.Empty;
                 string token = default;
                 //是否需要进行分页查询,默认不分页
                 bool iscontinuation = false;
-                if (requert.TryGetProperty("token", out JsonElement token_1))
+                if (request.TryGetProperty("token", out JsonElement token_1))
                 {
                     token = token_1.GetString();
                     iscontinuation = true;
                 };
                 //默认不指定返回大小
                 int? topcout = null;
-                if (requert.TryGetProperty("count", out JsonElement jcount))
+                if (request.TryGetProperty("count", out JsonElement jcount))
                 {
                     if (!jcount.ValueKind.Equals(JsonValueKind.Undefined) && !jcount.ValueKind.Equals(JsonValueKind.Null) && jcount.TryGetInt32(out int data))
                     {
@@ -253,12 +253,12 @@ namespace TEAMModelOS.Controllers.Common
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher")]
         [HttpPost("find-summary")]
-        public async Task<IActionResult> FindSummary(JsonElement requert)
+        public async Task<IActionResult> FindSummary(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 List<Homework> works = new();
                 await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryIterator<Homework>(queryText: $"select value(c) from c where (c.status<>404 or IS_DEFINED(c.status) = false ) and  c.id = '{id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Homework-{code}") }))
@@ -282,12 +282,12 @@ namespace TEAMModelOS.Controllers.Common
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher")]
         [HttpPost("find-by-teacher")]
-        public async Task<IActionResult> FindByTeacher(JsonElement requert)
+        public async Task<IActionResult> FindByTeacher(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-                if (!requert.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 var query = $"select c.id,c.name,c.createTime,A0.time from c join A0 in c.teachers where (c.status<>404 or IS_DEFINED(c.status) = false ) and  A0.id = '{tId}'";
                 List<object> works = new();
@@ -317,13 +317,13 @@ namespace TEAMModelOS.Controllers.Common
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher")]
         [HttpPost("find-summary-by-teacher")]
-        public async Task<IActionResult> FindSummaryByTeacher(JsonElement requert)
+        public async Task<IActionResult> FindSummaryByTeacher(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-                if (!requert.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 List<object> works = new();
                 await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: $"select value(c) from c join A0 in c.teachers  where (c.status<>404 or IS_DEFINED(c.status) = false ) and  A0.id = '{tId}' and c.id = '{id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Homework-{code}") }))

+ 1 - 1
TEAMModelOS/Controllers/OpenApi/Init/OpenApiConfigController.cs

@@ -42,7 +42,7 @@ namespace TEAMModelOS.Controllers
         /// <summary>
         /// {"id":"uuid","code":"hbcn学校编码"} 
         /// </summary>
-        /// <param name="requert"></param>
+        /// <param name="request"></param>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         //[AuthToken(Roles = "admin")]

+ 65 - 82
TEAMModelOS/Controllers/School/ClassController.cs

@@ -48,16 +48,19 @@ namespace TEAMModelOS.Controllers
         //[AuthToken(Roles = "teacher")]
         [HttpPost("upsert")]
         [Authorize(Roles = "IES")]
-        public async ValueTask<IActionResult> Upsert(JsonElement requert)
+        public async ValueTask<IActionResult> Upsert(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("classroom", out JsonElement room)) return BadRequest();
+                if (!request.TryGetProperty("classroom", out JsonElement room)) return BadRequest();
                 Class classroom = room.ToObject<Class>();
                 var client = _azureCosmos.GetCosmosClient();
                 classroom.code = "Class-" + classroom.school;
                 if (string.IsNullOrEmpty(classroom.id))
                 {
+                    if (classroom.graduate != 0) {
+                        return BadRequest("已毕业的班级不能被编辑");
+                    }
                     List<string> resultIds = new List<string>();
                     await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: $"select c.id from c where c.periodId = '{classroom.periodId}' and c.no = '{classroom.no}' and c.year = '{classroom.year}' ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey(classroom.code) }))
                     {
@@ -86,6 +89,10 @@ namespace TEAMModelOS.Controllers
                     {
                         using var json = await JsonDocument.ParseAsync(response.ContentStream);
                         Class @class = json.ToObject<Class>();
+                        if (classroom.graduate != 0)
+                        {
+                            return BadRequest("已毕业的班级不能被编辑");
+                        }
                         if (!@class.no.Equals(classroom.no))
                         {
                             List<string> resultIds = new List<string>();
@@ -129,12 +136,12 @@ namespace TEAMModelOS.Controllers
         //[AuthToken(Roles = "teacher")]
         [HttpPost("upsert-group")]
         [Authorize(Roles = "IES")]
-        public async ValueTask<IActionResult> UpsertGroup(JsonElement requert)
+        public async ValueTask<IActionResult> UpsertGroup(JsonElement request)
         {
             try
             {
                 List<Student> students = new List<Student>();
-                if (!requert.TryGetProperty("students", out JsonElement stus)) return BadRequest();
+                if (!request.TryGetProperty("students", out JsonElement stus)) return BadRequest();
                 students = stus.ToObject<List<Student>>();
                 var client = _azureCosmos.GetCosmosClient();
                 foreach (Student stu in students)
@@ -158,47 +165,65 @@ namespace TEAMModelOS.Controllers
             }
 
         }
-
+        /// <summary>
+        /// 已弃用
+        /// </summary>
+        /// <param name="request"></param>
+        /// <returns></returns>
         [ProducesDefaultResponseType]
-        //[AuthToken(Roles = "teacher")]
         [HttpPost("find")]
-        [Authorize(Roles = "IES")]
-        public async Task<IActionResult> Find(JsonElement requert)
+#if !DEBUG
+[Authorize(Roles = "IES")]
+#endif
+        public async Task<IActionResult> Find(JsonElement request)
         {
-            //ResponseBuilder builder = ResponseBuilder.custom();
-            if (!requert.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
+            if (!request.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
             try
-            {
-                var client = _azureCosmos.GetCosmosClient();
-                List<object> classrooms = new List<object>();
-                StringBuilder sql = new StringBuilder();
-                sql.Append("select c.id,c.no,c.point,c.name,c.teacher,c.periodId,c.gradeId,c.sn,c.style,c.scope,c.type,c.code,c.openType,c.x,c.y,ARRAY_LENGTH(c.students) AS studCount from c ");
-                Dictionary<string, object> dict = new Dictionary<string, object>();
-                var emobj = requert.EnumerateObject();
-                while (emobj.MoveNext())
+            {   
+                //增加毕业查询。当毕业查询字段1时,则需要传入入学年份。
+                int graduate = 0;
+                int inyear = 0;
+                //讀取該間學校所有的學生資訊
+                if (request.TryGetProperty("graduate", out JsonElement _graduate) && $"{_graduate}".Equals("1"))
                 {
-                    dict[emobj.Current.Name] = emobj.Current.Value;
+                    if (request.TryGetProperty("year", out JsonElement _year) && _year.ValueKind.Equals(JsonValueKind.Number))
+                    {
+                        if (int.TryParse($"{_year}", out inyear) && inyear > 0)
+                        {
+
+                        }
+                        else
+                        {
+                            return BadRequest("入学年份大于0");
+                        }
+                    }
+                    else
+                    {
+                        return BadRequest("请输入毕业学生的入学年份");
+                    }
                 }
-                //处理code
-                if (dict.TryGetValue("school_code", out object _))
-                {
-                    dict.Remove("school_code");
+                string sql = "";
+                if (graduate == 0) {
+                    sql = $"SELECT c.id,c.x,c.y,c.name,c.year,c.teacher,c.periodId,c.gradeId,c.room,c.sn,c.no,c.style,c.status,c.openType,c.school, c.graduate, " +
+                   $" ARRAY_LENGTH(c.students) AS studCount FROM c where c.graduate = 0 or  IS_DEFINED(c.graduate) = false";
+                }
+                else {
+                    sql = $"SELECT c.id,c.x,c.y,c.name,c.year,c.teacher,c.periodId,c.gradeId,c.room,c.sn,c.no,c.style,c.status,c.openType,c.school, c.graduate, " +
+                       $" ARRAY_LENGTH(c.students) AS studCount FROM c where c.graduate =1 and c.year ={inyear}";
                 }
-                AzureCosmosQuery cosmosDbQuery = SQLHelper.GetSQL(dict, sql);
-                await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Class-{school_code}") }))
+                List<object> school_classes = new List<object>();
+                var client = _azureCosmos.GetCosmosClient();
+                await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator
+                   (queryText:sql,
+                   requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Class-{school_code}") }))
                 {
-                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
-                    if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
+                    var jsonc = await JsonDocument.ParseAsync(item.ContentStream);
+                    foreach (var classeinfo in jsonc.RootElement.GetProperty("Documents").EnumerateArray())
                     {
-                        foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
-                        {
-                            classrooms.Add(obj.ToObject<object>());
-                        }
+                        school_classes.Add(classeinfo.ToObject<object>());
                     }
                 }
-                return Ok(new { classrooms });
-                /*List<Classroom> sc = await _azureCosmos.FindByDict<Classroom>(request);
-                return builder.Data(sc).build();*/
+                return Ok(new { school_classes });
             }
             catch (Exception ex)
             {
@@ -218,7 +243,10 @@ namespace TEAMModelOS.Controllers
            
             try
             {
-                string school_code = code.ToString();
+                Class clssz = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).ReadItemAsync<Class>($"{id}", new PartitionKey($"Class-{code}"));
+                if (clssz.graduate == 1) {
+                    return BadRequest("已毕业的班级不能被删除。");
+                }
                 var client = _azureCosmos.GetCosmosClient();
                 List<Student> students = new List<Student>();
                 await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Student").GetItemQueryIterator<Student>(queryText: $"select *  from c where c.classId='{id}' ", requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey($"Base-{code}") }))
@@ -247,60 +275,15 @@ namespace TEAMModelOS.Controllers
                 change.listid = $"{id}";
                 change.scope = "school";
                 change.originCode = $"{code}";
-                change.school = $"{school_code}";
+                change.school = $"{code}";
                 change.type = "class";
                 change.status = "delete";
                 var messageChange = new ServiceBusMessage(change.ToJsonString());
                 messageChange.ApplicationProperties.Add("name", "GroupChange");
                 var ActiveTask = _configuration.GetValue<string>("Azure:ServiceBus:ActiveTask");
                 await _serviceBus.GetServiceBusClient().SendMessageAsync(ActiveTask, messageChange);
-                //查询含有该班级的课程ID
-
-                /*
-                List<string> cids = new List<string>();
-                await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(
-                    queryText: $"select distinct c.id from c join A0 in c.schedule where A0.classId = '{id}'",
-                    requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey($"Course-{code}") }))
-                {
-                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
-                    if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
-                    {
-                        var accounts = json.RootElement.GetProperty("Documents").EnumerateArray();
-                        while (accounts.MoveNext())
-                        {
-                            JsonElement account = accounts.Current;
-                            cids.Add(account.GetProperty("id").GetString());
-                        }
-                    }
-                }
-                List<Task<ItemResponse<Course>>> taskCourses = new List<Task<ItemResponse<Course>>>();
-                List<Course> courses = new List<Course>();
-                if(cids.IsNotEmpty())
-                {
-                    await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<Course>(
-                       queryText: $"select value(c) from c where c.id in ({string.Join(",", cids.Select(o => $"'{o}'"))})",
-                       requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey($"Course-{code}") }))
-                    {
-                        courses.Add(item);
-                    }
-                }
-               
-                foreach (Course course in courses)
-                {
-                    for (int i =0;i< course.schedule.Count;i++) {
-                        if (!string.IsNullOrEmpty(course.schedule[i].classId)) {
-                            string classId = course.schedule[i].classId;
-                            if (classId.Equals(id.GetString())) { 
-                                course.schedule.RemoveAt(i);
-                            }
-                        }
-                    }
-                    taskCourses.Add(client.GetContainer(Constant.TEAMModelOS, "School").ReplaceItemAsync(course, course.id, new PartitionKey((course.code))));
-                }
-                await Task.WhenAll(taskCourses);
-                */
                 await Task.WhenAll(tasks);
-                Class classroom=   await client.GetContainer(Constant.TEAMModelOS, "School").DeleteItemAsync<Class>(id.ToString(), new PartitionKey($"Class-{school_code}"));
+                Class classroom=   await client.GetContainer(Constant.TEAMModelOS, "School").DeleteItemAsync<Class>(id.ToString(), new PartitionKey($"Class-{code}"));
                 return Ok(new { classroom });
             }
             catch (Exception ex)

+ 8 - 8
TEAMModelOS/Controllers/School/CorrectController.cs

@@ -72,7 +72,7 @@ namespace TEAMModelOS.Controllers
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-task")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> FindTask(JsonElement requert)
+        public async Task<IActionResult> FindTask(JsonElement request)
         {
             List<CorrectTask> tasks = new List<CorrectTask>();
             try
@@ -80,7 +80,7 @@ namespace TEAMModelOS.Controllers
                 var client = _azureCosmos.GetCosmosClient();
 
                 //活动分区
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var (_, _, _, school) = HttpContext.GetAuthTokenInfo();
                 await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<CorrectTask>(queryText: $"select value(c) from c where c.scode = 'Correct-{school}'",
                 requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"CorrectTask-{code}") }))
@@ -255,15 +255,15 @@ namespace TEAMModelOS.Controllers
         [ProducesDefaultResponseType]
         [HttpPost("find-id")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> FindById(JsonElement requert)
+        public async Task<IActionResult> FindById(JsonElement request)
         {
             try
             {
 
                 //活动id
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 //活动分区
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 Correct correct = await client.GetContainer(Constant.TEAMModelOS, "Common").ReadItemAsync<Correct>(id.GetString(), new PartitionKey($"Correct-{code}"));
                 return Ok(new { correct });
@@ -284,15 +284,15 @@ namespace TEAMModelOS.Controllers
         [ProducesDefaultResponseType]
         [HttpPost("delete-task")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> delete(JsonElement requert)
+        public async Task<IActionResult> delete(JsonElement request)
         {
             try
             {
 
                 //活动id
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 //活动分区
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 List<SDK.Models.Cosmos.Common.Scoring> attr = new();
                 await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<SDK.Models.Cosmos.Common.Scoring>(

+ 17 - 17
TEAMModelOS/Controllers/School/NoticeController.cs

@@ -128,27 +128,27 @@ namespace TEAMModelOS.Controllers
         /// <summary>
         /// 
         /// </summary>
-        /// <param name="requert"></param>
+        /// <param name="request"></param>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [HttpPost("find")]
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin,student")]
-        public async Task<IActionResult> Find(JsonElement requert)
+        public async Task<IActionResult> Find(JsonElement request)
         {
             try
             {
                 var (userid, _, _, school) = HttpContext.GetAuthTokenInfo();
                 //必须有学校或者教师编码
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-                if (!requert.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
-                requert.TryGetProperty("admin", out JsonElement admin);
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
+                request.TryGetProperty("admin", out JsonElement admin);
                 string stimestampsql = "";
                 string etimestampsql = "";
                 if (!$"{admin}".Equals("1"))
                 {
                     var stimestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
-                    if (requert.TryGetProperty("stime", out JsonElement stime))
+                    if (request.TryGetProperty("stime", out JsonElement stime))
                     {
                         if (long.TryParse($"{stime}", out long data))
                         {
@@ -158,7 +158,7 @@ namespace TEAMModelOS.Controllers
                     stimestampsql = $" and c.startTime <= {stimestamp} ";
                     //默认当前时间
                     var etimestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
-                    if (requert.TryGetProperty("etime", out JsonElement etime))
+                    if (request.TryGetProperty("etime", out JsonElement etime))
                     {
                         if (long.TryParse($"{etime}", out long data))
                         {
@@ -169,7 +169,7 @@ namespace TEAMModelOS.Controllers
 
                 }
                 var publishsql = "";
-                if (requert.TryGetProperty("publish", out JsonElement publish))
+                if (request.TryGetProperty("publish", out JsonElement publish))
                 {
 
                     if (!publish.ValueKind.Equals(JsonValueKind.Undefined) && !publish.ValueKind.Equals(JsonValueKind.Null) && publish.ValueKind.Equals(JsonValueKind.Number))
@@ -179,7 +179,7 @@ namespace TEAMModelOS.Controllers
                 }
 
                 var creatorIdSql = "";
-                if (requert.TryGetProperty("creatorId", out JsonElement creatorId))
+                if (request.TryGetProperty("creatorId", out JsonElement creatorId))
                 {
 
                     if (!publish.ValueKind.Equals(JsonValueKind.Undefined) && !publish.ValueKind.Equals(JsonValueKind.Null) && publish.ValueKind.Equals(JsonValueKind.String))
@@ -189,7 +189,7 @@ namespace TEAMModelOS.Controllers
                 }
 
                 var typesql = "";
-                if (requert.TryGetProperty("type", out JsonElement type))
+                if (request.TryGetProperty("type", out JsonElement type))
                 {
 
                     if (!type.ValueKind.Equals(JsonValueKind.Undefined) && !type.ValueKind.Equals(JsonValueKind.Null) && type.ValueKind.Equals(JsonValueKind.String))
@@ -199,7 +199,7 @@ namespace TEAMModelOS.Controllers
                 }
                 string joinSqlClasses = "";
                 string andSqlClasses = "";
-                if (requert.TryGetProperty("classes", out JsonElement _classes))
+                if (request.TryGetProperty("classes", out JsonElement _classes))
                 {
 
                     if (_classes.ValueKind is JsonValueKind.Array)
@@ -247,13 +247,13 @@ namespace TEAMModelOS.Controllers
         /// <summary>
         /// 
         /// </summary>
-        /// <param name="requert"></param>
+        /// <param name="request"></param>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [HttpPost("find-by-student")]
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin,student")]
-        public async Task<IActionResult> FindByStudent(JsonElement requert)
+        public async Task<IActionResult> FindByStudent(JsonElement request)
         {
             try
             {
@@ -261,12 +261,12 @@ namespace TEAMModelOS.Controllers
                 HttpContext?.Items.TryGetValue("Scope", out scope);
                 var (userid, _, _, school) = HttpContext.GetAuthTokenInfo();
                 //必须有学校或者教师编码
-               // if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+               // if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                
                 //string stimestampsql = "";
                 //string etimestampsql = "";
                 //var stimestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
-                //if (requert.TryGetProperty("stime", out JsonElement stime) && stime.ValueKind.Equals(JsonValueKind.Number))
+                //if (request.TryGetProperty("stime", out JsonElement stime) && stime.ValueKind.Equals(JsonValueKind.Number))
                 //{
                 //    if (long.TryParse($"{stime}", out long data))
                 //    {
@@ -276,7 +276,7 @@ namespace TEAMModelOS.Controllers
                 //stimestampsql = $" and c.startTime <= {stimestamp} ";
                 ////默认当前时间
                 //var etimestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
-                //if (requert.TryGetProperty("etime", out JsonElement etime) && stime.ValueKind.Equals(JsonValueKind.Number))
+                //if (request.TryGetProperty("etime", out JsonElement etime) && stime.ValueKind.Equals(JsonValueKind.Number))
                 //{
                 //    if (long.TryParse($"{etime}", out long data))
                 //    {
@@ -287,7 +287,7 @@ namespace TEAMModelOS.Controllers
                 var publishsql = $" and c.publish=1 ";
                 string joinSqlClasses = "";
                 string andSqlClasses = "";
-                if (requert.TryGetProperty("classes", out JsonElement _classes))
+                if (request.TryGetProperty("classes", out JsonElement _classes))
                 {
 
                     if (_classes.ValueKind is JsonValueKind.Array)

+ 9 - 9
TEAMModelOS/Controllers/School/RoomController.cs

@@ -79,7 +79,7 @@ namespace TEAMModelOS.Controllers
         /// <summary>
         /// {"code":"hbcn学校编码"} 
         /// </summary>
-        /// <param name="requert"></param>
+        /// <param name="request"></param>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         //[AuthToken(Roles = "teacher")]
@@ -107,20 +107,20 @@ namespace TEAMModelOS.Controllers
         /// <summary>
         /// {"id":"教室id","code":"hbcn学校编码"} 
         /// </summary>
-        /// <param name="requert"></param>
+        /// <param name="request"></param>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [HttpPost("find-id")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> FindById(JsonElement requert)
+        public async Task<IActionResult> FindById(JsonElement request)
         {
             try
             {
                 var client = _azureCosmos.GetCosmosClient();
                 //id
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 //
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 Room room = await client.GetContainer(Constant.TEAMModelOS, "School").ReadItemAsync<Room>(id.GetString(), new PartitionKey($"Room-{code}"));
                 if (room != null)
                 {
@@ -141,20 +141,20 @@ namespace TEAMModelOS.Controllers
         /// <summary>
         /// {"id":"教室id","code":"hbcn学校编码"} 
         /// </summary>
-        /// <param name="requert"></param>
+        /// <param name="request"></param>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [HttpPost("delete")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> Delete(JsonElement requert)
+        public async Task<IActionResult> Delete(JsonElement request)
         {
             try
             {
                 var client = _azureCosmos.GetCosmosClient();
                 //id
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 //
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var room= await client.GetContainer(Constant.TEAMModelOS, "School").DeleteItemAsync<Room>(id.GetString(), new PartitionKey($"Room-{code}"));
                 return Ok();
             }

+ 2 - 2
TEAMModelOS/Controllers/School/SchoolController.cs

@@ -180,9 +180,9 @@ namespace TEAMModelOS.Controllers
         //[AuthToken(Roles = "teacher")]
         [HttpPost("find")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> Find(JsonElement requert)
+        public async Task<IActionResult> Find(JsonElement request)
         {
-            if (!requert.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
+            if (!request.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
             var client = _azureCosmos.GetCosmosClient();
             List<School> schools = new ();
             var query = $"select c.id,c.pk,c.code, c.name,c.region,c.province,c.city,c.timeZone,c.picture,c.size,c.period,c.campuses from c where c.id ='{school_code}'";

+ 23 - 4
TEAMModelOS/Controllers/Student/StudentController.cs

@@ -170,8 +170,27 @@ namespace TEAMModelOS.Controllers
                         await CheckStudent(_serviceBus, _configuration, _azureCosmos, schoolId.GetString(), webStudents, preStudents);
                         return this.Ok(new { code = $"Base-{schoolId.GetString()}", students = retUpsert.studs, retUpsert.classDuplNos, retUpsert.errorIds });
                     case "read":
+                        //增加毕业查询。当毕业查询字段1时,则需要传入入学年份。
+                        int graduate = 0;
+                        int inyear = 0;
                         //讀取該間學校所有的學生資訊
-                        var students = await StudentService.getAllStudent(_azureCosmos, _dingDing, _option, schoolId.GetString());
+                        if (request.TryGetProperty("graduate", out JsonElement _graduate) && $"{_graduate}".Equals("1")) {
+                            if (request.TryGetProperty("year", out JsonElement _year) && _year.ValueKind.Equals(JsonValueKind.Number))
+                            {
+                                if (int.TryParse($"{_year}", out inyear) && inyear > 0)
+                                {
+
+                                }
+                                else {
+                                    return BadRequest("入学年份大于0");
+                                }
+                            }
+                            else {
+                                return BadRequest("请输入毕业学生的入学年份");
+                            }
+                        }
+                      
+                        var students = await StudentService.getAllStudent(_azureCosmos, _dingDing, _option, schoolId.GetString(), inyear, graduate);
                         return this.Ok(new { code = $"Base-{schoolId.GetString()}", students });
                     case "update":
                         //更新學生資料,批量密碼重置,基本資訊更新(姓名、教室ID、性別、學年及座號)
@@ -585,12 +604,12 @@ namespace TEAMModelOS.Controllers
         //[AuthToken(Roles = "teacher")]
         [HttpPost("get-summary-student")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> getSummary(JsonElement requert)
+        public async Task<IActionResult> getSummary(JsonElement request)
         {
             try
             {
-                requert.TryGetProperty("students", out JsonElement students);
-                requert.TryGetProperty("tmdIds", out JsonElement tmdIds);
+                request.TryGetProperty("students", out JsonElement students);
+                request.TryGetProperty("tmdIds", out JsonElement tmdIds);
 
                 List<TmdInfo> tmdinfos = new List<TmdInfo>();
                 List<object> stus = new List<object>();

+ 6 - 6
TEAMModelOS/Controllers/System/OpenApiController.cs

@@ -40,7 +40,7 @@ namespace TEAMModelOS.Controllers
         /// <summary>
         /// {"code":"hbcn学校编码"} 
         /// </summary>
-        /// <param name="requert"></param>
+        /// <param name="request"></param>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         //[AuthToken(Roles = "admin")]
@@ -171,7 +171,7 @@ namespace TEAMModelOS.Controllers
         /// <summary>
         /// {"id":"uuid","code":"hbcn学校编码"} 
         /// </summary>
-        /// <param name="requert"></param>
+        /// <param name="request"></param>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         //[AuthToken(Roles = "admin")]
@@ -217,20 +217,20 @@ namespace TEAMModelOS.Controllers
         /// <summary>
         /// {"id":"id","code":"hbcn"} 
         /// </summary>
-        /// <param name="requert"></param>
+        /// <param name="request"></param>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [HttpPost("delete-app")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> Delete(JsonElement requert)
+        public async Task<IActionResult> Delete(JsonElement request)
         {
             try
             {
                 var client = _azureCosmos.GetCosmosClient();
                 //id
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 //
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var room = await client.GetContainer(Constant.TEAMModelOS, "School").DeleteItemAsync<OpenApp>(id.GetString(), new PartitionKey($"OpenApp-{code}"));
                 return Ok();
             }

+ 5 - 5
TEAMModelOS/Controllers/Teacher/FavoriteController.cs

@@ -115,7 +115,7 @@ namespace TEAMModelOS.Controllers
         /// <summary>
         /// {"code":"教师编码"} 
         /// </summary>
-        /// <param name="requert"></param>
+        /// <param name="request"></param>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [AuthToken(Roles = "teacher,admin")]
@@ -144,19 +144,19 @@ namespace TEAMModelOS.Controllers
         /// <summary>
         /// {"id":"我的最爱id","code":"教师编码"} 
         /// </summary>
-        /// <param name="requert"></param>
+        /// <param name="request"></param>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [HttpPost("delete")]
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
-        public async Task<IActionResult> Delete(JsonElement requert)
+        public async Task<IActionResult> Delete(JsonElement request)
         {
             try
             {
                 var client = _azureCosmos.GetCosmosClient();
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 Favorite favorite = await client.GetContainer(Constant.TEAMModelOS, "Teacher").ReadItemAsync<Favorite>(id.GetString(), new PartitionKey($"Favorite-{code}"));
                 if (favorite.type.Equals("LessonRecord"))
                 {

+ 10 - 8
TEAMModelOS/Controllers/Teacher/InitController.cs

@@ -617,8 +617,10 @@ namespace TEAMModelOS.Controllers
 
                 //取得班级
                 List<object> school_classes = new List<object>();
+
                 await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator
-                    (queryText: $"SELECT c.id,c.x,c.y,c.name,c.year,c.teacher,c.periodId,c.gradeId,c.room,c.sn,c.no,c.style,c.status,c.openType,c.school, ARRAY_LENGTH(c.students) AS studCount FROM c",
+                    (queryText: $"SELECT c.id,c.x,c.y,c.name,c.year,c.teacher,c.periodId,c.gradeId,c.room,c.sn,c.no,c.style,c.status,c.openType,c.school, c.graduate, " +
+                    $" ARRAY_LENGTH(c.students) AS studCount FROM c where c.graduate = 0 or  IS_DEFINED(c.graduate) = false",
                     requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Class-{school_code}") }))
                 {
                     var jsonc = await JsonDocument.ParseAsync(item.ContentStream);
@@ -882,21 +884,21 @@ namespace TEAMModelOS.Controllers
         /// 申請或同意邀請加入學校
         /// </summary>
         /// 
-        /// <param name="requert"></param>
+        /// <param name="request"></param>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [AuthToken(Roles = "teacher")]
         [HttpPost("join-school")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> JoinSchool(JsonElement requert)
+        public async Task<IActionResult> JoinSchool(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("grant_type", out JsonElement grant_type)) return BadRequest();  //"invite":學校邀請 "request":老師申請 "join":"成為學校老師",leave 离开,cancel 取消。
-                if (!requert.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
-                if (!requert.TryGetProperty("school_name", out JsonElement school_name)) return BadRequest();
+                if (!request.TryGetProperty("grant_type", out JsonElement grant_type)) return BadRequest();  //"invite":學校邀請 "request":老師申請 "join":"成為學校老師",leave 离开,cancel 取消。
+                if (!request.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
+                if (!request.TryGetProperty("school_name", out JsonElement school_name)) return BadRequest();
                 ///当邀请某个老师加入学校则需要知道是谁邀请的
-                //if (!requert.TryGetProperty("school_admin", out JsonElement school_admin)) return BadRequest();
+                //if (!request.TryGetProperty("school_admin", out JsonElement school_admin)) return BadRequest();
                 string authtoken = HttpContext.GetXAuth("AuthToken");
                 if (string.IsNullOrEmpty(authtoken)) return BadRequest();
                 var jwt = new JwtSecurityToken(authtoken);
@@ -1107,7 +1109,7 @@ namespace TEAMModelOS.Controllers
             }
             catch (Exception ex)
             {
-                await _dingDing.SendBotMsg($"TEAMModel,{_option.Location},Init/JoinSchool()\n{ex.Message}\n{ex.StackTrace}\n{requert.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
+                await _dingDing.SendBotMsg($"TEAMModel,{_option.Location},Init/JoinSchool()\n{ex.Message}\n{ex.StackTrace}\n{request.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
                 return BadRequest();
             }
         }

+ 51 - 51
TEAMModelOS/Controllers/Teacher/TeacherCommonController.cs

@@ -39,13 +39,13 @@ namespace TEAMModelOS.Controllers
         [HttpPost("tch-activity-count")]
         [AuthToken(Roles = "admin,teacher")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> TchActivityCount(JsonElement requert)
+        public async Task<IActionResult> TchActivityCount(JsonElement request)
         {
             var (id, _, _, school) = HttpContext.GetAuthTokenInfo();
             var client = _azureCosmos.GetCosmosClient();
             HashSet<string> classes = new HashSet<string>();
             HashSet<string> stulist = new HashSet<string>();
-            //获取学校的名单:
+            //鑾峰彇瀛︽牎鐨勫悕鍗曪細
             List<Schedule> schedules = new List<Schedule>();
             string scheduleSql = $"SELECT   c.schedule  FROM c join scdl in c.schedule where c.pk='Course' and scdl.teacherId='{id}'";
             await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<Course>(scheduleSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Course-{school}") }))
@@ -97,7 +97,7 @@ namespace TEAMModelOS.Controllers
                 if (!string.IsNullOrWhiteSpace(school) && classes.ToList().IsNotEmpty())
                 {
                     string querySchool = $" SELECT distinct c.owner, c.id,c.code, c.classes,c.stuLists,c.subjects,c.progress,c.scope,c.startTime,c.school,c.creatorId,c.name,c.pk ,c.endTime   FROM c {joinSqlClasses}   where   {pksql}    {classesSql}  and    (c.status<>404 or IS_DEFINED(c.status) = false )   ";
-                    //查询数据归属学校的
+                    //查询数据归属学校的
                     await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIterator<MQActivity>(querySchool, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{type}-{school}") }))
                     {
                         if (item.progress.Equals("going", StringComparison.OrdinalIgnoreCase))
@@ -116,7 +116,7 @@ namespace TEAMModelOS.Controllers
                 if (!string.IsNullOrWhiteSpace(school) && stulist.ToList().IsNotEmpty())
                 {
                     string querySchool = $" SELECT distinct c.owner, c.id,c.code, c.classes,c.stuLists,c.subjects,c.progress,c.scope,c.startTime,c.school,c.creatorId,c.name,c.pk ,c.endTime   FROM c {joinSqlStulist}   where   {pksql}    {stuListsSql} and   (c.status<>404 or IS_DEFINED(c.status) = false )   ";
-                    //查询数据归属学校的
+                    //查询数据归属学校的
                     await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIterator<MQActivity>(querySchool, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{type}-{school}") }))
                     {
                         if (item.progress.Equals("going", StringComparison.OrdinalIgnoreCase))
@@ -127,7 +127,7 @@ namespace TEAMModelOS.Controllers
                     }
                 }
                 string queryTeacher = $" SELECT distinct c.owner, c.id,c.code, c.classes,c.stuLists,c.subjects,c.progress,c.scope,c.startTime,c.school,c.creatorId,c.name,c.pk ,c.endTime  FROM c   where   {pksql} and   (c.status<>404 or IS_DEFINED(c.status) = false )    ";
-                //查询数据归属个人的
+                //查询数据归属个人的
                 await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIterator<MQActivity>(queryTeacher, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{type}-{id}") }))
                 {
                     acount += 1;
@@ -139,7 +139,7 @@ namespace TEAMModelOS.Controllers
                 KeyValuePair<string, int> valuePair = new KeyValuePair<string, int>(type, acount);
                 count.Add(valuePair);
             }
-            //课程统计 个人和学校  分别对应的教学的班级有多少
+            //课程统计 个人和学校  分别对应的教学的班级有多少
             List<CourseCount> privateCourse = new List<CourseCount>();
             string courseSql = $" SELECT a.teacherId,a.classId,  a.stulist,c.id,c.name FROM c  join a in c.schedule where a.teacherId='{id}'  ";
             await foreach(var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<CourseCount>(courseSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Course-{id}") })){
@@ -152,10 +152,10 @@ namespace TEAMModelOS.Controllers
                     schoolCourse.Add(item);
                 }
             }
-            //涉及的课程清单数量(去重),与排课无关,排课涉及周期问题,暂不进行统计
+            //涉及的课程清单数量(去重),与排课无关,排课涉及周期问题,暂不进行统计
             int privateCourseCount= privateCourse.Select(x => x.id).ToHashSet().Count();
             int schoolCourseCount = schoolCourse.Select(x => x.id).ToHashSet().Count();
-            //行政班教学数量,去重。
+            //行政班教学数量,去重。
             HashSet<string> classIds = new HashSet<string>();
             HashSet<string> teachIds = new HashSet<string>();
             HashSet<string> stulists = new HashSet<string>();
@@ -220,31 +220,31 @@ namespace TEAMModelOS.Controllers
             public string name { get; set; }
         }
         /// <summary>
-        /// 教师端,查询活动所有活动类型的列表,班主任,任课教师等
-        /// 执教班级
+        /// 鏁欏笀绔�紝鏌ヨ�娲诲姩鎵€鏈夋椿鍔ㄧ被鍨嬬殑鍒楄〃锛岀彮涓讳换锛屼换璇炬暀甯堢瓑
+        /// 鎵ф暀鐝�骇
         /// </summary>
         /// <param name="request">
-        /// 教师tmdid                          !userid:"1255868536"   
-        ///学校编码                            !school:"hbcn"
-        ///执教的班级信息                      !classes:[{"classid":"S-C-00001","scope":"school"},{"classid":"P-C-00004","scope":"private"}]   TODO  需要排查 对象和班级字符串id设计原因 {"classid":"S-C-00001","scope":"school"}
-        ///执教的科目                          ?subjects:["subjectid1","subjectid2"]
-        ///活动类型                            !"pk":"Vote"/"Exam"/"Homework"/"Learn"/"Survey"" // Vote投票 Survey问卷 Exam评测 Learn学习活动 Homework作业活动
-        ///时间筛选范围开始时间 默认30天之前   ?"stime":1608274766154  
-        ///时间筛选范围结束时间 默认当前时间   ?"etime":1608274766666 
-        ///每页大小     ?"count":10/null/Undefined  
-        ///分页Token    ?"continuationToken":Undefined/null/"[{\"token\":\"+RID:~omxMAP3ipcSEEwAAAAAAAA==#RT:2#TRC:20#ISV:2#IEO:65551#QCF:1#FPC:AYQTAAAAAAAAiRMAAAAAAAA=\",\"range\":{\"min\":\"\",\"max\":\"FF\"}}]"
-        ///当前状态     ?"progress":Undefined/null/"" 表示两种状态都要查询/ "going"/"finish" 表示查询进行中/ 或者已完成 学生端只能查询正在进行或已经结束 going 已发布|finish 已结束  
+        /// 鏁欏笀tmdid                          !userid:"1255868536"   
+        ///瀛︽牎缂栫爜                            !school:"hbcn"
+        ///执教的班级信息                      !classes:[{"classid":"S-C-00001","scope":"school"},{"classid":"P-C-00004","scope":"private"}]   TODO  需要排查 对象和班级字符串id设计原因 {"classid":"S-C-00001","scope":"school"}
+        ///执教的科目                          ?subjects:["subjectid1","subjectid2"]
+        ///娲诲姩绫诲瀷                            !"pk":"Vote"/"Exam"/"Homework"/"Learn"/"Survey"" // Vote鎶曠エ Survey闂�嵎 Exam璇勬祴 Learn瀛︿範娲诲姩 Homework浣滀笟娲诲姩
+        ///时间筛选范围开始时间 默认30天之前   ?"stime":1608274766154  
+        ///时间筛选范围结束时间 默认当前时间   ?"etime":1608274766666 
+        ///姣忛〉澶у皬     ?"count":10/null/Undefined  
+        ///鍒嗛〉Token    ?"continuationToken":Undefined/null/"[{\"token\":\"+RID:~omxMAP3ipcSEEwAAAAAAAA==#RT:2#TRC:20#ISV:2#IEO:65551#QCF:1#FPC:AYQTAAAAAAAAiRMAAAAAAAA=\",\"range\":{\"min\":\"\",\"max\":\"FF\"}}]"
+        ///当前状态     ?"progress":Undefined/null/"" 表示两种状态都要查询/ "going"/"finish" 表示查询进行中/ 或者已完成 学生端只能查询正在进行或已经结束 going 已发布|finish 已结束  
         /// </param>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [HttpPost("tch-activity")]
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher")]
-        public async Task<IActionResult> TchActivity(JsonElement requert)
+        public async Task<IActionResult> TchActivity(JsonElement request)
         {
             string school = "";
             var (id, _, _, _) = HttpContext.GetAuthTokenInfo();
-            if (requert.TryGetProperty("school", out JsonElement schoolcode))
+            if (request.TryGetProperty("school", out JsonElement schoolcode))
             {
                 if (!schoolcode.ValueKind.Equals(JsonValueKind.Undefined) && !schoolcode.ValueKind.Equals(JsonValueKind.Null) && schoolcode.ValueKind.Equals(JsonValueKind.String))
                 {
@@ -253,7 +253,7 @@ namespace TEAMModelOS.Controllers
             }
             if (string.IsNullOrWhiteSpace(id))
             {
-                if (requert.TryGetProperty("userid", out JsonElement userid))
+                if (request.TryGetProperty("userid", out JsonElement userid))
                 {
                     if (!userid.ValueKind.Equals(JsonValueKind.Undefined) && !userid.ValueKind.Equals(JsonValueKind.Null) && userid.ValueKind.Equals(JsonValueKind.String))
                     {
@@ -262,7 +262,7 @@ namespace TEAMModelOS.Controllers
                 }
             }
             //var stimestamp = DateTimeOffset.UtcNow.AddDays(-30).ToUnixTimeMilliseconds();
-            //if (requert.TryGetProperty("stime", out JsonElement stime))
+            //if (request.TryGetProperty("stime", out JsonElement stime))
             //{
             //    if (!stime.ValueKind.Equals(JsonValueKind.Undefined) && !stime.ValueKind.Equals(JsonValueKind.Null) && stime.TryGetInt64(out long data))
             //    {
@@ -273,7 +273,7 @@ namespace TEAMModelOS.Controllers
             //var etimestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
             //string etimesql = $" and c.startTime <= {etimestamp}   ";
             //var progresssql = "";
-            //if (requert.TryGetProperty("progress", out JsonElement progress))
+            //if (request.TryGetProperty("progress", out JsonElement progress))
             //{
             //    if (!progress.ValueKind.Equals(JsonValueKind.Undefined) && !progress.ValueKind.Equals(JsonValueKind.Null) && progress.ValueKind.Equals(JsonValueKind.String))
             //    {
@@ -282,7 +282,7 @@ namespace TEAMModelOS.Controllers
             //}
             var pksql = "";
             string type = null;
-            if (requert.TryGetProperty("pk", out JsonElement pk))
+            if (request.TryGetProperty("pk", out JsonElement pk))
             {
                 if (!pk.ValueKind.Equals(JsonValueKind.Undefined) && !pk.ValueKind.Equals(JsonValueKind.Null) && pk.ValueKind.Equals(JsonValueKind.String))
                 {
@@ -292,52 +292,52 @@ namespace TEAMModelOS.Controllers
             }
             if (string.IsNullOrEmpty(type)) { return BadRequest("type is required!"); }
             string continuationTokenSchool = null;
-            //默认不指定返回大小
+            //默认不指定返回大小
             int? topcout = null;
-            if (requert.TryGetProperty("count", out JsonElement jcount))
+            if (request.TryGetProperty("count", out JsonElement jcount))
             {
                 if (!jcount.ValueKind.Equals(JsonValueKind.Undefined) && !jcount.ValueKind.Equals(JsonValueKind.Null) && jcount.TryGetInt32(out int data))
                 {
                     topcout = data;
                 }
             }
-            //是否需要进行分页查询,默认不分页
+            //是否需要进行分页查询,默认不分页
             bool iscontinuation = false;
             if (topcout != null && topcout.Value > 0)
             {
                 iscontinuation = true;
             }
-            //如果指定了返回大小
-            if (requert.TryGetProperty("continuationTokenSchool", out JsonElement continuationSchool))
+            //如果指定了返回大小
+            if (request.TryGetProperty("continuationTokenSchool", out JsonElement continuationSchool))
             {
-                //指定了cancellationToken continuationSchool
+                //鎸囧畾浜哻ancellationToken continuationSchool
                 if (!continuationSchool.ValueKind.Equals(JsonValueKind.Null) && continuationSchool.ValueKind.Equals(JsonValueKind.String))
                 {
                     continuationTokenSchool = continuationSchool.GetString();
 
                 }
             }
-            //班级
+            //鐝�骇
             string joinSqlClasses = "";
             string andSqlClasses = "";
 
             string joinSqlStulist = "";
             string andSqlStulist = "";
             List<string> classes = null;
-            if (requert.TryGetProperty("classes", out JsonElement jclasses))
+            if (request.TryGetProperty("classes", out JsonElement jclasses))
             {
                 if (jclasses.ValueKind is JsonValueKind.Array)
                 {
                     classes = jclasses.ToObject<List<string>>();
                     if (classes.IsNotEmpty())
                     {
-                        //行政班
+                        //行政班
                         joinSqlClasses = " join A1 in c.classes ";
                         List<string> sqlListc = new List<string>();
                         classes.ForEach(x => { sqlListc.Add($" '{x}' "); });
                         string sqlc = string.Join(" , ", sqlListc);
                         andSqlClasses = $"    A1 in ({sqlc}) ";
-                        //教学班
+                        //教学班
                         joinSqlStulist = " join A1 in c.stuLists ";
                         List<string> sqlListl = new List<string>();
                         classes.ForEach(x => { sqlListl.Add($" '{x}' "); });
@@ -360,13 +360,13 @@ namespace TEAMModelOS.Controllers
             }
             List<JsonElement> datas = new List<JsonElement>();
             var client = _azureCosmos.GetCosmosClient();
-            //班主任 ,任课教师只需要查询两种校园活动 和班级活动 ,  不查询私人教室创建的活动。  
+            //班主任 ,任课教师只需要查询两种校园活动 和班级活动 ,  不查询私人教室创建的活动。  
             if (!string.IsNullOrWhiteSpace(school) && classes.IsNotEmpty())
             {
                 //string querySchool = $" SELECT distinct  value c   FROM c {joinSqlClasses} {joinSqlSubjects}  where {stimesql}  {etimesql}  {progresssql}  {typesql}  {andSqlSubjects}  {tgSql}";
                 string querySchoolclss = $" SELECT distinct c.owner,c.sStatus, c.id,c.code, c.classes,c.stuLists,c.subjects,c.progress,c.scope,c.startTime,c.school,c.creatorId,c.name,c.pk ,c.endTime,c.source,c.type " +
                     $"  FROM c {joinSqlClasses}   where   {pksql}    {classesSql}  and   (c.status<>404 or IS_DEFINED(c.status) = false )   ";
-                //查询数据归属学校的
+                //查询数据归属学校的
                 await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryStreamIterator(querySchoolclss, continuationToken: continuationTokenSchool, requestOptions: new QueryRequestOptions() { MaxItemCount = topcout, PartitionKey = new PartitionKey($"{type}-{school}") }))
                 {
                     using var json = await JsonDocument.ParseAsync(item.ContentStream);
@@ -376,7 +376,7 @@ namespace TEAMModelOS.Controllers
                         {
                             datas.Add(obj.ToObject<JsonElement>());
                         }
-                        //如果需要分页则跳出
+                        //濡傛灉闇€瑕佸垎椤靛垯璺冲嚭
                         if (iscontinuation)
                         {
                             continuationTokenSchool = item.GetContinuationToken();
@@ -395,7 +395,7 @@ namespace TEAMModelOS.Controllers
                         {
                             datas.Add(obj.ToObject<JsonElement>());
                         }
-                        //如果需要分页则跳出
+                        //濡傛灉闇€瑕佸垎椤靛垯璺冲嚭
                         if (iscontinuation)
                         {
                             continuationTokenSchool = item.GetContinuationToken();
@@ -405,10 +405,10 @@ namespace TEAMModelOS.Controllers
                 }
             }
             string continuationTokenTeacher = null;
-            //如果指定了返回大小
-            if (requert.TryGetProperty("continuationTokenTeacher", out JsonElement continuationTeacher))
+            //如果指定了返回大小
+            if (request.TryGetProperty("continuationTokenTeacher", out JsonElement continuationTeacher))
             {
-                //指定了cancellationToken continuationSchool
+                //鎸囧畾浜哻ancellationToken continuationSchool
                 if (!continuationTeacher.ValueKind.Equals(JsonValueKind.Null) && continuationTeacher.ValueKind.Equals(JsonValueKind.String))
                 {
                     continuationTokenTeacher = continuationTeacher.GetString();
@@ -420,7 +420,7 @@ namespace TEAMModelOS.Controllers
             {
                 string queryTeacherClass = $" SELECT distinct c.owner,c.sStatus, c.id,c.code, c.classes,c.stuLists,c.subjects,c.progress,c.scope,c.startTime,c.school,c.creatorId,c.name,c.pk ,c.endTime ,c.source,c.type" +
                     $" FROM c  {joinSqlClasses}    where    {pksql}     {stuListsSql}  and   (c.status<>404 or IS_DEFINED(c.status) = false )     ";
-                //查询数据归属学校的
+                //查询数据归属学校的
                 await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryStreamIterator
                     (queryTeacherClass, continuationToken: continuationTokenSchool, requestOptions: new QueryRequestOptions() { MaxItemCount = topcout, PartitionKey = new PartitionKey($"{type}-{id}") }))
                 {
@@ -431,7 +431,7 @@ namespace TEAMModelOS.Controllers
                         {
                             datas.Add(obj.ToObject<JsonElement>());
                         }
-                        //如果需要分页则跳出
+                        //濡傛灉闇€瑕佸垎椤靛垯璺冲嚭
                         if (iscontinuation)
                         {
                             continuationTokenTeacher = item.GetContinuationToken();
@@ -442,7 +442,7 @@ namespace TEAMModelOS.Controllers
 
                 string queryTeacherStulist = $" SELECT distinct c.owner,c.sStatus, c.id,c.code, c.classes,c.stuLists,c.subjects,c.progress,c.scope,c.startTime,c.school,c.creatorId,c.name,c.pk ,c.endTime ,c.source,c.type" +
                     $" FROM c  {joinSqlStulist}    where    {pksql}     {classesSql}   and   (c.status<>404 or IS_DEFINED(c.status) = false )     ";
-                //查询数据归属学校的
+                //查询数据归属学校的
                 await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryStreamIterator
                     (queryTeacherStulist, continuationToken: continuationTokenSchool, requestOptions: new QueryRequestOptions() { MaxItemCount = topcout, PartitionKey = new PartitionKey($"{type}-{id}") }))
                 {
@@ -453,7 +453,7 @@ namespace TEAMModelOS.Controllers
                         {
                             datas.Add(obj.ToObject<JsonElement>());
                         }
-                        //如果需要分页则跳出
+                        //濡傛灉闇€瑕佸垎椤靛垯璺冲嚭
                         if (iscontinuation)
                         {
                             continuationTokenTeacher = item.GetContinuationToken();
@@ -467,7 +467,7 @@ namespace TEAMModelOS.Controllers
                 {
                     string queryTeacher = $" SELECT distinct c.owner,c.sStatus, c.id,c.code, c.classes,c.stuLists,c.subjects,c.progress,c.scope,c.startTime,c.school,c.creatorId,c.name,c.pk ,c.endTime ,c.source,c.type" +
                        $" FROM c      where    {pksql} and (c.school='{school}' or c.school=null)  and   (c.status<>404 or IS_DEFINED(c.status) = false )     ";
-                    //查询个人发布的
+                    //查询个人发布的
                     await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryStreamIterator
                         (queryTeacher, continuationToken: continuationTokenSchool, requestOptions: new QueryRequestOptions() { MaxItemCount = topcout, PartitionKey = new PartitionKey($"{type}-{id}") }))
                     {
@@ -478,7 +478,7 @@ namespace TEAMModelOS.Controllers
                             {
                                 datas.Add(obj.ToObject<JsonElement>());
                             }
-                            //如果需要分页则跳出
+                            //濡傛灉闇€瑕佸垎椤靛垯璺冲嚭
                             if (iscontinuation)
                             {
                                 continuationTokenTeacher = item.GetContinuationToken();
@@ -490,7 +490,7 @@ namespace TEAMModelOS.Controllers
                 else {
                     string queryTeacher = $" SELECT distinct c.owner,c.sStatus, c.id,c.code, c.classes,c.stuLists,c.subjects,c.progress,c.scope,c.startTime,c.school,c.creatorId,c.name,c.pk ,c.endTime ,c.source,c.type" +
                        $" FROM c      where    {pksql}  and c.school=null  and   (c.status<>404 or IS_DEFINED(c.status) = false )     ";
-                    //查询个人发布的
+                    //查询个人发布的
                     await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryStreamIterator
                         (queryTeacher, continuationToken: continuationTokenSchool, requestOptions: new QueryRequestOptions() { MaxItemCount = topcout, PartitionKey = new PartitionKey($"{type}-{id}") }))
                     {
@@ -501,7 +501,7 @@ namespace TEAMModelOS.Controllers
                             {
                                 datas.Add(obj.ToObject<JsonElement>());
                             }
-                            //如果需要分页则跳出
+                            //濡傛灉闇€瑕佸垎椤靛垯璺冲嚭
                             if (iscontinuation)
                             {
                                 continuationTokenTeacher = item.GetContinuationToken();

+ 1 - 1
TEAMModelOS/Startup.cs

@@ -170,7 +170,7 @@ namespace TEAMModelOS
             BlobServiceProperties prop = _azureStorage.GetBlobServiceClient().GetProperties();
             prop.DefaultServiceVersion = "2018-03-28";
             _azureStorage.GetBlobServiceClient().SetProperties(prop);
-            //TODO 目前不使用中間件全局攔截Exception,請在API中,明確處理200成功返回值或錯誤碼,Exception一率返回BadRequert 400,並選擇需要返回釘釘群組回報的API
+            //TODO 目前不使用中間件全局攔截Exception,請在API中,明確處理200成功返回值或錯誤碼,Exception一率返回Badrequest 400,並選擇需要返回釘釘群組回報的API
             //app.UseMiddleware<HttpGlobalExceptionInvoke>();
 
             //以下需要按照順序載入中間件  如果应用调用 UseStaticFiles,请将 UseStaticFiles 置于 UseRouting之前。