a lot of changes

This commit is contained in:
Eudes Inácio
2023-09-06 21:23:21 +01:00
parent 9de3019446
commit fb1bd07ad0
25 changed files with 1187 additions and 482 deletions
+53 -42
View File
@@ -36,9 +36,9 @@ export class DespachoService {
public p: PermissionService,
public LoaderService: LoaderService,
private sortService: SortService,
) {}
) { }
arquivar(note:string, documents:AttachmentList, serialnumber) {
arquivar(note: string, documents: AttachmentList, serialnumber) {
let body = {
"serialNumber": serialnumber,
@@ -47,13 +47,13 @@ export class DespachoService {
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
"AttachmentList": documents,
}
return this.processes.CompleteTask(body)
}
executado(note:string, documents:any , serialnumber) {
executado(note: string, documents: any, serialnumber) {
let body = {
"serialNumber": serialnumber,
@@ -62,19 +62,19 @@ export class DespachoService {
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
"AttachmentList": documents,
}
return this.processes.CompleteTask(body)
}
solicitarParecer({note, documents = [], serialnumber, activityInstanceName}) {
solicitarParecer({ note, documents = [], serialnumber, activityInstanceName }) {
let body;
if(activityInstanceName == 'Concluir Despacho'
|| activityInstanceName == 'Concluir Parecer'
|| activityInstanceName == 'Concluir Deferimento'
|| activityInstanceName == 'Tarefa de Deferimento'
){
if (activityInstanceName == 'Concluir Despacho'
|| activityInstanceName == 'Concluir Parecer'
|| activityInstanceName == 'Concluir Deferimento'
|| activityInstanceName == 'Tarefa de Deferimento'
) {
body = {
"serialNumber": serialnumber,
"action": "Parecer",
@@ -82,11 +82,11 @@ export class DespachoService {
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
"AttachmentList": documents,
}
}
else{
else {
body = {
"serialNumber": serialnumber,
"action": "Conhecimento",
@@ -94,7 +94,7 @@ export class DespachoService {
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
"AttachmentList": documents,
}
}
@@ -102,13 +102,15 @@ export class DespachoService {
return this.processes.CompleteTask(body)
}
EfectuarDespacho({note, documents = [], serialnumber, activityInstanceName}) {
EfectuarDespacho({ note, documents = [], serialnumber, activityInstanceName }) {
console.log('activityInstanceName', activityInstanceName)
let body;
if(activityInstanceName == 'Concluir Despacho'
|| activityInstanceName == 'Concluir Parecer'
|| activityInstanceName == 'Concluir Deferimento'
|| activityInstanceName == 'Tarefa de Deferimento'
){
if (activityInstanceName == 'Concluir Despacho'
|| activityInstanceName == 'Concluir Parecer'
|| activityInstanceName == 'Concluir Deferimento'
|| activityInstanceName == 'Tarefa de Deferimento'
|| activityInstanceName == 'Diploma Assinado'
) {
body = {
"serialNumber": serialnumber,
"action": "Despacho",
@@ -116,10 +118,19 @@ export class DespachoService {
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
"AttachmentList": documents,
}
}
else{
} else if (activityInstanceName == 'Revisar Diploma') {
body = {
"serialNumber": serialnumber,
"action": "Aprovar",
"ActionTypeId": 94,
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList": documents,
}
} else {
body = {
"serialNumber": serialnumber,
"action": "Conhecimento",
@@ -127,15 +138,15 @@ export class DespachoService {
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
"AttachmentList": documents,
}
}
return this.processes.CompleteTask(body)
}
reexecute({note, documents, serialnumber}) {
reexecute({ note, documents, serialnumber }) {
let body = {
"serialNumber": serialnumber,
"action": "Reexecução",
@@ -143,7 +154,7 @@ export class DespachoService {
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
"AttachmentList": documents,
}
return this.processes.CompleteTask(body)
@@ -152,7 +163,7 @@ export class DespachoService {
/**
* @description efetuar despacho
*/
CompleteTask({serialNumber, note}) {
CompleteTask({ serialNumber, note }) {
const body = {
"serialNumber": serialNumber,
@@ -161,7 +172,7 @@ export class DespachoService {
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :null,
"AttachmentList": null,
}
return this.processes.CompleteTask(body)
@@ -190,7 +201,7 @@ export class DespachoService {
* @description for both profile PR and MDGPR
*/
createDespacho(body: any) {
if(this.p.userRole(['PR'])) {
if (this.p.userRole(['PR'])) {
return this.processes.postDespatchoPr(body)
} else {
return this.processes.postDespatcho(body)
@@ -198,14 +209,14 @@ export class DespachoService {
}
createParecer(body: any) {
if(this.p.userRole(['PR'])) {
if (this.p.userRole(['PR'])) {
return this.processes.postParecerPr(body)
} else {
return this.processes.postParecer(body)
}
}
generateDiploma({note = '', documents = [], serialnumber}) {
generateDiploma({ note = '', documents = [], serialnumber }) {
let body = {
"serialNumber": serialnumber,
"action": "Reencaminhar",
@@ -213,14 +224,14 @@ export class DespachoService {
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
"AttachmentList": documents,
}
return this.processes.CompleteTask(body)
}
async getList({updateStore = false}) {
async getList({ updateStore = false }) {
if (this.LoaderService.loading) {
return this.despachoStore.list
@@ -234,7 +245,7 @@ export class DespachoService {
try {
result = await this.processes.GetTasksList("Despacho", false).toPromise();
result = result.filter((data:fullTaskList) => data.workflowInstanceDataFields.Status == "Active")
result = result.filter((data: fullTaskList) => data.workflowInstanceDataFields.Status == "Active")
result.forEach((element, index) => {
let task: customTask = this.customTaskPipe.transform(element);
@@ -244,7 +255,7 @@ export class DespachoService {
despachoList = this.sortService.sortDate(despachoList, 'CreateDate')
if(updateStore) {
if (updateStore) {
this.despachoStore.reset(despachoList);
}
@@ -253,7 +264,7 @@ export class DespachoService {
} finally {
this.LoaderService.pop({})
// this.loader.pop()
return this.despachoStore.list
return this.despachoStore.list
}
}
@@ -265,18 +276,18 @@ export class DespachoService {
try {
result = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
} catch(error) {
} catch (error) {
// this.loader.pop()
}
// this.loader.pop()
let despachosPr;
let despachos = this.sortService.sortArrayByDate(result);
let despachos = this.sortService.sortArrayByDate(result);
if(SessionStore.user.Profile != 'PR') {
if (SessionStore.user.Profile != 'PR') {
despachosPr = despachos.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
} else if(SessionStore.user.Profile == 'PR') {
} else if (SessionStore.user.Profile == 'PR') {
despachosPr = despachos.reverse().filter(data => data.activityInstanceName == "Concluir Despacho");
}