|
@@ -115,17 +115,7 @@ namespace TEAMModelOS.Controllers
|
|
await _serviceBus.GetServiceBusClient().SendMessageAsync(GenPdfQueue, messageBlobPDF);
|
|
await _serviceBus.GetServiceBusClient().SendMessageAsync(GenPdfQueue, messageBlobPDF);
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
|
|
|
|
- string query = $" select value c from c where c.school = '{_schoolId}' ";
|
|
|
|
- if (studentIds.Any())
|
|
|
|
- {
|
|
|
|
- query = $" select value c from c where c.school = '{_schoolId}' and c.studentId in ({string.Join(",", studentIds.Select(z => $"'{z}'"))})";
|
|
|
|
- }
|
|
|
|
- List<StudentArtResult> artResults = new List<StudentArtResult>();
|
|
|
|
- await foreach (var item in client.GetContainer(Constant.TEAMModelOS, Constant.Student).GetItemQueryIterator<StudentArtResult>
|
|
|
|
- (queryText: query, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey($"ArtResult-{_artId}") }))
|
|
|
|
- {
|
|
|
|
- artResults.Add(item);
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
//List<ArtStudentPdf> studentPdfs = await ArtService.GenArtPDF(artResults, $"{_artId}", $"{_schoolId}", head_lang, _azureCosmos, _environment, _coreAPIHttpService, _dingDing, _serviceBus, _configuration);
|
|
//List<ArtStudentPdf> studentPdfs = await ArtService.GenArtPDF(artResults, $"{_artId}", $"{_schoolId}", head_lang, _azureCosmos, _environment, _coreAPIHttpService, _dingDing, _serviceBus, _configuration);
|
|
return Ok(new { /*count = studentPdfs.Count(), studentIds = studentPdfs.Select(z => z.studentId)*/ });
|
|
return Ok(new { /*count = studentPdfs.Count(), studentIds = studentPdfs.Select(z => z.studentId)*/ });
|
|
}
|
|
}
|
|
@@ -407,7 +397,7 @@ namespace TEAMModelOS.Controllers
|
|
await client.GetContainer(Constant.TEAMModelOS, Constant.Student).ReplaceItemAsync(rs, rs.id, new PartitionKey(rs.code));
|
|
await client.GetContainer(Constant.TEAMModelOS, Constant.Student).ReplaceItemAsync(rs, rs.id, new PartitionKey(rs.code));
|
|
}
|
|
}
|
|
if (artResults.Any()) {
|
|
if (artResults.Any()) {
|
|
- List<ArtStudentPdf> studentPdfs = await ArtService.GenArtPDF(artResults.Select(z=>z.studentId).ToList(), $"{_artId}", $"{school}", head_lang, _azureCosmos, _environment, _coreAPIHttpService, _dingDing, _serviceBus, _configuration);
|
|
|
|
|
|
+ List<ArtStudentPdf> studentPdfs = await ArtService.GenArtPDF(artResults, $"{_artId}", $"{school}", head_lang, _azureCosmos, _environment, _coreAPIHttpService, _dingDing, _serviceBus, _configuration);
|
|
}
|
|
}
|
|
return Ok(new { results = studentArtResults, status = 1 });
|
|
return Ok(new { results = studentArtResults, status = 1 });
|
|
}
|
|
}
|