Browse Source

优化所有区的参数返回

Li 3 years ago
parent
commit
4dbe988063
1 changed files with 3 additions and 2 deletions
  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");
             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");
             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");
             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) 
             foreach (var area in areaInfos) 
             {
             {
@@ -519,7 +520,7 @@ namespace TEAMModelBI.Controllers.Census
                 }
                 }
                 //scCount += recSchools.Count;
                 //scCount += recSchools.Count;
                 recSchools.ForEach(x => { if (x.type == 2) heCount += 1; else if (x.type == 1) geCount += 1; else oeCount += 1; });
                 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;
                 area.schoolCount = recSchools.Count;
                 //统计服务
                 //统计服务
                 var (tempb, temps, tempm) = await ProductWay.GetVersionCount(cosmosClient, recSchools);
                 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" });
             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" });
             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 });
         }
         }