zhouj1203@hotmail.com hai 11 meses
pai
achega
b09fa1d74d

+ 3 - 3
TEAMModelBI/Controllers/BINormal/AbilityTaskMgmtController.cs

@@ -263,14 +263,14 @@ namespace TEAMModelBI.Controllers.BINormal
                 //}
                 var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").DeleteItemStreamAsync(id.ToString(), new PartitionKey($"AbilityTask-{standard}"));
 
-                string msg = $"{_tmdName}【{_tmdId}】删除册别,删除状态:{response.Status},删除ID:{id}";
+                string msg = $"{_tmdName}【{_tmdId}】删除册别,删除状态:{response.StatusCode},删除ID:{id}";
 
                 //保存操作记录
                 await AzureStorageBlobExtensions.SaveBILog(blobClient, tableClient, "abilitytask-del", msg, _dingDing, httpContext: HttpContext);
-                if (response.Status == 204)
+                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                     return Ok(new { state = 200 });
                 else
-                    return Ok(new { state = response.Status });
+                    return Ok(new { state = response.StatusCode });
             }
             catch (Exception ex)
             {

+ 6 - 6
TEAMModelBI/Controllers/BINormal/AreaRelevantController.cs

@@ -185,7 +185,7 @@ namespace TEAMModelBI.Controllers.BINormal
                 //}
 
                 var responseSet = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{areaId}", new PartitionKey("AreaSetting"));
-                if (responseSet.Status == 200)
+                if (responseSet.StatusCode == System.Net.HttpStatusCode.OK)
                 {
                     using var fileJson = await JsonDocument.ParseAsync(responseSet.Content);
                     AreaSetting delSet = fileJson.ToObject<AreaSetting>();
@@ -291,7 +291,7 @@ namespace TEAMModelBI.Controllers.BINormal
 
             Teacher teacher = new();
             var response = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Base"));
-            if (response.Status == 200)
+            if (response.StatusCode == System.Net.HttpStatusCode.OK)
             {
                 using var json = await JsonDocument.ParseAsync(response.Content);
                 teacher = json.ToObject<Teacher>();
@@ -331,11 +331,11 @@ namespace TEAMModelBI.Controllers.BINormal
                         foreach (var item in schoolMs)
                         {
                             var resSc = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{item.id}", new PartitionKey($"Base"));
-                            if (resSc.Status == 200)
+                            if (resSc.StatusCode == System.Net.HttpStatusCode.OK)
                             {
                                 SchoolTeacher schoolTeacher = null;
                                 var resScTch = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Teacher-{item.id}"));
-                                if (resScTch.Status == 200)
+                                if (resScTch.StatusCode == System.Net.HttpStatusCode.OK)
                                 {
                                     using var json = await JsonDocument.ParseAsync(resScTch.Content);
                                     schoolTeacher = json.ToObject<SchoolTeacher>();
@@ -443,7 +443,7 @@ namespace TEAMModelBI.Controllers.BINormal
 
             Teacher teacher = null;
             var response = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Base"));
-            if (response.Status == 200)
+            if (response.StatusCode == System.Net.HttpStatusCode.OK)
             {
                 using var json = await JsonDocument.ParseAsync(response.Content);
                 teacher = json.ToObject<Teacher>();
@@ -496,7 +496,7 @@ namespace TEAMModelBI.Controllers.BINormal
             areaSchool.ForEach(async areaSc =>
             {
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(areaSc.id, 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))

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

@@ -141,7 +141,7 @@ namespace TEAMModelBI.Controllers.BINormal
                             areas.Add(obj.ToObject<RecArea>());
                         }
 
-                        if (iscontinuation) 
+                        if (iscontinuation)
                         {
                             continuationToken = itemArea.GetContinuationToken();
                             break;