|
@@ -135,8 +135,10 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
List<BISchool> schools = new();
|
|
|
List<BISchool> userScs = new();
|
|
|
List<BISchool> cutArea = new();
|
|
|
+ List<string> scId = new();
|
|
|
List<string> upSc = new();
|
|
|
StringBuilder stringBuilder = new($"{_tmdName}【{_tmdId}】使用批量创校功能:");
|
|
|
+ StringBuilder vsSql = new();
|
|
|
StringBuilder noticeDD = new(); //创校信息通知
|
|
|
var cosmosClient = _azureCosmos.GetCosmosClient();
|
|
|
var tableClient = _azureStorage.GetCloudTableClient();
|
|
@@ -210,7 +212,8 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
scale = bischool.size >= 300 ? 500 : 0,
|
|
|
createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
|
|
|
};
|
|
|
-
|
|
|
+ scId.Add(upSchool.id);
|
|
|
+ vsSql.Append($"{upSchool.name}【{upSchool.id}】,");
|
|
|
stringBuilder.Append($"创建学校:{upSchool.name}【{upSchool.id}】");
|
|
|
noticeDD.Append($"{upSchool.name}【{upSchool.id}】 \r 学校管理员信息:");
|
|
|
upSc.Add(upSchool.id);
|
|
@@ -470,7 +473,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
|
|
|
//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 } }, "transfer-admin_school", Constant.NotifyType_IES5_Management, new Dictionary<string, object> { { "tmdname", $"{_tmdName}" }, { "schooName", "学校名称" }, { "schoolId", $"学校id" }, { "tmdid", "账号id" } }, _option.Location, _configuration, _dingDing, _environment.ContentRootPath);
|
|
|
+ _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);
|
|
|
|
|
|
//保存操作记录
|
|
|
await AzureStorageBlobExtensions.SaveBILog(blobClient, tableClient, "school-batchAdd", stringBuilder?.ToString(), _dingDing, httpContext: HttpContext);
|
|
@@ -481,7 +484,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
if (schools.Count > 0 || userScs.Count > 0 || cutArea.Count > 0)
|
|
|
return Ok(new { state = RespondCode.Created, message = "已有部分学校批量创建成功;学校已经重复/学校信息有误/区域已在研修不能加区!请检查学校信息!", schools, userScs, cutArea });
|
|
|
else
|
|
|
- return Ok(new { state = RespondCode.Ok, message = "批量创校已全部完成" });
|
|
|
+ return Ok(new { state = RespondCode.Ok, message = "批量创校已全部完成", scId });
|
|
|
}
|
|
|
}
|
|
|
catch (Exception ex)
|