Li 2 年之前
父节点
当前提交
6a78943ec2

+ 49 - 42
TEAMModelBI/Controllers/Census/SchoolController.cs

@@ -493,6 +493,8 @@ namespace TEAMModelBI.Controllers.Census
             return Ok(new { state = RespondCode.Ok, scCnt = scIds.Count, tchCnt, stuCnt, allCnt = tLessCnt + tActCnt, tLessCnt, tActCnt });
         }
 
+        #region   新的统计接口
+
         /// <summary>
         /// 学校统计     
         /// 新的数据结构
@@ -1007,52 +1009,11 @@ namespace TEAMModelBI.Controllers.Census
             return Ok(new { state = RespondCode.Ok, areaScStats, schoolInfos, weekLess, assists = assits.Where((w, i) => assits.FindIndex(s => s.id.Equals(w.id)) == i).ToList(), saless = saless.Where((w, i) => saless.FindIndex(f => f.id.Equals(w.id)) == i).ToList() });
         }
 
-
         /// <summary>
-        /// 学校信息中间件查询接口
+        /// 所有区级的统计
         /// </summary>
         /// <param name="jsonElement"></param>
         /// <returns></returns>
-        [ProducesDefaultResponseType]
-        [HttpPost("get-scinfos")]
-        public async Task<IActionResult> GetScInfos(JsonElement jsonElement)
-        {
-            var cosmosClient = _azureCosmos.GetCosmosClient();
-            jsonElement.TryGetProperty("role", out JsonElement role);
-            jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
-            jsonElement.TryGetProperty("areaId", out JsonElement areaId);
-
-            StringBuilder sql = new($"select value(c) from c");
-
-            if (!string.IsNullOrEmpty($"{role}") && !string.IsNullOrEmpty($"{tmdId}") && string.IsNullOrEmpty($"{areaId}"))
-            {
-                switch ($"{role}")
-                {
-                    case "assist":
-                        sql.Append($" join a in c.assist where a.id='{tmdId}'");
-                        break;
-                    case "sales":
-                        sql.Append($" join a in c.sales where a.id='{tmdId}'");
-                        break;
-                }
-            }
-
-            if (!string.IsNullOrEmpty($"{areaId}") && !string.IsNullOrEmpty($"{role}"))
-            {
-                sql.Append($" where c.areaId ='{areaId}'");
-            }
-
-            //List<string> scId = await CommonFind.FindScIds(cosmosClient, "select value(c.id) from c ", "Base");
-
-            List<BIRelation> scInfos = new();
-            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<BIRelation>(queryText: sql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("BIRel") }))
-            {
-                scInfos.Add(item);
-            }
-
-            return Ok(new { state = RespondCode.Ok, allCnt = scInfos.Count, scInfos });
-        }
-
         [ProducesDefaultResponseType]
         [HttpPost("get-allscstats")]
         public async Task<IActionResult> GetAllAreaStats(JsonElement jsonElement)
@@ -1150,6 +1111,52 @@ namespace TEAMModelBI.Controllers.Census
             return Ok(new { state = RespondCode.Ok, allScStats });
         }
 
+        #endregion   新的统计接口
+
+        /// <summary>
+        /// 学校信息中间件查询接口
+        /// </summary>
+        /// <param name="jsonElement"></param>
+        /// <returns></returns>
+        [ProducesDefaultResponseType]
+        [HttpPost("get-scinfos")]
+        public async Task<IActionResult> GetScInfos(JsonElement jsonElement)
+        {
+            var cosmosClient = _azureCosmos.GetCosmosClient();
+            jsonElement.TryGetProperty("role", out JsonElement role);
+            jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
+            jsonElement.TryGetProperty("areaId", out JsonElement areaId);
+
+            StringBuilder sql = new($"select value(c) from c");
+
+            if (!string.IsNullOrEmpty($"{role}") && !string.IsNullOrEmpty($"{tmdId}") && string.IsNullOrEmpty($"{areaId}"))
+            {
+                switch ($"{role}")
+                {
+                    case "assist":
+                        sql.Append($" join a in c.assist where a.id='{tmdId}'");
+                        break;
+                    case "sales":
+                        sql.Append($" join a in c.sales where a.id='{tmdId}'");
+                        break;
+                }
+            }
+
+            if (!string.IsNullOrEmpty($"{areaId}") && !string.IsNullOrEmpty($"{role}"))
+            {
+                sql.Append($" where c.areaId ='{areaId}'");
+            }
+
+            //List<string> scId = await CommonFind.FindScIds(cosmosClient, "select value(c.id) from c ", "Base");
+
+            List<BIRelation> scInfos = new();
+            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<BIRelation>(queryText: sql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("BIRel") }))
+            {
+                scInfos.Add(item);
+            }
+
+            return Ok(new { state = RespondCode.Ok, allCnt = scInfos.Count, scInfos });
+        }
 
 
         /// <summary>

+ 6 - 3
TEAMModelOS.SDK/Models/Cosmos/BI/BINormal/BizConfig.cs

@@ -266,11 +266,14 @@ namespace TEAMModelOS.SDK.Models.Cosmos.BI.BINormal
         /// </summary>
 
         public string webhook { get; set; }
-
         /// <summary>
-        /// 是否https 0 否,1 是 
+        /// webhook的访问金钥
+        /// </summary>
+        public string webhookToken { get; set; }
+        /// <summary>
+        /// webhook的访问金钥
         /// </summary>
-        public int https { get; set; } = 0;
+        public string webhookHead { get; set; }
 
         /// <summary>
         /// 授权的token ,存放 scope="business",Sub="合作方id",  9e40e436-f958-498d-93cf-4242b77a17ab