add new endpoint to save and get draft

This commit is contained in:
Peter Maquiran
2024-09-12 18:57:45 +01:00
parent 38f51bd7e1
commit 82d6a15d5e
10 changed files with 118 additions and 66 deletions
@@ -166,7 +166,7 @@ export class DespachoPage implements OnInit {
// this.updateProcessOnDB(res);
this.fulltask = res;
this.getDocumentPdf(this.fulltask.Documents)
this.getDocumentPdf({FolderID: res.workflowInstanceDataFields.FolderID})
console.log('All', this.mergedArray)
@@ -200,53 +200,59 @@ export class DespachoPage implements OnInit {
});
}
// getDocumentPdf({FolderID}) {
// this.agendaService.getDraftListByProcessId({
// processId: FolderID
// }).then(( draftList => {
getDocumentPdf({FolderID}) {
this.agendaService.getDraftListByProcessId({
processId: FolderID
}).then(( draftList => {
// if(draftList.isOk()) {
// const docObject = draftList.value.data.map((e) => ({
// "ApplicationId": "",
// "Assunto": e.description,
// "DocDate": e.createdAt,
// "DocId": "",
// "DocNumber": "element.DocNumber",
// "FolderId": e.folderId,
// "Sender": "uuid",
// "SourceDocId": "element.SourceDocId",
// "content": "",
// "path": "",
// "ownerId": "",
// "status": "",
// }))
if(draftList.isOk()) {
const docObject = draftList.value.data.map((e) => ({
"id": e.id,
"ownerId": e.ownerId,
"path": e.path,
"description":e.description,
"ApplicationId": "",
"Assunto": e.description,
"DocDate": e.createdAt,
"DocId": "",
"DocNumber": "element.DocNumber",
"FolderId": e.folderId,
"content": e.content,
"Sender": "uuid",
"SourceDocId": "element.SourceDocId",
"status": e.status,
}))
// this.mergedArray.push(docObject);
// }
// }));
// }
for(const file of docObject) {
this.mergedArray.push(file);
}
getDocumentPdf(Documents: any) {
Documents.forEach(element => {
let docObject = {
"ApplicationId": element.ApplicationId,
"Assunto": element.Assunto,
"DocDate": element.DocDate,
"DocId": element.DocId,
"DocNumber": element.DocNumber,
"FolderId": element.FolderId,
"Sender": element.Sender,
"SourceDocId": element.SourceDocId,
"content": "",
"path": "",
"ownerId": "",
"status": "",
}
this.mergedArray.push(docObject);
});
}));
}
// getDocumentPdf(Documents: any) {
// Documents.forEach(element => {
// let docObject = {
// "ApplicationId": element.ApplicationId,
// "Assunto": element.Assunto,
// "DocDate": element.DocDate,
// "DocId": element.DocId,
// "DocNumber": element.DocNumber,
// "FolderId": element.FolderId,
// "Sender": element.Sender,
// "SourceDocId": element.SourceDocId,
// "content": "",
// "path": "",
// "ownerId": "",
// "status": "",
// }
// this.mergedArray.push(docObject);
// });
// }
@XTracerAsync({name:'task/getDraft', bugPrint: true})
getDraft(split_stringDraft: string[], tracing?: TracingType) {
split_stringDraft.forEach(element => {