zhouj1203@hotmail.com 11 miesięcy temu
rodzic
commit
5c9e1c0693

+ 2 - 3
TEAMModelBI/Controllers/BITable/DDStructController.cs

@@ -18,7 +18,6 @@ using Microsoft.Azure.Cosmos;
 using TEAMModelOS.SDK.Models;
 using TEAMModelBI.Controllers.BISchool;
 using TEAMModelOS.SDK.Models.Cosmos.BI;
-using Microsoft.Table;
 using TEAMModelOS.SDK;
 using TEAMModelOS.SDK.Context.BI;
 
@@ -379,7 +378,7 @@ namespace TEAMModelBI.Controllers.BITable
                                                 if (!string.IsNullOrEmpty($"{item.defaultSchool}"))
                                                 {
                                                     var schoolRoles = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(item.id, new PartitionKey($"Teacher-{item.defaultSchool}"));
-                                                    if (schoolRoles.Status == 200)
+                                                    if (schoolRoles.StatusCode == System.Net.HttpStatusCode.OK)
                                                     {
                                                         using var json = await JsonDocument.ParseAsync(schoolRoles.Content);
                                                         if (json.RootElement.TryGetProperty("roles", out JsonElement _roles) && _roles.ValueKind != JsonValueKind.Null)
@@ -511,7 +510,7 @@ namespace TEAMModelBI.Controllers.BITable
                                     if (!string.IsNullOrEmpty($"{item.defaultSchool}"))
                                     {
                                         var schoolRoles = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(item.id, new PartitionKey($"Teacher-{item.defaultSchool}"));
-                                        if (schoolRoles.Status == 200)
+                                        if (schoolRoles.StatusCode == System.Net.HttpStatusCode.OK)
                                         {
                                             using var json = await JsonDocument.ParseAsync(schoolRoles.Content);
                                             if (json.RootElement.TryGetProperty("roles", out JsonElement _roles) && _roles.ValueKind != JsonValueKind.Null)

+ 1 - 1
TEAMModelBI/Controllers/BITable/IES5OAuthController.cs

@@ -122,7 +122,7 @@ namespace TEAMModelBI.Controllers.BITable
                     if (oAuthShow.Type.Equals("art")) 
                     {
                         var isExist = await cosmosClinet.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{oAuthShow.Code}", new PartitionKey("ArtSetting"));
-                        if (isExist.Status != 200)
+                        if (isExist.StatusCode != System.Net.HttpStatusCode.OK)
                         {
                             artSetting = await cosmosClinet.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemAsync<ArtSetting>("default", new PartitionKey("ArtSetting"));
                             artSetting.id = oAuthShow.Code;

+ 0 - 1
TEAMModelBI/Controllers/BITable/OperateLogController.cs

@@ -1,6 +1,5 @@
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
-using Microsoft.Table;
 using Microsoft.Extensions.Options;
 using System;
 using System.Collections.Generic;

+ 2 - 3
TEAMModelBI/Controllers/BITable/TableDingDingInfoController.cs

@@ -19,7 +19,6 @@ using System.Net;
 using TEAMModelOS.SDK.Extension;
 using System.Text;
 using Microsoft.Azure.Cosmos;
-using Microsoft.Table;
 using TEAMModelBI.Filter;
 using TEAMModelBI.Tool.Extension;
 using TEAMModelBI.Models;
@@ -1460,7 +1459,7 @@ namespace TEAMModelBI.Controllers.BITable
 
                     Teacher teacher = new();
                     var respone = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReadItemStreamAsync(coreUser.id, new PartitionKey("Base"));
-                    if (respone.Status == 200)
+                    if (respone.StatusCode == HttpStatusCode.OK)
                     {
                         using var json = await JsonDocument.ParseAsync(respone.Content);
                         teacher = json.ToObject<Teacher>();
@@ -1568,7 +1567,7 @@ namespace TEAMModelBI.Controllers.BITable
                     //    }
                     //}
 
-                    if (respone.Status == 200)
+                    if (respone.StatusCode == HttpStatusCode.OK)
                         await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemAsync<Teacher>(teacher, teacher.id, new PartitionKey("Base"));
                     else
                         await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").CreateItemAsync<Teacher>(teacher, new PartitionKey("Base"));

+ 3 - 4
TEAMModelBI/Controllers/BITest/TestController.cs

@@ -5,7 +5,6 @@ using DingTalk.Api.Response;
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
-using Microsoft.Table;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.Options;
 using System;
@@ -535,7 +534,7 @@ namespace TEAMModelBI.Controllers.BITest
                         catch { schoolAssist.scale = 0; }
 
                         var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(schoolId, new PartitionKey("ProductSum"));
-                        if (response.Status == 200)
+                        if (response.StatusCode == HttpStatusCode.OK)
                         {
                             using var json = await JsonDocument.ParseAsync(response.Content);
                             if (json.RootElement.TryGetProperty("serial", out JsonElement serial) && !serial.ValueKind.Equals(JsonValueKind.Null))
@@ -585,7 +584,7 @@ namespace TEAMModelBI.Controllers.BITest
             foreach (var temp in schoolAssists)
             {
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(temp.id, new PartitionKey("ProductSum"));
-                if (response.Status == 200)
+                if (response.StatusCode == HttpStatusCode.OK)
                 {
                     using var json = await JsonDocument.ParseAsync(response.Content);
                     if (json.RootElement.TryGetProperty("serial", out JsonElement serial) && !serial.ValueKind.Equals(JsonValueKind.Null))
@@ -1089,7 +1088,7 @@ namespace TEAMModelBI.Controllers.BITest
 
                     if (iscontinuation)
                     {
-                        continuationToken = item.GetContinuationToken();
+                        continuationToken = item.ContinuationToken;
                         break;
                     }
                 }

+ 12 - 11
TEAMModelBI/Controllers/BITmid/TmidController.cs

@@ -1,7 +1,7 @@
 using Microsoft.Azure.Cosmos;
 using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Mvc;
-using Microsoft.Table;
+
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.Options;
 using System;
@@ -17,6 +17,7 @@ using TEAMModelOS.SDK.Extension;
 using TEAMModelOS.SDK.Models;
 using TEAMModelOS.SDK.Services;
 using static TEAMModelBI.Models.Extension.GeoRegion;
+using Microsoft.Azure.Documents.Client;
 
 namespace TEAMModelBI.Controllers.BITmid
 {
@@ -132,7 +133,7 @@ namespace TEAMModelBI.Controllers.BITmid
                        .WithParameter("@key", tmids);
                 await foreach (var item in cosmosClientCsv2
                             .GetContainer("Core", "ID2")
-                            .GetItemQueryStreamIteratorSql(query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("base") }))
+                            .GetItemQueryStreamIteratorQuery(query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("base") }))
                 {
                     using var json = await JsonDocument.ParseAsync(item.Content);
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
@@ -169,7 +170,7 @@ namespace TEAMModelBI.Controllers.BITmid
                     .WithParameter("@key", tmids);
                 await foreach (var item in cosmosClientCsv2
                             .GetContainer("Core", "ID2")
-                            .GetItemQueryStreamIteratorSql(query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("base-ex") }))
+                            .GetItemQueryStreamIteratorQuery(query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("base-ex") }))
                 {
                     using var json = await JsonDocument.ParseAsync(item.Content);
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
@@ -405,7 +406,7 @@ namespace TEAMModelBI.Controllers.BITmid
                                         .WithParameter("@key", schoolIds);
                                     await foreach (var itemsc in cosmosClientIes5
                                         .GetContainer(Constant.TEAMModelOS, "School")
-                                        .GetItemQueryStreamIteratorSql(querysc, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+                                        .GetItemQueryStreamIteratorQuery(querysc, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
                                     {
                                         using var jsonsc = await JsonDocument.ParseAsync(itemsc.Content);
                                         if (jsonsc.RootElement.TryGetProperty("_count", out JsonElement countsc) && countsc.GetUInt16() > 0)
@@ -501,7 +502,7 @@ namespace TEAMModelBI.Controllers.BITmid
                                           .WithParameter("@key", tmidDic.Keys.ToList());
                     await foreach (var item in cosmosClientCsv2
                                 .GetContainer("Core", "ID2")
-                                .GetItemQueryStreamIteratorSql(query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("benefits") }))
+                                .GetItemQueryStreamIteratorQuery(query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("benefits") }))
                     {
                         using var json = await JsonDocument.ParseAsync(item.Content);
                         if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
@@ -528,7 +529,7 @@ namespace TEAMModelBI.Controllers.BITmid
                       .WithParameter("@key", tmidDic.Keys.ToList());
                     await foreach (var item in cosmosClientCsv2
                                 .GetContainer("Core", "ID2")
-                                .GetItemQueryStreamIteratorSql(query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("sokrates") }))
+                                .GetItemQueryStreamIteratorQuery(query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("sokrates") }))
                     {
                         using var json = await JsonDocument.ParseAsync(item.Content);
                         if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
@@ -808,7 +809,7 @@ namespace TEAMModelBI.Controllers.BITmid
                             }
                         }
                     }
-                    continuationToken = item.GetContinuationToken();
+                    continuationToken = item.ContinuationToken;
                 }
             }
             while (!string.IsNullOrWhiteSpace(continuationToken));
@@ -821,7 +822,7 @@ namespace TEAMModelBI.Controllers.BITmid
                 .WithParameter("@key", tmids);
                 await foreach (var item in cosmosClientCsv2
                             .GetContainer("Core", "ID2")
-                            .GetItemQueryStreamIteratorSql(querye, continuationToken: continuationToken, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("base-ex"), MaxItemCount = pageSize }))
+                            .GetItemQueryStreamIteratorQuery(querye, continuationToken: continuationToken, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("base-ex"), MaxItemCount = pageSize }))
                 {
                     using var json = await JsonDocument.ParseAsync(item.Content);
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
@@ -844,7 +845,7 @@ namespace TEAMModelBI.Controllers.BITmid
                             }
                         }
                     }
