Explorar el Código

Merge branch 'PL/develop-BI' into develop

Li hace 2 años
padre
commit
16d66d6843

+ 19 - 23
TEAMModelBI/Controllers/BITest/TestController.cs

@@ -1232,7 +1232,6 @@ namespace TEAMModelBI.Controllers.BITest
                 redisClinet = _azureRedis.GetRedisClient(dbnum: 8, name: BIConst.Global);
             }
 
-
             #region  依赖注入的方式 
 
             DateTimeOffset dateTime = DateTimeOffset.UtcNow;
@@ -1388,16 +1387,14 @@ namespace TEAMModelBI.Controllers.BITest
                         json.TryGetProperty("url", out JsonElement base64);
                         using (MemoryStream ms = new MemoryStream(Convert.FromBase64String($"{base64}")))
                         {
-                            image = await _azureStorage.GetBlobContainerClient("0-public").UploadFileByContainer(ms, $"visitCnt/{y}{m}{d}", $"{y}{m}{d}{h}.png", false);
+                            image = await _azureStorage.GetBlobContainerClient("0-public").UploadFileByContainer(ms, $"visitCnt/{y}{m}{d}", $"{h}.png", false);
                         }
                     }
                 }
-                catch (Exception ex)
-                {
+                catch (Exception ex) { }
 
-                }
-                await _dingDing.SendBotMarkdown("防火墙日志记录", $"#### 测试(小时)-防火墙日志记录\n> 记录时间:{datetime.AddHours(8).ToString("yyyy-MM-dd HH")}\n> ![screenshot]({image})\n> ###### 发布时间:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}" +
-                    $" [发布地址]({publishUrl}) \n", GroupNames.醍摩豆服務運維群組);
+                //await _dingDing.SendBotMarkdown("防火墙日志记录", $"#### 测试(小时)-防火墙日志记录\n> 记录时间:{datetime.AddHours(8).ToString("yyyy-MM-dd HH")}\n> ![screenshot]({image})\n> ###### 发布时间:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}" +
+                   // $" [发布地址]({publishUrl}) \n", GroupNames.醍摩豆服務運維群組);
             }
 
             if (h.Equals("00"))
@@ -1436,31 +1433,30 @@ namespace TEAMModelBI.Controllers.BITest
             return Ok(new { state = 200});
         }
 
-
         /// <summary>
         /// 测试研究table 表分页的问题
         /// </summary>
         /// <param name="jsonElement"></param>
         /// <returns></returns>
         [HttpPost("get-logrec")]
-            public async Task<IActionResult> GetLogRec(JsonElement jsonElement)
-            {
-                int takeCount = 500;
-                var table = _azureStorage.GetCloudTableClient().GetTableReference("BIOptLog");
-                var table1 = _azureStorage.GetCloudTableClient();
-                int pagesize = 10;
-                int pageNum = 2;
+        public async Task<IActionResult> GetLogRec(JsonElement jsonElement)
+        {
+            int takeCount = 500;
+            var table = _azureStorage.GetCloudTableClient().GetTableReference("BIOptLog");
+            var table1 = _azureStorage.GetCloudTableClient();
+            int pagesize = 10;
+            int pageNum = 2;
 
-                var query = (from entity in table.CreateQuery<BIOptLog>()
-                             select entity).ToList().Skip(pagesize * (pageNum - 1)).Take(pagesize);
+            var query = (from entity in table.CreateQuery<BIOptLog>()
+                         select entity).ToList().Skip(pagesize * (pageNum - 1)).Take(pagesize);
 
-                //var query = (from entity in table.CreateQuery<BIOptLog>()
-                //             orderby entity.time descending
-                //             select  entity).Skip(pagesize * (pageNum - 1)).Take(pagesize);
-                //var ster = AzureStorageTableExtensions.GetTablePage<BIOptLog>(table1, "BIOptLog", 10, 1);
-                return Ok(new { state = 200, query });
+            //var query = (from entity in table.CreateQuery<BIOptLog>()
+            //             orderby entity.time descending
+            //             select  entity).Skip(pagesize * (pageNum - 1)).Take(pagesize);
+            //var ster = AzureStorageTableExtensions.GetTablePage<BIOptLog>(table1, "BIOptLog", 10, 1);
+            return Ok(new { state = 200, query });
 
-            }
+        }
 
 
         public class linqTest

+ 5 - 1
TEAMModelBI/Controllers/Census/BlobLogController.cs

@@ -53,8 +53,10 @@ namespace TEAMModelBI.Controllers.Census
                 cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             StringBuilder sqlSize = new($"select value(sum(c.size)) from c ");
             long useSize = 0;  //使用大小
+            int recCount = 0;
             Dictionary<string, int> typeCnt = new();
 
+
             List<string> schoolIds = new();
             if (!string.IsNullOrEmpty($"{areaId}"))
             {
@@ -70,6 +72,7 @@ namespace TEAMModelBI.Controllers.Census
                         string typeSql = $"select value(count(c.id)) from c where c.pk='Bloblog' and {inScStr} and c.type='{item}'";
                         fileCnt = await CommonFind.GetSqlValueCount(cosmosClient, new List<string>() { "School", "Teacher" }, typeSql);
                     }
+                    recCount += fileCnt;
                     typeCnt.Add(item, fileCnt);
                 }
 
@@ -95,6 +98,7 @@ namespace TEAMModelBI.Controllers.Census
                     int fileCnt = await CommonFind.GetSqlValueCount(cosmosClient, new List<string>() { "School", "Teacher" }, typeSql);
 
                     typeCnt.Add(item, fileCnt);
+                    recCount += fileCnt;
                 }
                 schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"select c.id from c", "Base");
                 foreach (var id in schoolIds)
@@ -114,7 +118,7 @@ namespace TEAMModelBI.Controllers.Census
 
             var areaSize = await CommonFind.GetSqlValueCount(cosmosClient, "School", sqlSize.ToString(), "Base");
 
-            return Ok(new { state = 200, areaSize, useSize, typeCount = typeCnt.ToList() });
+            return Ok(new { state = 200, areaSize, useSize, typeCount = typeCnt.ToList(), recCount });
         }
 
         /// <summary>

+ 3 - 3
TEAMModelBI/TEAMModelBI.csproj

@@ -43,9 +43,9 @@
 		<SpaRoot>ClientApp\</SpaRoot>
 		<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
 		<UserSecretsId>078b5d89-7d90-4f6a-88fc-7d96025990a8</UserSecretsId>
-		<Version>5.2207.27</Version>
-		<AssemblyVersion>5.2207.27.1</AssemblyVersion>
-		<FileVersion>5.2207.27.1</FileVersion>
+		<Version>1.2207.27</Version>
+		<AssemblyVersion>1.2207.27.1</AssemblyVersion>
+		<FileVersion>1.2207.27.1</FileVersion>
 		<Description>TEAMModelBI(BI)</Description>
 		<PackageReleaseNotes>BI版本说明版本切换标记202200701</PackageReleaseNotes>
 		<PackageId>TEAMModelBI</PackageId>