Browse Source

处理多站点,改为单站点,分布式部署

Li 2 years ago
parent
commit
5674e144f5
28 changed files with 692 additions and 609 deletions
  1. 16 14
      TEAMModelBI/Controllers/BIBlob/AnalyseFileController.cs
  2. 28 22
      TEAMModelBI/Controllers/BIHome/HomeStatisController.cs
  3. 20 23
      TEAMModelBI/Controllers/BIHome/OnLineController.cs
  4. 24 22
      TEAMModelBI/Controllers/BINormal/AbilityMgmtController.cs
  5. 12 10
      TEAMModelBI/Controllers/BINormal/AbilityTaskMgmtController.cs
  6. 39 40
      TEAMModelBI/Controllers/BINormal/AreaRelevantController.cs
  7. 32 28
      TEAMModelBI/Controllers/BINormal/BatchAreaController.cs
  8. 28 24
      TEAMModelBI/Controllers/BINormal/BusinessConfigController.cs
  9. 23 20
      TEAMModelBI/Controllers/BINormal/BusinessUsersController.cs
  10. 24 22
      TEAMModelBI/Controllers/BISchool/BatchSchoolController.cs
  11. 8 7
      TEAMModelBI/Controllers/BISchool/RoomController.cs
  12. 97 86
      TEAMModelBI/Controllers/BISchool/SchoolController.cs
  13. 7 6
      TEAMModelBI/Controllers/BIStudent/StudentController.cs
  14. 4 3
      TEAMModelBI/Controllers/BITable/BIOpenApiController.cs
  15. 9 10
      TEAMModelBI/Controllers/BITable/DDStructController.cs
  16. 13 12
      TEAMModelBI/Controllers/BITable/OperateLogController.cs
  17. 81 74
      TEAMModelBI/Controllers/BITable/TableDingDingInfoController.cs
  18. 9 7
      TEAMModelBI/Controllers/BITeacher/TeacherController.cs
  19. 17 15
      TEAMModelBI/Controllers/BITest/TestController.cs
  20. 34 28
      TEAMModelBI/Controllers/Census/ActivitySticsController.cs
  21. 4 3
      TEAMModelBI/Controllers/Census/BlobLogController.cs
  22. 18 15
      TEAMModelBI/Controllers/Census/ItemSticsController.cs
  23. 38 30
      TEAMModelBI/Controllers/Census/LessonSticsController.cs
  24. 24 18
      TEAMModelBI/Controllers/Census/PaperController.cs
  25. 20 16
      TEAMModelBI/Controllers/Census/ProductStatisController.cs
  26. 16 12
      TEAMModelBI/Controllers/Census/SchoolController.cs
  27. 41 36
      TEAMModelBI/Controllers/LoginController.cs
  28. 6 6
      TEAMModelBI/Controllers/ManySiteCut/SystemConfigController.cs

+ 16 - 14
TEAMModelBI/Controllers/BIBlob/AnalyseFileController.cs

