|
@@ -47,6 +47,7 @@ using System.Diagnostics;
|
|
using StackExchange.Redis;
|
|
using StackExchange.Redis;
|
|
using TEAMModelBI.Tool.Context;
|
|
using TEAMModelBI.Tool.Context;
|
|
using TEAMModelBI.DI.BIAzureStorage;
|
|
using TEAMModelBI.DI.BIAzureStorage;
|
|
|
|
+using TEAMModelOS.SDK.Models.Service.BI;
|
|
|
|
|
|
namespace TEAMModelBI.Controllers.BITest
|
|
namespace TEAMModelBI.Controllers.BITest
|
|
{
|
|
{
|
|
@@ -1408,6 +1409,11 @@ namespace TEAMModelBI.Controllers.BITest
|
|
return Ok(new { state = 200, linqTest,cosmosClient,site });
|
|
return Ok(new { state = 200, linqTest,cosmosClient,site });
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 查询一个实体信息
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="jsonElement"></param>
|
|
|
|
+ /// <returns></returns>
|
|
[HttpPost("get-bizschool")]
|
|
[HttpPost("get-bizschool")]
|
|
public async Task<IActionResult> GetTable(JsonElement jsonElement)
|
|
public async Task<IActionResult> GetTable(JsonElement jsonElement)
|
|
{
|
|
{
|
|
@@ -1416,10 +1422,87 @@ namespace TEAMModelBI.Controllers.BITest
|
|
var tableClient = _azureStorage.GetCloudTableClient();
|
|
var tableClient = _azureStorage.GetCloudTableClient();
|
|
var table = _azureStorage.GetCloudTableClient().GetTableReference("IESOpenApi");
|
|
var table = _azureStorage.GetCloudTableClient().GetTableReference("IESOpenApi");
|
|
BusinessSchool tempUser = table.Get<BusinessSchool>(partitionKey: $"{partitionKey}", rowKey: $"{rowKey}");
|
|
BusinessSchool tempUser = table.Get<BusinessSchool>(partitionKey: $"{partitionKey}", rowKey: $"{rowKey}");
|
|
|
|
+ return Ok(new { state = 200, table = tempUser });
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ [HttpPost("get-testway")]
|
|
|
|
+ public async Task<IActionResult> TestWay (JsonElement jsonElement)
|
|
|
|
+ {
|
|
|
|
+ jsonElement.TryGetProperty("source", out JsonElement source);
|
|
|
|
+ jsonElement.TryGetProperty("splitChar", out JsonElement splitChar);
|
|
|
|
+ jsonElement.TryGetProperty("indexes", out JsonElement indexes);
|
|
|
|
+ jsonElement.TryGetProperty("num", out JsonElement num);
|
|
|
|
|
|
|
|
+ var upS= BICommonWay.SplitStr(source.GetString(), ',', indexes.GetInt32(), num.GetInt32());
|
|
|
|
+ return Ok(new { state = 200, source, upS });
|
|
|
|
+ }
|
|
|
|
|
|
- return Ok(new { state = 200, table = tempUser });
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ List<string> schools = new()
|
|
|
|
+ {
|
|
|
|
+ "dghznx",
|
|
|
|
+ "cxhhlx",
|
|
|
|
+ "xjaxx",
|
|
|
|
+ "zjqxx",
|
|
|
|
+ "xnygxx",
|
|
|
|
+ "lxxcfx",
|
|
|
|
+ "gxjrxx",
|
|
|
|
+ "cdgxsx",
|
|
|
|
+ "yzxx",
|
|
|
|
+ "kjyxx",
|
|
|
|
+ "wjylxx",
|
|
|
|
+ "dsgjxx",
|
|
|
|
+ "ydzt",
|
|
|
|
+ "xndbxx",
|
|
|
|
+ "sqtszx",
|
|
|
|
+ "cdxczx",
|
|
|
|
+ "ghsyzx",
|
|
|
|
+ "lqsx",
|
|
|
|
+ "cdxxps",
|
|
|
|
+ "xcfx",
|
|
|
|
+ "xyqxx",
|
|
|
|
+ "xncbyy",
|
|
|
|
+ "cdlqjk",
|
|
|
|
+ "lqdmxx",
|
|
|
|
+ "lqyx",
|
|
|
|
+ "pclxxx",
|
|
|
|
+ "cdfzx",
|
|
|
|
+ "xnblxx",
|
|
|
|
+ "ghsx",
|
|
|
|
+ "khdycz",
|
|
|
|
+ "khbmxx",
|
|
|
|
+ "khdecz",
|
|
|
|
+ "khzx",
|
|
|
|
+ "khhbzx",
|
|
|
|
+ "gxxcxx",
|
|
|
|
+ "khhtxx",
|
|
|
|
+ "khdxxx",
|
|
|
|
+ "khsyxx"
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ public async Task SetTeacherSchool(AzureCosmosFactory _azureCosmos)
|
|
|
|
+ {
|
|
|
|
+ var cosmosClient = _azureCosmos.GetCosmosClient();
|
|
|
|
+ foreach (var item in schools)
|
|
|
|
+ {
|
|
|
|
+ School school = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemAsync<School>($"{item}", new PartitionKey("Base"));
|
|
|
|
+
|
|
|
|
+ List<Teacher> teachers = new();
|
|
|
|
+ await foreach (var tch in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<Teacher>(queryText: $"SELECT value(c) FROM c join s in c.schools where s.schoolId='dghznx' and c.code='Base'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
|
|
|
|
+ {
|
|
|
|
+ teachers.Add(tch);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (teachers.Count > 0)
|
|
|
|
+ {
|
|
|
|
+ foreach (var teacher in teachers)
|
|
|
|
+ {
|
|
|
|
+ teacher.schools.ForEach(tch => { if (tch.schoolId.Equals(item)) { tch.areaId = school.areaId; } });
|
|
|
|
+ await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync<Teacher>(teacher, teacher.id, new PartitionKey("Base"));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public class linqTest
|
|
public class linqTest
|