|
@@ -2708,10 +2708,10 @@ namespace TEAMModelOS.Controllers
|
|
public async Task<IActionResult> GenSchoolTeacherPdf(JsonElement json) {
|
|
public async Task<IActionResult> GenSchoolTeacherPdf(JsonElement json) {
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
//金牛直属。
|
|
//金牛直属。
|
|
-
|
|
|
|
|
|
+ if (!json.TryGetProperty("areaId", out JsonElement areaId)) { BadRequest(); }
|
|
//string sql = $"SELECT distinct c.id,s.schoolId as code , c.name as nickname, s.name as name FROM c join s in c.schools where s.areaId='f35e0031-a53f-45e5-b307-1cd39446a2cf'" +
|
|
//string sql = $"SELECT distinct c.id,s.schoolId as code , c.name as nickname, s.name as name FROM c join s in c.schools where s.areaId='f35e0031-a53f-45e5-b307-1cd39446a2cf'" +
|
|
// $" and array_length(c.binds)>0 and s.schoolId in ({string.Join(",", schools.Select(s => $"'{s}'"))})";
|
|
// $" and array_length(c.binds)>0 and s.schoolId in ({string.Join(",", schools.Select(s => $"'{s}'"))})";
|
|
- string sql = $"SELECT distinct c.id,s.schoolId as code , c.name as nickname, s.name as name FROM c join s in c.schools where s.areaId='870a5a6b-1ab3-461a-bdeb-baec19780ddb'" +
|
|
|
|
|
|
+ string sql = $"SELECT distinct c.id,s.schoolId as code , c.name as nickname, s.name as name FROM c join s in c.schools where s.areaId='{areaId}'" +
|
|
$" and array_length(c.binds)>0 ";
|
|
$" and array_length(c.binds)>0 ";
|
|
List<IdNameCode> tmdidSchooCode = new List<IdNameCode>();
|
|
List<IdNameCode> tmdidSchooCode = new List<IdNameCode>();
|
|
await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Teacher).GetItemQueryIterator<IdNameCode>(queryText: sql,
|
|
await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Teacher).GetItemQueryIterator<IdNameCode>(queryText: sql,
|
|
@@ -2728,7 +2728,7 @@ namespace TEAMModelOS.Controllers
|
|
var GenPdfQueue = _configuration.GetValue<string>("Azure:ServiceBus:GenPdfQueue");
|
|
var GenPdfQueue = _configuration.GetValue<string>("Azure:ServiceBus:GenPdfQueue");
|
|
await _serviceBus.GetServiceBusClient().SendMessageAsync(GenPdfQueue, messageBlobPDF);
|
|
await _serviceBus.GetServiceBusClient().SendMessageAsync(GenPdfQueue, messageBlobPDF);
|
|
}
|
|
}
|
|
- return Ok();
|
|
|
|
|
|
+ return Ok(group);
|
|
}
|
|
}
|
|
|
|
|
|
[HttpPost("restore-teacher-pdf")]
|
|
[HttpPost("restore-teacher-pdf")]
|