zhouj1203@hotmail.com 11 months ago
parent
commit
186c4eda6b

+ 12 - 12
TEAMModelBI/Controllers/BINormal/BatchAreaController.cs

@@ -143,7 +143,7 @@ namespace TEAMModelBI.Controllers.BINormal
 
                         if (iscontinuation)
                         {
-                            continuationToken = itemArea.GetContinuationToken();
+                            continuationToken = itemArea.ContinuationToken;
                             break;
                         }
                     } 
@@ -766,7 +766,7 @@ namespace TEAMModelBI.Controllers.BINormal
                 var table = tableClient.GetTableReference("IESLogin");
 
                 var responseSet = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{_oldId}", new PartitionKey("AreaSetting"));
-                if (responseSet.Status == 200)
+                if (responseSet.StatusCode == HttpStatusCode.OK)
                 {
                     using var fileJson = await JsonDocument.ParseAsync(responseSet.Content);
                     AreaSetting delSet = fileJson.ToObject<AreaSetting>();
@@ -897,7 +897,7 @@ namespace TEAMModelBI.Controllers.BINormal
                 if (saveFile.id != null)
                 {
                     var respFile = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync(saveFile.id, new PartitionKey("StandardFile"));
-                    if (respFile.Status == 200)
+                    if (respFile.StatusCode == HttpStatusCode.OK)
                     {
                         using var json = await JsonDocument.ParseAsync(respFile.Content);
                         tempFile = json.ToObject<StandardFile>();
@@ -924,7 +924,7 @@ namespace TEAMModelBI.Controllers.BINormal
                 if (saveSetting.id != null)
                 {
                     var respSetting = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync(saveSetting.id, new PartitionKey("AreaSetting"));
-                    if (respSetting.Status == 200)
+                    if (respSetting.StatusCode == HttpStatusCode.OK)
                     {
                         using var json = await JsonDocument.ParseAsync(respSetting.Content);
                         tempSetting = json.ToObject<AreaSetting>();
@@ -1003,7 +1003,7 @@ namespace TEAMModelBI.Controllers.BINormal
             //}
 
             var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{areaId}", new PartitionKey("Base-Area"));
-            if (response.Status == 200)
+            if (response.StatusCode == HttpStatusCode.OK)
             {
                 using var json = await JsonDocument.ParseAsync(response.Content);
                 Area area = json.ToObject<Area>();
@@ -1064,7 +1064,7 @@ namespace TEAMModelBI.Controllers.BINormal
                     //区域政策文件
                     StandardFile delFile = new();
                     var responseFile = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync(area.id, new PartitionKey("StandardFile"));
-                    if(responseFile.Status == 200)
+                    if(responseFile.StatusCode == HttpStatusCode.OK)
                     {
                         using var fileJson = await JsonDocument.ParseAsync(responseFile.Content);
                         delFile = fileJson.ToObject<StandardFile>();
@@ -1074,7 +1074,7 @@ namespace TEAMModelBI.Controllers.BINormal
                     //区域设置
                     AreaSetting delSet = new();
                     var responseSet = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync(area.id, new PartitionKey("AreaSetting"));
-                    if (responseSet.Status == 200)
+                    if (responseSet.StatusCode == HttpStatusCode.OK)
                     {
                         using var fileJson = await JsonDocument.ParseAsync(responseSet.Content);
                         delSet = fileJson.ToObject<AreaSetting>();
@@ -1148,7 +1148,7 @@ namespace TEAMModelBI.Controllers.BINormal
                 if (area != null)
                 {
                     var responseSet = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{_oldId}", new PartitionKey("AreaSetting"));
-                    if (responseSet.Status == 200)
+                    if (responseSet.StatusCode == HttpStatusCode.OK)
                     {
                         using var fileJson = await JsonDocument.ParseAsync(responseSet.Content);
                         AreaSetting delSet = fileJson.ToObject<AreaSetting>();
@@ -1204,7 +1204,7 @@ namespace TEAMModelBI.Controllers.BINormal
                                 //await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync(item, new PartitionKey($"Ability-{_oldStandard}"));
 
                                 var respond = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync(item.id, new PartitionKey(item.code));
-                                if (respond.Status != 200)
+                                if (respond.StatusCode != HttpStatusCode.OK)
                                     abilities.Add(cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync(item, new PartitionKey($"Ability-{area.standard}")));
                                 else
                                     repeatAbilityId.Add(item.id);
@@ -1266,7 +1266,7 @@ namespace TEAMModelBI.Controllers.BINormal
                                 atask.codeval = $"{area.standard}";
 
                                 var respond = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync(atask.id, new PartitionKey(atask.code));
-                                if (respond.Status != 200)
+                                if (respond.StatusCode != HttpStatusCode.OK)
                                     ////添加区能力标准点中的节点 
                                     //abilityTasks.Add(cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync(atask, new PartitionKey($"AbilityTask-{_oldStandard}")));
                                     await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync(atask, new PartitionKey($"AbilityTask-{area.standard}"));
@@ -1322,7 +1322,7 @@ namespace TEAMModelBI.Controllers.BINormal
                     if (saveFile.id != null)
                     {
                         var respFile = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync(saveFile.id, new PartitionKey("StandardFile"));
-                        if (respFile.Status == 200)
+                        if (respFile.StatusCode == HttpStatusCode.OK)
                         {
                             using var json = await JsonDocument.ParseAsync(respFile.Content);
                             tempFile = json.ToObject<StandardFile>();
@@ -1357,7 +1357,7 @@ namespace TEAMModelBI.Controllers.BINormal
                     if (saveSetting.id != null)
                     {
                         var respSetting = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync(saveSetting.id, new PartitionKey("AreaSetting"));
-                        if (respSetting.Status == 200)
+                        if (respSetting.StatusCode == HttpStatusCode.OK)
                         {
                             using var json = await JsonDocument.ParseAsync(respSetting.Content);
                             tempSetting = json.ToObject<AreaSetting>();

+ 4 - 4
TEAMModelBI/Controllers/BINormal/BusinessConfigController.cs

@@ -103,7 +103,7 @@ namespace TEAMModelBI.Controllers.BINormal
             else
             {
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "Normal").ReadItemStreamAsync(bizConfig.id, new PartitionKey("BizConfig"));
-                if (response.Status == 200)
+                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                 {
                     using var json = await JsonDocument.ParseAsync(response.Content);
                     BizConfig tempBizConfig = json.ToObject<BizConfig>();
@@ -229,7 +229,7 @@ namespace TEAMModelBI.Controllers.BINormal
             BizConfig bizConfig = new();
 
             var response = await cosmosClient.GetContainer("TEAMModelOS", "Normal").ReadItemStreamAsync($"{id}", new PartitionKey("BizConfig"));
-            if (response.Status == 200)
+            if (response.StatusCode == System.Net.HttpStatusCode.OK)
             {
                 using var json = await JsonDocument.ParseAsync(response.Content);
                 bizConfig = json.ToObject<BizConfig>();
@@ -284,7 +284,7 @@ namespace TEAMModelBI.Controllers.BINormal
             List<BizSchool> noBizSc = new();
             BizConfig bizConfig = new();
             var response = await cosmosClient.GetContainer("TEAMModelOS", "Normal").ReadItemStreamAsync($"{id}", new PartitionKey("BizConfig"));
-            if (response.Status == RespondCode.Ok)
+            if (response.StatusCode == System.Net.HttpStatusCode.OK)
             {
                 using var json = await JsonDocument.ParseAsync(response.Content);
                 bizConfig = json.ToObject<BizConfig>();
@@ -353,7 +353,7 @@ namespace TEAMModelBI.Controllers.BINormal
             if (!string.IsNullOrEmpty($"id"))
             {
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "Normal").ReadItemStreamAsync($"{id}", new PartitionKey("BizConfig"));
-                if (response.Status == RespondCode.Ok)
+                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                 {
                     using var json = await JsonDocument.ParseAsync(response.Content);
                     bizConfig = json.ToObject<BizConfig>();

+ 4 - 4
TEAMModelBI/Controllers/BINormal/BusinessUsersController.cs

@@ -112,7 +112,7 @@ namespace TEAMModelBI.Controllers.BINormal
             else 
             {
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "Normal").ReadItemStreamAsync(bizUsers.id, new PartitionKey("BizUsers"));
-                if (response.Status == RespondCode.Ok)
+                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                 {
                     using var json = await JsonDocument.ParseAsync(response.Content);
                     BizUsers tempbizUsers = json.ToObject<BizUsers>();
@@ -193,7 +193,7 @@ namespace TEAMModelBI.Controllers.BINormal
             StringBuilder strMsg = new($"{tmdName}[{tmdId}]操作:");
             string salt = Utils.CreatSaltString(8);
             var response = await cosmosClient.GetContainer("TEAMModelOS", "Normal").ReadItemStreamAsync($"{id}", new PartitionKey("BizUsers"));
-            if (response.Status == 200)
+            if (response.StatusCode == System.Net.HttpStatusCode.OK)
             {
                 using var json = await JsonDocument.ParseAsync(response.Content);
                 bizUsers = json.ToObject<BizUsers>();
@@ -279,7 +279,7 @@ namespace TEAMModelBI.Controllers.BINormal
             else { return Ok(new { state = RespondCode.ParamsError, msg = "类型错误" }); }
 
             var response = await cosmosClient.GetContainer("TEAMModelOS", "Normal").ReadItemStreamAsync($"{id}", new PartitionKey("BizUsers"));
-            if (response.Status == RespondCode.Ok)
+            if (response.StatusCode == System.Net.HttpStatusCode.OK)
             {
                 using var json = await JsonDocument.ParseAsync(response.Content);
                 bizUsers = json.ToObject<BizUsers>();
@@ -310,7 +310,7 @@ namespace TEAMModelBI.Controllers.BINormal
                 }
             }
 
-            if (response.Status == RespondCode.Ok) 
+            if (response.StatusCode == System.Net.HttpStatusCode.OK) 
             {
                 bizUsers = await cosmosClient.GetContainer("TEAMModelOS", "Normal").ReplaceItemAsync<BizUsers>(bizUsers, bizUsers.id, new PartitionKey("BizUsers"));
             }

+ 2 - 2
TEAMModelBI/Controllers/BIProductAnalysis/ProductAnalysisController.cs

@@ -23,8 +23,8 @@ using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.Extension;
 using TEAMModelOS.SDK.Models;
 using TEAMModelOS.SDK.Models.Service.BI;
-using PartitionKey = PartitionKey;
-using QueryRequestOptions = QueryRequestOptions;
+using PartitionKey = Microsoft.Azure.Cosmos.PartitionKey;
+using QueryRequestOptions = Microsoft.Azure.Cosmos.QueryRequestOptions;
 
 namespace TEAMModelBI.Controllers.ProductAnalysis
 {

+ 22 - 22
TEAMModelBI/Controllers/BISchool/BatchSchoolController.cs

@@ -112,7 +112,7 @@ namespace TEAMModelBI.Controllers.BISchool
                 {
                     createSchoolInfo = await SchoolCode.GenerateSchoolCode(createSchoolInfo, _dingDing, _environment);
                     var schoolStatu = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{createSchoolInfo.id}", new PartitionKey($"Base"));
-                    if (schoolStatu.Status != 200) tempStaus = false;
+                    if (schoolStatu.StatusCode != HttpStatusCode.OK) tempStaus = false;
                     else createSchoolInfo.createCount = createSchoolInfo.createCount >= 3 ? createSchoolInfo.createCount = 3 : createSchoolInfo.createCount += 1;
                 } while (tempStaus);
                 createScInfo.Add(createSchoolInfo);
@@ -161,7 +161,7 @@ namespace TEAMModelBI.Controllers.BISchool
                         Area area = null;
                         //查询区是否存在
                         var respAreaId = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{bischool.areaId}", new PartitionKey("Base-Area"));
-                        if (respAreaId.Status == 200)
+                        if (respAreaId.StatusCode == HttpStatusCode.OK)
                         {
                             using var areaBase = await JsonDocument.ParseAsync(respAreaId.Content);
                             area = areaBase.ToObject<Area>();
@@ -183,7 +183,7 @@ namespace TEAMModelBI.Controllers.BISchool
                         {
                             createSchoolInfo = await SchoolCode.GenerateSchoolCode(createSchoolInfo, _dingDing, _environment);
                             var schoolStatu = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{createSchoolInfo.id}", new PartitionKey($"Base"));
-                            if (schoolStatu.Status != 200) tempStaus = false;
+                            if (schoolStatu.StatusCode != HttpStatusCode.OK) tempStaus = false;
                             else createSchoolInfo.createCount = createSchoolInfo.createCount >= 3 ? createSchoolInfo.createCount = 3 : createSchoolInfo.createCount += 1;
                         } while (tempStaus);
 
@@ -244,7 +244,7 @@ namespace TEAMModelBI.Controllers.BISchool
                             {
                                 Teacher teacher = new();
                                 var resTeache = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReadItemStreamAsync($"{tmdIndo.id}", new PartitionKey("Base"));
-                                if (resTeache.Status == 200)
+                                if (resTeache.StatusCode == HttpStatusCode.OK)
                                 {
                                     using var tchJson = await JsonDocument.ParseAsync(resTeache.Content);
                                     teacher = tchJson.ToObject<Teacher>();
@@ -631,7 +631,7 @@ namespace TEAMModelBI.Controllers.BISchool
                             }
                             if (iscontinuation)
                             {
-                                continuationToken = itemSchool.GetContinuationToken();
+                                continuationToken = itemSchool.ContinuationToken;
                                 break;
                             }
                         }
@@ -708,7 +708,7 @@ namespace TEAMModelBI.Controllers.BISchool
                 foreach (var item in schoolAssists)
                 {
                     var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(item.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))
@@ -859,7 +859,7 @@ namespace TEAMModelBI.Controllers.BISchool
                 foreach (var item in schoolAssists)
                 {
                     var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(item.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))
@@ -896,7 +896,7 @@ namespace TEAMModelBI.Controllers.BISchool
             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))
@@ -1105,7 +1105,7 @@ namespace TEAMModelBI.Controllers.BISchool
                         //計算學校版本
                         List<SchoolProductSumData> services = new List<SchoolProductSumData>();
                         ResponseMessage productSumResponse = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{_schoolId}", new PartitionKey("ProductSum"));
-                        if (productSumResponse.Status == 200)
+                        if (productSumResponse.StatusCode == HttpStatusCode.OK)
                         {
                             var doc = JsonDocument.Parse(productSumResponse.Content);
                             if (doc.RootElement.TryGetProperty("service", out JsonElement service))
@@ -1145,7 +1145,7 @@ namespace TEAMModelBI.Controllers.BISchool
                         //学校信息中间件更新
                         BIRelation biRel = new();
                         var respRel = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(tempShool.id, new PartitionKey("BIRel"));
-                        if (respRel.Status == 200)
+                        if (respRel.StatusCode == HttpStatusCode.OK)
                         {
                             using var fileJson = await JsonDocument.ParseAsync(respRel.Content);
                             biRel = fileJson.ToObject<BIRelation>();
@@ -1188,7 +1188,7 @@ namespace TEAMModelBI.Controllers.BISchool
                             biRel.assists = idInfos;
                         }
 
-                        if (respRel.Status == 200)
+                        if (respRel.StatusCode == HttpStatusCode.OK)
                         {
                             await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReplaceItemAsync<BIRelation>(biRel, biRel.id, new PartitionKey("BIRel"));
                         }
@@ -1399,14 +1399,14 @@ namespace TEAMModelBI.Controllers.BISchool
                 {
                     //查询区是否存在
                     var respAreaId = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{item}", new PartitionKey("Base-Area"));
-                    if (respAreaId.Status != 200)
+                    if (respAreaId.StatusCode != HttpStatusCode.OK)
                     {
                         noAreaIds.Add(item);
                     }
 
                     //查询去是否同步省平台
                     var responseSet = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{item}", new PartitionKey("AreaSetting"));
-                    if (responseSet.Status == 200)
+                    if (responseSet.StatusCode == HttpStatusCode.OK)
                     {
                         using var fileJson = await JsonDocument.ParseAsync(responseSet.Content);
                         AreaSetting delSet = fileJson.ToObject<AreaSetting>();
@@ -1425,7 +1425,7 @@ namespace TEAMModelBI.Controllers.BISchool
                 {
                     createSchoolInfo = await SchoolCode.GenerateSchoolCode(createSchoolInfo, _dingDing, _environment);
                     var schoolStatu = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{createSchoolInfo.id}", new PartitionKey($"Base"));
-                    if (schoolStatu.Status != 200) tempStaus = false;
+                    if (schoolStatu.StatusCode != HttpStatusCode.OK) tempStaus = false;
                     else createSchoolInfo.createCount = createSchoolInfo.createCount >= 3 ? createSchoolInfo.createCount = 3 : createSchoolInfo.createCount += 1;
                 } while (tempStaus);
                 createScInfo.Add(createSchoolInfo);
@@ -1492,14 +1492,14 @@ namespace TEAMModelBI.Controllers.BISchool
                 {
                     //查询区是否存在
                     var respAreaId = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{bISchool.areaId}", new PartitionKey("Base-Area"));
-                    if (respAreaId.Status != 200)
+                    if (respAreaId.StatusCode != HttpStatusCode.OK)
                     {
                         noAreaIds.Add(bISchool);
                     }
 
                     //查询去是否同步省平台
                     var responseSet = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{bISchool.areaId}", new PartitionKey("AreaSetting"));
-                    if (responseSet.Status == 200)
+                    if (responseSet.StatusCode == HttpStatusCode.OK)
                     {
                         using var fileJson = await JsonDocument.ParseAsync(responseSet.Content);
                         AreaSetting delSet = fileJson.ToObject<AreaSetting>();
@@ -1524,7 +1524,7 @@ namespace TEAMModelBI.Controllers.BISchool
                 {
                     createSchoolInfo = await SchoolCode.GenerateSchoolCode(createSchoolInfo, _dingDing, _environment);
                     var schoolStatu = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{createSchoolInfo.id}", new PartitionKey($"Base"));
-                    if (schoolStatu.Status != 200) tempStaus = false;
+                    if (schoolStatu.StatusCode != HttpStatusCode.OK) tempStaus = false;
                     else createSchoolInfo.createCount = createSchoolInfo.createCount >= 3 ? createSchoolInfo.createCount = 3 : createSchoolInfo.createCount += 1;
                 } while (tempStaus);
                 bISchool.id = createSchoolInfo.id;
@@ -1566,7 +1566,7 @@ namespace TEAMModelBI.Controllers.BISchool
                         if (tempTeacher != null)
                         {
                             var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{msId}", new PartitionKey($"Teacher-{scId}"));
-                            if (response.Status == 200)
+                            if (response.StatusCode == HttpStatusCode.OK)
                             {
                                 using var tchJson = await JsonDocument.ParseAsync(response.Content);
                                 SchoolTeacher tchSc = tchJson.ToObject<SchoolTeacher>();
@@ -1614,7 +1614,7 @@ namespace TEAMModelBI.Controllers.BISchool
 
                             Teacher teacher = new() { id = coreUser.id, name = coreUser.name, picture = coreUser.picture, pk = "Base", code = "Base", size = 1, createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() };
                             var responseSc = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(scId, new PartitionKey("Base"));
-                            if (responseSc.Status == 200)
+                            if (responseSc.StatusCode == HttpStatusCode.OK)
                             {
                                 using var tchJson = await JsonDocument.ParseAsync(responseSc.Content);
                                 School scInfo = tchJson.ToObject<School>();
@@ -1668,7 +1668,7 @@ namespace TEAMModelBI.Controllers.BISchool
             {
                 School school = new();
                 var resSc = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{item.id}", new PartitionKey("Base"));
-                if (resSc.Status == 200)
+                if (resSc.StatusCode == HttpStatusCode.OK)
                 {
                     using var sJson = await JsonDocument.ParseAsync(resSc.Content);
                     school = sJson.ToObject<School>();
@@ -1680,12 +1680,12 @@ namespace TEAMModelBI.Controllers.BISchool
                     foreach (var tmd in tmdInfos)
                     {
                         var respone = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReadItemStreamAsync($"{tmd.id}", new PartitionKey("Base"));
-                        if (respone.Status == 200)
+                        if (respone.StatusCode == HttpStatusCode.OK)
                         {
                             using var tchJson = await JsonDocument.ParseAsync(respone.Content);
                             teacher = tchJson.ToObject<Teacher>();
                             var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{tmd.id}", new PartitionKey($"Teacher-{item.id}"));
-                            if (response.Status == 200)
+                            if (response.StatusCode == HttpStatusCode.OK)
                             {
                                 using var scTchJson = await JsonDocument.ParseAsync(response.Content);
                                 SchoolTeacher tchSc = scTchJson.ToObject<SchoolTeacher>();

+ 1 - 1
TEAMModelBI/Controllers/BISchool/RoomController.cs

@@ -70,7 +70,7 @@ namespace TEAMModelBI.Controllers.BISchool
                 //}
 
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{roomId}", new PartitionKey($"{roomCode}"));
-                if (response.Status == 200)
+                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                 {
                     using var json = await JsonDocument.ParseAsync(response.Content);
                     Room roomInfo = json.ToObject<Room>();

+ 36 - 36
TEAMModelBI/Controllers/BISchool/SchoolController.cs

@@ -136,7 +136,7 @@ namespace TEAMModelBI.Controllers.BISchool
 
                         if (iscontinuation)
                         {
-                            continuationToken = item.GetContinuationToken();
+                            continuationToken = item.ContinuationToken;
                             break;
                         }
                     }
@@ -275,7 +275,7 @@ namespace TEAMModelBI.Controllers.BISchool
                 //}
 
                 var responseSet = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{_areaId}", new PartitionKey("AreaSetting"));
-                if (responseSet.Status == 200)
+                if (responseSet.StatusCode == HttpStatusCode.OK)
                 {
                     using var fileJson = await JsonDocument.ParseAsync(responseSet.Content);
                     AreaSetting delSet = fileJson.ToObject<AreaSetting>();
@@ -376,7 +376,7 @@ namespace TEAMModelBI.Controllers.BISchool
                 if (schoolAssists.id != null)
                 {
                     var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(schoolAssists.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))
@@ -442,7 +442,7 @@ namespace TEAMModelBI.Controllers.BISchool
                 string _auth = HttpContext.GetXAuth("AuthToken");
                 var (tmdId, tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(_auth, _option);
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(school.id, new PartitionKey($"Base"));
-                if (response.Status == 200)
+                if (response.StatusCode == HttpStatusCode.OK)
                 {
                     string sql = $"SELECT distinct value(c) FROM c join A1 in c.schools where A1.schoolId='{school.id}'";
                     List<Teacher> teachers = new();
@@ -499,7 +499,7 @@ namespace TEAMModelBI.Controllers.BISchool
             {
                 School school = new();
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(sid, new PartitionKey("Base"));
-                if (response.Status == 200)
+                if (response.StatusCode == HttpStatusCode.OK)
                 {
                     using var json = await JsonDocument.ParseAsync(response.Content);
                     school = json.ToObject<School>();
@@ -767,7 +767,7 @@ namespace TEAMModelBI.Controllers.BISchool
                 {
                     var resScInfo = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{schoolId}", new PartitionKey("Base"));
 
-                    if (resScInfo.Status == 200)
+                    if (resScInfo.StatusCode == HttpStatusCode.OK)
                     {
                         using var tchJson = await JsonDocument.ParseAsync(resScInfo.Content);
                         School scInfo = tchJson.ToObject<School>();
@@ -780,7 +780,7 @@ namespace TEAMModelBI.Controllers.BISchool
                 Teacher teacher = new();
                 SchoolTeacher schoolTeacher = new();
                 var resTeacher = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Base"));
-                if (resTeacher.Status == 200)
+                if (resTeacher.StatusCode == HttpStatusCode.OK)
                 {
                     using var tchJson = await JsonDocument.ParseAsync(resTeacher.Content);
                     teacher = tchJson.ToObject<Teacher>();
@@ -811,7 +811,7 @@ namespace TEAMModelBI.Controllers.BISchool
                 if (teacher != null)
                 {
                     var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Teacher-{schoolId}"));
-                    if (response.Status == 200)
+                    if (response.StatusCode == HttpStatusCode.OK)
                     {
                         using var json = await JsonDocument.ParseAsync(response.Content);
                         schoolTeacher = json.ToObject<SchoolTeacher>();
@@ -893,7 +893,7 @@ namespace TEAMModelBI.Controllers.BISchool
             if (rmvFromSc) //從老師的學校列表移除該學校
             {
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{tmdId}", new PartitionKey("Base"));
-                if (response.Status == 200)
+                if (response.StatusCode == HttpStatusCode.OK)
                 {
                     using var json = await JsonDocument.ParseAsync(response.Content);
                     Teacher teacher = json.ToObject<Teacher>();
@@ -906,7 +906,7 @@ namespace TEAMModelBI.Controllers.BISchool
             foreach (var scId in scIds)
             {
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Teacher-{scId}"));
-                if (response.Status == 200)
+                if (response.StatusCode == HttpStatusCode.OK)
                 {
                     if (rmvFromSc) //將該老師從學校的老師名單中移除
                     {
@@ -968,7 +968,7 @@ namespace TEAMModelBI.Controllers.BISchool
                 if (schools.Count > 0)
                 {
                     var resTeacher = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Base"));
-                    if (resTeacher.Status == 200)
+                    if (resTeacher.StatusCode == HttpStatusCode.OK)
                     {
                         using var tchJson = await JsonDocument.ParseAsync(resTeacher.Content);
                         teacher = tchJson.ToObject<Teacher>();
@@ -997,7 +997,7 @@ namespace TEAMModelBI.Controllers.BISchool
                             existSchool.name = school.name;
 
                         var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Teacher-{school.id}"));
-                        if (response.Status == 200)
+                        if (response.StatusCode == HttpStatusCode.OK)
                         {
                             using var json = await JsonDocument.ParseAsync(response.Content);
                             schoolTeacher = json.ToObject<SchoolTeacher>();
@@ -1030,7 +1030,7 @@ namespace TEAMModelBI.Controllers.BISchool
                         msg.Append($"{school.name}[{school.id}]");
                     }
 
-                    if (resTeacher.Status == 200)
+                    if (resTeacher.StatusCode == HttpStatusCode.OK)
                         teacher = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync<Teacher>(teacher, teacher.id, new PartitionKey("Base"));
                     else
                         teacher = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").CreateItemAsync<Teacher>(teacher, new PartitionKey("Base"));
@@ -1109,30 +1109,30 @@ namespace TEAMModelBI.Controllers.BISchool
                         }
 
                         var response = await cosmosClient.GetContainer("TEAMModelOS", "School").DeleteItemStreamAsync($"{tempId}", new PartitionKey($"Base"));
-                        if (response.Status == 204)
-                            msg.AppendLine($"{tmdName}【{tmdId}】删除学校,删除状态:{response.Status},删除ID:{tempId}");
+                        if (response.StatusCode == HttpStatusCode.NoContent)
+                            msg.AppendLine($"{tmdName}【{tmdId}】删除学校,删除状态:{response.StatusCode},删除ID:{tempId}");
                         else
-                            delSchoolRels.Add(new DelSchoolRel() { id = $"{tempId}", code = "Base", type = 1, status = response.Status });
+                            delSchoolRels.Add(new DelSchoolRel() { id = $"{tempId}", code = "Base", type = 1, status = (int)HttpStatusCode.NoContent });
 
                         //删除学校信息中间
                         var resBiRel = await cosmosClient.GetContainer("TEAMModelOS", "School").DeleteItemStreamAsync($"{tempId}", new PartitionKey($"BIRel"));
-                        if (resBiRel.Status == 204)
-                            msg.AppendLine($"{tmdName}【{tmdId}】删除学校信息中间件,删除状态:{resBiRel.Status},删除ID:{tempId}");
+                        if (resBiRel.StatusCode == HttpStatusCode.NoContent)
+                            msg.AppendLine($"{tmdName}【{tmdId}】删除学校信息中间件,删除状态:{resBiRel.StatusCode},删除ID:{tempId}");
                         else
-                            delSchoolRels.Add(new DelSchoolRel() { id = $"{tempId}", code = "Base", type = 1, status = response.Status });
+                            delSchoolRels.Add(new DelSchoolRel() { id = $"{tempId}", code = "Base", type = 1, status = (int)response.StatusCode });
 
                         foreach (var item in scTchIds)
                         {
                             //学校教师信息
                             var tchRespnse = await cosmosClient.GetContainer("TEAMModelOS", "School").DeleteItemStreamAsync($"{item}", new PartitionKey($"Teacher-{tempId}"));
-                            if (tchRespnse.Status == 204)
-                                msg.AppendLine($"删除教师,删除状态:{tchRespnse.Status},删除ID:{item}");
+                            if (tchRespnse.StatusCode == HttpStatusCode.NoContent)
+                                msg.AppendLine($"删除教师,删除状态:{tchRespnse.StatusCode},删除ID:{item}");
                             else
-                                delSchoolRels.Add(new DelSchoolRel() { id = $"{item}", code = $"Teacher-{tempId}", type = 2, status = response.Status });
+                                delSchoolRels.Add(new DelSchoolRel() { id = $"{item}", code = $"Teacher-{tempId}", type = 2, status = (int)response.StatusCode });
 
                             //教师基础信息
                             var tchBaseResponse = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{item}", new PartitionKey("Base"));
-                            if (tchBaseResponse.Status == 200)
+                            if (tchBaseResponse.StatusCode == HttpStatusCode.OK)
                             {
                                 using var json = await JsonDocument.ParseAsync(tchBaseResponse.Content);
                                 Teacher teacher = json.ToObject<Teacher>();
@@ -1144,26 +1144,26 @@ namespace TEAMModelBI.Controllers.BISchool
                                 }
                             }
                             else
-                                delSchoolRels.Add(new DelSchoolRel { id = $"{item}", code = "Base", type = 2, status = response.Status });
+                                delSchoolRels.Add(new DelSchoolRel { id = $"{item}", code = "Base", type = 2, status = (int)response.StatusCode });
                         }
                         //删除学校学生
                         foreach (var item in scStuIds)
                         {
                             var stuRespnse = await cosmosClient.GetContainer("TEAMModelOS", "Student").DeleteItemStreamAsync($"{item}", new PartitionKey($"Base-{tempId}"));
-                            if (stuRespnse.Status == 204)
-                                msg.AppendLine($"删除学生,删除状态:{stuRespnse.Status},删除ID:{item}");
+                            if (stuRespnse.StatusCode == HttpStatusCode.NoContent)
+                                msg.AppendLine($"删除学生,删除状态:{stuRespnse.StatusCode},删除ID:{item}");
                             else
-                                delSchoolRels.Add(new DelSchoolRel() { id = $"{item}", code = $"Base-{tempId}", type = 3, status = response.Status });
+                                delSchoolRels.Add(new DelSchoolRel() { id = $"{item}", code = $"Base-{tempId}", type = 3, status = (int)response.StatusCode });
                         }
                     }
                     //虛擬學校刪除
                     else
                     {
                         var response = await cosmosClient.GetContainer("TEAMModelOS", "School").DeleteItemStreamAsync($"{tempId}", new PartitionKey($"VirtualBase"));
-                        if (response.Status == 204)
-                            msg.AppendLine($"{tmdName}【{tmdId}】删除学校,删除状态:{response.Status},删除ID:{tempId}");
+                        if (response.StatusCode == HttpStatusCode.NoContent)
+                            msg.AppendLine($"{tmdName}【{tmdId}】删除学校,删除状态:{response.StatusCode},删除ID:{tempId}");
                         else
-                            delSchoolRels.Add(new DelSchoolRel() { id = $"{tempId}", code = "VirtualBase", type = 1, status = response.Status });
+                            delSchoolRels.Add(new DelSchoolRel() { id = $"{tempId}", code = "VirtualBase", type = 1, status = (int)response.StatusCode });
                     }
                 }
 
@@ -1267,7 +1267,7 @@ namespace TEAMModelBI.Controllers.BISchool
             if (schoolInfo != null)
             {
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(schoolInfo.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))
@@ -1344,7 +1344,7 @@ namespace TEAMModelBI.Controllers.BISchool
 
             RecSchool recSchool = new();
             var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{schoolId}", new PartitionKey("Base"));
-            if (response.Status == 200)
+            if (response.StatusCode == HttpStatusCode.OK)
             {
                 using var json = await JsonDocument.ParseAsync(response.Content);
                 recSchool = json.ToObject<RecSchool>();
@@ -1864,7 +1864,7 @@ namespace TEAMModelBI.Controllers.BISchool
             AnSchool school = new();  //学校基础基础信息
 
             var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{schoolId}", new PartitionKey("Base"));
-            if (response.Status == 200)
+            if (response.StatusCode == HttpStatusCode.OK)
             {
                 using var json = await JsonDocument.ParseAsync(response.Content);
                 school = json.ToObject<AnSchool>();
@@ -1883,7 +1883,7 @@ namespace TEAMModelBI.Controllers.BISchool
             var subCnt = subs.Select(x => new { name = x.key, value = x.count });
 
             var responseProduct = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(school.id, new PartitionKey("ProductSum"));
-            if (responseProduct.Status == 200)
+            if (responseProduct.StatusCode == HttpStatusCode.OK)
             {
                 using var json = await JsonDocument.ParseAsync(responseProduct.Content);
                 if (json.RootElement.TryGetProperty("serial", out JsonElement _serial) && !_serial.ValueKind.Equals(JsonValueKind.Null))
@@ -1986,7 +1986,7 @@ namespace TEAMModelBI.Controllers.BISchool
                         allCnt += await CommonFind.GetSqlValueCount(cosmosClient, "School", serialAllSql, $"Product-{scProd.id}");
 
                         var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(scProd.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))
@@ -2417,7 +2417,7 @@ namespace TEAMModelBI.Controllers.BISchool
 
                 ////取得各產品目前可得數量
                 var response = await db.ReadItemStreamAsync(school_code.ToString(), new PartitionKey($"ProductSum"));
-                if (response.Status == 200)
+                if (response.StatusCode == HttpStatusCode.OK)
                 {
                     using var json = await JsonDocument.ParseAsync(response.Content);
                     productSum = json.ToObject<SchoolProductSum>();

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

@@ -124,7 +124,7 @@ namespace TEAMModelBI.Controllers.BITable
                 else
                 {
                     var response = await cosmosClient.GetContainer("TEAMModelOS", "Normal").ReadItemStreamAsync(openApi.id, new PartitionKey("Api"));
-                    if (response.Status == 200)
+                    if (response.StatusCode == System.Net.HttpStatusCode.OK)
                     {
                         openApi.ttl = -1;
                         openApi.pk = "Api";