|
@@ -37,6 +37,8 @@ using DocumentFormat.OpenXml.Wordprocessing;
|
|
|
using DocumentFormat.OpenXml.Bibliography;
|
|
|
using HTEXLib;
|
|
|
using TEAMModelOS.SDK.Models.Service.BI;
|
|
|
+using TEAMModelOS.SDK.Models.Cosmos.BI.BISchool;
|
|
|
+using DocumentFormat.OpenXml.Vml.Office;
|
|
|
|
|
|
namespace TEAMModelBI.Controllers.BISchool
|
|
|
{
|
|
@@ -53,8 +55,9 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
//读取配置信息
|
|
|
private readonly IConfiguration _configuration;
|
|
|
private readonly CoreAPIHttpService _coreAPIHttpService;
|
|
|
+ private readonly HttpTrigger _httpTrigger;
|
|
|
|
|
|
- public BatchSchoolController(AzureCosmosFactory azureCosmos, DingDing dingDing, AzureStorageFactory azureStorage, IOptionsSnapshot<Option> option, IWebHostEnvironment hostingEnvironment, IConfiguration configuration, IHttpClientFactory http, CoreAPIHttpService coreAPIHttpService)
|
|
|
+ public BatchSchoolController(AzureCosmosFactory azureCosmos, DingDing dingDing, AzureStorageFactory azureStorage, IOptionsSnapshot<Option> option, IWebHostEnvironment hostingEnvironment, IConfiguration configuration, IHttpClientFactory http, CoreAPIHttpService coreAPIHttpService, HttpTrigger httpTrigger)
|
|
|
{
|
|
|
_azureCosmos = azureCosmos;
|
|
|
_dingDing = dingDing;
|
|
@@ -64,6 +67,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
_configuration = configuration;
|
|
|
_http = http;
|
|
|
_coreAPIHttpService = coreAPIHttpService;
|
|
|
+ _httpTrigger = httpTrigger;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -185,7 +189,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
if (schoolStatu.Status != 200) tempStaus = false;
|
|
|
else createSchoolInfo.createCount = createSchoolInfo.createCount >= 3 ? createSchoolInfo.createCount = 3 : createSchoolInfo.createCount += 1;
|
|
|
} while (tempStaus);
|
|
|
-
|
|
|
+
|
|
|
if (createSchoolInfo.id != null)
|
|
|
{
|
|
|
string campusId = Guid.NewGuid().ToString();
|
|
@@ -211,6 +215,8 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
schoolCode = createSchoolInfo.id,
|
|
|
period = PresetSchoolPeriod(bischool.period, foundSchools.lang, campusId),
|
|
|
scale = bischool.size >= 300 ? 500 : 0,
|
|
|
+ isinit = true,
|
|
|
+ openLessonRecord = (_option.Location.Contains("Global")) ? false : true,
|
|
|
createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
|
|
|
};
|
|
|
scInfos.Add(createSchoolInfo);
|
|
@@ -218,9 +224,16 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
stringBuilder.Append($"创建学校:{upSchool.name}【{upSchool.id}】");
|
|
|
noticeDD.Append($"{upSchool.name}【{upSchool.id}】 \r 学校管理员信息:");
|
|
|
upSc.Add(upSchool.id);
|
|
|
+
|
|
|
//创建学校
|
|
|
await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync<School>(upSchool, new PartitionKey(upSchool.code));
|
|
|
-
|
|
|
+ //创建学校信息中间件
|
|
|
+ //_ = _httpTrigger.RequestHttpTrigger(new { school = $"{upSchool}" }, _option.Location, "set-sc-birelation");
|
|
|
+ await BIStats.SetSchoolBIRelation(cosmosClient, blobClient, tableClient, _dingDing, upSchool);
|
|
|
+
|
|
|
+ //创建BI和统计信息
|
|
|
+ await BIStats.SetScStatsInfo(cosmosClient, _dingDing,upSchool);
|
|
|
+
|
|
|
var content = new StringContent(bischool.admin.ToArray().ToJsonString(), Encoding.UTF8, "application/json");
|
|
|
string json = await _coreAPIHttpService.GetUserInfos(content);
|
|
|
List<TmdUserinfo> tmdInfos = json.ToObject<List<TmdUserinfo>>();
|
|
@@ -235,7 +248,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
teacher = tchJson.ToObject<Teacher>();
|
|
|
Teacher.TeacherSchool tchSc = null;
|
|
|
//var tempTch = teacher.schools.Select(x => x.schoolId.Equals(upSchool.id)).ToString();
|
|
|
- tchSc = teacher.schools.Find(x => x.schoolId.Equals(upSchool.id));
|
|
|
+ tchSc = teacher.schools.Find(x => x.schoolId.Equals(upSchool.id));
|
|
|
if (tchSc == null)
|
|
|
{
|
|
|
//教师存在,在该教师信息中添加要管理的学校信息
|
|
@@ -247,7 +260,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
{
|
|
|
id = tmdIndo.id,
|
|
|
code = $"Teacher-{createSchoolInfo.id}",
|
|
|
- roles = new List<string> { "admin" },
|
|
|
+ roles = new List<string> { "admin", "teacher" },
|
|
|
job = "管理员",
|
|
|
name = teacher.name,
|
|
|
picture = teacher.picture,
|
|
@@ -285,7 +298,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
{
|
|
|
id = tmdIndo.id,
|
|
|
code = $"Teacher-{createSchoolInfo.id}",
|
|
|
- roles = new List<string> { "admin" },
|
|
|
+ roles = new List<string> { "admin", "teacher" },
|
|
|
job = "管理员",
|
|
|
name = $"{tmdIndo.name}",
|
|
|
picture = "",
|
|
@@ -295,7 +308,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
ttl = -1
|
|
|
};
|
|
|
|
|
|
- stringBuilder.Append($"权限:{string.Join(",", schoolTeacher.roles)}】");
|
|
|
+ stringBuilder.Append($"权限:{string.Join(",", schoolTeacher.roles)}】");
|
|
|
noticeDD.Append($"{schoolTeacher.name}【{schoolTeacher.id}】");
|
|
|
await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync<SchoolTeacher>(schoolTeacher, new PartitionKey(schoolTeacher.code));
|
|
|
}
|
|
@@ -476,9 +489,10 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
|
|
|
if (upSc.Count > 1)
|
|
|
await _dingDing.SendBotMsg($"BI,{_option.Location} \n 批量建校信息:{noticeDD}", GroupNames.成都开发測試群組);
|
|
|
- else if(upSc.Count == 1)
|
|
|
+ else if (upSc.Count == 1)
|
|
|
await _dingDing.SendBotMsg($"BI,{_option.Location} \n 单个建校信息:{noticeDD}", GroupNames.成都开发測試群組);
|
|
|
|
|
|
+
|
|
|
////v2通知
|
|
|
//Teacher targetTeacher = await cosmosClient.GetContainer(Constant.TEAMModelOS, Constant.Teacher).ReadItemAsync<Teacher>($"{_tmdId}", new PartitionKey($"Base"));
|
|
|
//_coreAPIHttpService.PushNotify(new List<IdNameCode> { new IdNameCode { id = targetTeacher.id, name = targetTeacher.name, code = targetTeacher.lang } }, "create-school", Constant.NotifyType_IES5_Management, new Dictionary<string, object> { { "tmdname", $"{_tmdName}" }, { "schooName", $"{vsSql}" } }, _option.Location, _configuration, _dingDing, _environment.ContentRootPath);
|
|
@@ -514,6 +528,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
try
|
|
|
{
|
|
|
jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
|
|
|
+ jsonElement.TryGetProperty("role", out JsonElement role);
|
|
|
jsonElement.TryGetProperty("scId", out JsonElement scId);
|
|
|
jsonElement.TryGetProperty("name", out JsonElement name);
|
|
|
jsonElement.TryGetProperty("order", out JsonElement order);
|
|
@@ -548,15 +563,41 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
if (jsonElement.TryGetProperty("contToken", out JsonElement ContToken))
|
|
|
pageToken = ContToken.GetString();
|
|
|
|
|
|
+ if (!string.IsNullOrEmpty($"{scId}") && string.IsNullOrEmpty($"{name}"))
|
|
|
+ {
|
|
|
+ stringBuilder.Append($" where c.id='{scId}'");
|
|
|
+ scCntSql.Append($" where c.id='{scId}'");
|
|
|
+ }
|
|
|
+ if (string.IsNullOrEmpty($"{scId}") && !string.IsNullOrEmpty($"{name}"))
|
|
|
+ {
|
|
|
+ stringBuilder.Append($" where Contains(c.name,'{name}')");
|
|
|
+ scCntSql.Append($" where Contains(c.name,'{name}')");
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty($"{province}") && string.IsNullOrEmpty($"{city}") && string.IsNullOrEmpty($"{dist}"))
|
|
|
+ {
|
|
|
+ stringBuilder.Append($" where Contains(c.province,'{province}')");
|
|
|
+ scCntSql.Append($" where Contains(c.province,'{province}')");
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty($"{city}") && !string.IsNullOrEmpty($"{city}") && string.IsNullOrEmpty($"{dist}"))
|
|
|
+ {
|
|
|
+ stringBuilder.Append($" where Contains(c.province,'{province}') and Contains(c.city,'{city}')");
|
|
|
+ scCntSql.Append($" where Contains(c.province,'{province}') and Contains(c.city,'{city}')");
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty($"{dist}") && !string.IsNullOrEmpty($"{city}") && !string.IsNullOrEmpty($"{dist}"))
|
|
|
+ {
|
|
|
+ stringBuilder.Append($" where Contains(c.province,'{province}') and Contains(c.city,'{city}') and Contains(c.dist,'{dist}')");
|
|
|
+ scCntSql.Append($" where Contains(c.province,'{province}') and Contains(c.city,'{city}') and Contains(c.dist,'{dist}')");
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($"{order}".Equals("desc"))
|
|
|
+ stringBuilder.Append(" order by c.createTime desc");
|
|
|
+
|
|
|
if (!string.IsNullOrEmpty($"{tmdId}"))
|
|
|
{
|
|
|
- schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}");
|
|
|
+ schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}", roles: !string.IsNullOrEmpty($"{role}") ? $"{role}" : "assist", isMany: true);
|
|
|
string scsSql = BICommonWay.ManyScSql("c.id", schoolIds);
|
|
|
scCntSql.Append($" where {scsSql}");
|
|
|
- }
|
|
|
|
|
|
- if (schoolIds.Count > 0)
|
|
|
- {
|
|
|
scCnt = await CommonFind.GetSqlValueCount(cosmosClient, "School", scCntSql.ToString(), "Base");
|
|
|
foreach (var id in schoolIds)
|
|
|
{
|
|
@@ -564,6 +605,8 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
|
|
|
if ($"{order}".Equals("desc"))
|
|
|
sqlTxt.Append(" order by c.createTime desc");
|
|
|
+ else
|
|
|
+ sqlTxt.Append(" order by c.createTime asc");
|
|
|
|
|
|
await foreach (var itemSchool in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<AssistSchool>(queryText: sqlTxt.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
|
|
|
{
|
|
@@ -573,35 +616,6 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (!string.IsNullOrEmpty($"{scId}") && string.IsNullOrEmpty($"{name}"))
|
|
|
- {
|
|
|
- stringBuilder.Append($" where c.id='{scId}'");
|
|
|
- scCntSql.Append($" where c.id='{scId}'");
|
|
|
- }
|
|
|
- if (string.IsNullOrEmpty($"{scId}") && !string.IsNullOrEmpty($"{name}"))
|
|
|
- {
|
|
|
- stringBuilder.Append($" where Contains(c.name,'{name}')");
|
|
|
- scCntSql.Append($" where Contains(c.name,'{name}')");
|
|
|
- }
|
|
|
- if (!string.IsNullOrEmpty($"{province}") && string.IsNullOrEmpty($"{city}") && string.IsNullOrEmpty($"{dist}"))
|
|
|
- {
|
|
|
- stringBuilder.Append($" where Contains(c.province,'{province}')");
|
|
|
- scCntSql.Append($" where Contains(c.province,'{province}')");
|
|
|
- }
|
|
|
- if (!string.IsNullOrEmpty($"{city}") && !string.IsNullOrEmpty($"{city}") && string.IsNullOrEmpty($"{dist}"))
|
|
|
- {
|
|
|
- stringBuilder.Append($" where Contains(c.province,'{province}') and Contains(c.city,'{city}')");
|
|
|
- scCntSql.Append($" where Contains(c.province,'{province}') and Contains(c.city,'{city}')");
|
|
|
- }
|
|
|
- if (!string.IsNullOrEmpty($"{dist}") && !string.IsNullOrEmpty($"{city}") && !string.IsNullOrEmpty($"{dist}"))
|
|
|
- {
|
|
|
- stringBuilder.Append($" where Contains(c.province,'{province}') and Contains(c.city,'{city}') and Contains(c.dist,'{dist}')");
|
|
|
- scCntSql.Append($" where Contains(c.province,'{province}') and Contains(c.city,'{city}') and Contains(c.dist,'{dist}')");
|
|
|
- }
|
|
|
-
|
|
|
- if ($"{order}".Equals("desc"))
|
|
|
- stringBuilder.Append(" order by c.createTime desc");
|
|
|
-
|
|
|
scCnt = await CommonFind.GetSqlValueCount(cosmosClient, "School", scCntSql.ToString(), "Base");
|
|
|
|
|
|
await foreach (var itemSchool in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: stringBuilder.ToString(), continuationToken: pageToken, requestOptions: new QueryRequestOptions() { MaxItemCount = pageSize, PartitionKey = new PartitionKey("Base") }))
|
|
@@ -622,6 +636,73 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //if (schoolIds.Count > 0)
|
|
|
+ //{
|
|
|
+ // scCnt = await CommonFind.GetSqlValueCount(cosmosClient, "School", scCntSql.ToString(), "Base");
|
|
|
+ // foreach (var id in schoolIds)
|
|
|
+ // {
|
|
|
+ // StringBuilder sqlTxt = new($"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 from c where c.id='{id}'");
|
|
|
+
|
|
|
+ // if ($"{order}".Equals("desc"))
|
|
|
+ // sqlTxt.Append(" order by c.createTime desc");
|
|
|
+
|
|
|
+ // await foreach (var itemSchool in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<AssistSchool>(queryText: sqlTxt.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
|
|
|
+ // {
|
|
|
+ // schoolAssists.Add(itemSchool);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+ //else
|
|
|
+ //{
|
|
|
+ // if (!string.IsNullOrEmpty($"{scId}") && string.IsNullOrEmpty($"{name}"))
|
|
|
+ // {
|
|
|
+ // stringBuilder.Append($" where c.id='{scId}'");
|
|
|
+ // scCntSql.Append($" where c.id='{scId}'");
|
|
|
+ // }
|
|
|
+ // if (string.IsNullOrEmpty($"{scId}") && !string.IsNullOrEmpty($"{name}"))
|
|
|
+ // {
|
|
|
+ // stringBuilder.Append($" where Contains(c.name,'{name}')");
|
|
|
+ // scCntSql.Append($" where Contains(c.name,'{name}')");
|
|
|
+ // }
|
|
|
+ // if (!string.IsNullOrEmpty($"{province}") && string.IsNullOrEmpty($"{city}") && string.IsNullOrEmpty($"{dist}"))
|
|
|
+ // {
|
|
|
+ // stringBuilder.Append($" where Contains(c.province,'{province}')");
|
|
|
+ // scCntSql.Append($" where Contains(c.province,'{province}')");
|
|
|
+ // }
|
|
|
+ // if (!string.IsNullOrEmpty($"{city}") && !string.IsNullOrEmpty($"{city}") && string.IsNullOrEmpty($"{dist}"))
|
|
|
+ // {
|
|
|
+ // stringBuilder.Append($" where Contains(c.province,'{province}') and Contains(c.city,'{city}')");
|
|
|
+ // scCntSql.Append($" where Contains(c.province,'{province}') and Contains(c.city,'{city}')");
|
|
|
+ // }
|
|
|
+ // if (!string.IsNullOrEmpty($"{dist}") && !string.IsNullOrEmpty($"{city}") && !string.IsNullOrEmpty($"{dist}"))
|
|
|
+ // {
|
|
|
+ // stringBuilder.Append($" where Contains(c.province,'{province}') and Contains(c.city,'{city}') and Contains(c.dist,'{dist}')");
|
|
|
+ // scCntSql.Append($" where Contains(c.province,'{province}') and Contains(c.city,'{city}') and Contains(c.dist,'{dist}')");
|
|
|
+ // }
|
|
|
+
|
|
|
+ // if ($"{order}".Equals("desc"))
|
|
|
+ // stringBuilder.Append(" order by c.createTime desc");
|
|
|
+
|
|
|
+ // scCnt = await CommonFind.GetSqlValueCount(cosmosClient, "School", scCntSql.ToString(), "Base");
|
|
|
+
|
|
|
+ // await foreach (var itemSchool in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: stringBuilder.ToString(), continuationToken: pageToken, requestOptions: new QueryRequestOptions() { MaxItemCount = pageSize, PartitionKey = new PartitionKey("Base") }))
|
|
|
+ // {
|
|
|
+ // using var json = await JsonDocument.ParseAsync(itemSchool.ContentStream);
|
|
|
+ // if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetInt16() > 0)
|
|
|
+ // {
|
|
|
+ // foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
|
|
|
+ // {
|
|
|
+ // schoolAssists.Add(obj.ToObject<AssistSchool>());
|
|
|
+ // }
|
|
|
+ // if (iscontinuation)
|
|
|
+ // {
|
|
|
+ // continuationToken = itemSchool.GetContinuationToken();
|
|
|
+ // break;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+
|
|
|
foreach (var item in schoolAssists)
|
|
|
{
|
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(item.id, new PartitionKey("ProductSum"));
|
|
@@ -637,7 +718,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
}
|
|
|
|
|
|
item.assists = await CommonFind.FindSchoolRoles(cosmosClient, item.id, "assist");
|
|
|
- item.scAdmin = await CommonFind.FindSchoolRoles(cosmosClient, item.id, "admin");
|
|
|
+ item.scAdmin = await CommonFind.FindSchoolRoles(cosmosClient, item.id, "admin");
|
|
|
item.lessonCount = await CommonFind.GetSqlValueCount(cosmosClient, "School", $"select value(count(c.id)) from c ", $"LessonRecord-{item.id}");
|
|
|
}
|
|
|
|
|
@@ -674,6 +755,133 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 所有信息
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="jsonElement"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [ProducesDefaultResponseType]
|
|
|
+ [HttpPost("get-allscinfo")]
|
|
|
+ public async Task<IActionResult> GetAllScsInfo(JsonElement jsonElement)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ jsonElement.TryGetProperty("tmdId", out JsonElement tmdId);
|
|
|
+ jsonElement.TryGetProperty("role", out JsonElement role);
|
|
|
+ jsonElement.TryGetProperty("scId", out JsonElement scId);
|
|
|
+ jsonElement.TryGetProperty("name", out JsonElement name);
|
|
|
+ jsonElement.TryGetProperty("order", out JsonElement order);
|
|
|
+
|
|
|
+ jsonElement.TryGetProperty("province", out JsonElement province);
|
|
|
+ jsonElement.TryGetProperty("city", out JsonElement city);
|
|
|
+ jsonElement.TryGetProperty("dist", out JsonElement dist);
|
|
|
+
|
|
|
+ //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
|
|
|
+ var cosmosClient = _azureCosmos.GetCosmosClient();
|
|
|
+ ////分开部署,就不需要,一站多用时,取消注释
|
|
|
+ //if ($"{site}".Equals(BIConst.Global))
|
|
|
+ // cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
|
|
|
+ int scCnt = 0;
|
|
|
+
|
|
|
+ List<AssistSchool> schoolAssists = new(); //返回学校列表集合
|
|
|
+ List<string> schoolIds = new();
|
|
|
+ StringBuilder stringBuilder = new("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 from c ");
|
|
|
+ StringBuilder scCntSql = new($"select value(count(c.id)) from c");
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty($"{scId}") && string.IsNullOrEmpty($"{name}"))
|
|
|
+ {
|
|
|
+ stringBuilder.Append($" where c.id='{scId}'");
|
|
|
+ scCntSql.Append($" where c.id='{scId}'");
|
|
|
+ }
|
|
|
+ if (string.IsNullOrEmpty($"{scId}") && !string.IsNullOrEmpty($"{name}"))
|
|
|
+ {
|
|
|
+ stringBuilder.Append($" where Contains(c.name,'{name}')");
|
|
|
+ scCntSql.Append($" where Contains(c.name,'{name}')");
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty($"{province}") && string.IsNullOrEmpty($"{city}") && string.IsNullOrEmpty($"{dist}"))
|
|
|
+ {
|
|
|
+ stringBuilder.Append($" where Contains(c.province,'{province}')");
|
|
|
+ scCntSql.Append($" where Contains(c.province,'{province}')");
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty($"{city}") && !string.IsNullOrEmpty($"{city}") && string.IsNullOrEmpty($"{dist}"))
|
|
|
+ {
|
|
|
+ stringBuilder.Append($" where Contains(c.province,'{province}') and Contains(c.city,'{city}')");
|
|
|
+ scCntSql.Append($" where Contains(c.province,'{province}') and Contains(c.city,'{city}')");
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty($"{dist}") && !string.IsNullOrEmpty($"{city}") && !string.IsNullOrEmpty($"{dist}"))
|
|
|
+ {
|
|
|
+ stringBuilder.Append($" where Contains(c.province,'{province}') and Contains(c.city,'{city}') and Contains(c.dist,'{dist}')");
|
|
|
+ scCntSql.Append($" where Contains(c.province,'{province}') and Contains(c.city,'{city}') and Contains(c.dist,'{dist}')");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty($"{tmdId}"))
|
|
|
+ {
|
|
|
+ schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}", roles: !string.IsNullOrEmpty($"{role}") ? $"{role}" : "assist", isMany: true);
|
|
|
+ string scsSql = BICommonWay.ManyScSql("c.id", schoolIds);
|
|
|
+ scCntSql.Append($" where {scsSql}");
|
|
|
+
|
|
|
+ scCnt = await CommonFind.GetSqlValueCount(cosmosClient, "School", scCntSql.ToString(), "Base");
|
|
|
+ foreach (var id in schoolIds)
|
|
|
+ {
|
|
|
+ StringBuilder sqlTxt = new($"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 from c where c.id='{id}'");
|
|
|
+
|
|
|
+ if ($"{order}".Equals("desc"))
|
|
|
+ sqlTxt.Append(" order by c.createTime desc");
|
|
|
+
|
|
|
+ await foreach (var itemSchool in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<AssistSchool>(queryText: sqlTxt.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
|
|
|
+ {
|
|
|
+ schoolAssists.Add(itemSchool);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if ($"{order}".Equals("desc"))
|
|
|
+ stringBuilder.Append(" order by c.createTime desc");
|
|
|
+
|
|
|
+ scCnt = await CommonFind.GetSqlValueCount(cosmosClient, "School", scCntSql.ToString(), "Base");
|
|
|
+
|
|
|
+ await foreach (var itemSchool in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: stringBuilder.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
|
|
|
+ {
|
|
|
+ using var json = await JsonDocument.ParseAsync(itemSchool.ContentStream);
|
|
|
+ if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetInt16() > 0)
|
|
|
+ {
|
|
|
+ foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
|
|
|
+ {
|
|
|
+ schoolAssists.Add(obj.ToObject<AssistSchool>());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ foreach (var item in schoolAssists)
|
|
|
+ {
|
|
|
+ var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(item.id, new PartitionKey("ProductSum"));
|
|
|
+ if (response.Status == 200)
|
|
|
+ {
|
|
|
+ using var json = await JsonDocument.ParseAsync(response.ContentStream);
|
|
|
+ if (json.RootElement.TryGetProperty("serial", out JsonElement serial) && !serial.ValueKind.Equals(JsonValueKind.Null))
|
|
|
+ item.serial = serial.ToObject<List<SchoolProductSumData>>().Select(x => x.prodCode).ToList();
|
|
|
+ if (json.RootElement.TryGetProperty("service", out JsonElement service) && !service.ValueKind.Equals(JsonValueKind.Null))
|
|
|
+ item.service = service.ToObject<List<SchoolProductSumData>>().Select(x => x.prodCode).ToList();
|
|
|
+ if (json.RootElement.TryGetProperty("hard", out JsonElement hard) && !hard.ValueKind.Equals(JsonValueKind.Null))
|
|
|
+ item.hard = hard.ToObject<List<SchoolProductSumDataHard>>().Select(x => x.prodCode).ToList();
|
|
|
+ }
|
|
|
+
|
|
|
+ item.assists = await CommonFind.FindSchoolRoles(cosmosClient, item.id, "assist");
|
|
|
+ item.scAdmin = await CommonFind.FindSchoolRoles(cosmosClient, item.id, "admin");
|
|
|
+ item.lessonCount = await CommonFind.GetSqlValueCount(cosmosClient, "School", $"select value(count(c.id)) from c ", $"LessonRecord-{item.id}");
|
|
|
+ }
|
|
|
+
|
|
|
+ return Ok(new { state = 200, scCnt, schoolAssists });
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ await _dingDing.SendBotMsg($"BI,{_option.Location} /batchschool/get-allscinfo() \n {ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
|
|
|
+ return BadRequest();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 使用yieId 关键字 本地效率未测出
|
|
|
/// </summary>
|
|
@@ -829,20 +1037,18 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
if (!jsonElement.TryGetProperty("picture", out JsonElement picture)) return BadRequest();
|
|
|
if (!jsonElement.TryGetProperty("size", out JsonElement size)) return BadRequest();
|
|
|
if (!jsonElement.TryGetProperty("scale", out JsonElement scale)) return BadRequest();
|
|
|
- if (!jsonElement.TryGetProperty("assistId", out JsonElement _assistId)) return BadRequest();
|
|
|
if (!jsonElement.TryGetProperty("type", out JsonElement _type)) return BadRequest();
|
|
|
jsonElement.TryGetProperty("province", out JsonElement province);
|
|
|
jsonElement.TryGetProperty("city", out JsonElement city);
|
|
|
jsonElement.TryGetProperty("dist", out JsonElement dist);
|
|
|
jsonElement.TryGetProperty("address", out JsonElement address);
|
|
|
|
|
|
+ jsonElement.TryGetProperty("assist", out JsonElement assist);
|
|
|
+ List<IdInfo> idInfos = assist.ToObject<List<IdInfo>>();
|
|
|
//jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
|
|
|
|
|
|
var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
|
|
|
|
|
|
- List<string> assistId = _assistId.ToObject<List<string>>();
|
|
|
- //List<string> periodS = period.ToObject<List<string>>();
|
|
|
- Dictionary<string, List<Dictionary<string, string>>> haveSchoolManger = new();
|
|
|
var cosmosClient = _azureCosmos.GetCosmosClient();
|
|
|
var tableClient = _azureStorage.GetCloudTableClient();
|
|
|
var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
|
|
@@ -880,6 +1086,10 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
//修改学校
|
|
|
await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReplaceItemAsync<School>(tempShool, tempShool.id, new PartitionKey("Base"));
|
|
|
|
|
|
+ //创建学校信息中间件
|
|
|
+ //_ = _httpTrigger.RequestHttpTrigger(new { school = $"{tempShool}" }, _option.Location, "set-sc-birelation");
|
|
|
+ //await BIStats.SetSchoolBIRelation(cosmosClient, blobClient, tableClient, _dingDing, tempShool);
|
|
|
+
|
|
|
//修改学校教师关联的信息
|
|
|
string sql = $"SELECT distinct value(c) FROM c join A1 in c.schools where A1.schoolId='{tempShool.id}'";
|
|
|
List<Teacher> teachers = new();
|
|
@@ -899,114 +1109,63 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemAsync(item, item.id, new PartitionKey($"Base"));
|
|
|
}
|
|
|
|
|
|
- if (assistId.Count > 0)
|
|
|
+ //需要重大修改后保留
|
|
|
+ BIRelation biRel = new();
|
|
|
+ var respRel = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(tempShool.id, new PartitionKey("BIRel"));
|
|
|
+ if (respRel.Status == 200)
|
|
|
{
|
|
|
- //修改学校顾问
|
|
|
- string sqlTxt = $"SELECT value(c) From c WHERE ARRAY_CONTAINS(c.roles,'assist',true)";
|
|
|
- List<SchoolTeacher> schoolTeachers = new();
|
|
|
- await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<SchoolTeacher>(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{tempShool.id}") }))
|
|
|
- {
|
|
|
- if (!assistId.Contains(item.id))
|
|
|
- {
|
|
|
- if (item.roles.Contains("assist"))
|
|
|
- {
|
|
|
- item.roles.Remove("assist");
|
|
|
- if (item.roles.Count > 0)
|
|
|
- {
|
|
|
- await cosmosClient.GetContainer("TEAMModelOS", "School").ReplaceItemAsync<SchoolTeacher>(item, item.id, new PartitionKey(item.code));
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- await cosmosClient.GetContainer("TEAMModelOS", "School").DeleteItemAsync<SchoolTeacher>(item.id, new PartitionKey(item.code));
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- foreach (var itemTeacher in assistId)
|
|
|
- {
|
|
|
- Teacher tempTeacher = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReadItemAsync<Teacher>($"{itemTeacher}", new PartitionKey("Base"));
|
|
|
- if (tempTeacher != null)
|
|
|
- {
|
|
|
- var haveTeacher = tempTeacher.schools.Find(x => x.schoolId.Equals($"{_schoolId}"));
|
|
|
- if (haveTeacher == null)
|
|
|
- {
|
|
|
- Teacher.TeacherSchool teacherSchool = new()
|
|
|
- {
|
|
|
- schoolId = tempShool.id,
|
|
|
- name = tempShool.name,
|
|
|
- status = "join",
|
|
|
- time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
|
|
|
- picture = tempShool.picture,
|
|
|
- areaId = tempShool.areaId
|
|
|
- };
|
|
|
- tempTeacher.schools.Add(teacherSchool);
|
|
|
- //给醍摩豆顾问添加学校
|
|
|
- await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemAsync<Teacher>(tempTeacher, tempTeacher.id, new PartitionKey($"Base"));
|
|
|
-
|
|
|
- ////不存在则在原来的基础上添加顾问角色
|
|
|
- //SchoolTeacher addSchoolTeacher = new()
|
|
|
- //{
|
|
|
- // id = itemTeacher,
|
|
|
- // code = $"Teacher-{tempShool.id}",
|
|
|
- // pk = "Teacher",
|
|
|
- // status = "join",
|
|
|
- // roles = new List<string>() { "assist" },
|
|
|
- // name = tempTeacher.name,
|
|
|
- // job = $"{tempShool.name}-顾问",
|
|
|
- // size = 0,
|
|
|
- // createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
|
|
|
- //};
|
|
|
-
|
|
|
- //var resScTch = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{itemTeacher}", new PartitionKey($"Teacher-{tempShool.id}"));
|
|
|
- //if(resScTch.)
|
|
|
-
|
|
|
- ////添加学校学校顾问
|
|
|
- //await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync<SchoolTeacher>(addSchoolTeacher, new PartitionKey($"Teacher-{tempShool.id}"));
|
|
|
- }
|
|
|
+ using var fileJson = await JsonDocument.ParseAsync(respRel.ContentStream);
|
|
|
+ biRel = fileJson.ToObject<BIRelation>();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ biRel.id = tempShool.id;
|
|
|
+ }
|
|
|
|
|
|
- //查询该教师是否存在该校
|
|
|
- SchoolTeacher schoolTeacher = null;
|
|
|
- var resScTch = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{itemTeacher}", new PartitionKey($"Teacher-{tempShool.id}"));
|
|
|
- if (resScTch.Status == 200)
|
|
|
- {
|
|
|
- using var tchJson = await JsonDocument.ParseAsync(resScTch.ContentStream);
|
|
|
- schoolTeacher = tchJson.ToObject<SchoolTeacher>();
|
|
|
- }
|
|
|
+ string aName = null;
|
|
|
+ if (!string.IsNullOrEmpty($"{tempShool.areaId}"))
|
|
|
+ {
|
|
|
+ aName = await CosmosQueryHelper.GetStr(cosmosClient, "Normal", $"select value(c.name) from c where c.id='{tempShool.areaId}'", "Base-Area");
|
|
|
+ }
|
|
|
|
|
|
- if (schoolTeacher != null)
|
|
|
- {
|
|
|
- if (!schoolTeacher.roles.Contains("assist"))
|
|
|
- {
|
|
|
- schoolTeacher.roles.Add("assist");
|
|
|
- //添加顾问权限
|
|
|
- await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReplaceItemAsync<SchoolTeacher>(schoolTeacher, schoolTeacher.id, new PartitionKey($"Teacher-{tempShool.id}"));
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- SchoolTeacher addSchoolTeacher = new()
|
|
|
- {
|
|
|
- id = itemTeacher,
|
|
|
- code = $"Teacher-{tempShool.id}",
|
|
|
- pk = "Teacher",
|
|
|
- status = "join",
|
|
|
- roles = new List<string>() { "assist" },
|
|
|
- name = tempTeacher.name,
|
|
|
- job = $"{tempShool.name}-顾问",
|
|
|
- size = 0,
|
|
|
- createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
|
|
|
- };
|
|
|
- //添加学校顾问
|
|
|
- await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync<SchoolTeacher>(addSchoolTeacher, new PartitionKey($"Teacher-{tempShool.id}"));
|
|
|
- }
|
|
|
- }
|
|
|
+ biRel.name = tempShool.name;
|
|
|
+ biRel.picture = tempShool.picture;
|
|
|
+ biRel.region = tempShool.region;
|
|
|
+ biRel.province = tempShool.province;
|
|
|
+ biRel.city = tempShool.city;
|
|
|
+ biRel.dist = tempShool.dist;
|
|
|
+ biRel.address = tempShool.address;
|
|
|
+ biRel.areaId = tempShool.areaId;
|
|
|
+ biRel.size = tempShool.size;
|
|
|
+ biRel.scale = tempShool.scale;
|
|
|
+ biRel.upDate = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
|
|
|
+ biRel.areaName = aName;
|
|
|
+ if (idInfos.Count > 0)
|
|
|
+ {
|
|
|
+ foreach (var item in idInfos)
|
|
|
+ {
|
|
|
+ var tempAss = biRel.assists.Find(f => f.id.Equals(item.id));
|
|
|
+ if (tempAss == null)
|
|
|
+ biRel.assists.Add(item);
|
|
|
}
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ biRel.assists = idInfos;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (respRel.Status == 200)
|
|
|
+ {
|
|
|
+ await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReplaceItemAsync<BIRelation>(biRel, biRel.id, new PartitionKey("BIRel"));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync<BIRelation>(biRel, new PartitionKey("BIRel"));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//保存操作记录
|
|
|
- await AzureStorageBlobExtensions.SaveBILog(blobClient, tableClient, "school-update", $"{_tmdName}【{_tmdId}】修改学校功能,修改的学校:{_schoolId},{_type},{picture},{size},{string.Join("|", assistId.ToArray())}", _dingDing, httpContext: HttpContext);
|
|
|
+ await AzureStorageBlobExtensions.SaveBILog(blobClient, tableClient, "school-update", $"{_tmdName}【{_tmdId}】修改学校功能,修改的学校:{_schoolId},{_type},{picture},{size},{idInfos.ToArray()}", _dingDing, httpContext: HttpContext);
|
|
|
|
|
|
return Ok(new { state = 200 });
|
|
|
}
|
|
@@ -1109,13 +1268,13 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
/// <returns></returns>
|
|
|
[ProducesDefaultResponseType]
|
|
|
[HttpPost("get-checlkexist")]
|
|
|
- public async Task<IActionResult> GetCheckExist(JsonElement jsonElement)
|
|
|
+ public async Task<IActionResult> GetCheckExist(JsonElement jsonElement)
|
|
|
{
|
|
|
if (!jsonElement.TryGetProperty("scNames", out JsonElement _scNames)) return BadRequest();
|
|
|
if (!jsonElement.TryGetProperty("accounts", out JsonElement _accounts)) return BadRequest();
|
|
|
if (!jsonElement.TryGetProperty("areaIds", out JsonElement _areaIds)) return BadRequest();
|
|
|
jsonElement.TryGetProperty("schools", out JsonElement schools);
|
|
|
-
|
|
|
+
|
|
|
var cosmosClient = _azureCosmos.GetCosmosClient();
|
|
|
List<CreateSchoolInfo> cSchools = new();
|
|
|
if (!string.IsNullOrEmpty($"{schools}"))
|
|
@@ -1156,10 +1315,10 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
tmdInfos.ForEach(tmd =>
|
|
|
{
|
|
|
if (!string.IsNullOrEmpty(tmd.id))
|
|
|
- if (tmd.id.Equals($"{ac}"))
|
|
|
+ if (tmd.id.Equals($"{ac}"))
|
|
|
noTmdInfo = tmd;
|
|
|
if (!string.IsNullOrEmpty(tmd.mobile))
|
|
|
- if (tmd.mobile.Equals($"{ac}"))
|
|
|
+ if (tmd.mobile.Equals($"{ac}"))
|
|
|
noTmdInfo = tmd;
|
|
|
if (!string.IsNullOrEmpty(tmd.mail))
|
|
|
if (tmd.mail.Equals($"{ac}"))
|
|
@@ -1171,7 +1330,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- if (areaIds.Count > 0)
|
|
|
+ if (areaIds.Count > 0)
|
|
|
{
|
|
|
foreach (var item in areaIds)
|
|
|
{
|
|
@@ -1212,7 +1371,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
if (existScNames.Count > 0 || noAccounts.Count > 0 || noAreaIds.Count > 0 || synPro.Count > 0)
|
|
|
return Ok(new { state = RespondCode.Created, existScNames, noAccounts, noAreaIds, synPro, createScInfo });
|
|
|
else
|
|
|
- return Ok(new { state = RespondCode.Ok , createScInfo });
|
|
|
+ return Ok(new { state = RespondCode.Ok, createScInfo });
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -1329,7 +1488,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
|
|
|
var cosmosClient = _azureCosmos.GetCosmosClient();
|
|
|
|
|
|
- List<string> scIds= _scIds.ToObject<List<string>>();
|
|
|
+ List<string> scIds = _scIds.ToObject<List<string>>();
|
|
|
List<string> manages = _manages.ToObject<List<string>>();
|
|
|
|
|
|
List<ExistScManage> existScManages = new();
|
|
@@ -1373,7 +1532,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
};
|
|
|
|
|
|
var haveTeacher = tempTeacher.schools.Find(x => x.schoolId.Equals($"{scId}"));
|
|
|
- if (haveTeacher == null)
|
|
|
+ if (haveTeacher == null)
|
|
|
{
|
|
|
School school = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemAsync<School>(scId, new PartitionKey("Base"));
|
|
|
//教师存在,在该教师信息中添加要管理的学校信息
|
|
@@ -1398,7 +1557,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
School scInfo = tchJson.ToObject<School>();
|
|
|
teacher.schools.Add(new() { schoolId = scInfo.id, name = scInfo.name, status = "join", time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(), picture = scInfo.picture, areaId = scInfo.areaId });
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
teacher = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").CreateItemAsync<Teacher>(teacher, new PartitionKey("Base"));
|
|
|
SchoolTeacher addSchoolTeacher = new()
|
|
|
{
|
|
@@ -1434,7 +1593,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
[ProducesDefaultResponseType]
|
|
|
[AuthToken(Roles = "admin")]
|
|
|
[HttpPost("batch-scmanage")]
|
|
|
- public async Task<IActionResult> BatchScManage(JsonElement jsonElement)
|
|
|
+ public async Task<IActionResult> BatchScManage(JsonElement jsonElement)
|
|
|
{
|
|
|
if (!jsonElement.TryGetProperty("scManages", out JsonElement _scManages)) return BadRequest();
|
|
|
var cosmosClient = _azureCosmos.GetCosmosClient();
|
|
@@ -1594,7 +1753,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
periods.Add(new Period
|
|
|
{
|
|
|
id = Guid.NewGuid().ToString(),
|
|
|
- name = x.pidName,
|
|
|
+ name = x.name,
|
|
|
campusId = campusId,
|
|
|
semesters = new List<Semester>() { new Semester { name = schoolConfig.semester[0].term, start = schoolConfig.semester[0].start, month = schoolConfig.semester[0].month, day = schoolConfig.semester[0].day, id = Guid.NewGuid().ToString() },
|
|
|
new Semester { name = schoolConfig.semester[1].term, start = schoolConfig.semester[1].start, month = schoolConfig.semester[1].month, day = schoolConfig.semester[1].day, id = Guid.NewGuid().ToString() } },
|
|
@@ -1614,12 +1773,12 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
eugenics = schoolConfig.PresetExam[0].eugenics,
|
|
|
touch = schoolConfig.PresetExam[0].touch
|
|
|
},
|
|
|
- type = x.pidType
|
|
|
-
|
|
|
+ periodType = x.value
|
|
|
+
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
- else
|
|
|
+ else
|
|
|
{
|
|
|
periods.Add(new Period
|
|
|
{
|
|
@@ -1760,8 +1919,8 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
/// </summary>
|
|
|
public record PeriodType
|
|
|
{
|
|
|
- public List<string> pidType { get; set; }
|
|
|
- public string pidName { get; set; }
|
|
|
+ public string name { get; set; }
|
|
|
+ public string value { get; set; }
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -1769,7 +1928,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
/// </summary>
|
|
|
public record ExistScManage
|
|
|
{
|
|
|
- public string scId{ get; set; }
|
|
|
+ public string scId { get; set; }
|
|
|
public string tmdId { get; set; }
|
|
|
}
|
|
|
|
|
@@ -1777,7 +1936,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
/// <summary>
|
|
|
/// 管理员
|
|
|
/// </summary>
|
|
|
- public record ScManages
|
|
|
+ public record ScManages
|
|
|
{
|
|
|
public string id { get; set; }
|
|
|
public string name { get; set; }
|