|
@@ -78,9 +78,15 @@ namespace TEAMModelOS.SDK.Models.Service
|
|
|
}
|
|
|
return nodes;
|
|
|
}
|
|
|
-
|
|
|
- public async static Task<List<ArtStudentPdf>> GenArtPDF(List<string> studentIds, string _artId,string _schoolId,string head_lang ,AzureCosmosFactory _azureCosmos,
|
|
|
- IWebHostEnvironment _environment, CoreAPIHttpService _coreAPIHttpService, DingDing _dingDing, AzureServiceBusFactory _serviceBus, IConfiguration _configuration) {
|
|
|
+ public async static Task GenArtPDF (List<string> studentIds, string _artId, string _schoolId, string head_lang, AzureCosmosFactory _azureCosmos,
|
|
|
+ IWebHostEnvironment _environment, CoreAPIHttpService _coreAPIHttpService, DingDing _dingDing, AzureServiceBusFactory _serviceBus, IConfiguration _configuration)
|
|
|
+ {
|
|
|
+ var messageBlobPDF = new ServiceBusMessage(new { studentIds = studentIds, artId= _artId, schoolCode = $"{_schoolId}", headLang= head_lang, bizType = "ArtStudentPdf" }.ToJsonString());
|
|
|
+ var GenPdfQueue = _configuration.GetValue<string>("Azure:ServiceBus:GenPdfQueue");
|
|
|
+ await _serviceBus.GetServiceBusClient().SendMessageAsync(GenPdfQueue, messageBlobPDF);
|
|
|
+ }
|
|
|
+ public async static Task<(List<ArtStudentPdf> studentPdfs, List<StudentArtResult> artResults)> GenStuArtPDF(List<string> studentIds, string _artId,string _schoolId,string head_lang ,AzureCosmosFactory _azureCosmos,
|
|
|
+ CoreAPIHttpService _coreAPIHttpService, DingDing _dingDing) {
|
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
|
|
|
|
string query = $" select value c from c where c.school = '{_schoolId}' ";
|
|
@@ -95,7 +101,7 @@ namespace TEAMModelOS.SDK.Models.Service
|
|
|
artResults.Add(item);
|
|
|
}
|
|
|
School school = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).ReadItemAsync<School>($"{_schoolId}", new PartitionKey("Base"));
|
|
|
- string path = Path.Combine(_environment.ContentRootPath, $"Lang/{head_lang}.json");
|
|
|
+ string path = Path.Combine("", $"Lang/{head_lang}.json");
|
|
|
string comment1 = "";
|
|
|
string comment2 = "";
|
|
|
string comment3 = "";
|
|
@@ -452,10 +458,8 @@ namespace TEAMModelOS.SDK.Models.Service
|
|
|
studentPdfs.Add(studentPdf);
|
|
|
});
|
|
|
// _ = _httpTrigger.RequestHttpTrigger(new { studentPdfs = studentPdfs, artResults, schoolCode = $"{_schoolId}" }, _option.Location, "gen-art-pdf");
|
|
|
- var messageBlobPDF = new ServiceBusMessage(new { studentPdfs = studentPdfs, artResults, schoolCode = $"{_schoolId}", bizType = "ArtStudentPdf" }.ToJsonString());
|
|
|
- var GenPdfQueue = _configuration.GetValue<string>("Azure:ServiceBus:GenPdfQueue");
|
|
|
- await _serviceBus.GetServiceBusClient().SendMessageAsync(GenPdfQueue, messageBlobPDF);
|
|
|
- return studentPdfs;
|
|
|
+
|
|
|
+ return (studentPdfs, artResults);
|
|
|
}
|
|
|
private static JsonDocument readFileJson(string path)
|
|
|
{
|