@@ -44,13 +44,14 @@ namespace TEAMModelBI.Controllers.BIBlob
         public async Task<IActionResult> GetDayApi(JsonElement jsonElement)
         public async Task<IActionResult> GetDayApi(JsonElement jsonElement)
         {
         {
             jsonElement.TryGetProperty("dateTime", out JsonElement dateTime);
             jsonElement.TryGetProperty("dateTime", out JsonElement dateTime);
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site); //分开部署,就不需要,一站多用时,取消注释
 
 
             DateTimeOffset dtOff = DateTimeOffset.UtcNow;
             DateTimeOffset dtOff = DateTimeOffset.UtcNow;
 
 
             var blobCilent = _azureStorage.GetBlobContainerClient(containerName: "0-public");
             var blobCilent = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-            if ($"{site}".Equals(BIConst.Global))
-                blobCilent = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    blobCilent = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
 
 
             if (!string.IsNullOrEmpty($"{dateTime}"))
             if (!string.IsNullOrEmpty($"{dateTime}"))
                 dtOff = TimeHelper.GetDateTime(dateTime.GetInt64());
                 dtOff = TimeHelper.GetDateTime(dateTime.GetInt64());
@@ -92,10 +93,11 @@ namespace TEAMModelBI.Controllers.BIBlob
         public async Task<IActionResult> GetSevenDayApi(JsonElement jsonElement)
         public async Task<IActionResult> GetSevenDayApi(JsonElement jsonElement)
         {
         {
 
 
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site); //分开部署,就不需要,一站多用时,取消注释
             var blobCilent = _azureStorage.GetBlobContainerClient(containerName: "0-public");
             var blobCilent = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-            if ($"{site}".Equals(BIConst.Global))
-                blobCilent = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    blobCilent = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
 
 
             List<RecApiCnt> savenDayApis = new();
             List<RecApiCnt> savenDayApis = new();
             List<string> day7 = TimeHelper.GetNearDay(DateTimeOffset.UtcNow, 7);
             List<string> day7 = TimeHelper.GetNearDay(DateTimeOffset.UtcNow, 7);
@@ -131,10 +133,11 @@ namespace TEAMModelBI.Controllers.BIBlob
         public async Task<IActionResult> GetThirtyDayApi(JsonElement jsonElement) 
         public async Task<IActionResult> GetThirtyDayApi(JsonElement jsonElement) 
         {
         {
 
 
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);   //分开部署,就不需要,一站多用时,取消注释
             var blobCilent = _azureStorage.GetBlobContainerClient(containerName: "0-public");
             var blobCilent = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-            if ($"{site}".Equals(BIConst.Global))
-                blobCilent = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    blobCilent = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
 
 
             List<RecApiCnt> thirtyDayApi = new();
             List<RecApiCnt> thirtyDayApi = new();
             List<string> day30 = TimeHelper.GetNearDay(DateTimeOffset.UtcNow, 30);
             List<string> day30 = TimeHelper.GetNearDay(DateTimeOffset.UtcNow, 30);
@@ -243,13 +246,12 @@ namespace TEAMModelBI.Controllers.BIBlob
         [HttpPost("get-loginfos")]
         [HttpPost("get-loginfos")]
         public async Task<IActionResult> GetOSLog(JsonElement jsonElement) 
         public async Task<IActionResult> GetOSLog(JsonElement jsonElement) 
         {
         {
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site); //分开部署,就不需要,一站多用时,取消注释
 
 
             var blobClient = _azureStorage.GetBlobContainerClient($"insights-logs-applicationgatewayfirewalllog",name:BIConst.LogChina);
             var blobClient = _azureStorage.GetBlobContainerClient($"insights-logs-applicationgatewayfirewalllog",name:BIConst.LogChina);
-            if ($"{site}".Equals(BIConst.Global)) 
-            {
-                blobClient = _azureStorage.GetBlobContainerClient($"insights-logs-applicationgatewayfirewalllog", name: BIConst.LogGlobal);
-            }
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global)) 
+            //    blobClient = _azureStorage.GetBlobContainerClient($"insights-logs-applicationgatewayfirewalllog", name: BIConst.LogGlobal);
             
             
             //List<ReadContent> contents = new();
             //List<ReadContent> contents = new();
             List<RecCnt> recCnts = new();
             List<RecCnt> recCnts = new();

+ 28 - 22
TEAMModelBI/Controllers/BIHome/HomeStatisController.cs

@@ -48,10 +48,11 @@ namespace TEAMModelBI.Controllers.BIHome
         {
         {
             try
             try
             {
             {
-                jsonElement.TryGetProperty("site", out JsonElement site);
-                var client = _azureCosmos.GetCosmosClient();;
-                if ($"{site}".Equals(BIConst.Global))
-                    client = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
+                var client = _azureCosmos.GetCosmosClient();
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //    client = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
                 //查询全部教师人数
                 //查询全部教师人数
                 long teacherCount = await CommonFind.GetSqlValueCount(client, "Teacher", "select value(count(c.id)) from c ", "Base");
                 long teacherCount = await CommonFind.GetSqlValueCount(client, "Teacher", "select value(count(c.id)) from c ", "Base");
@@ -81,10 +82,10 @@ namespace TEAMModelBI.Controllers.BIHome
         {
         {
             try
             try
             {
             {
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
-                if ($"{site}".Equals(BIConst.Global))
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                //if ($"{site}".Equals(BIConst.Global))
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
                 List<ProvinceStandard> standards = new();
                 List<ProvinceStandard> standards = new();
                 await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryStreamIterator(queryText: $"select c.provCode,c.provName,c.standard from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base-Area") }))
                 await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryStreamIterator(queryText: $"select c.provCode,c.provName,c.standard from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base-Area") }))
@@ -190,10 +191,11 @@ namespace TEAMModelBI.Controllers.BIHome
         {
         {
             try
             try
             {
             {
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
-                if ($"{site}".Equals(BIConst.Global))
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
                 List<CityStandard> standards = new();
                 List<CityStandard> standards = new();
                 //查询省份区域
                 //查询省份区域
@@ -257,10 +259,12 @@ namespace TEAMModelBI.Controllers.BIHome
             try
             try
             {
             {
                 if (!jsonElement.TryGetProperty("cityCode", out JsonElement _cityCode)) return BadRequest();
                 if (!jsonElement.TryGetProperty("cityCode", out JsonElement _cityCode)) return BadRequest();
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);
+
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
-                if ($"{site}".Equals(BIConst.Global))
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
                 List<DistrictStandard> districtStandards = new();
                 List<DistrictStandard> districtStandards = new();
                 //查询省份区域
                 //查询省份区域
@@ -328,10 +332,11 @@ namespace TEAMModelBI.Controllers.BIHome
         {
         {
             try
             try
             {
             {
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site); //分开部署,就不需要,一站多用时,取消注释
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
-                if ($"{site}".Equals(BIConst.Global))
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
                 List<AllCityStics> tempAllCityStics = new();
                 List<AllCityStics> tempAllCityStics = new();
                 //查询省份区域
                 //查询省份区域
@@ -443,7 +448,7 @@ namespace TEAMModelBI.Controllers.BIHome
         {
         {
             try
             try
             {
             {
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site); //分开部署,就不需要,一站多用时,取消注释
 
 
                 long totalSize = 0; //总空间
                 long totalSize = 0; //总空间
                 long useSize = 0; //已使用空间                
                 long useSize = 0; //已使用空间                
@@ -454,11 +459,12 @@ namespace TEAMModelBI.Controllers.BIHome
                 List<string> schoolId = new();
                 List<string> schoolId = new();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var redisClinet = _azureRedis.GetRedisClient(8);
                 var redisClinet = _azureRedis.GetRedisClient(8);
-                if ($"{site}".Equals(BIConst.Global))
-                {
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                    redisClinet = _azureRedis.GetRedisClient(dbnum: 8, name: BIConst.Global);
-                }
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //{
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                //    redisClinet = _azureRedis.GetRedisClient(dbnum: 8, name: BIConst.Global);
+                //}
 
 
 
 
                 //查询学校空间和学校Id
                 //查询学校空间和学校Id

+ 20 - 23
TEAMModelBI/Controllers/BIHome/OnLineController.cs

@@ -48,13 +48,13 @@ namespace TEAMModelBI.Controllers.BIHome
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var table = _azureStorage.GetCloudTableClient().GetTableReference("IESLogin");
             var table = _azureStorage.GetCloudTableClient().GetTableReference("IESLogin");
             var blobClient = _azureStorage.GetBlobContainerClient($"0-public");
             var blobClient = _azureStorage.GetBlobContainerClient($"0-public");
-            jsonElement.TryGetProperty("site", out JsonElement site);
-            if ($"{site}".Equals(BIConst.Global))
-            {
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                table = _azureStorage.GetCloudTableClient(BIConst.Global).GetTableReference("IESLogin");
-                blobClient = _azureStorage.GetBlobContainerClient($"0-public", BIConst.Global);
-            }
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //{
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            //    table = _azureStorage.GetCloudTableClient(BIConst.Global).GetTableReference("IESLogin");
+            //    blobClient = _azureStorage.GetBlobContainerClient($"0-public", BIConst.Global);
+            //}
 
 
             DateTimeOffset dateTime = DateTimeOffset.UtcNow;
             DateTimeOffset dateTime = DateTimeOffset.UtcNow;
             string cDay = dateTime.ToString("yyyyMMdd");
             string cDay = dateTime.ToString("yyyyMMdd");
@@ -132,12 +132,12 @@ namespace TEAMModelBI.Controllers.BIHome
 
 
             var table = _azureStorage.GetCloudTableClient().GetTableReference("IESLogin");
             var table = _azureStorage.GetCloudTableClient().GetTableReference("IESLogin");
             var redisClinet = _azureRedis.GetRedisClient(8);
             var redisClinet = _azureRedis.GetRedisClient(8);
-            jsonElement.TryGetProperty("site", out JsonElement site);
-            if ($"{site}".Equals(BIConst.Global))
-            {
-                table = _azureStorage.GetCloudTableClient(BIConst.Global).GetTableReference("IESLogin");
-                redisClinet = _azureRedis.GetRedisClient(dbnum: 8, name: BIConst.Global);
-            }
+            //jsonElement.TryGetProperty("site", out JsonElement site); //分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //{
+            //    table = _azureStorage.GetCloudTableClient(BIConst.Global).GetTableReference("IESLogin");
+            //    redisClinet = _azureRedis.GetRedisClient(dbnum: 8, name: BIConst.Global);
+            //}
 
 
             DateTimeOffset dateTime =  DateTimeOffset.UtcNow;
             DateTimeOffset dateTime =  DateTimeOffset.UtcNow;
 
 
@@ -268,11 +268,10 @@ namespace TEAMModelBI.Controllers.BIHome
         {
         {
             DateTimeOffset dateTime = DateTimeOffset.UtcNow;
             DateTimeOffset dateTime = DateTimeOffset.UtcNow;
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            jsonElement.TryGetProperty("site", out JsonElement site);
-            if ($"{site}".Equals(BIConst.Global))
-            {
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-            }
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+
             int year = dateTime.Year;   //当前年
             int year = dateTime.Year;   //当前年
             int month = dateTime.Month;  //当前月
             int month = dateTime.Month;  //当前月
             int day = dateTime.Day;      //当天
             int day = dateTime.Day;      //当天
@@ -395,11 +394,9 @@ namespace TEAMModelBI.Controllers.BIHome
         public async Task<IActionResult> GetEdition(JsonElement jsonElement) 
         public async Task<IActionResult> GetEdition(JsonElement jsonElement) 
         {
         {
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            jsonElement.TryGetProperty("site", out JsonElement site);
-            if ($"{site}".Equals(BIConst.Global))
-            {
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-            }
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             int beCnt = 0; //基础班
             int beCnt = 0; //基础班
             int seCnt = 0; //标准版
             int seCnt = 0; //标准版

+ 24 - 22
TEAMModelBI/Controllers/BINormal/AbilityMgmtController.cs

@@ -55,10 +55,11 @@ namespace TEAMModelBI.Controllers.BINormal
             try
             try
             {
             {
                 if (!jsonElement.TryGetProperty("standard", out JsonElement standard)) return BadRequest();
                 if (!jsonElement.TryGetProperty("standard", out JsonElement standard)) return BadRequest();
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
-                if ($"{site}".Equals(BIConst.Global))
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
                 List<Ability> abilities = new();
                 List<Ability> abilities = new();
                 string sqltxt = "select value(c) from c";
                 string sqltxt = "select value(c) from c";
@@ -89,11 +90,11 @@ namespace TEAMModelBI.Controllers.BINormal
             {
             {
                 if (!jsonElement.TryGetProperty("standard", out JsonElement standard)) return BadRequest();
                 if (!jsonElement.TryGetProperty("standard", out JsonElement standard)) return BadRequest();
                 if (!jsonElement.TryGetProperty("abilityId", out JsonElement abilityId)) return BadRequest();
                 if (!jsonElement.TryGetProperty("abilityId", out JsonElement abilityId)) return BadRequest();
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
-
-                if ($"{site}".Equals(BIConst.Global))
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
                 Ability ability = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemAsync<Ability>($"{abilityId}", new PartitionKey($"Ability-{standard}"));
                 Ability ability = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemAsync<Ability>($"{abilityId}", new PartitionKey($"Ability-{standard}"));
                 return Ok(new { state = 200, ability = ability });
                 return Ok(new { state = 200, ability = ability });
             }
             }
@@ -118,7 +119,7 @@ namespace TEAMModelBI.Controllers.BINormal
             {
             {
                 if (!jsonElement.TryGetProperty("standard", out JsonElement standard)) return BadRequest();
                 if (!jsonElement.TryGetProperty("standard", out JsonElement standard)) return BadRequest();
                 if (!jsonElement.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 if (!jsonElement.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site); //分开部署,就不需要,一站多用时,取消注释
 
 
                 var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
                 var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
 
 
@@ -130,12 +131,13 @@ namespace TEAMModelBI.Controllers.BINormal
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-                if ($"{site}".Equals(BIConst.Global))
-                {
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-                }
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //{
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+                //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+                //}
                 List<AbilityTask> syllabus = new();
                 List<AbilityTask> syllabus = new();
                 string sql = $"select value(c) from c where c.abilityId='{id}'";
                 string sql = $"select value(c) from c where c.abilityId='{id}'";
                 var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").DeleteItemStreamAsync(id.ToString(), new PartitionKey($"Ability-{standard}"));
                 var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").DeleteItemStreamAsync(id.ToString(), new PartitionKey($"Ability-{standard}"));
@@ -274,20 +276,20 @@ namespace TEAMModelBI.Controllers.BINormal
             try
             try
             {
             {
                 if (!jsonElement.TryGetProperty("isRequired", out JsonElement isRequired)) return BadRequest(); //是否是必修集合
                 if (!jsonElement.TryGetProperty("isRequired", out JsonElement isRequired)) return BadRequest(); //是否是必修集合
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site); //分开部署,就不需要,一站多用时,取消注释
 
 
                 var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
                 var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
                 var currencys = isRequired.ToObject<List<IsRequired>>();
                 var currencys = isRequired.ToObject<List<IsRequired>>();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-                if ($"{site}".Equals(BIConst.Global))
-                {
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-                }
-                    foreach (var item in currencys)
+                //if ($"{site}".Equals(BIConst.Global))
+                //{
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+                //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+                //}
+                foreach (var item in currencys)
                 {
                 {
                     Ability ability = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemAsync<Ability>(item.abilityId, new PartitionKey($"Ability-{item.standard}"));
                     Ability ability = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemAsync<Ability>(item.abilityId, new PartitionKey($"Ability-{item.standard}"));
                     ability.currency = item.currency;
                     ability.currency = item.currency;

+ 12 - 10
TEAMModelBI/Controllers/BINormal/AbilityTaskMgmtController.cs

@@ -58,10 +58,11 @@ namespace TEAMModelBI.Controllers.BINormal
             {
             {
                 if (!jsonElement.TryGetProperty("standard", out JsonElement standard)) return BadRequest();
                 if (!jsonElement.TryGetProperty("standard", out JsonElement standard)) return BadRequest();
                 if (!jsonElement.TryGetProperty("abilityId", out JsonElement abilityId)) return BadRequest();
                 if (!jsonElement.TryGetProperty("abilityId", out JsonElement abilityId)) return BadRequest();
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
-                if ($"{site}".Equals(BIConst.Global))
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
                 Ability ability = null;
                 Ability ability = null;
                 List<AbilityTaskTreeNode> abilityTaskTreeNodes = new();//原始数据未排序
                 List<AbilityTaskTreeNode> abilityTaskTreeNodes = new();//原始数据未排序
                 List<AbilityTaskTreeNode> redtAbilityTaskTreeNodes = new();//排序后的数据
                 List<AbilityTaskTreeNode> redtAbilityTaskTreeNodes = new();//排序后的数据
@@ -247,18 +248,19 @@ namespace TEAMModelBI.Controllers.BINormal
             {
             {
                 if (!jsonElement.TryGetProperty("standard", out JsonElement standard)) return BadRequest();
                 if (!jsonElement.TryGetProperty("standard", out JsonElement standard)) return BadRequest();
                 if (!jsonElement.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 if (!jsonElement.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
 
 
                 var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
                 var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-                if ($"{site}".Equals(BIConst.Global))
-                {
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-                }
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //{
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+                //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+                //}
                 var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").DeleteItemStreamAsync(id.ToString(), new PartitionKey($"AbilityTask-{standard}"));
                 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.Status},删除ID:{id}";

+ 39 - 40
TEAMModelBI/Controllers/BINormal/AreaRelevantController.cs

@@ -58,10 +58,11 @@ namespace TEAMModelBI.Controllers.BINormal
             {
             {
                 jsonElement.TryGetProperty("areaId", out JsonElement _areaId);
                 jsonElement.TryGetProperty("areaId", out JsonElement _areaId);
                 jsonElement.TryGetProperty("isDefault", out JsonElement _isDefalue);
                 jsonElement.TryGetProperty("isDefault", out JsonElement _isDefalue);
-                jsonElement.TryGetProperty("site", out JsonElement site);
-                var cosmosClient = _azureCosmos.GetCosmosClient(); 
-                if ($"{site}".Equals(BIConst.Global))
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
+                var cosmosClient = _azureCosmos.GetCosmosClient();
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
                 var isManyArea = false;
                 var isManyArea = false;
                 if (!string.IsNullOrEmpty($"{_isDefalue}"))
                 if (!string.IsNullOrEmpty($"{_isDefalue}"))
                 {
                 {
@@ -132,18 +133,19 @@ namespace TEAMModelBI.Controllers.BINormal
                 jsonElement.TryGetProperty("areaId", out JsonElement areaId);
                 jsonElement.TryGetProperty("areaId", out JsonElement areaId);
                 jsonElement.TryGetProperty("standard", out JsonElement standard);
                 jsonElement.TryGetProperty("standard", out JsonElement standard);
                 jsonElement.TryGetProperty("isDefault", out JsonElement isDefault);
                 jsonElement.TryGetProperty("isDefault", out JsonElement isDefault);
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
 
 
                 var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
                 var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-                if ($"{site}".Equals(BIConst.Global)) 
-                {
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-                }
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global)) 
+                //{
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+                //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+                //}
 
 
                 var responseSet = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{areaId}", new PartitionKey("AreaSetting"));
                 var responseSet = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{areaId}", new PartitionKey("AreaSetting"));
                 if (responseSet.Status == 200)
                 if (responseSet.Status == 200)
@@ -225,16 +227,16 @@ namespace TEAMModelBI.Controllers.BINormal
             jsonElement.TryGetProperty("tmdPic", out JsonElement tmdPic);
             jsonElement.TryGetProperty("tmdPic", out JsonElement tmdPic);
             if (!jsonElement.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
             if (!jsonElement.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
             if (!jsonElement.TryGetProperty("areaName", out JsonElement areaName)) return BadRequest();
             if (!jsonElement.TryGetProperty("areaName", out JsonElement areaName)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var tableClient = _azureStorage.GetCloudTableClient();
             var tableClient = _azureStorage.GetCloudTableClient();
             var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
             var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-            if ($"{site}".Equals(BIConst.Global))
-            {
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-            }
+            //if ($"{site}".Equals(BIConst.Global))
+            //{
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+            //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+            //}
 
 
             Teacher teacher = null;
             Teacher teacher = null;
             var response = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Base"));
             var response = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Base"));
@@ -278,13 +280,12 @@ namespace TEAMModelBI.Controllers.BINormal
         public async Task<IActionResult> GetAreaManages(JsonElement jsonElement) 
         public async Task<IActionResult> GetAreaManages(JsonElement jsonElement) 
         {
         {
             if (!jsonElement.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
             if (!jsonElement.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
 
 
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-            {
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-            }
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             
             
             List<BaseInfo> areaManages = new();
             List<BaseInfo> areaManages = new();
             await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<BaseInfo>(queryText:$"select c.id,c.name,c.picture from c join a in c.areas where a.areaId ='{areaId}' and c.code='Base'",requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey("Base")}))
             await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<BaseInfo>(queryText:$"select c.id,c.name,c.picture from c join a in c.areas where a.areaId ='{areaId}' and c.code='Base'",requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey("Base")}))
@@ -308,13 +309,11 @@ namespace TEAMModelBI.Controllers.BINormal
             if (!jsonElement.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
             if (!jsonElement.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
             if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
             if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
 
 
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
 
 
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-            {
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-            }
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             Teacher teacher = null;
             Teacher teacher = null;
             var response = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Base"));
             var response = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Base"));
@@ -347,13 +346,12 @@ namespace TEAMModelBI.Controllers.BINormal
         public async Task<IActionResult> GetSchools(JsonElement jsonElement) 
         public async Task<IActionResult> GetSchools(JsonElement jsonElement) 
         {
         {
             if (!jsonElement.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
             if (!jsonElement.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
 
 
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-            {
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-            }
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             List<AreaSchool> areaSchool = new();
             List<AreaSchool> areaSchool = new();
 
 
@@ -397,17 +395,18 @@ namespace TEAMModelBI.Controllers.BINormal
         public async Task<IActionResult> GetAssists(JsonElement jsonElement)
         public async Task<IActionResult> GetAssists(JsonElement jsonElement)
         {
         {
             if (!jsonElement.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
             if (!jsonElement.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
 
 
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var tableClient = _azureStorage.GetCloudTableClient();
             var tableClient = _azureStorage.GetCloudTableClient();
             var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
             var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-            if ($"{site}".Equals(BIConst.Global))
-            {
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-            }
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //{
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+            //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+            //}
             var table = tableClient.GetTableReference("BIDDUserInfo");
             var table = tableClient.GetTableReference("BIDDUserInfo");
 
 
             List<string> scIds = new();
             List<string> scIds = new();

+ 32 - 28
TEAMModelBI/Controllers/BINormal/BatchAreaController.cs

@@ -68,7 +68,7 @@ namespace TEAMModelBI.Controllers.BINormal
         {
         {
             try
             try
             {
             {
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
 
 
                 int? pageSize = null;      //默认不指定返回大小        
                 int? pageSize = null;      //默认不指定返回大小        
                 string continuationToken = string.Empty;     //返给前端分页token           
                 string continuationToken = string.Empty;     //返给前端分页token           
@@ -93,11 +93,12 @@ namespace TEAMModelBI.Controllers.BINormal
                 List<RecArea> areas = new();
                 List<RecArea> areas = new();
                 var table = _azureStorage.GetCloudTableClient().GetTableReference("IESLogin");
                 var table = _azureStorage.GetCloudTableClient().GetTableReference("IESLogin");
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
-                if ($"{site}".Equals(BIConst.Global))
-                {
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                    table = _azureStorage.GetCloudTableClient(BIConst.Global).GetTableReference("IESLogin");
-                }
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //{
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                //    table = _azureStorage.GetCloudTableClient(BIConst.Global).GetTableReference("IESLogin");
+                //}
 
 
                 string areaSql = $"select c.id,c.code,c.pk,c.name,c.provCode,c.provName,c.cityCode,c.cityName,c.standard,c.standardName,c.institution from c";
                 string areaSql = $"select c.id,c.code,c.pk,c.name,c.provCode,c.provName,c.cityCode,c.cityName,c.standard,c.standardName,c.institution from c";
 
 
@@ -186,7 +187,7 @@ namespace TEAMModelBI.Controllers.BINormal
                 jsonElement.TryGetProperty("oldId", out JsonElement _oldId);
                 jsonElement.TryGetProperty("oldId", out JsonElement _oldId);
                 jsonElement.TryGetProperty("oldStandard", out JsonElement oldStandard);
                 jsonElement.TryGetProperty("oldStandard", out JsonElement oldStandard);
                 jsonElement.TryGetProperty("oldName", out JsonElement oldName);
                 jsonElement.TryGetProperty("oldName", out JsonElement oldName);
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
 
 
                 var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
                 var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
 
 
@@ -208,12 +209,13 @@ namespace TEAMModelBI.Controllers.BINormal
                 }
                 }
 
 
                 var activeTask = _configuration.GetValue<string>("Azure:ServiceBus:ActiveTask");//秘钥地址
                 var activeTask = _configuration.GetValue<string>("Azure:ServiceBus:ActiveTask");//秘钥地址
-                if ($"{site}".Equals(BIConst.Global))
-                {
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", name: BIConst.Global);
-                }
+                //分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //{
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+                //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", name: BIConst.Global);
+                //}
 
 
                 var table = tableClient.GetTableReference("IESLogin");
                 var table = tableClient.GetTableReference("IESLogin");
 
 
@@ -613,7 +615,7 @@ namespace TEAMModelBI.Controllers.BINormal
                 if (!jsonElement.TryGetProperty("newId", out JsonElement _newId)) return BadRequest();
                 if (!jsonElement.TryGetProperty("newId", out JsonElement _newId)) return BadRequest();
                 if (!jsonElement.TryGetProperty("newStandard", out JsonElement _newStandard)) return BadRequest();
                 if (!jsonElement.TryGetProperty("newStandard", out JsonElement _newStandard)) return BadRequest();
                 jsonElement.TryGetProperty("newName", out JsonElement newName);
                 jsonElement.TryGetProperty("newName", out JsonElement newName);
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
 
 
                 var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
                 var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
                 //操作记录实体
                 //操作记录实体
@@ -623,14 +625,15 @@ namespace TEAMModelBI.Controllers.BINormal
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var serBusClient = _serviceBus.GetServiceBusClient();
                 var serBusClient = _serviceBus.GetServiceBusClient();
                 var activeTask = _configuration.GetValue<string>("Azure:ServiceBus:ActiveTask");//秘钥地址
                 var activeTask = _configuration.GetValue<string>("Azure:ServiceBus:ActiveTask");//秘钥地址
-                if ($"{site}".Equals(BIConst.Global))
-                {
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-                    serBusClient = _serviceBus.GetServiceBusClient(BIConst.Global);    //暂未确定使用默认 
-                    //activeTask = _configuration.GetValue<string>("GlobalAzure:ServiceBus:ActiveTask");  //暂未确定使用默认
-                }
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //{
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+                //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+                //    serBusClient = _serviceBus.GetServiceBusClient(BIConst.Global);    //暂未确定使用默认 
+                //    //activeTask = _configuration.GetValue<string>("GlobalAzure:ServiceBus:ActiveTask");  //暂未确定使用默认
+                //}
                 var table = tableClient.GetTableReference("IESLogin");
                 var table = tableClient.GetTableReference("IESLogin");
 
 
 
 
@@ -871,14 +874,15 @@ namespace TEAMModelBI.Controllers.BINormal
         {
         {
             if (!jsonElement.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
             if (!jsonElement.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
             if (!jsonElement.TryGetProperty("standard", out JsonElement standard)) return BadRequest();
             if (!jsonElement.TryGetProperty("standard", out JsonElement standard)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var blobClient = _azureStorage.GetBlobContainerClient(containerName: "teammodelos");
             var blobClient = _azureStorage.GetBlobContainerClient(containerName: "teammodelos");
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-            {
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                blobClient = _azureStorage.GetBlobContainerClient(containerName: "teammodelos", BIConst.Global);
-            }
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //{
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "teammodelos", BIConst.Global);
+            //}
 
 
             var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{areaId}", new PartitionKey("Base-Area"));
             var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{areaId}", new PartitionKey("Base-Area"));
             if (response.Status == 200)
             if (response.Status == 200)

+ 28 - 24
TEAMModelBI/Controllers/BINormal/BusinessConfigController.cs

@@ -137,10 +137,11 @@ namespace TEAMModelBI.Controllers.BINormal
         public async Task<IActionResult> GetInfos(JsonElement jsonElement) 
         public async Task<IActionResult> GetInfos(JsonElement jsonElement) 
         {
         {
             jsonElement.TryGetProperty("id", out JsonElement id);
             jsonElement.TryGetProperty("id", out JsonElement id);
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             StringBuilder sqlTxt = new("select value(c) from c");
             StringBuilder sqlTxt = new("select value(c) from c");
             if (!string.IsNullOrEmpty($"{id}"))
             if (!string.IsNullOrEmpty($"{id}"))
             {
             {
@@ -167,18 +168,19 @@ namespace TEAMModelBI.Controllers.BINormal
         public async Task<IActionResult> ResetSecretKey(JsonElement jsonElement) 
         public async Task<IActionResult> ResetSecretKey(JsonElement jsonElement) 
         {
         {
             if (!jsonElement.TryGetProperty("id", out JsonElement id)) return BadRequest();
             if (!jsonElement.TryGetProperty("id", out JsonElement id)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var (tmdId, tmdName, pic, _, _, _) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
             var (tmdId, tmdName, pic, _, _, _) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
 
 
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var tableClient = _azureStorage.GetCloudTableClient();
             var tableClient = _azureStorage.GetCloudTableClient();
             var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
             var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-            if ($"{site}".Equals(BIConst.Global))
-            {
-                cosmosClient = _azureCosmos.GetCosmosClient(BIConst.Global);
-                tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-            }
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //{
+            //    cosmosClient = _azureCosmos.GetCosmosClient(BIConst.Global);
+            //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+            //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+            //}
             BizConfig bizConfig = new();
             BizConfig bizConfig = new();
 
 
             var response = await cosmosClient.GetContainer("TEAMModelOS", "Normal").ReadItemStreamAsync($"{id}", new PartitionKey("BizConfig"));
             var response = await cosmosClient.GetContainer("TEAMModelOS", "Normal").ReadItemStreamAsync($"{id}", new PartitionKey("BizConfig"));
@@ -209,19 +211,20 @@ namespace TEAMModelBI.Controllers.BINormal
             if (!jsonElement.TryGetProperty("id", out JsonElement id)) return BadRequest();
             if (!jsonElement.TryGetProperty("id", out JsonElement id)) return BadRequest();
             if (!jsonElement.TryGetProperty("schools", out JsonElement _schools)) return BadRequest();
             if (!jsonElement.TryGetProperty("schools", out JsonElement _schools)) return BadRequest();
             if (!jsonElement.TryGetProperty("type", out JsonElement type)) return BadRequest();
             if (!jsonElement.TryGetProperty("type", out JsonElement type)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site); //分开部署,就不需要,一站多用时,取消注释
             var (tmdId, tmdName, pic, _, _, _) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
             var (tmdId, tmdName, pic, _, _, _) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
 
 
             List<BizSchool> bizSchool = _schools.ToObject<List<BizSchool>>();
             List<BizSchool> bizSchool = _schools.ToObject<List<BizSchool>>();
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var tableClient = _azureStorage.GetCloudTableClient();
             var tableClient = _azureStorage.GetCloudTableClient();
             var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
             var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-            if ($"{site}".Equals(BIConst.Global))
-            {
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-            }
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //{
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+            //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+            //}
 
 
             StringBuilder strMsg = new($"{tmdName}[{tmdId}]给");
             StringBuilder strMsg = new($"{tmdName}[{tmdId}]给");
             if ($"{type}".Equals("add"))
             if ($"{type}".Equals("add"))
@@ -283,16 +286,17 @@ namespace TEAMModelBI.Controllers.BINormal
         public async Task<IActionResult> GetSchools(JsonElement jsonElement)
         public async Task<IActionResult> GetSchools(JsonElement jsonElement)
         {
         {
             jsonElement.TryGetProperty("id", out JsonElement id);
             jsonElement.TryGetProperty("id", out JsonElement id);
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var tableClient = _azureStorage.GetCloudTableClient();
             var tableClient = _azureStorage.GetCloudTableClient();
             var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
             var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-            if ($"{site}".Equals(BIConst.Global))
-            {
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-            }
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //{
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+            //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+            //}
 
 
             List<OpenSchool> openSchools = new();
             List<OpenSchool> openSchools = new();
 
 

+ 23 - 20
TEAMModelBI/Controllers/BINormal/BusinessUsersController.cs

@@ -45,10 +45,10 @@ namespace TEAMModelBI.Controllers.BINormal
         public async Task<IActionResult> GetInfos(JsonElement jsonElement) 
         public async Task<IActionResult> GetInfos(JsonElement jsonElement) 
         {
         {
             jsonElement.TryGetProperty("id", out JsonElement id);
             jsonElement.TryGetProperty("id", out JsonElement id);
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             StringBuilder sqlTxt = new("select value(c) from c");
             StringBuilder sqlTxt = new("select value(c) from c");
             if (!string.IsNullOrEmpty($"{id}"))
             if (!string.IsNullOrEmpty($"{id}"))
             {
             {
@@ -140,18 +140,19 @@ namespace TEAMModelBI.Controllers.BINormal
         public async Task<IActionResult> ResetPassWord(JsonElement jsonElement)
         public async Task<IActionResult> ResetPassWord(JsonElement jsonElement)
         {
         {
             if (!jsonElement.TryGetProperty("id", out JsonElement id)) return BadRequest();
             if (!jsonElement.TryGetProperty("id", out JsonElement id)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);  //分开部署,就不需要,一站多用时,取消注释
             var (tmdId, tmdName, pic, _, _, _) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
             var (tmdId, tmdName, pic, _, _, _) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
 
 
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var tableClient = _azureStorage.GetCloudTableClient();
             var tableClient = _azureStorage.GetCloudTableClient();
             var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
             var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-            if ($"{site}".Equals(BIConst.Global))
-            {
-                cosmosClient = _azureCosmos.GetCosmosClient(BIConst.Global);
-                tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-            }
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //{
+            //    cosmosClient = _azureCosmos.GetCosmosClient(BIConst.Global);
+            //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+            //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+            //}
             BizUsers bizUsers = new();
             BizUsers bizUsers = new();
             StringBuilder strMsg = new($"{tmdName}[{tmdId}]操作:");
             StringBuilder strMsg = new($"{tmdName}[{tmdId}]操作:");
             string salt = Utils.CreatSaltString(8);
             string salt = Utils.CreatSaltString(8);
@@ -185,7 +186,7 @@ namespace TEAMModelBI.Controllers.BINormal
             if(!jsonElement.TryGetProperty("id", out JsonElement id)) return BadRequest();
             if(!jsonElement.TryGetProperty("id", out JsonElement id)) return BadRequest();
             if (!jsonElement.TryGetProperty("bizs", out JsonElement _bizs)) return BadRequest();
             if (!jsonElement.TryGetProperty("bizs", out JsonElement _bizs)) return BadRequest();
             if (!jsonElement.TryGetProperty("type", out JsonElement type)) return BadRequest();
             if (!jsonElement.TryGetProperty("type", out JsonElement type)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var (tmdId, tmdName, pic, _, _, _) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
             var (tmdId, tmdName, pic, _, _, _) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
 
 
             List<BizRel> bizRels = _bizs.ToObject<List<BizRel>>();
             List<BizRel> bizRels = _bizs.ToObject<List<BizRel>>();
@@ -193,12 +194,13 @@ namespace TEAMModelBI.Controllers.BINormal
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var tableClient = _azureStorage.GetCloudTableClient();
             var tableClient = _azureStorage.GetCloudTableClient();
             var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
             var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-            if ($"{site}".Equals(BIConst.Global))
-            {
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-            }
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //{
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+            //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+            //}
 
 
             StringBuilder strMsg = new($"{tmdName}[{tmdId}]给");
             StringBuilder strMsg = new($"{tmdName}[{tmdId}]给");
             if ($"{type}".Equals("add"))
             if ($"{type}".Equals("add"))
@@ -266,10 +268,11 @@ namespace TEAMModelBI.Controllers.BINormal
         {
         {
 
 
             if (!jsonElement.TryGetProperty("id", out JsonElement id)) return BadRequest();
             if (!jsonElement.TryGetProperty("id", out JsonElement id)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             List<BusinessUsers> businessUsers = new();
             List<BusinessUsers> businessUsers = new();
             string sql = $"select value(c) from c join s in c.relation  where c.code='BizUsers' and s.bizId = '80e1bb6c-acba-46ab-9939-4851c4ef2158'";
             string sql = $"select value(c) from c join s in c.relation  where c.code='BizUsers' and s.bizId = '80e1bb6c-acba-46ab-9939-4851c4ef2158'";

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

@@ -66,11 +66,12 @@ namespace TEAMModelBI.Controllers.BISchool
         [HttpPost("get-teacher-authoritybilist")]
         [HttpPost("get-teacher-authoritybilist")]
         public async Task<IActionResult> GetAuthorityBIList(JsonElement jsonElement)
         public async Task<IActionResult> GetAuthorityBIList(JsonElement jsonElement)
         {
         {
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);
             Dictionary<string, object> dic = new() { { "PartitionKey", "authority-bi" } };
             Dictionary<string, object> dic = new() { { "PartitionKey", "authority-bi" } };
             var table = _azureStorage.GetCloudTableClient().GetTableReference("SchoolSetting");
             var table = _azureStorage.GetCloudTableClient().GetTableReference("SchoolSetting");
-            if ($"{site}".Equals(BIConst.Global))
-                table = _azureStorage.GetCloudTableClient(BIConst.Global).GetTableReference("SchoolSetting");
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    table = _azureStorage.GetCloudTableClient(BIConst.Global).GetTableReference("SchoolSetting");
 
 
             List<Authority> authorityBIList = await table.FindListByDict<Authority>(dic);
             List<Authority> authorityBIList = await table.FindListByDict<Authority>(dic);
 
 
@@ -303,10 +304,11 @@ namespace TEAMModelBI.Controllers.BISchool
                 jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
                 jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
                 jsonElement.TryGetProperty("scId", out JsonElement scId);
                 jsonElement.TryGetProperty("scId", out JsonElement scId);
                 jsonElement.TryGetProperty("name", out JsonElement name);
                 jsonElement.TryGetProperty("name", out JsonElement name);
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
-                if ($"{site}".Equals(BIConst.Global))
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
                 int scCnt = 0;
                 int scCnt = 0;
 
 
                 int? pageSize = 100;      //默认不指定返回大小        
                 int? pageSize = 100;      //默认不指定返回大小        
@@ -482,7 +484,7 @@ namespace TEAMModelBI.Controllers.BISchool
         {
         {
             try
             try
             {
             {
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
                 string schoolId = (jsonElement.TryGetProperty("schoolId", out JsonElement _schoolId)) ? _schoolId.GetString() : string.Empty;
                 string schoolId = (jsonElement.TryGetProperty("schoolId", out JsonElement _schoolId)) ? _schoolId.GetString() : string.Empty;
 
 
                 Dictionary<string, List<Dictionary<string, string>>> haveSchoolManger = new();
                 Dictionary<string, List<Dictionary<string, string>>> haveSchoolManger = new();
@@ -491,8 +493,8 @@ namespace TEAMModelBI.Controllers.BISchool
                 //查询学校的顾问
                 //查询学校的顾问
                 string managerSql = $"SELECT DISTINCT REPLACE(c.code, 'Teacher-', '') AS schoolId, c.id, c.name FROM c WHERE ARRAY_CONTAINS(c.roles, 'assist', true) AND c.pk = 'Teacher' AND c.status = 'join'{managerWhereOption}";
                 string managerSql = $"SELECT DISTINCT REPLACE(c.code, 'Teacher-', '') AS schoolId, c.id, c.name FROM c WHERE ARRAY_CONTAINS(c.roles, 'assist', true) AND c.pk = 'Teacher' AND c.status = 'join'{managerWhereOption}";
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
-                if ($"{site}".Equals(BIConst.Global))
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                //if ($"{site}".Equals(BIConst.Global))
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
                 await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: managerSql, requestOptions: new QueryRequestOptions() { }))
                 await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: managerSql, requestOptions: new QueryRequestOptions() { }))
                 {
                 {
                     using var json = await JsonDocument.ParseAsync(item.ContentStream);
                     using var json = await JsonDocument.ParseAsync(item.ContentStream);
@@ -593,7 +595,7 @@ namespace TEAMModelBI.Controllers.BISchool
                 if (!jsonElement.TryGetProperty("scale", out JsonElement scale)) return BadRequest();
                 if (!jsonElement.TryGetProperty("scale", out JsonElement scale)) return BadRequest();
                 if (!jsonElement.TryGetProperty("assistId", out JsonElement _assistId)) return BadRequest();
                 if (!jsonElement.TryGetProperty("assistId", out JsonElement _assistId)) return BadRequest();
                 if (!jsonElement.TryGetProperty("type", out JsonElement _type)) return BadRequest();
                 if (!jsonElement.TryGetProperty("type", out JsonElement _type)) return BadRequest();
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
 
 
                 var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
                 var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
 
 
@@ -604,12 +606,12 @@ namespace TEAMModelBI.Controllers.BISchool
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
 
 
-                if ($"{site}".Equals(BIConst.Global))
-                {
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-                }
+                //if ($"{site}".Equals(BIConst.Global))
+                //{
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+                //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+                //}
 
 
                 School tempShool = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemAsync<School>($"{_schoolId}", new PartitionKey("Base"));
                 School tempShool = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemAsync<School>($"{_schoolId}", new PartitionKey("Base"));
                 if (tempShool != null)
                 if (tempShool != null)
@@ -781,11 +783,11 @@ namespace TEAMModelBI.Controllers.BISchool
             try
             try
             {
             {
                 if (!jsonElement.TryGetProperty("dist", out JsonElement _dist)) return BadRequest();
                 if (!jsonElement.TryGetProperty("dist", out JsonElement _dist)) return BadRequest();
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site); //分开部署,就不需要,一站多用时,取消注释
 
 
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
-                if ($"{site}".Equals(BIConst.Global))
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                //if ($"{site}".Equals(BIConst.Global))
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
                 string sqltxt = $"SELECT * FROM c where c.dist='{_dist}'";
                 string sqltxt = $"SELECT * FROM c where c.dist='{_dist}'";
 
 
@@ -817,11 +819,11 @@ namespace TEAMModelBI.Controllers.BISchool
             List<AssistSchool> schoolAssists = new List<AssistSchool>();
             List<AssistSchool> schoolAssists = new List<AssistSchool>();
             if (!jsonElement.TryGetProperty("endPosition", out JsonElement endPosition)) return BadRequest();
             if (!jsonElement.TryGetProperty("endPosition", out JsonElement endPosition)) return BadRequest();
             if (!jsonElement.TryGetProperty("pageSize", out JsonElement pageSize)) return BadRequest();
             if (!jsonElement.TryGetProperty("pageSize", out JsonElement pageSize)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site); //分开部署,就不需要,一站多用时,取消注释
 
 
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             string sqltxt = $"SELECT * FROM c order by c.id offset {endPosition} limit {pageSize}";
             string sqltxt = $"SELECT * FROM c order by c.id offset {endPosition} limit {pageSize}";
 
 
             await foreach (var itemSchool in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<School>(queryText: sqltxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
             await foreach (var itemSchool in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<School>(queryText: sqltxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))

+ 8 - 7
TEAMModelBI/Controllers/BISchool/RoomController.cs

@@ -54,19 +54,20 @@ namespace TEAMModelBI.Controllers.BISchool
                 if (!jsonElement.TryGetProperty("roomId", out JsonElement roomId)) return BadRequest();
                 if (!jsonElement.TryGetProperty("roomId", out JsonElement roomId)) return BadRequest();
                 if (!jsonElement.TryGetProperty("roomCode", out JsonElement roomCode)) return BadRequest();
                 if (!jsonElement.TryGetProperty("roomCode", out JsonElement roomCode)) return BadRequest();
                 jsonElement.TryGetProperty("serial", out JsonElement serial);
                 jsonElement.TryGetProperty("serial", out JsonElement serial);
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
                 var s = string.IsNullOrEmpty($"{serial}") ? null : $"{serial}";
                 var s = string.IsNullOrEmpty($"{serial}") ? null : $"{serial}";
 
 
                 Room room = new();
                 Room room = new();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-                if ($"{site}".Equals(BIConst.Global))
-                {
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-                }
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //{
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+                //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+                //}
 
 
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{roomId}", new PartitionKey($"{roomCode}"));
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{roomId}", new PartitionKey($"{roomCode}"));
                 if (response.Status == 200)
                 if (response.Status == 200)

+ 97 - 86
TEAMModelBI/Controllers/BISchool/SchoolController.cs

@@ -75,10 +75,11 @@ namespace TEAMModelBI.Controllers.BISchool
             try
             try
             {
             {
                 jsonElement.TryGetProperty("areaId", out JsonElement areaId);
                 jsonElement.TryGetProperty("areaId", out JsonElement areaId);
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
-                if ($"{site}".Equals(BIConst.Global))
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
                 //默认不指定返回大小
                 //默认不指定返回大小
                 int? pageSize = null;
                 int? pageSize = null;
@@ -193,7 +194,7 @@ namespace TEAMModelBI.Controllers.BISchool
                 if (!jsonElement.TryGetProperty("areaId", out JsonElement _areaId)) return BadRequest();
                 if (!jsonElement.TryGetProperty("areaId", out JsonElement _areaId)) return BadRequest();
                 jsonElement.TryGetProperty("areaName", out JsonElement areaName);
                 jsonElement.TryGetProperty("areaName", out JsonElement areaName);
                 jsonElement.TryGetProperty("isDefault", out JsonElement isDefault);
                 jsonElement.TryGetProperty("isDefault", out JsonElement isDefault);
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site); //分开部署,就不需要,一站多用时,取消注释
                 var isManyArea = false;
                 var isManyArea = false;
                 if (!string.IsNullOrEmpty($"{isDefault}"))
                 if (!string.IsNullOrEmpty($"{isDefault}"))
                 {
                 {
@@ -207,12 +208,13 @@ namespace TEAMModelBI.Controllers.BISchool
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-                if ($"{site}".Equals(BIConst.Global))
-                {
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-                }
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //{
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+                //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+                //}
 
 
                 var responseSet = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{_areaId}", new PartitionKey("AreaSetting"));
                 var responseSet = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{_areaId}", new PartitionKey("AreaSetting"));
                 if (responseSet.Status == 200)
                 if (responseSet.Status == 200)
@@ -291,11 +293,12 @@ namespace TEAMModelBI.Controllers.BISchool
             try
             try
             {
             {
                 if (!jsonElement.TryGetProperty("schoolId", out JsonElement schoolId)) return BadRequest();
                 if (!jsonElement.TryGetProperty("schoolId", out JsonElement schoolId)) return BadRequest();
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);  //分开部署,就不需要,一站多用时,取消注释
 
 
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
-                if ($"{site}".Equals(BIConst.Global))
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
                 AssistSchool schoolAssists = new(); //返回学校列表集合
                 AssistSchool schoolAssists = new(); //返回学校列表集合
                 string sqlTxt = $"select c.id,c.code,c.schoolCode,c.name,c.region,c.province,c.city,c.dist,c.size,c.address,c.picture,c.type,c.scale,c.areaId,c.standard,c.period from c where c.id='{schoolId}'";
                 string sqlTxt = $"select c.id,c.code,c.schoolCode,c.name,c.region,c.province,c.city,c.dist,c.size,c.address,c.picture,c.type,c.scale,c.areaId,c.standard,c.period from c where c.id='{schoolId}'";
@@ -409,10 +412,11 @@ namespace TEAMModelBI.Controllers.BISchool
         public async Task<IActionResult> GetAssistSchoolSpace(JsonElement jsonElement)
         public async Task<IActionResult> GetAssistSchoolSpace(JsonElement jsonElement)
         {
         {
             if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
             if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             List<string> schools = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}");
             List<string> schools = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}");
             List<SchoolSpace> schoolSpaces = new();
             List<SchoolSpace> schoolSpaces = new();
@@ -527,14 +531,15 @@ namespace TEAMModelBI.Controllers.BISchool
                 jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
                 jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
                 if (!jsonElement.TryGetProperty("schoolIds", out JsonElement jsSchoolIds)) return BadRequest();
                 if (!jsonElement.TryGetProperty("schoolIds", out JsonElement jsSchoolIds)) return BadRequest();
                 if (!jsonElement.TryGetProperty("busy", out JsonElement busy)) return BadRequest();
                 if (!jsonElement.TryGetProperty("busy", out JsonElement busy)) return BadRequest();
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
 
 
                 List<string> schoolIds = jsSchoolIds.ToObject<List<string>>();
                 List<string> schoolIds = jsSchoolIds.ToObject<List<string>>();
                 var table = _azureStorage.GetCloudTableClient().GetTableReference("BIDDUserInfo");
                 var table = _azureStorage.GetCloudTableClient().GetTableReference("BIDDUserInfo");
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 string divide = _option.Location;
                 string divide = _option.Location;
-                if ($"{site}".Equals(BIConst.Global))
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
                 Dictionary<string, object> dic = new() { { "PartitionKey", $"{parKey}" } };
                 Dictionary<string, object> dic = new() { { "PartitionKey", $"{parKey}" } };
                 if (!string.IsNullOrEmpty($"{userId}"))
                 if (!string.IsNullOrEmpty($"{userId}"))
@@ -631,10 +636,11 @@ namespace TEAMModelBI.Controllers.BISchool
         public async Task<IActionResult> GetSchoolManage(JsonElement jsonElement)
         public async Task<IActionResult> GetSchoolManage(JsonElement jsonElement)
         {
         {
             if (!jsonElement.TryGetProperty("scId", out JsonElement scId)) return BadRequest();
             if (!jsonElement.TryGetProperty("scId", out JsonElement scId)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             List<BaseInfo> scManages = new();
             List<BaseInfo> scManages = new();
             await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<BaseInfo>(queryText: $"select c.id,c.name,c.picture from c where ARRAY_CONTAINS(c.roles,'admin',true) and c.code='Teacher-{scId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{scId}") }))
             await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<BaseInfo>(queryText: $"select c.id,c.name,c.picture from c where ARRAY_CONTAINS(c.roles,'admin',true) and c.code='Teacher-{scId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{scId}") }))
@@ -665,16 +671,17 @@ namespace TEAMModelBI.Controllers.BISchool
                 if (!jsonElement.TryGetProperty("scId", out JsonElement schoolId)) return BadRequest();
                 if (!jsonElement.TryGetProperty("scId", out JsonElement schoolId)) return BadRequest();
                 if (!jsonElement.TryGetProperty("scName", out JsonElement schoolName)) return BadRequest();
                 if (!jsonElement.TryGetProperty("scName", out JsonElement schoolName)) return BadRequest();
                 jsonElement.TryGetProperty("scPic", out JsonElement scpicture);
                 jsonElement.TryGetProperty("scPic", out JsonElement scpicture);
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-                if ($"{site}".Equals(BIConst.Global))
-                {
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-                }
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //{
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+                //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+                //}
                 StringBuilder strMsg = new($"{_tmdName}【{_tmdId}】账户将{tmdName}【{tmdId}】");
                 StringBuilder strMsg = new($"{_tmdName}【{_tmdId}】账户将{tmdName}【{tmdId}】");
 
 
                 Teacher teacher = null;
                 Teacher teacher = null;
@@ -768,10 +775,11 @@ namespace TEAMModelBI.Controllers.BISchool
         {
         {
             if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
             if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
             if (!jsonElement.TryGetProperty("scId", out JsonElement scId)) return BadRequest();
             if (!jsonElement.TryGetProperty("scId", out JsonElement scId)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             SchoolTeacher scTeacher = null;
             SchoolTeacher scTeacher = null;
             var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Teacher-{scId}"));
             var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Teacher-{scId}"));
@@ -808,22 +816,22 @@ namespace TEAMModelBI.Controllers.BISchool
                 if (!jsonElement.TryGetProperty("schoolId", out JsonElement schoolId)) return BadRequest();
                 if (!jsonElement.TryGetProperty("schoolId", out JsonElement schoolId)) return BadRequest();
                 List<string> schools = schoolId.ToObject<List<string>>();
                 List<string> schools = schoolId.ToObject<List<string>>();
 
 
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
                 string _auth = HttpContext.GetXAuth("AuthToken");
                 string _auth = HttpContext.GetXAuth("AuthToken");
                 var (tmdId, tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(_auth, _option);
                 var (tmdId, tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(_auth, _option);
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-                if ($"{site}".Equals(BIConst.Global))
-                {
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-                }
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //{
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+                //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+                //}
                 StringBuilder msg = new();
                 StringBuilder msg = new();
                 List<DelSchoolRel> delSchoolRels = new();
                 List<DelSchoolRel> delSchoolRels = new();
 
 
-
                 foreach (var tempId in schools)
                 foreach (var tempId in schools)
                 {
                 {
                     List<string> scTchIds = new();
                     List<string> scTchIds = new();
@@ -943,10 +951,11 @@ namespace TEAMModelBI.Controllers.BISchool
         public async Task<IActionResult> GetSchoolCnt(JsonElement jsonElement)
         public async Task<IActionResult> GetSchoolCnt(JsonElement jsonElement)
         {
         {
             if (!jsonElement.TryGetProperty("schoolId", out JsonElement schoolId)) return BadRequest();
             if (!jsonElement.TryGetProperty("schoolId", out JsonElement schoolId)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             DateTimeOffset dtime = DateTimeOffset.UtcNow;
             DateTimeOffset dtime = DateTimeOffset.UtcNow;
             var (weekS, weekE) = TimeHelper.GetStartOrEnd(dtime, "week");
             var (weekS, weekE) = TimeHelper.GetStartOrEnd(dtime, "week");
@@ -1054,10 +1063,11 @@ namespace TEAMModelBI.Controllers.BISchool
         {
         {
             if (!jsonElement.TryGetProperty("schoolId", out JsonElement schoolId)) return BadRequest();
             if (!jsonElement.TryGetProperty("schoolId", out JsonElement schoolId)) return BadRequest();
 
 
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             RecSchool recSchool = new();
             RecSchool recSchool = new();
             var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{schoolId}", new PartitionKey("Base"));
             var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{schoolId}", new PartitionKey("Base"));
@@ -1160,10 +1170,11 @@ namespace TEAMModelBI.Controllers.BISchool
         public async Task<IActionResult> GetSchoolDate(JsonElement jsonElement)
         public async Task<IActionResult> GetSchoolDate(JsonElement jsonElement)
         {
         {
             if (!jsonElement.TryGetProperty("schoolId", out JsonElement schoolId)) return BadRequest();
             if (!jsonElement.TryGetProperty("schoolId", out JsonElement schoolId)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             List<double> weekTrend = new();
             List<double> weekTrend = new();
             int year = DateTimeOffset.UtcNow.Year;
             int year = DateTimeOffset.UtcNow.Year;
@@ -1277,23 +1288,20 @@ namespace TEAMModelBI.Controllers.BISchool
         public async Task<IActionResult> GetAssistSchoolCnt(JsonElement jsonElement)
         public async Task<IActionResult> GetAssistSchoolCnt(JsonElement jsonElement)
         {
         {
             if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
             if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-            DateTimeOffset dateTime = DateTimeOffset.UtcNow;
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
+            DateTimeOffset dateTime = DateTimeOffset.UtcNow;
             int scAllCnt = 0; //学校
             int scAllCnt = 0; //学校
             int tchAllCnt = 0;   //教师数量
             int tchAllCnt = 0;   //教师数量
             int tchMonthCnt = 0;  //教师本月新增
             int tchMonthCnt = 0;  //教师本月新增
-
             int stuAllCnt = 0;   //所有学校学生
             int stuAllCnt = 0;   //所有学校学生
-
             int lessAllCnt = 0;  //课例总数
             int lessAllCnt = 0;  //课例总数
             int lessMthCnt = 0;   //本月新增
             int lessMthCnt = 0;   //本月新增
-
             List<ScRankCnt> scRankCnts = new();   //学校开课、上传, 课例排名
             List<ScRankCnt> scRankCnts = new();   //学校开课、上传, 课例排名
-
             var (start, end) = TimeHelper.GetStartOrEnd(dateTime, "month");
             var (start, end) = TimeHelper.GetStartOrEnd(dateTime, "month");
 
 
             List<string> schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}");
             List<string> schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}");
@@ -1358,10 +1366,10 @@ namespace TEAMModelBI.Controllers.BISchool
         {
         {
             jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
             jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
             jsonElement.TryGetProperty("schoolId", out JsonElement schooId);
             jsonElement.TryGetProperty("schoolId", out JsonElement schooId);
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site); //分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             List<YearCnt> yearCnts = new();  //当前的课例,活动,互动统计
             List<YearCnt> yearCnts = new();  //当前的课例,活动,互动统计
 
 
@@ -1412,10 +1420,10 @@ namespace TEAMModelBI.Controllers.BISchool
         public async Task<IActionResult> GetAssisScCnt(JsonElement jsonElement)
         public async Task<IActionResult> GetAssisScCnt(JsonElement jsonElement)
         {
         {
             if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
             if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site); //分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             DateTimeOffset dateTime = DateTimeOffset.UtcNow;
             DateTimeOffset dateTime = DateTimeOffset.UtcNow;
             var (days, daye) = TimeHelper.GetStartOrEnd(dateTime);
             var (days, daye) = TimeHelper.GetStartOrEnd(dateTime);
             var (lastDays, lastDaye) = TimeHelper.GetStartOrEnd(dateTime.AddDays(-1));
             var (lastDays, lastDaye) = TimeHelper.GetStartOrEnd(dateTime.AddDays(-1));
@@ -1510,16 +1518,16 @@ namespace TEAMModelBI.Controllers.BISchool
         {
         {
             if (!jsonElement.TryGetProperty("schoolId", out JsonElement schoolId)) return BadRequest();
             if (!jsonElement.TryGetProperty("schoolId", out JsonElement schoolId)) return BadRequest();
 
 
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             AnSchool school = new();  //学校基础基础信息
             AnSchool school = new();  //学校基础基础信息
             int serial = 0;     //学校软体数量
             int serial = 0;     //学校软体数量
             int service = 0;    //学校服务数量
             int service = 0;    //学校服务数量
             int hard = 0;     //学校硬件数量
             int hard = 0;     //学校硬件数量
 
 
-
             var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{schoolId}", new PartitionKey("Base"));
             var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{schoolId}", new PartitionKey("Base"));
             if (response.Status == 200)
             if (response.Status == 200)
             {
             {
@@ -1570,17 +1578,18 @@ namespace TEAMModelBI.Controllers.BISchool
         public async Task<IActionResult> GetProdEd(JsonElement jsonElement)
         public async Task<IActionResult> GetProdEd(JsonElement jsonElement)
         {
         {
             if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return Ok(new { state = RespondCode.ParamsError, nsg = "参数错误" });
             if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return Ok(new { state = RespondCode.ParamsError, nsg = "参数错误" });
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-
-            List<string> schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}");
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             int adCnt = 0;
             int adCnt = 0;
             int allCnt = 0;
             int allCnt = 0;
             List<ScProdEd> scInfos = new();
             List<ScProdEd> scInfos = new();
             List<string> products = new();
             List<string> products = new();
+            List<string> schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}");
+
             if (schoolIds.Count > 0)
             if (schoolIds.Count > 0)
             {
             {
                 string scInfoSql = $"select c.id,c.name,c.code,c.picture,c.type,c.size,c.scale from c ";
                 string scInfoSql = $"select c.id,c.name,c.code,c.picture,c.type,c.size,c.scale from c ";
@@ -1660,11 +1669,12 @@ namespace TEAMModelBI.Controllers.BISchool
         public async Task<IActionResult> GetSchool(JsonElement jsonElement)
         public async Task<IActionResult> GetSchool(JsonElement jsonElement)
         {
         {
             jsonElement.TryGetProperty("schoolId", out JsonElement schoolId);
             jsonElement.TryGetProperty("schoolId", out JsonElement schoolId);
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-            StringBuilder sqlTxt = new StringBuilder("select * from c");
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            StringBuilder sqlTxt = new("select * from c");
             if (!string.IsNullOrEmpty($"{schoolId}"))
             if (!string.IsNullOrEmpty($"{schoolId}"))
             {
             {
                 sqlTxt.Append($" where c.id='{schoolId}'");
                 sqlTxt.Append($" where c.id='{schoolId}'");
@@ -1698,10 +1708,11 @@ namespace TEAMModelBI.Controllers.BISchool
         {
         {
             jsonElement.TryGetProperty("areaId", out JsonElement areaId);
             jsonElement.TryGetProperty("areaId", out JsonElement areaId);
             jsonElement.TryGetProperty("schoolId", out JsonElement schoolId);
             jsonElement.TryGetProperty("schoolId", out JsonElement schoolId);
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             long allSize = 0;    //全部大小
             long allSize = 0;    //全部大小
             int teacherSpace = 0;  //学校分配给教师的空间
             int teacherSpace = 0;  //学校分配给教师的空间
             long useSize = 0;   //已使用大小 
             long useSize = 0;   //已使用大小 
@@ -1858,17 +1869,17 @@ namespace TEAMModelBI.Controllers.BISchool
             if (!jsonElement.TryGetProperty("school", out JsonElement _school)) return BadRequest();
             if (!jsonElement.TryGetProperty("school", out JsonElement _school)) return BadRequest();
             //if (!jsonElement.TryGetProperty("teacher", out JsonElement _teacher)) return BadRequest();
             //if (!jsonElement.TryGetProperty("teacher", out JsonElement _teacher)) return BadRequest();
             if (!jsonElement.TryGetProperty("shiftTeacher", out JsonElement _shiftTeacher)) return BadRequest();
             if (!jsonElement.TryGetProperty("shiftTeacher", out JsonElement _shiftTeacher)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
 
 
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var tableClient = _azureStorage.GetCloudTableClient();
             var tableClient = _azureStorage.GetCloudTableClient();
             var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
             var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-            if ($"{site}".Equals(BIConst.Global))
-            {
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-            }
+            //if ($"{site}".Equals(BIConst.Global))
+            //{
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+            //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+            //}
 
 
             SchoolTeacher schoolTeacher = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemAsync<SchoolTeacher>($"{_tmdId}", new PartitionKey($"Teacher-{_school}"));
             SchoolTeacher schoolTeacher = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemAsync<SchoolTeacher>($"{_tmdId}", new PartitionKey($"Teacher-{_school}"));
             if (schoolTeacher.roles.IsNotEmpty() && schoolTeacher.roles.Contains("assist"))
             if (schoolTeacher.roles.IsNotEmpty() && schoolTeacher.roles.Contains("assist"))

+ 7 - 6
TEAMModelBI/Controllers/BIStudent/StudentController.cs

@@ -42,10 +42,11 @@ namespace TEAMModelBI.Controllers.BIStudent
         {
         {
             if (!jsonElement.TryGetProperty("studentId", out JsonElement studentId)) return BadRequest();
             if (!jsonElement.TryGetProperty("studentId", out JsonElement studentId)) return BadRequest();
             jsonElement.TryGetProperty("code", out JsonElement code);
             jsonElement.TryGetProperty("code", out JsonElement code);
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             List<object> objs = new();
             List<object> objs = new();
             await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Student").GetItemQueryStreamIterator(queryText: $"select value(c) from c where c.id='{studentId}'", requestOptions: string.IsNullOrEmpty($"{code}") ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
             await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Student").GetItemQueryStreamIterator(queryText: $"select value(c) from c where c.id='{studentId}'", requestOptions: string.IsNullOrEmpty($"{code}") ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
             {
             {
@@ -73,11 +74,11 @@ namespace TEAMModelBI.Controllers.BIStudent
         {
         {
             try
             try
             {
             {
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
 
 
-                if ($"{site}".Equals(BIConst.Global))
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                //if ($"{site}".Equals(BIConst.Global))
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
                 //string sqlTxt = "SELECT select c.id,c.code,c.classIds FROM c  where c.pk='Activity' and c.classIds <> []";
                 //string sqlTxt = "SELECT select c.id,c.code,c.classIds FROM c  where c.pk='Activity' and c.classIds <> []";
                 string sqlTxt = "select c.id,c.code,c.classIds from c where c.school='cswznb' and c.classIds <> []";
                 string sqlTxt = "select c.id,c.code,c.classIds from c where c.school='cswznb' and c.classIds <> []";

+ 4 - 3
TEAMModelBI/Controllers/BITable/BIOpenApiController.cs

@@ -45,10 +45,11 @@ namespace TEAMModelBI.Controllers.BITable
         public async Task<IActionResult> GetOpenApi(JsonElement jsonElement) 
         public async Task<IActionResult> GetOpenApi(JsonElement jsonElement) 
         {
         {
             jsonElement.TryGetProperty("id", out JsonElement id);
             jsonElement.TryGetProperty("id", out JsonElement id);
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             StringBuilder sqlTxt = new("select c.id,c.code,c.pk,c.name,c.rw,c.method,c.url,c.descr,c.type,c.descrUrl,c.createTime from c where c.pk='Api' ");
             StringBuilder sqlTxt = new("select c.id,c.code,c.pk,c.name,c.rw,c.method,c.url,c.descr,c.type,c.descrUrl,c.createTime from c where c.pk='Api' ");
             if (!string.IsNullOrEmpty($"{id}")) 
             if (!string.IsNullOrEmpty($"{id}")) 
             {
             {

+ 9 - 10
TEAMModelBI/Controllers/BITable/DDStructController.cs

@@ -216,7 +216,7 @@ namespace TEAMModelBI.Controllers.BITable
             try
             try
             {
             {
                 jsonElement.TryGetProperty("deptId", out JsonElement deptId);
                 jsonElement.TryGetProperty("deptId", out JsonElement deptId);
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
                 string tempDeptId = string.IsNullOrEmpty($"{deptId}") ? "67863053" : $"{deptId}";
                 string tempDeptId = string.IsNullOrEmpty($"{deptId}") ? "67863053" : $"{deptId}";
 
 
                 string appKey = _configuration["DingDingAuth:appKey"];
                 string appKey = _configuration["DingDingAuth:appKey"];
@@ -254,8 +254,8 @@ namespace TEAMModelBI.Controllers.BITable
                 List<DingDingUserInfo> ddUserInfos = new();
                 List<DingDingUserInfo> ddUserInfos = new();
 
 
                 var tabledd = _azureStorage.GetCloudTableClient().GetTableReference("BIDDUserInfo");
                 var tabledd = _azureStorage.GetCloudTableClient().GetTableReference("BIDDUserInfo");
-                if ($"{site}".Equals(BIConst.Global))
-                    table = _azureStorage.GetCloudTableClient(BIConst.Global).GetTableReference("BIDDUserInfo");
+                //if ($"{site}".Equals(BIConst.Global))
+                //    tabledd = _azureStorage.GetCloudTableClient(BIConst.Global).GetTableReference("BIDDUserInfo");
 
 
                 if (rspV2UserList1.Result.List != null)
                 if (rspV2UserList1.Result.List != null)
                 {
                 {
@@ -444,12 +444,11 @@ namespace TEAMModelBI.Controllers.BITable
             try
             try
             {
             {
                 if (!jsonElement.TryGetProperty("userids", out JsonElement userIds)) return Ok(new { state = 1, message = "参数问题" });
                 if (!jsonElement.TryGetProperty("userids", out JsonElement userIds)) return Ok(new { state = 1, message = "参数问题" });
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site); //分开部署,就不需要,一站多用时,取消注释
                 List<DDUserInfoAndTMD> dDUserInfoAndTMDs = new List<DDUserInfoAndTMD>();//返回钉钉信息和查询的醍摩豆信息
                 List<DDUserInfoAndTMD> dDUserInfoAndTMDs = new List<DDUserInfoAndTMD>();//返回钉钉信息和查询的醍摩豆信息
                 string appKey = _configuration["DingDingAuth:appKey"];
                 string appKey = _configuration["DingDingAuth:appKey"];
                 string appSecret = _configuration["DingDingAuth:appSecret"];
                 string appSecret = _configuration["DingDingAuth:appSecret"];
 
 
-
                 //获取access_token
                 //获取access_token
                 DefaultDingTalkClient client = new("https://oapi.dingtalk.com/gettoken");
                 DefaultDingTalkClient client = new("https://oapi.dingtalk.com/gettoken");
                 OapiGettokenRequest request = new();
                 OapiGettokenRequest request = new();
@@ -469,11 +468,11 @@ namespace TEAMModelBI.Controllers.BITable
                 Dictionary<string, object> dic = new() { { "PartitionKey", "authority-bi" } };
                 Dictionary<string, object> dic = new() { { "PartitionKey", "authority-bi" } };
                 var table = _azureStorage.GetCloudTableClient().GetTableReference("SchoolSetting");
                 var table = _azureStorage.GetCloudTableClient().GetTableReference("SchoolSetting");
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
-                if ($"{site}".Equals(BIConst.Global)) 
-                {
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                    table = _azureStorage.GetCloudTableClient(BIConst.Global).GetTableReference("SchoolSetting");
-                }
+                //if ($"{site}".Equals(BIConst.Global)) 
+                //{
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                //    table = _azureStorage.GetCloudTableClient(BIConst.Global).GetTableReference("SchoolSetting");
+                //}
 
 
                 List<Authority> authorityBIList = await table.FindListByDict<Authority>(dic);
                 List<Authority> authorityBIList = await table.FindListByDict<Authority>(dic);
 
 

+ 13 - 12
TEAMModelBI/Controllers/BITable/OperateLogController.cs

@@ -51,7 +51,7 @@ namespace TEAMModelBI.Controllers.BITable
                 jsonElement.TryGetProperty("endDate", out JsonElement endDate);
                 jsonElement.TryGetProperty("endDate", out JsonElement endDate);
                 jsonElement.TryGetProperty("platform", out JsonElement platform);
                 jsonElement.TryGetProperty("platform", out JsonElement platform);
                 if(!jsonElement.TryGetProperty("reorder", out JsonElement orderby)) return BadRequest();
                 if(!jsonElement.TryGetProperty("reorder", out JsonElement orderby)) return BadRequest();
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
 
 
                 List<BIOptLog> operateLogs = new();
                 List<BIOptLog> operateLogs = new();
                 StringBuilder tableSql = new StringBuilder();
                 StringBuilder tableSql = new StringBuilder();
@@ -66,8 +66,9 @@ namespace TEAMModelBI.Controllers.BITable
                     tableSql.Append(!string.IsNullOrEmpty(tableSql.ToString()) ? $" and platform eq '{platform}' " : $" platform eq '{platform}' ");
                     tableSql.Append(!string.IsNullOrEmpty(tableSql.ToString()) ? $" and platform eq '{platform}' " : $" platform eq '{platform}' ");
                 
                 
                 var table = _azureStorage.GetCloudTableClient().GetTableReference("BIOptLog");
                 var table = _azureStorage.GetCloudTableClient().GetTableReference("BIOptLog");
-                if ($"{site}".Equals(BIConst.Global))
-                    table = _azureStorage.GetCloudTableClient(BIConst.Global).GetTableReference("BIOptLog");
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //    table = _azureStorage.GetCloudTableClient(BIConst.Global).GetTableReference("BIOptLog");
 
 
                 //lambda 表达式排序
                 //lambda 表达式排序
                 operateLogs = await table.QueryWhereString<BIOptLog>(tableSql.ToString());
                 operateLogs = await table.QueryWhereString<BIOptLog>(tableSql.ToString());
@@ -107,7 +108,7 @@ namespace TEAMModelBI.Controllers.BITable
                 jsonElement.TryGetProperty("startDate", out JsonElement startDate);
                 jsonElement.TryGetProperty("startDate", out JsonElement startDate);
                 jsonElement.TryGetProperty("endDate", out JsonElement endDate);
                 jsonElement.TryGetProperty("endDate", out JsonElement endDate);
                 jsonElement.TryGetProperty("rowKey", out JsonElement rowKey);
                 jsonElement.TryGetProperty("rowKey", out JsonElement rowKey);
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
 
 
                 var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
                 var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
                 //var temp = await _azureStorage.Delete<OperateLog>(partitionKey: "OperateLog-BI", rowKey: $"{startDate}");  //删除单个
                 //var temp = await _azureStorage.Delete<OperateLog>(partitionKey: "OperateLog-BI", rowKey: $"{startDate}");  //删除单个
@@ -125,11 +126,11 @@ namespace TEAMModelBI.Controllers.BITable
                 }
                 }
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-                if ($"{site}".Equals(BIConst.Global))
-                {
-                    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-                }
+                //if ($"{site}".Equals(BIConst.Global))
+                //{
+                //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+                //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+                //}
 
 
                 var table = tableClient.GetTableReference("BIOptLog");
                 var table = tableClient.GetTableReference("BIOptLog");
                 var temp = await table.DeleteStringWhere<BIOptLog>(rowKey: tableStrWhere.ToString());
                 var temp = await table.DeleteStringWhere<BIOptLog>(rowKey: tableStrWhere.ToString());
@@ -163,7 +164,7 @@ namespace TEAMModelBI.Controllers.BITable
             {
             {
                 if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
                 if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
                 jsonElement.TryGetProperty("platform", out JsonElement platform);
                 jsonElement.TryGetProperty("platform", out JsonElement platform);
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
 
 
                 string storageSql = null;
                 string storageSql = null;
                 if (!string.IsNullOrEmpty($"{platform}"))
                 if (!string.IsNullOrEmpty($"{platform}"))
@@ -171,8 +172,8 @@ namespace TEAMModelBI.Controllers.BITable
                 else storageSql = $"tmdId eq '{tmdId}'";
                 else storageSql = $"tmdId eq '{tmdId}'";
 
 
                 var table = _azureStorage.GetCloudTableClient().GetTableReference("BIOptLog");
                 var table = _azureStorage.GetCloudTableClient().GetTableReference("BIOptLog");
-                if ($"{site}".Equals(BIConst.Global))
-                    table = _azureStorage.GetCloudTableClient(BIConst.Global).GetTableReference("BIOptLog");
+                //if ($"{site}".Equals(BIConst.Global))
+                //    table = _azureStorage.GetCloudTableClient(BIConst.Global).GetTableReference("BIOptLog");
                 var optLogs = await table.QueryWhereString<BIOptLog>(storageSql);
                 var optLogs = await table.QueryWhereString<BIOptLog>(storageSql);
 
 
                 return Ok(new { state = 200, optLogs });
                 return Ok(new { state = 200, optLogs });

+ 81 - 74
TEAMModelBI/Controllers/BITable/TableDingDingInfoController.cs

@@ -69,14 +69,15 @@ namespace TEAMModelBI.Controllers.BITable
         {
         {
             try
             try
             {
             {
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-                if ($"{site}".Equals(BIConst.Global))
-                {
-                    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-                }
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //{
+                //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+                //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+                //}
                 var table = tableClient.GetTableReference("BIDDUserInfo");                
                 var table = tableClient.GetTableReference("BIDDUserInfo");                
 
 
                 string appKey = _configuration["DingDingAuth:appKey"];
                 string appKey = _configuration["DingDingAuth:appKey"];
@@ -221,13 +222,13 @@ namespace TEAMModelBI.Controllers.BITable
             try
             try
             {
             {
                 jsonElement.TryGetProperty("busy", out JsonElement busy);
                 jsonElement.TryGetProperty("busy", out JsonElement busy);
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
                 var cosmosCliet = _azureCosmos.GetCosmosClient();
                 var cosmosCliet = _azureCosmos.GetCosmosClient();
                 var table = _azureStorage.GetCloudTableClient().GetTableReference("BIDDUserInfo");
                 var table = _azureStorage.GetCloudTableClient().GetTableReference("BIDDUserInfo");
-                if ($"{site}".Equals(BIConst.Global))
-                {
-                    table = _azureStorage.GetCloudTableClient(BIConst.Global).GetTableReference("BIDDUserInfo");
-                }
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //    table = _azureStorage.GetCloudTableClient(BIConst.Global).GetTableReference("BIDDUserInfo");
+
                 //string divide = _configuration["CustomParam:SiteScope"];
                 //string divide = _configuration["CustomParam:SiteScope"];
                 string divide = _option.Location;
                 string divide = _option.Location;
                 List<DDUserInfo> ddUserInfos = new();
                 List<DDUserInfo> ddUserInfos = new();
@@ -348,15 +349,16 @@ namespace TEAMModelBI.Controllers.BITable
                 jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
                 jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
                 if (!jsonElement.TryGetProperty("permissions", out JsonElement _permissions)) return BadRequest();
                 if (!jsonElement.TryGetProperty("permissions", out JsonElement _permissions)) return BadRequest();
                 if (!jsonElement.TryGetProperty("roles", out JsonElement _roles)) return BadRequest();
                 if (!jsonElement.TryGetProperty("roles", out JsonElement _roles)) return BadRequest();
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
 
 
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-                if ($"{site}".Equals(BIConst.Global))
-                {
-                    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-                }
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //{
+                //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+                //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+                //}
 
 
                 var table = tableClient.GetTableReference("BIDDUserInfo");
                 var table = tableClient.GetTableReference("BIDDUserInfo");
                 var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
                 var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
@@ -422,17 +424,18 @@ namespace TEAMModelBI.Controllers.BITable
             try
             try
             {
             {
                 if (!jsonElement.TryGetProperty("deptId", out JsonElement deptId)) return BadRequest();
                 if (!jsonElement.TryGetProperty("deptId", out JsonElement deptId)) return BadRequest();
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
 
 
                 var cosmosCliet = _azureCosmos.GetCosmosClient();
                 var cosmosCliet = _azureCosmos.GetCosmosClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-                if ($"{site}".Equals(BIConst.Global))
-                {
-                    cosmosCliet = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-                };
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //{
+                //    cosmosCliet = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+                //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+                //};
 
 
                 var table = tableClient.GetTableReference("BIDDUserInfo");
                 var table = tableClient.GetTableReference("BIDDUserInfo");
                 //string divide = _configuration["CustomParam:SiteScope"];
                 //string divide = _configuration["CustomParam:SiteScope"];
@@ -524,18 +527,19 @@ namespace TEAMModelBI.Controllers.BITable
                 if (!jsonElement.TryGetProperty("mobile", out JsonElement mobile)) return BadRequest();
                 if (!jsonElement.TryGetProperty("mobile", out JsonElement mobile)) return BadRequest();
                 jsonElement.TryGetProperty("picture ", out JsonElement picture);
                 jsonElement.TryGetProperty("picture ", out JsonElement picture);
                 jsonElement.TryGetProperty("mail ", out JsonElement mail);
                 jsonElement.TryGetProperty("mail ", out JsonElement mail);
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site); //分开部署,就不需要,一站多用时,取消注释
                 var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
                 var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
                 var cosmosCliet = _azureCosmos.GetCosmosClient();
                 var cosmosCliet = _azureCosmos.GetCosmosClient();
 
 
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-                if ($"{site}".Equals(BIConst.Global))
-                {
-                    cosmosCliet = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-                }
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //{
+                //    cosmosCliet = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+                //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+                //}
                 var table = tableClient.GetTableReference("BIDDUserInfo");
                 var table = tableClient.GetTableReference("BIDDUserInfo");
 
 
                 List<DDUserInfo> ddUserInfos = new();
                 List<DDUserInfo> ddUserInfos = new();
@@ -675,17 +679,17 @@ namespace TEAMModelBI.Controllers.BITable
                 if (!jsonElement.TryGetProperty("partitionKey", out JsonElement partitionKey)) return BadRequest();
                 if (!jsonElement.TryGetProperty("partitionKey", out JsonElement partitionKey)) return BadRequest();
                 if (!jsonElement.TryGetProperty("rowKey", out JsonElement rowKey)) return BadRequest();
                 if (!jsonElement.TryGetProperty("rowKey", out JsonElement rowKey)) return BadRequest();
                 if (!jsonElement.TryGetProperty("isAdmin", out JsonElement isAdmin)) return BadRequest();
                 if (!jsonElement.TryGetProperty("isAdmin", out JsonElement isAdmin)) return BadRequest();
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
                 var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
                 var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
 
 
-
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-                if ($"{site}".Equals(BIConst.Global))
-                {
-                    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-                }
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //{
+                //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+                //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+                //}
 
 
                 var table = tableClient.GetTableReference("BIDDUserInfo");
                 var table = tableClient.GetTableReference("BIDDUserInfo");
 
 
@@ -780,14 +784,15 @@ namespace TEAMModelBI.Controllers.BITable
         {
         {
             try
             try
             {
             {
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-                if ($"{site}".Equals(BIConst.Global))
-                {
-                    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-                }
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //{
+                //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+                //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+                //}
                 var table = tableClient.GetTableReference("BIDDUserInfo");
                 var table = tableClient.GetTableReference("BIDDUserInfo");
 
 
                 string appKey = _configuration["DingDingAuth:appKey"];
                 string appKey = _configuration["DingDingAuth:appKey"];
@@ -935,17 +940,18 @@ namespace TEAMModelBI.Controllers.BITable
             {
             {
                 if (!jsonElement.TryGetProperty("rowKey", out JsonElement rowKey)) return BadRequest();
                 if (!jsonElement.TryGetProperty("rowKey", out JsonElement rowKey)) return BadRequest();
                 if (!jsonElement.TryGetProperty("mobile", out JsonElement mobile)) return BadRequest();
                 if (!jsonElement.TryGetProperty("mobile", out JsonElement mobile)) return BadRequest();
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site); //分开部署,就不需要,一站多用时,取消注释
 
 
                 var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
                 var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
 
 
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-                if ($"{site}".Equals(BIConst.Global))
-                {
-                    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-                }
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //{
+                //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+                //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+                //}
 
 
                 var table = tableClient.GetTableReference("BIDDUserInfo");
                 var table = tableClient.GetTableReference("BIDDUserInfo");
 
 
@@ -965,7 +971,6 @@ namespace TEAMModelBI.Controllers.BITable
                 var coreUser = await _coreAPIHttpService.GetUserInfo(new Dictionary<string, string> { { "key", $"{mobile}" } }, _option.Location, _configuration);
                 var coreUser = await _coreAPIHttpService.GetUserInfo(new Dictionary<string, string> { { "key", $"{mobile}" } }, _option.Location, _configuration);
                 if (coreUser != null && coreUser.id != null) 
                 if (coreUser != null && coreUser.id != null) 
                 {
                 {
-
                     tmdId = coreUser.id;
                     tmdId = coreUser.id;
                     tmdName = coreUser.name;
                     tmdName = coreUser.name;
                     tmdMobile = coreUser.mobile;
                     tmdMobile = coreUser.mobile;
@@ -1017,7 +1022,7 @@ namespace TEAMModelBI.Controllers.BITable
             jsonElement.TryGetProperty("partitionKey", out JsonElement partitionKey);
             jsonElement.TryGetProperty("partitionKey", out JsonElement partitionKey);
             if (!jsonElement.TryGetProperty("mobile", out JsonElement mobile)) return BadRequest();
             if (!jsonElement.TryGetProperty("mobile", out JsonElement mobile)) return BadRequest();
 
 
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site); //分开部署,就不需要,一站多用时,取消注释
             var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
             var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
             var partKey = _option.Location;
             var partKey = _option.Location;
             if (string.IsNullOrEmpty($"{partitionKey}")) 
             if (string.IsNullOrEmpty($"{partitionKey}")) 
@@ -1027,11 +1032,12 @@ namespace TEAMModelBI.Controllers.BITable
 
 
             var tableClient = _azureStorage.GetCloudTableClient();
             var tableClient = _azureStorage.GetCloudTableClient();
             var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
             var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-            if ($"{site}".Equals(BIConst.Global))
-            {
-                tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-            }
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //{
+            //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+            //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+            //}
 
 
             var table = tableClient.GetTableReference("BIDDUserInfo");
             var table = tableClient.GetTableReference("BIDDUserInfo");
 
 
@@ -1079,12 +1085,11 @@ namespace TEAMModelBI.Controllers.BITable
         public async Task<IActionResult> SetUnbind(JsonElement jsonElement) 
         public async Task<IActionResult> SetUnbind(JsonElement jsonElement) 
         {
         {
             jsonElement.TryGetProperty("mobile", out JsonElement mobile);
             jsonElement.TryGetProperty("mobile", out JsonElement mobile);
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var table = _azureStorage.GetCloudTableClient().GetTableReference("BIDDUserInfo");
             var table = _azureStorage.GetCloudTableClient().GetTableReference("BIDDUserInfo");
-            if ($"{site}".Equals(BIConst.Global))
-            {
-                table = _azureStorage.GetCloudTableClient(BIConst.Global).GetTableReference("BIDDUserInfo");
-            }
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    table = _azureStorage.GetCloudTableClient(BIConst.Global).GetTableReference("BIDDUserInfo");
 
 
             //string divide = _configuration["CustomParam:SiteScope"];
             //string divide = _configuration["CustomParam:SiteScope"];
             string divide = _option.Location;
             string divide = _option.Location;
@@ -1125,14 +1130,15 @@ namespace TEAMModelBI.Controllers.BITable
         {
         {
             try
             try
             {
             {
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-                if ($"{site}".Equals(BIConst.Global))
-                {
-                    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-                }
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //{
+                //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+                //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+                //}
                 var table = tableClient.GetTableReference("BIDDUserInfo");
                 var table = tableClient.GetTableReference("BIDDUserInfo");
 
 
                 string appKey = _configuration["DingDingAuth:appKey"];
                 string appKey = _configuration["DingDingAuth:appKey"];
@@ -1203,14 +1209,15 @@ namespace TEAMModelBI.Controllers.BITable
         {
         {
             try
             try
             {
             {
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-                if ($"{site}".Equals(BIConst.Global))
-                {
-                    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-                }
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //{
+                //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+                //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+                //}
                 var table = tableClient.GetTableReference("BIDDUserInfo");
                 var table = tableClient.GetTableReference("BIDDUserInfo");
 
 
                 string appKey = _configuration["DingDingAuth:appKey"];
                 string appKey = _configuration["DingDingAuth:appKey"];

+ 9 - 7
TEAMModelBI/Controllers/BITeacher/TeacherController.cs

@@ -41,11 +41,12 @@ namespace TEAMModelBI.Controllers.BITeacher
         {
         {
             jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
             jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
             jsonElement.TryGetProperty("schoolCode", out JsonElement schoolCode);
             jsonElement.TryGetProperty("schoolCode", out JsonElement schoolCode);
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-            
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+
             List<SchoolTeacher> teachers = new();
             List<SchoolTeacher> teachers = new();
             string sqlTxt = "";
             string sqlTxt = "";
             if (!string.IsNullOrEmpty($"{tmdId}")) 
             if (!string.IsNullOrEmpty($"{tmdId}")) 
@@ -88,11 +89,12 @@ namespace TEAMModelBI.Controllers.BITeacher
         {
         {
             if (!jsonElement.TryGetProperty("teacherId", out JsonElement teacherId)) return BadRequest();
             if (!jsonElement.TryGetProperty("teacherId", out JsonElement teacherId)) return BadRequest();
             jsonElement.TryGetProperty("code", out JsonElement code);
             jsonElement.TryGetProperty("code", out JsonElement code);
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site); //分开部署,就不需要,一站多用时,取消注释
 
 
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             List<object> objs = new();
             List<object> objs = new();
 
 
             await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryStreamIterator(queryText: $"select value(c) from c where c.id='{teacherId}'", requestOptions: string.IsNullOrEmpty($"{code}") ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
             await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryStreamIterator(queryText: $"select value(c) from c where c.id='{teacherId}'", requestOptions: string.IsNullOrEmpty($"{code}") ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))

+ 17 - 15
TEAMModelBI/Controllers/BITest/TestController.cs

@@ -166,20 +166,21 @@ namespace TEAMModelBI.Controllers.BITest
         [HttpPost("set-savebilog")]
         [HttpPost("set-savebilog")]
         public async Task<IActionResult> SetTestSaveBIlog(JsonElement jsonElement)
         public async Task<IActionResult> SetTestSaveBIlog(JsonElement jsonElement)
         {
         {
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             jsonElement.TryGetProperty("msg", out JsonElement msg);
             jsonElement.TryGetProperty("msg", out JsonElement msg);
 
 
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var tableClient = _azureStorage.GetCloudTableClient();
             var tableClient = _azureStorage.GetCloudTableClient();
             var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
             var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
             var redisClinet = _azureRedis.GetRedisClient(8);
             var redisClinet = _azureRedis.GetRedisClient(8);
-            if ($"{site}".Equals(BIConst.Global))
-            {
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-                redisClinet = _azureRedis.GetRedisClient(dbnum: 8, name: BIConst.Global);
-            }
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //{
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+            //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+            //    redisClinet = _azureRedis.GetRedisClient(dbnum: 8, name: BIConst.Global);
+            //}
 
 
             var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
             var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
             await _azureStorage.SaveLog(type: "table-save", msg: "测试保存方法01", dingDing: _dingDing, httpContext: HttpContext); //IES5 日志记录
             await _azureStorage.SaveLog(type: "table-save", msg: "测试保存方法01", dingDing: _dingDing, httpContext: HttpContext); //IES5 日志记录
@@ -1221,16 +1222,17 @@ namespace TEAMModelBI.Controllers.BITest
         [HttpPost("get-manydb")]
         [HttpPost("get-manydb")]
         public async Task<IActionResult> GetMany(JsonElement jsonElement)
         public async Task<IActionResult> GetMany(JsonElement jsonElement)
         {
         {
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var table = _azureStorage.GetCloudTableClient().GetTableReference("BIDDUserInfo");
             var table = _azureStorage.GetCloudTableClient().GetTableReference("BIDDUserInfo");
             var redisClinet = _azureRedis.GetRedisClient(8);
             var redisClinet = _azureRedis.GetRedisClient(8);
-            if ($"{site}".Equals(BIConst.Global))
-            {
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                table = _azureStorage.GetCloudTableClient(BIConst.Global).GetTableReference("");
-                redisClinet = _azureRedis.GetRedisClient(dbnum: 8, name: BIConst.Global);
-            }
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //{
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            //    table = _azureStorage.GetCloudTableClient(BIConst.Global).GetTableReference("");
+            //    redisClinet = _azureRedis.GetRedisClient(dbnum: 8, name: BIConst.Global);
+            //}
 
 
             #region  依赖注入的方式 
             #region  依赖注入的方式 
 
 

+ 34 - 28
TEAMModelBI/Controllers/Census/ActivitySticsController.cs

@@ -53,10 +53,11 @@ namespace TEAMModelBI.Controllers.Census
             try
             try
             {
             {
                 jsonElement.TryGetProperty("areaId", out JsonElement areaId);
                 jsonElement.TryGetProperty("areaId", out JsonElement areaId);
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
-                if ($"{site}".Equals(BIConst.Global))
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
                 List<KeyValuePair<string, long>> typeCount = new();
                 List<KeyValuePair<string, long>> typeCount = new();
 
 
                 string inSql = null;
                 string inSql = null;
@@ -111,15 +112,16 @@ namespace TEAMModelBI.Controllers.Census
         public async Task<IActionResult> GetAreaStics(JsonElement jsonElement)
         public async Task<IActionResult> GetAreaStics(JsonElement jsonElement)
         {
         {
             if (!jsonElement.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
             if (!jsonElement.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var (dayS, dayE) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow);
             var (dayS, dayE) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow);
             var (weekS, weekE) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow, "week");
             var (weekS, weekE) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow, "week");
             var (monthS, monthE) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow, "month");
             var (monthS, monthE) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow, "month");
             var (termS, termE) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow, "term");
             var (termS, termE) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow, "term");
 
 
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             int scCnt = 0; //学校人数
             int scCnt = 0; //学校人数
             int weekScCnt = 0; //本周学校人数
             int weekScCnt = 0; //本周学校人数
@@ -443,10 +445,11 @@ namespace TEAMModelBI.Controllers.Census
         [HttpPost("get-all")]
         [HttpPost("get-all")]
         public async Task<IActionResult> GetAll(JsonElement jsonElement)
         public async Task<IActionResult> GetAll(JsonElement jsonElement)
         {
         {
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             var (weekStart, weekEnd) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow, "week");
             var (weekStart, weekEnd) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow, "week");
             var (termStart, termEnd) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow, "term");
             var (termStart, termEnd) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow, "term");
@@ -540,10 +543,11 @@ namespace TEAMModelBI.Controllers.Census
         [HttpPost("get-areasanls")]
         [HttpPost("get-areasanls")]
         public async Task<IActionResult> GetAreasAnls(JsonElement jsonElement)
         public async Task<IActionResult> GetAreasAnls(JsonElement jsonElement)
         {
         {
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             List<AreaInfo> areaInfos = new();
             List<AreaInfo> areaInfos = new();
             await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Normal").GetItemQueryIterator<AreaInfo>(queryText: $"select c.id,c.name,c.standard,c.standardName from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base-Area") }))
             await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Normal").GetItemQueryIterator<AreaInfo>(queryText: $"select c.id,c.name,c.standard,c.standardName from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base-Area") }))
@@ -589,10 +593,10 @@ namespace TEAMModelBI.Controllers.Census
         [HttpPost("get-allanls")]
         [HttpPost("get-allanls")]
         public async Task<IActionResult> GetAllAnls(JsonElement jsonElement) 
         public async Task<IActionResult> GetAllAnls(JsonElement jsonElement) 
         {
         {
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             DateTimeOffset dateTime = DateTimeOffset.UtcNow;
             DateTimeOffset dateTime = DateTimeOffset.UtcNow;
             var (weeks, weeke) = TimeHelper.GetStartOrEnd(dateTime, "week");
             var (weeks, weeke) = TimeHelper.GetStartOrEnd(dateTime, "week");
             var (terms, terme) = TimeHelper.GetStartOrEnd(dateTime, "term");
             var (terms, terme) = TimeHelper.GetStartOrEnd(dateTime, "term");
@@ -648,15 +652,16 @@ namespace TEAMModelBI.Controllers.Census
         {
         {
             jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
             jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
             if (!jsonElement.TryGetProperty("term", out JsonElement term)) return BadRequest();
             if (!jsonElement.TryGetProperty("term", out JsonElement term)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             long start = 0, end = 0;
             long start = 0, end = 0;
             if (bool.Parse($"{term}") == true)
             if (bool.Parse($"{term}") == true)
             {
             {
                 (start, end) = TimeHelper.GetTermStartOrEnd(DateTime.Now);
                 (start, end) = TimeHelper.GetTermStartOrEnd(DateTime.Now);
             }
             }
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             List<object> activityCount = new List<object>();
             List<object> activityCount = new List<object>();
 
 
             if (!string.IsNullOrEmpty($"{tmdId}"))
             if (!string.IsNullOrEmpty($"{tmdId}"))
@@ -718,10 +723,11 @@ namespace TEAMModelBI.Controllers.Census
         public async Task<IActionResult> GetAssistSchoolActivity(JsonElement jsonElement)
         public async Task<IActionResult> GetAssistSchoolActivity(JsonElement jsonElement)
         {
         {
             if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
             if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             List<string> schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}");
             List<string> schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}");
 
 
@@ -760,10 +766,10 @@ namespace TEAMModelBI.Controllers.Census
         public async Task<IActionResult> GetTermActivity(JsonElement jsonElement)
         public async Task<IActionResult> GetTermActivity(JsonElement jsonElement)
         {
         {
             jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
             jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             var (start, end) = TimeHelper.GetTermStartOrEnd(DateTime.Now);
             var (start, end) = TimeHelper.GetTermStartOrEnd(DateTime.Now);
 
 
@@ -820,10 +826,10 @@ namespace TEAMModelBI.Controllers.Census
         public async Task<IActionResult> GetAreaActovoty(JsonElement jsonElement)
         public async Task<IActionResult> GetAreaActovoty(JsonElement jsonElement)
         {
         {
             if (!jsonElement.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
             if (!jsonElement.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             List<RecSchool> schools = new();
             List<RecSchool> schools = new();
 
 
             await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<RecSchool>(queryText: $"select c.id,c.name,c.picture,c.scale from c where c.areaId='{areaId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
             await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<RecSchool>(queryText: $"select c.id,c.name,c.picture,c.scale from c where c.areaId='{areaId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
@@ -882,7 +888,7 @@ namespace TEAMModelBI.Controllers.Census
             if (!jsonElement.TryGetProperty("id", out JsonElement id)) return BadRequest();
             if (!jsonElement.TryGetProperty("id", out JsonElement id)) return BadRequest();
             jsonElement.TryGetProperty("activity", out JsonElement activity);
             jsonElement.TryGetProperty("activity", out JsonElement activity);
             jsonElement.TryGetProperty("isPersonal", out JsonElement isPersonal);
             jsonElement.TryGetProperty("isPersonal", out JsonElement isPersonal);
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             //if (jsonElement.TryGetProperty("", out JsonElement code)) return BadRequest();
             //if (jsonElement.TryGetProperty("", out JsonElement code)) return BadRequest();
 
 
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();

+ 4 - 3
TEAMModelBI/Controllers/Census/BlobLogController.cs

@@ -46,11 +46,12 @@ namespace TEAMModelBI.Controllers.Census
         [HttpPost("get-area")]
         [HttpPost("get-area")]
         public async Task<IActionResult> GetArea(JsonElement jsonElement)
         public async Task<IActionResult> GetArea(JsonElement jsonElement)
         {
         {
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             jsonElement.TryGetProperty("areaId", out JsonElement areaId);
             jsonElement.TryGetProperty("areaId", out JsonElement areaId);
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             StringBuilder sqlSize = new($"select value(sum(c.size)) from c ");
             StringBuilder sqlSize = new($"select value(sum(c.size)) from c ");
             long useSize = 0;  //使用大小
             long useSize = 0;  //使用大小
             int recCount = 0;
             int recCount = 0;

+ 18 - 15
TEAMModelBI/Controllers/Census/ItemSticsController.cs

@@ -43,10 +43,11 @@ namespace TEAMModelBI.Controllers.Census
         public async Task<IActionResult> GetTotals(JsonElement jsonElement)
         public async Task<IActionResult> GetTotals(JsonElement jsonElement)
         {
         {
             jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
             jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             if (!string.IsNullOrEmpty($"{tmdId}"))
             if (!string.IsNullOrEmpty($"{tmdId}"))
             {
             {
@@ -90,13 +91,14 @@ namespace TEAMModelBI.Controllers.Census
         {
         {
             jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
             jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
             if (!jsonElement.TryGetProperty("term", out JsonElement term)) return BadRequest();
             if (!jsonElement.TryGetProperty("term", out JsonElement term)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site); //分开部署,就不需要,一站多用时,取消注释
 
 
             var (start, end) = TimeHelper.GetTermStartOrEnd(DateTime.Now);
             var (start, end) = TimeHelper.GetTermStartOrEnd(DateTime.Now);
 
 
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             List<string> itemType = new() { "single", "multiple", "judge", "complete", "subjective", "connector", "correct", "compose" };
             List<string> itemType = new() { "single", "multiple", "judge", "complete", "subjective", "connector", "correct", "compose" };
             List<object> typeCount = new();
             List<object> typeCount = new();
 
 
@@ -159,10 +161,10 @@ namespace TEAMModelBI.Controllers.Census
         {
         {
             jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
             jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
             if(!jsonElement.TryGetProperty("term", out JsonElement term)) return BadRequest();
             if(!jsonElement.TryGetProperty("term", out JsonElement term)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             var (start, end) = TimeHelper.GetTermStartOrEnd(DateTime.Now);
             var (start, end) = TimeHelper.GetTermStartOrEnd(DateTime.Now);
 
 
             List<object> levelCount = new();
             List<object> levelCount = new();
@@ -225,14 +227,14 @@ namespace TEAMModelBI.Controllers.Census
         [HttpPost("get-layer")]
         [HttpPost("get-layer")]
         public async Task<IActionResult> GetLayerCount(JsonElement jsonElement)
         public async Task<IActionResult> GetLayerCount(JsonElement jsonElement)
         {
         {
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
             jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
             if (!jsonElement.TryGetProperty("term", out JsonElement term)) return BadRequest();
             if (!jsonElement.TryGetProperty("term", out JsonElement term)) return BadRequest();
 
 
             var (start, end) = TimeHelper.GetTermStartOrEnd(DateTime.Now);
             var (start, end) = TimeHelper.GetTermStartOrEnd(DateTime.Now);
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             List<object> layerCount = new();
             List<object> layerCount = new();
 
 
             if (!string.IsNullOrEmpty($"{tmdId}"))
             if (!string.IsNullOrEmpty($"{tmdId}"))
@@ -296,10 +298,11 @@ namespace TEAMModelBI.Controllers.Census
         {
         {
             if (!jsonElement.TryGetProperty("itemId", out JsonElement itemId)) return BadRequest();
             if (!jsonElement.TryGetProperty("itemId", out JsonElement itemId)) return BadRequest();
             jsonElement.TryGetProperty("isPersonal", out JsonElement isPersonal);
             jsonElement.TryGetProperty("isPersonal", out JsonElement isPersonal);
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             List<object> objItems = new();
             List<object> objItems = new();
             string sqlTxt = $"select * from c where c.id='{itemId}' and c.pk='Item'";
             string sqlTxt = $"select * from c where c.id='{itemId}' and c.pk='Item'";

+ 38 - 30
TEAMModelBI/Controllers/Census/LessonSticsController.cs

@@ -56,13 +56,14 @@ namespace TEAMModelBI.Controllers.Census
         public async Task<IActionResult> GetSchoolsAn(JsonElement jsonElement)
         public async Task<IActionResult> GetSchoolsAn(JsonElement jsonElement)
         {
         {
             if (!jsonElement.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
             if (!jsonElement.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site); //分开部署,就不需要,一站多用时,取消注释
             var (lWeekS, lWeekE) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow, "week");
             var (lWeekS, lWeekE) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow, "week");
             var (monthS, monthE) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow, "month");
             var (monthS, monthE) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow, "month");
 
 
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             List<AreaSchools> areaSchools = new();
             List<AreaSchools> areaSchools = new();
             await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<AreaSchools>(queryText: $"select c.id,c.name,c.picture from c where c.areaId='{areaId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base")}))
             await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<AreaSchools>(queryText: $"select c.id,c.name,c.picture from c where c.areaId='{areaId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base")}))
@@ -93,13 +94,14 @@ namespace TEAMModelBI.Controllers.Census
         public async Task<IActionResult> GetWeekCount(JsonElement jsonElement)
         public async Task<IActionResult> GetWeekCount(JsonElement jsonElement)
         {
         {
             jsonElement.TryGetProperty("areaId", out JsonElement areaId);
             jsonElement.TryGetProperty("areaId", out JsonElement areaId);
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
 
 
             //Dictionary<int, double> weeks = new();
             //Dictionary<int, double> weeks = new();
             List<double> weeks = new();
             List<double> weeks = new();
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             int year = DateTimeOffset.UtcNow.Year;
             int year = DateTimeOffset.UtcNow.Year;
             int dayOfweek = (int)DateTimeOffset.Parse($"{year}-1-1").DayOfWeek;
             int dayOfweek = (int)DateTimeOffset.Parse($"{year}-1-1").DayOfWeek;
@@ -210,11 +212,11 @@ namespace TEAMModelBI.Controllers.Census
         [HttpPost("get-allarea")]
         [HttpPost("get-allarea")]
         public async Task<IActionResult> GetAllArea(JsonElement jsonElement)
         public async Task<IActionResult> GetAllArea(JsonElement jsonElement)
         {
         {
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
 
 
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             List<AllAreaInfo> areaInfos = new();
             List<AllAreaInfo> areaInfos = new();
             await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Normal").GetItemQueryIterator<AllAreaInfo>(queryText: $"select c.id,c.name,c.standard,c.standardName from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base-Area") }))
             await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Normal").GetItemQueryIterator<AllAreaInfo>(queryText: $"select c.id,c.name,c.standard,c.standardName from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base-Area") }))
@@ -260,10 +262,10 @@ namespace TEAMModelBI.Controllers.Census
         {
         {
             jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
             jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
             if (!jsonElement.TryGetProperty("term", out JsonElement term)) return BadRequest();
             if (!jsonElement.TryGetProperty("term", out JsonElement term)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             var (start, end) = TimeHelper.GetTermStartOrEnd(DateTime.Now);
             var (start, end) = TimeHelper.GetTermStartOrEnd(DateTime.Now);
             object totals = new();
             object totals = new();
             StringBuilder sqlTxt = new($"select value(COUNT(c.id)) from c where c.pk='LessonRecord'");
             StringBuilder sqlTxt = new($"select value(COUNT(c.id)) from c where c.pk='LessonRecord'");
@@ -329,10 +331,11 @@ namespace TEAMModelBI.Controllers.Census
             try
             try
             {
             {
                 if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
                 if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var cosmosClient = _azureCosmos.GetCosmosClient();
-                if ($"{site}".Equals(BIConst.Global))
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
                 List<SchoolLen> schoolLens = new();
                 List<SchoolLen> schoolLens = new();
 
 
                 List<string> schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}");
                 List<string> schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}");
@@ -372,10 +375,11 @@ namespace TEAMModelBI.Controllers.Census
         public async Task<IActionResult> GetDicCount(JsonElement jsonElement)
         public async Task<IActionResult> GetDicCount(JsonElement jsonElement)
         {
         {
             jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
             jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             if (!string.IsNullOrEmpty($"{tmdId}"))
             if (!string.IsNullOrEmpty($"{tmdId}"))
             {
             {
                 jsonElement.TryGetProperty("years", out JsonElement _years);
                 jsonElement.TryGetProperty("years", out JsonElement _years);
@@ -433,10 +437,11 @@ namespace TEAMModelBI.Controllers.Census
         public async Task<IActionResult> GetTermCount(JsonElement jsonElement) 
         public async Task<IActionResult> GetTermCount(JsonElement jsonElement) 
         {
         {
             if (jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) BadRequest();
             if (jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site); //分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             List<SchoolLen> schoolLens = new();
             List<SchoolLen> schoolLens = new();
             List<string> schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}");
             List<string> schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}");
@@ -536,11 +541,12 @@ namespace TEAMModelBI.Controllers.Census
         public async Task<IActionResult> GetAreaCount(JsonElement jsonElement) 
         public async Task<IActionResult> GetAreaCount(JsonElement jsonElement) 
         {
         {
             if(!jsonElement.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
             if(!jsonElement.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             List<string> schools = new();
             List<string> schools = new();
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             StringBuilder scSqlTxt = new("select c.id from c");
             StringBuilder scSqlTxt = new("select c.id from c");
             if (!string.IsNullOrEmpty($"{areaId}"))
             if (!string.IsNullOrEmpty($"{areaId}"))
@@ -607,10 +613,11 @@ namespace TEAMModelBI.Controllers.Census
         public async Task<IActionResult> GetInfo(JsonElement jsonElement) 
         public async Task<IActionResult> GetInfo(JsonElement jsonElement) 
         {
         {
             if (!jsonElement.TryGetProperty("lessonId", out JsonElement lessonId)) return BadRequest();
             if (!jsonElement.TryGetProperty("lessonId", out JsonElement lessonId)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             List<object> lessons = new();
             List<object> lessons = new();
             string sqlTxt = $"select * from c where c.id='{lessonId}'";
             string sqlTxt = $"select * from c where c.id='{lessonId}'";
             await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { })) 
             await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { })) 
@@ -889,11 +896,12 @@ namespace TEAMModelBI.Controllers.Census
         [HttpPost("get-alllesson")]
         [HttpPost("get-alllesson")]
         public async Task<IActionResult> GetAllLessonRecords(JsonElement jsonElement)
         public async Task<IActionResult> GetAllLessonRecords(JsonElement jsonElement)
         {
         {
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
 
 
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             List<LessonRecord> allLesson = new();
             List<LessonRecord> allLesson = new();
 
 

+ 24 - 18
TEAMModelBI/Controllers/Census/PaperController.cs

@@ -48,11 +48,12 @@ namespace TEAMModelBI.Controllers.Census
         {
         {
             jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
             jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
             if(!jsonElement.TryGetProperty("term", out JsonElement term)) return BadRequest();
             if(!jsonElement.TryGetProperty("term", out JsonElement term)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var (start, end) = TimeHelper.GetTermStartOrEnd(DateTime.Now);
             var (start, end) = TimeHelper.GetTermStartOrEnd(DateTime.Now);
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             object paperCount = new object();            
             object paperCount = new object();            
 
 
             if (!string.IsNullOrEmpty($"{tmdId}"))
             if (!string.IsNullOrEmpty($"{tmdId}"))
@@ -117,10 +118,11 @@ namespace TEAMModelBI.Controllers.Census
         [HttpPost("get-total")]
         [HttpPost("get-total")]
         public async Task<IActionResult> GetTotal(JsonElement jsonElement)
         public async Task<IActionResult> GetTotal(JsonElement jsonElement)
         {
         {
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             string sqlTxt = $"select value(COUNT(c.id)) from c where c.pk='Paper'";
             string sqlTxt = $"select value(COUNT(c.id)) from c where c.pk='Paper'";
 
 
             long totals = await CommonFind.GetSqlValueCount(cosmosClient, "School", sqlTxt.ToString());
             long totals = await CommonFind.GetSqlValueCount(cosmosClient, "School", sqlTxt.ToString());
@@ -137,10 +139,11 @@ namespace TEAMModelBI.Controllers.Census
         public async Task<IActionResult> GetAssistSchool(JsonElement jsonElement)
         public async Task<IActionResult> GetAssistSchool(JsonElement jsonElement)
         {
         {
             if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
             if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             List<string> schoolIds = new();
             List<string> schoolIds = new();
             List<SchoolPaper> schoolPapers = new();
             List<SchoolPaper> schoolPapers = new();
 
 
@@ -176,10 +179,11 @@ namespace TEAMModelBI.Controllers.Census
         public async Task<IActionResult> GetNewYear(JsonElement jsonElement) 
         public async Task<IActionResult> GetNewYear(JsonElement jsonElement) 
         {
         {
             jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
             jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             List<MonthStartEnd> endList1 = TimeHelper.GetYearMonthlyStartEnd(DateTimeOffset.UtcNow.Year);
             List<MonthStartEnd> endList1 = TimeHelper.GetYearMonthlyStartEnd(DateTimeOffset.UtcNow.Year);
             if (string.IsNullOrEmpty($"{tmdId}"))
             if (string.IsNullOrEmpty($"{tmdId}"))
             {
             {
@@ -236,10 +240,11 @@ namespace TEAMModelBI.Controllers.Census
         public async Task<IActionResult> GetTermPaper(JsonElement jsonElement) 
         public async Task<IActionResult> GetTermPaper(JsonElement jsonElement) 
         {
         {
             jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
             jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             var (start, end) = TimeHelper.GetTermStartOrEnd(DateTime.Now);
             var (start, end) = TimeHelper.GetTermStartOrEnd(DateTime.Now);
 
 
              var totals = new object();
              var totals = new object();
@@ -304,10 +309,11 @@ namespace TEAMModelBI.Controllers.Census
         {
         {
             if (!jsonElement.TryGetProperty("paperId", out JsonElement paperId)) return BadRequest();
             if (!jsonElement.TryGetProperty("paperId", out JsonElement paperId)) return BadRequest();
             jsonElement.TryGetProperty("isPersonal", out JsonElement isPersonal);
             jsonElement.TryGetProperty("isPersonal", out JsonElement isPersonal);
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             List<object> paperInfos = new List<object>();
             List<object> paperInfos = new List<object>();
             string sqlTxt = $"select * from c where c.id='{paperId}' and c.pk='Paper'";
             string sqlTxt = $"select * from c where c.id='{paperId}' and c.pk='Paper'";

+ 20 - 16
TEAMModelBI/Controllers/Census/ProductStatisController.cs

@@ -51,10 +51,11 @@ namespace TEAMModelBI.Controllers.Census
         [HttpPost("get-allcount")]
         [HttpPost("get-allcount")]
         public async Task<IActionResult> GetProductSum(JsonElement jsonElement)
         public async Task<IActionResult> GetProductSum(JsonElement jsonElement)
         {
         {
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             List<ProductStatis> productStatis = new List<ProductStatis>();
             List<ProductStatis> productStatis = new List<ProductStatis>();
             await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: $"SELECT c.serial,c.service FROM c",requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("ProductSum") }))
             await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: $"SELECT c.serial,c.service FROM c",requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("ProductSum") }))
             {
             {
@@ -174,11 +175,11 @@ namespace TEAMModelBI.Controllers.Census
         public async Task<IActionResult> GetSchoolSum(JsonElement jsonElement)
         public async Task<IActionResult> GetSchoolSum(JsonElement jsonElement)
         {
         {
             if (!jsonElement.TryGetProperty("schoolCode", out JsonElement schoolCode)) return BadRequest();
             if (!jsonElement.TryGetProperty("schoolCode", out JsonElement schoolCode)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var clientContainer = _azureCosmos.GetCosmosClient();
             var clientContainer = _azureCosmos.GetCosmosClient();
-
-            if ($"{site}".Equals(BIConst.Global))
-                clientContainer = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    clientContainer = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             List<SchoolProductSerial> serials = new(); //软体
             List<SchoolProductSerial> serials = new(); //软体
             List<SchoolProductService> services = new(); //服务
             List<SchoolProductService> services = new(); //服务
@@ -262,10 +263,11 @@ namespace TEAMModelBI.Controllers.Census
         public async Task<IActionResult> GetAssistSchoolId(JsonElement jsonElement)
         public async Task<IActionResult> GetAssistSchoolId(JsonElement jsonElement)
         {
         {
             if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
             if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             List<string> schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}");
             List<string> schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}");
             List<SchoolProduct> schoolProducts = new();
             List<SchoolProduct> schoolProducts = new();
@@ -373,10 +375,11 @@ namespace TEAMModelBI.Controllers.Census
         public async Task<IActionResult> GetModuleAnalys(JsonElement jsonElement)
         public async Task<IActionResult> GetModuleAnalys(JsonElement jsonElement)
         {
         {
             jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
             jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             long buyServiceCount = 0; //所有购买服务数量
             long buyServiceCount = 0; //所有购买服务数量
             long buySerialsCount = 0; //所有购买软体数量
             long buySerialsCount = 0; //所有购买软体数量
@@ -494,10 +497,11 @@ namespace TEAMModelBI.Controllers.Census
         public async Task<IActionResult> GetAdviserSchool(JsonElement jsonElement) 
         public async Task<IActionResult> GetAdviserSchool(JsonElement jsonElement) 
         {
         {
             if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
             if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             long buyServiceCount = 0;  //购买服务数量
             long buyServiceCount = 0;  //购买服务数量
             long buySerialsCount = 0;  //购买软体数量
             long buySerialsCount = 0;  //购买软体数量

+ 16 - 12
TEAMModelBI/Controllers/Census/SchoolController.cs

@@ -46,10 +46,11 @@ namespace TEAMModelBI.Controllers.Census
         [HttpPost("get-all")]
         [HttpPost("get-all")]
         public async Task<IActionResult> GetAll(JsonElement jsonElement)
         public async Task<IActionResult> GetAll(JsonElement jsonElement)
         {
         {
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            //////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
 
             long schoolCount = 0;   //学校数量
             long schoolCount = 0;   //学校数量
             int tecCount = 0;  //教师数量
             int tecCount = 0;  //教师数量
@@ -142,7 +143,7 @@ namespace TEAMModelBI.Controllers.Census
         public async Task<IActionResult> GetAssistStatis(JsonElement jsonElement)
         public async Task<IActionResult> GetAssistStatis(JsonElement jsonElement)
         {
         {
             if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
             if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
 
 
             int tecCount = 0;   //教师数量
             int tecCount = 0;   //教师数量
             int stuCount = 0;   //学校数量
             int stuCount = 0;   //学校数量
@@ -167,8 +168,9 @@ namespace TEAMModelBI.Controllers.Census
             long weekActivity = 0;  //本周学校所有活动
             long weekActivity = 0;  //本周学校所有活动
 
 
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             List<string> schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}");
             List<string> schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}");
 
 
             var (lastWeekStart, lastWeekEnd) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow, "lastweek");   //计算上周开始/结束时间
             var (lastWeekStart, lastWeekEnd) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow, "lastweek");   //计算上周开始/结束时间
@@ -242,7 +244,8 @@ namespace TEAMModelBI.Controllers.Census
         public async Task<IActionResult> GetIdStatis(JsonElement jsonElement)
         public async Task<IActionResult> GetIdStatis(JsonElement jsonElement)
         {
         {
             if (!jsonElement.TryGetProperty("schoolId", out JsonElement schoolId)) return BadRequest();
             if (!jsonElement.TryGetProperty("schoolId", out JsonElement schoolId)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
 
 
             int tecCount = 0;  //学校教师数量
             int tecCount = 0;  //学校教师数量
             int stuCount = 0;  //学校学生数量
             int stuCount = 0;  //学校学生数量
@@ -268,8 +271,9 @@ namespace TEAMModelBI.Controllers.Census
             int yearBlob = 0;  //去年的资源
             int yearBlob = 0;  //去年的资源
 
 
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             var (lastWeekStart, lastWeekEnd) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow, "lastweek");   //计算上周开始/结束时间
             var (lastWeekStart, lastWeekEnd) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow, "lastweek");   //计算上周开始/结束时间
             var (weekStart, weekEnd) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow, "week");             //计算本周开始/结束时间
             var (weekStart, weekEnd) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow, "week");             //计算本周开始/结束时间
             var (lastTermStart, lastTermEnd) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow, "lastterm");   //计算上学期开始/结束时间
             var (lastTermStart, lastTermEnd) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow, "lastterm");   //计算上学期开始/结束时间
@@ -358,10 +362,10 @@ namespace TEAMModelBI.Controllers.Census
         public async Task<IActionResult> GetSchool(JsonElement jsonElement)
         public async Task<IActionResult> GetSchool(JsonElement jsonElement)
         {
         {
             if (!jsonElement.TryGetProperty("id", out JsonElement id)) return BadRequest();
             if (!jsonElement.TryGetProperty("id", out JsonElement id)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            if ($"{site}".Equals(BIConst.Global))
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            //if ($"{site}".Equals(BIConst.Global))
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             List<object> infos = new List<object>();
             List<object> infos = new List<object>();
 
 
             string sqlTxt = $"select value(c) from c where c.id='{id}'";
             string sqlTxt = $"select value(c) from c where c.id='{id}'";

+ 41 - 36
TEAMModelBI/Controllers/LoginController.cs

@@ -98,15 +98,16 @@ namespace TEAMModelBI.Controllers
                 }
                 }
                 //自己传的code
                 //自己传的code
                 if (!jsonElement.TryGetProperty("code", out JsonElement LoginTempCode)) return BadRequest();
                 if (!jsonElement.TryGetProperty("code", out JsonElement LoginTempCode)) return BadRequest();
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-                if ($"{site}".Equals(BIConst.Global))
-                {
-                    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-                    Website = BIConst.Global;
-                }
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //{
+                //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+                //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+                //    Website = BIConst.Global;
+                //}
 
 
                 //获取access_token
                 //获取access_token
                 IDingTalkClient tokenClient = new DefaultDingTalkClient("https://oapi.dingtalk.com/gettoken");
                 IDingTalkClient tokenClient = new DefaultDingTalkClient("https://oapi.dingtalk.com/gettoken");
@@ -320,16 +321,17 @@ namespace TEAMModelBI.Controllers
                 if (!jsonElement.TryGetProperty("rowKey", out JsonElement userId)) return BadRequest();
                 if (!jsonElement.TryGetProperty("rowKey", out JsonElement userId)) return BadRequest();
                 jsonElement.TryGetProperty("id_token", out JsonElement idtoken);
                 jsonElement.TryGetProperty("id_token", out JsonElement idtoken);
                 jsonElement.TryGetProperty("mobile", out JsonElement mobile);
                 jsonElement.TryGetProperty("mobile", out JsonElement mobile);
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                jsonElement.TryGetProperty("site", out JsonElement site); //分开部署,就不需要,一站多用时,取消注释
                 string Website = "China";
                 string Website = "China";
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-                if ($"{site}".Equals(BIConst.Global))
-                {
-                    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-                    Website = BIConst.Global;
-                }
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //{
+                //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+                //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+                //    Website = BIConst.Global;
+                //}
 
 
                 HttpClient httpClient = _http.CreateClient();
                 HttpClient httpClient = _http.CreateClient();
                 var table = _azureStorage.GetCloudTableClient().GetTableReference("BIDDUserInfo");
                 var table = _azureStorage.GetCloudTableClient().GetTableReference("BIDDUserInfo");
@@ -425,17 +427,18 @@ namespace TEAMModelBI.Controllers
                 if (!jsonElement.TryGetProperty("mobile", out JsonElement moile)) return BadRequest();
                 if (!jsonElement.TryGetProperty("mobile", out JsonElement moile)) return BadRequest();
                 if (!jsonElement.TryGetProperty("partitionKey", out JsonElement partitionKey)) return BadRequest();
                 if (!jsonElement.TryGetProperty("partitionKey", out JsonElement partitionKey)) return BadRequest();
                 if (!jsonElement.TryGetProperty("rowKey", out JsonElement userId)) return BadRequest();
                 if (!jsonElement.TryGetProperty("rowKey", out JsonElement userId)) return BadRequest();
-                
-                jsonElement.TryGetProperty("site", out JsonElement site); 
+
+                //jsonElement.TryGetProperty("site", out JsonElement site); //分开部署,就不需要,一站多用时,取消注释
                 string Website = "China";
                 string Website = "China";
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-                if ($"{site}".Equals(BIConst.Global))
-                {
-                    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-                    Website = BIConst.Global;
-                }
+                ////分开部署,就不需要,一站多用时,取消注释
+                //if ($"{site}".Equals(BIConst.Global))
+                //{
+                //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+                //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+                //    Website = BIConst.Global;
+                //}
                 var table = tableClient.GetTableReference("BIDDUserInfo");
                 var table = tableClient.GetTableReference("BIDDUserInfo");
                 var tempUser = await table.FindListByDict<DingDingUserInfo>(new Dictionary<string, object> { { "PartitionKey", $"{partitionKey}" }, { "userId", $"{userId}" } });
                 var tempUser = await table.FindListByDict<DingDingUserInfo>(new Dictionary<string, object> { { "PartitionKey", $"{partitionKey}" }, { "userId", $"{userId}" } });
 
 
@@ -512,17 +515,18 @@ namespace TEAMModelBI.Controllers
             jsonElement.TryGetProperty("mobile", out JsonElement mobile);
             jsonElement.TryGetProperty("mobile", out JsonElement mobile);
             jsonElement.TryGetProperty("mail", out JsonElement mail);
             jsonElement.TryGetProperty("mail", out JsonElement mail);
             if (!jsonElement.TryGetProperty("pwd", out JsonElement password)) return BadRequest();
             if (!jsonElement.TryGetProperty("pwd", out JsonElement password)) return BadRequest();
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
 
 
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var tableClient = _azureStorage.GetCloudTableClient();
             var tableClient = _azureStorage.GetCloudTableClient();
             var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
             var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-            if ($"{site}".Equals(BIConst.Global))
-            {
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-            }
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //{
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+            //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+            //}
             
             
             string loginSql = null;
             string loginSql = null;
             if (!string.IsNullOrEmpty($"{mobile}"))
             if (!string.IsNullOrEmpty($"{mobile}"))
@@ -573,17 +577,18 @@ namespace TEAMModelBI.Controllers
             if (!jsonElement.TryGetProperty("mobile", out JsonElement mobile)) return BadRequest();
             if (!jsonElement.TryGetProperty("mobile", out JsonElement mobile)) return BadRequest();
             jsonElement.TryGetProperty("mail", out JsonElement mail);
             jsonElement.TryGetProperty("mail", out JsonElement mail);
             jsonElement.TryGetProperty("pwd", out JsonElement pwd);
             jsonElement.TryGetProperty("pwd", out JsonElement pwd);
-            jsonElement.TryGetProperty("site", out JsonElement site);
+            //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
 
 
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var tableClient = _azureStorage.GetCloudTableClient();
             var tableClient = _azureStorage.GetCloudTableClient();
             var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
             var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-            if ($"{site}".Equals(BIConst.Global))
-            {
-                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-            }
+            ////分开部署,就不需要,一站多用时,取消注释
+            //if ($"{site}".Equals(BIConst.Global))
+            //{
+            //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+            //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+            //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+            //}
 
 
             string loginSql = null;
             string loginSql = null;
             if (!string.IsNullOrEmpty($"{mobile}"))
             if (!string.IsNullOrEmpty($"{mobile}"))

+ 6 - 6
TEAMModelBI/Controllers/ManySiteCut/SystemConfigController.cs

@@ -76,7 +76,7 @@ namespace TEAMModelBI.Controllers.ManySiteCut
             try
             try
             {
             {
                 if (!jsonElement.TryGetProperty("busy", out JsonElement busy)) return BadRequest();
                 if (!jsonElement.TryGetProperty("busy", out JsonElement busy)) return BadRequest();
-                jsonElement.TryGetProperty("site", out JsonElement site);
+                //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
                 jsonElement.TryGetProperty("proDeptId", out JsonElement proDeptId);
                 jsonElement.TryGetProperty("proDeptId", out JsonElement proDeptId);
                 jsonElement.TryGetProperty("appId", out JsonElement appId);
                 jsonElement.TryGetProperty("appId", out JsonElement appId);
                 jsonElement.TryGetProperty("appKey", out JsonElement appKey);
                 jsonElement.TryGetProperty("appKey", out JsonElement appKey);
@@ -102,11 +102,11 @@ namespace TEAMModelBI.Controllers.ManySiteCut
                 switch ($"{busy}")
                 switch ($"{busy}")
                 {
                 {
                     case "website":
                     case "website":
-                        if (!string.IsNullOrEmpty($"{site}"))
-                        {
-                            jsonObject["Option"]["Location"] = $"{site}";
-                            jsonObjectDeve["Option"]["Location"] = $"{site}";
-                        }
+                        //if (!string.IsNullOrEmpty($"{site}"))
+                        //{
+                        //    jsonObject["Option"]["Location"] = $"{site}";
+                        //    jsonObjectDeve["Option"]["Location"] = $"{site}";
+                        //}
 
 
                         if (!string.IsNullOrEmpty($"{proDeptId}"))
                         if (!string.IsNullOrEmpty($"{proDeptId}"))
                         {
                         {