-                    continuationToken = item.GetContinuationToken();
+                    continuationToken = item.ContinuationToken;
                 }
             }
             while (!string.IsNullOrWhiteSpace(continuationToken));
@@ -1114,7 +1115,7 @@ namespace TEAMModelBI.Controllers.BITmid
             {
                 strQueryV += $" AND c.prodCode = '{prodCode}'";
             }
-            await foreach (OrderHisService orderService in cosmosClientCsv2.GetContainer("Habb", "Auth").GetItemQueryIteratorSql<OrderHisService>(strQueryV, null, qryOption))
+            await foreach (OrderHisService orderService in cosmosClientCsv2.GetContainer("Habb", "Auth").GetItemQueryIteratorSql<OrderHisService>(queryText:strQueryV, continuationToken: null, requestOptions: qryOption))
             {
                 Ies5OrderHisService ies5OrderVRow = new Ies5OrderHisService();
                 ies5OrderVRow.prodCode = orderService.prodCode;
@@ -1199,7 +1200,7 @@ namespace TEAMModelBI.Controllers.BITmid
             if (from > 0) strQuery += $" AND c.dateTime >= {from}";
             if (to > 0) strQuery += $" AND c.dateTime <= {to}";
 
-            await foreach (TmidAnalysisCosmos tmidAnalysis in cosmosClientIes5.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIteratorSql<TmidAnalysisCosmos>(strQuery, null, qryOption))
+            await foreach (TmidAnalysisCosmos tmidAnalysis in cosmosClientIes5.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIteratorSql<TmidAnalysisCosmos>(queryText:strQuery, continuationToken:null, requestOptions:qryOption))
             {
                 //特殊修正
                 tmidAnalysis.lTypeNone = ((tmidAnalysis.lTypeNone - tmidAnalysis.lessonLeng0) < 0) ? 0 : tmidAnalysis.lTypeNone - tmidAnalysis.lessonLeng0; //無學習型態數值須扣除未上課

+ 3 - 3
TEAMModelBI/Controllers/Census/ActivitySticsController.cs

@@ -686,7 +686,7 @@ namespace TEAMModelBI.Controllers.Census
                 {
                     School school = new();
                     var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(itemId, new PartitionKey("Base"));
-                    if (response.Status == 200)
+                    if (response.StatusCode == System.Net.HttpStatusCode.OK)
                     {
                         using var json = await JsonDocument.ParseAsync(response.Content);
                         school = json.ToObject<School>();
@@ -750,7 +750,7 @@ namespace TEAMModelBI.Controllers.Census
             {
                 School school = new();
                 var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(itemId, new PartitionKey("Base"));
-                if (response.Status == 200)
+                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                 {
                     using var json = await JsonDocument.ParseAsync(response.Content);
                     school = json.ToObject<School>();
@@ -795,7 +795,7 @@ namespace TEAMModelBI.Controllers.Census
                 {
                     School school = new();
                     var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(schoolId, new PartitionKey("Base"));
-                    if (response.Status == 200)
+                    if (response.StatusCode == System.Net.HttpStatusCode.OK)
                     {
                         using var json = await JsonDocument.ParseAsync(response.Content);
                         school = json.ToObject<School>();

+ 8 - 8
TEAMModelBI/Controllers/Census/ItemSticsController.cs

@@ -87,7 +87,7 @@ namespace TEAMModelBI.Controllers.Census
             List<object> items = new();
             if (scope.ToString().Equals("private"))
             {
-                await foreach (var item in cosmosClinet.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryStreamIteratorSql(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Item-{code}") }))
+                await foreach (var item in cosmosClinet.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryStreamIteratorQuery(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Item-{code}") }))
                 {
                     using var json = await JsonDocument.ParseAsync(item.Content);
 
@@ -102,7 +102,7 @@ namespace TEAMModelBI.Controllers.Census
             }
             else if (scope.ToString().Equals("school"))
             {
-                await foreach (var item in cosmosClinet.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIteratorSql(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Item-{code}") }))
+                await foreach (var item in cosmosClinet.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIteratorQuery(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Item-{code}") }))
                 {
                     using var json = await JsonDocument.ParseAsync(item.Content);
 
@@ -117,7 +117,7 @@ namespace TEAMModelBI.Controllers.Census
             }
             else
             {
-                await foreach (var item in cosmosClinet.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryStreamIteratorSql(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Item-{code}") }))
+                await foreach (var item in cosmosClinet.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryStreamIteratorQuery(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Item-{code}") }))
                 {
                     using var json = await JsonDocument.ParseAsync(item.Content);
 
@@ -130,7 +130,7 @@ namespace TEAMModelBI.Controllers.Census
                     }
                 }
 
-                await foreach (var item in cosmosClinet.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIteratorSql(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Item-{code}") }))
+                await foreach (var item in cosmosClinet.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIteratorQuery(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Item-{code}") }))
                 {
                     using var json = await JsonDocument.ParseAsync(item.Content);
 
@@ -172,7 +172,7 @@ namespace TEAMModelBI.Controllers.Census
                 {
                     School school = new();
                     var rsponse = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(scid, new PartitionKey("Base"));
-                    if (rsponse.Status == 200)
+                    if (rsponse.StatusCode == System.Net.HttpStatusCode.OK)
                     {
                         using var json = await JsonDocument.ParseAsync(rsponse.Content);
                         school = json.ToObject<School>();
@@ -225,7 +225,7 @@ namespace TEAMModelBI.Controllers.Census
                 {
                     School school = new();
                     var rsponse = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(schoolId, new PartitionKey("Base"));
-                    if (rsponse.Status == 200) 
+                    if (rsponse.StatusCode == System.Net.HttpStatusCode.OK) 
                     {
                         using var json = await JsonDocument.ParseAsync(rsponse.Content);
                         school = json.ToObject<School>();
@@ -294,7 +294,7 @@ namespace TEAMModelBI.Controllers.Census
                     School school = new();
 
                     var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(schoolId, new PartitionKey("Base"));
-                    if (response.Status == 200) 
+                    if (response.StatusCode == System.Net.HttpStatusCode.OK) 
                     {
                         using var json = await JsonDocument.ParseAsync(response.Content);
                         school = json.ToObject<School>();
@@ -361,7 +361,7 @@ namespace TEAMModelBI.Controllers.Census
                 {
                     School school = new();
                     var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(schoolId, new PartitionKey("Base"));
-                    if (response.Status == 200) 
+                    if (response.StatusCode == System.Net.HttpStatusCode.OK) 
                     {
                         using var json = await JsonDocument.ParseAsync(response.Content);
                         school = json.ToObject<School>();

+ 10 - 10
TEAMModelBI/Controllers/Census/LessonSticsController.cs

@@ -289,7 +289,7 @@ namespace TEAMModelBI.Controllers.Census
                 {
                     School school = new();
                     var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(itemId, new PartitionKey("Base"));
-                    if (response.Status == 200)
+                    if (response.StatusCode == System.Net.HttpStatusCode.OK)
                     {
                         using var json = await JsonDocument.ParseAsync(response.Content);
                         school = json.ToObject<School>();
@@ -354,7 +354,7 @@ namespace TEAMModelBI.Controllers.Census
                 {
                     School school = new();
                     var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(itemId, new PartitionKey("Base"));
-                    if (response.Status == 200)
+                    if (response.StatusCode == System.Net.HttpStatusCode.OK)
                     {
                         using var json = await JsonDocument.ParseAsync(response.Content);
                         school = json.ToObject<School>();
@@ -405,7 +405,7 @@ namespace TEAMModelBI.Controllers.Census
                 {
                     School school = new();
                     var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(schoolId, new PartitionKey("Base"));
-                    if (response.Status == 200)
+                    if (response.StatusCode == System.Net.HttpStatusCode.OK)
                     {
                         using var json = await JsonDocument.ParseAsync(response.Content);
                         school = json.ToObject<School>();
@@ -459,7 +459,7 @@ namespace TEAMModelBI.Controllers.Census
             {
                 School school = new();
                 var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(scid, new PartitionKey("Base"));
-                if (response.Status == 200)
+                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                 {
                     using var json = await JsonDocument.ParseAsync(response.Content);
                     school = json.ToObject<School>();
@@ -760,7 +760,7 @@ namespace TEAMModelBI.Controllers.Census
             List<double> yHours = new(daHours);
 
             var openRes = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{year}", new PartitionKey("LessonYear"));
-            if (openRes.Status == 200)
+            if (openRes.StatusCode == System.Net.HttpStatusCode.OK)
             {
                 using var json = await JsonDocument.ParseAsync(openRes.Content);
                 LessonStats lessonYear = json.ToObject<LessonStats>();
@@ -794,7 +794,7 @@ namespace TEAMModelBI.Controllers.Census
             }
 
             var lessRes = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{hourId}", new PartitionKey("LessonHour"));
-            if (lessRes.Status == 200)
+            if (lessRes.StatusCode == System.Net.HttpStatusCode.OK)
             {
                 using var json = await JsonDocument.ParseAsync(lessRes.Content);
                 LessonStats lessonHour = json.ToObject<LessonStats>();
@@ -831,7 +831,7 @@ namespace TEAMModelBI.Controllers.Census
             if (!string.IsNullOrEmpty(schoolId))
             {
                 var openResSc = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{year}", new PartitionKey($"LessonYear-{schoolId}"));
-                if (openResSc.Status == 200)
+                if (openResSc.StatusCode == System.Net.HttpStatusCode.OK)
                 {
                     using var jsonSc = await JsonDocument.ParseAsync(openResSc.Content);
                     LessonStats lessonYearSc = jsonSc.ToObject<LessonStats>();
@@ -863,7 +863,7 @@ namespace TEAMModelBI.Controllers.Census
                 }
 
                 var lessResSc = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{hourId}", new PartitionKey($"LessonHour-{schoolId}"));
-                if (lessResSc.Status == 200)
+                if (lessResSc.StatusCode == System.Net.HttpStatusCode.OK)
                 {
                     using var jsonSc = await JsonDocument.ParseAsync(lessResSc.Content);
                     LessonStats lessonHourSc = jsonSc.ToObject<LessonStats>();
@@ -930,7 +930,7 @@ namespace TEAMModelBI.Controllers.Census
             foreach (var itemY in lessYears)
             {
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(itemY.id, new PartitionKey($"{itemY.code}"));
-                if (response.Status == 200)
+                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                 {
                     using var json = await JsonDocument.ParseAsync(response.Content);
                     LessonStats lessonYear = json.ToObject<LessonStats>();
@@ -946,7 +946,7 @@ namespace TEAMModelBI.Controllers.Census
             foreach (var itemH in lessHours)
             {
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(itemH.id, new PartitionKey($"{itemH.code}"));
-                if (response.Status == 200)
+                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                 {
                     using var json = await JsonDocument.ParseAsync(response.Content);
                     LessonStats lessonHour = json.ToObject<LessonStats>();

+ 5 - 5
TEAMModelBI/Controllers/Census/PaperController.cs

@@ -150,7 +150,7 @@ namespace TEAMModelBI.Controllers.Census
                         paper.code = $"Paper-{itemSc.newSc}";
 
                         var resState = await cosmosClinet.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(paper.id, new PartitionKey(paper.code));
-                        if (resState.Status == 200)
+                        if (resState.StatusCode == System.Net.HttpStatusCode.OK)
                             paper.id = Guid.NewGuid().ToString();
 
                         msg.Append($"将学校[{cItem.oldSc}]中的[{cItem.oldId}]试卷复制到新学校试卷新id:{paper.id}");
@@ -291,7 +291,7 @@ namespace TEAMModelBI.Controllers.Census
                     };
                     School school = new();
                     var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(schoolId, new PartitionKey("Base"));
-                    if (response.Status == 200)
+                    if (response.StatusCode == System.Net.HttpStatusCode.OK)
                     {
                         using var json = await JsonDocument.ParseAsync(response.Content);
                         school = json.ToObject<School>();
@@ -363,7 +363,7 @@ namespace TEAMModelBI.Controllers.Census
             {
                 School school = new();
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(schoolId, new PartitionKey("Base"));
-                if (response.Status == 200) 
+                if (response.StatusCode == System.Net.HttpStatusCode.OK) 
                 {
                     using var json = await JsonDocument.ParseAsync(response.Content);
                     school = json.ToObject<School>();
@@ -418,7 +418,7 @@ namespace TEAMModelBI.Controllers.Census
                 {
                     School school = new();
                     var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(schoolId, new PartitionKey("Base"));
-                    if (response.Status == 200) 
+                    if (response.StatusCode == System.Net.HttpStatusCode.OK) 
                     {
                         using var json = await JsonDocument.ParseAsync(response.Content);
                         school = json.ToObject<School>();
@@ -469,7 +469,7 @@ namespace TEAMModelBI.Controllers.Census
                     School school = new();
 
                     var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(schoolId, new PartitionKey("Base"));
-                    if(response.Status == 200) 
+                    if(response.StatusCode == System.Net.HttpStatusCode.OK) 
                     {
                         using var json = await JsonDocument.ParseAsync(response.Content);
                         school = json.ToObject<School>();

+ 4 - 4
TEAMModelBI/Controllers/Census/ProductStatisController.cs

@@ -195,7 +195,7 @@ namespace TEAMModelBI.Controllers.Census
 
             //取产品的数量
             var response = await clientContainer.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(schoolCode.ToString(), new PartitionKey($"ProductSum"));
-            if (response.Status == 200)
+            if (response.StatusCode == System.Net.HttpStatusCode.OK)
             {
                 using var json = await JsonDocument.ParseAsync(response.Content);
                 productSum = json.ToObject<SchoolProductSum>();
@@ -277,7 +277,7 @@ namespace TEAMModelBI.Controllers.Census
                 School school = new();
 
                 var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(scid, new PartitionKey("Base"));
-                if (response.Status == 200)
+                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                 {
                     using var json = await JsonDocument.ParseAsync(response.Content);
                     school = json.ToObject<School>();
@@ -407,7 +407,7 @@ namespace TEAMModelBI.Controllers.Census
                     List<SchoolProductSumData> Services = new();
                     School school = new();
                     var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(scId, new PartitionKey("Base"));
-                    if (response.Status == 200)
+                    if (response.StatusCode == System.Net.HttpStatusCode.OK)
                     {
                         using var json = await JsonDocument.ParseAsync(response.Content);
                         school = json.ToObject<School>();
@@ -526,7 +526,7 @@ namespace TEAMModelBI.Controllers.Census
                 List<SchoolProductSumData> Services = new();
                 School school = new();
                 var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(scId, new PartitionKey("Base"));
-                if (response.Status == 200)
+                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                 {
                     using var json = await JsonDocument.ParseAsync(response.Content);
                     school = json.ToObject<School>();

+ 6 - 6
TEAMModelBI/Controllers/Census/SchoolController.cs

@@ -199,7 +199,7 @@ namespace TEAMModelBI.Controllers.Census
             {
                 School school = new();
                 var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(itemId, new PartitionKey("Base"));
-                if (response.Status == 200)
+                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                 {
                     using var json = await JsonDocument.ParseAsync(response.Content);
                     school = json.ToObject<School>();
@@ -334,7 +334,7 @@ namespace TEAMModelBI.Controllers.Census
             {
                 var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{schoolId}", new PartitionKey($"Base"));
                 School sc = new();
-                if (response.Status == 200)
+                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                 {
                     using var json = await JsonDocument.ParseAsync(response.Content);
                     sc = json.ToObject<School>();
@@ -509,7 +509,7 @@ namespace TEAMModelBI.Controllers.Census
             ScStats scStats = new();
 
             var respSc = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{scId}", new PartitionKey($"Base"));
-            if (respSc.Status == 200)
+            if (respSc.StatusCode == System.Net.HttpStatusCode.OK)
             {
                 using var fileJson = await JsonDocument.ParseAsync(respSc.Content);
                 school = fileJson.ToObject<School>();
@@ -522,7 +522,7 @@ namespace TEAMModelBI.Controllers.Census
             StatsInfo statsInfo = null;
             List<LastYearLessAndAct> lastYear = new();
             var scDataStats = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").ReadItemStreamAsync($"{DateTimeOffset.UtcNow.Year}-{scId}", new PartitionKey("Statistics"));
-            if (scDataStats.Status == 200)
+            if (scDataStats.StatusCode == System.Net.HttpStatusCode.OK)
             {
                 using var fileJson = await JsonDocument.ParseAsync(scDataStats.Content);
                 statsInfo = fileJson.ToObject<StatsInfo>();
@@ -635,7 +635,7 @@ namespace TEAMModelBI.Controllers.Census
             ScStats scStats = new();
 
             var respSc = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{scId}", new PartitionKey($"Base"));
-            if (respSc.Status == 200)
+            if (respSc.StatusCode == System.Net.HttpStatusCode.OK)
             {
                 using var fileJson = await JsonDocument.ParseAsync(respSc.Content);
                 school = fileJson.ToObject<School>();
@@ -648,7 +648,7 @@ namespace TEAMModelBI.Controllers.Census
                 StatsInfo statsInfo = null;
                 List<LastYearLessAndAct> lastYear = new();
                 var scDataStats = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").ReadItemStreamAsync($"{DateTimeOffset.UtcNow.Year}-{scId}", new PartitionKey("Statistics"));
-                if (scDataStats.Status == 200)
+                if (scDataStats.StatusCode == System.Net.HttpStatusCode.OK)
                 {
                     using var fileJson = await JsonDocument.ParseAsync(scDataStats.Content);
                     statsInfo = fileJson.ToObject<StatsInfo>();

+ 4 - 4
TEAMModelBI/Controllers/RepairApi/SchoolRepController.cs

@@ -418,7 +418,7 @@ namespace TEAMModelBI.Controllers.RepairApi
                 {
                     BIRelation bIRelation = null;
                     var resRel = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(itemId, new PartitionKey("BIRel"));
-                    if (resRel.Status == 200)
+                    if (resRel.StatusCode == System.Net.HttpStatusCode.OK)
                     {
                         continue;
                         //using var fileJson = await JsonDocument.ParseAsync(resRel.Content);
@@ -455,7 +455,7 @@ namespace TEAMModelBI.Controllers.RepairApi
                         };
 
                         var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(itemId, new PartitionKey("ProductSum"));
-                        if (response.Status == 200)
+                        if (response.StatusCode == System.Net.HttpStatusCode.OK)
                         {
                             using var json = await JsonDocument.ParseAsync(response.Content);
                             if (json.RootElement.TryGetProperty("serial", out JsonElement serial) && !serial.ValueKind.Equals(JsonValueKind.Null))
@@ -527,7 +527,7 @@ namespace TEAMModelBI.Controllers.RepairApi
                     id = sc;
                     StatsInfo statsInfo = new();
                     var scDataStats = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").ReadItemStreamAsync($"{year}-{sc}", new PartitionKey("Statistics"));
-                    if (scDataStats.Status == 200)
+                    if (scDataStats.StatusCode == System.Net.HttpStatusCode.OK)
                     {
                         using var fileJson = await JsonDocument.ParseAsync(scDataStats.Content);
                         statsInfo = fileJson.ToObject<StatsInfo>();
@@ -540,7 +540,7 @@ namespace TEAMModelBI.Controllers.RepairApi
                     statsInfo = await SchoolStatsWay.GetSingleSc(cosmosClient, redisClinet, sc, year);
                     statsInfo.witRoom = ((int)await SchoolStatsWay.GetShoolWisdomRoomCount(_azureCosmos, _azureRedis, _configuration, _httpClient, _dingDing, statsInfo.schoolId));
 
-                    if (scDataStats.Status == 200)
+                    if (scDataStats.StatusCode == System.Net.HttpStatusCode.OK)
                         taskStss.Add(cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").ReplaceItemAsync<StatsInfo>(statsInfo, $"{year}-{sc}", new PartitionKey("Statistics")));
                     else
                         taskStss.Add(cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").CreateItemAsync<StatsInfo>(statsInfo, new PartitionKey("Statistics")));

+ 1 - 1
TEAMModelBI/Controllers/RepairApi/TeacherREPController.cs

@@ -90,7 +90,7 @@ namespace TEAMModelBI.Controllers.RepairApi
                     foreach (var teacher in tch.schools)
                     {
                         var resSc = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{teacher.schoolId}", new PartitionKey("Base"));
-                        if (resSc.Status == 200)
+                        if (resSc.StatusCode == System.Net.HttpStatusCode.OK)
                         {
                             using var areaBase = await JsonDocument.ParseAsync(resSc.Content);
                             School school = areaBase.ToObject<School>();

+ 0 - 1
TEAMModelBI/Filter/RequestAuditFilter.cs

@@ -12,7 +12,6 @@ using Azure.Core;
 using TEAMModelOS.SDK.DI;
 using Microsoft.Extensions.Primitives;
 using System.Net.Http;
-using System.ServiceModel.Channels;
 using System.Net;
 using System.Net.Http.Json;
 using Microsoft.Extensions.Options;