Browse Source

处理返回值没有计算到

Li 2 years ago
parent
commit
e838899fad
1 changed files with 19 additions and 20 deletions
  1. 19 20
      TEAMModelBI/Controllers/BISchool/BatchAreaController.cs

+ 19 - 20
TEAMModelBI/Controllers/BISchool/BatchAreaController.cs

@@ -119,7 +119,24 @@ namespace TEAMModelBI.Controllers.BISchool
                     } 
                 }
 
-                areas.ForEach(async area => 
+                //areas.ForEach(async area =>
+                //{
+                //    area.schoolCount = await CommonFind.GetSqlValueCount(cosmosClient, "School", $"select value(count(c.id)) from c where c.areaId='{area.id}' and c.standard='{area.standard}'", "Base");
+
+                //    area.aquoteRec = await table.QueryWhereString<AreaQuoteRecord>($"PartitionKey eq 'QuoteRecord' and  areaId eq '{area.id}'");
+                //    //List<AreaQuoteRecord> aqr = await table.QueryWhereString<AreaQuoteRecord>($"PartitionKey eq 'QuoteRecord' and  areaId eq '{area.id}'");
+                //    //aqr.Sort((x, y) => y.RowKey.CompareTo(x.RowKey));
+
+                //    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<string>(queryText: $"select value(c.accessConfig) from c where c.id='{area.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("AreaSetting") }))
+                //    {
+                //        if (string.IsNullOrEmpty(item))
+                //            area.cutArea = false;
+                //        else
+                //            area.cutArea = true;
+                //    };
+                //});
+
+                foreach (var area in areas)
                 {
                     area.schoolCount = await CommonFind.GetSqlValueCount(cosmosClient, "School", $"select value(count(c.id)) from c where c.areaId='{area.id}' and c.standard='{area.standard}'", "Base");
 
@@ -134,26 +151,8 @@ namespace TEAMModelBI.Controllers.BISchool
                         else
                             area.cutArea = true;
                     };
-                });
+                }
 
-                //await foreach (var item in azureClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<RecArea>(queryText: areaSql,requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base-Area") }))
-                //{
-                //    areas.Add(item);
-                //}
-                //foreach (var recArea in areas)
-                //{
-                //    recArea.schoolCount = await CommonFind.GetSqlValueCount(cosmosClient, "School", $"select value(count(c.id)) from c where c.areaId='{recArea.id}' and c.standard='{recArea.standard}'", "Base");
-                //    List<AreaQuoteRecord> aqr = await table.QueryWhereString<AreaQuoteRecord>($"PartitionKey eq 'QuoteRecord' and  areaId eq '{recArea.id}'");
-                //    aqr.Sort((x, y) => y.RowKey.CompareTo(x.RowKey));
-                //    recArea.aquoteRec = aqr;
-                //    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<string>(queryText: $"select value(c.accessConfig) from c where c.id='{recArea.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("AreaSetting") }))
-                //    {
-                //        if (string.IsNullOrEmpty(item))
-                //            recArea.cutArea = false;
-                //        else
-                //            recArea.cutArea = true;
-                //    };
-                //}
 
                 return Ok(new { state = 200, areas, continuationToken });
             }