Преглед на файлове

优化所有区的参数返回

Li преди 3 години
родител
ревизия
4dbe988063
променени са 1 файла, в които са добавени 3 реда и са изтрити 2 реда
  1. 3 2
      TEAMModelBI/Controllers/Census/ActivitySticsController.cs

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

@@ -509,6 +509,7 @@ namespace TEAMModelBI.Controllers.Census
             scCount = await CommonFind.FindTotals(cosmosClient, $"SELECT count(c.id) as totals FROM c ", "School", "Base");
             tecCount = await CommonFind.FindTotals(cosmosClient, $"SELECT count(c.id) as totals FROM c ", "Teacher", "Base");
             stuCount = await CommonFind.FindTotals(cosmosClient, $"SELECT count(c.id) as totals FROM c ", "Student", "Base");
+            allSize = await CommonFind.FindTotals(cosmosClient, $"SELECT sum(c.size) as totals FROM c ", "School", "Base");
 
             foreach (var area in areaInfos) 
             {
@@ -519,7 +520,7 @@ namespace TEAMModelBI.Controllers.Census
                 }
                 //scCount += recSchools.Count;
                 recSchools.ForEach(x => { if (x.type == 2) heCount += 1; else if (x.type == 1) geCount += 1; else oeCount += 1; });
-                allSize += recSchools.Select(s => s.size).Sum();
+                //allSize += recSchools.Select(s => s.size).Sum();
                 area.schoolCount = recSchools.Count;
                 //统计服务
                 var (tempb, temps, tempm) = await ProductWay.GetVersionCount(cosmosClient, recSchools);
@@ -558,7 +559,7 @@ namespace TEAMModelBI.Controllers.Census
             totalTime = await CommonFind.FindTotals(cosmosClient, "select sum(c.totalTime) as totals from c where c.pk='TeacherTrain'", new List<string>() { "Teacher" });
             resourceCount = await CommonFind.FindTotals(cosmosClient, "select count(c.id) as totals from c where c.pk='Bloblog'", new List<string>() { "School", "Teacher" });
 
-            return Ok(new { state = 200, areaCount = areaInfos.Count, allSize, heCount, geCount, oeCount, allLess, termLess, weekLess, allActivity, termActivity, weekActivity, resourceCount, basics, standard, major, totalTime, activitys, areaInfos });
+            return Ok(new { state = 200, areaCount = areaInfos.Count, scCount, tecCount, stuCount, allSize, heCount, geCount, oeCount, allLess, termLess, weekLess, allActivity, termActivity, weekActivity, resourceCount, basics, standard, major, totalTime, activitys, areaInfos });
         }