diff --git a/src/app/Rules/deploma.service.ts b/src/app/Rules/deploma.service.ts index 461bb449c..4c8e89e96 100644 --- a/src/app/Rules/deploma.service.ts +++ b/src/app/Rules/deploma.service.ts @@ -88,8 +88,6 @@ export class DeplomaService { } - async getList() { - - } + async getList() {} } diff --git a/src/app/Rules/despacho.service.ts b/src/app/Rules/despacho.service.ts index 1ceeac183..7bddae1c2 100644 --- a/src/app/Rules/despacho.service.ts +++ b/src/app/Rules/despacho.service.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { customTask, fullTask, fullTaskList } from '../models/dailyworktask.model'; +import { customTask, fullTaskList } from '../models/dailyworktask.model'; import { AttachmentList } from '../models/Excludetask'; import { CustomTaskPipe } from '../pipes/custom-task.pipe'; import { ProcessesService } from '../services/processes.service'; diff --git a/src/app/domain/agenda/event.ts b/src/app/domain/agenda/event.ts new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/domain/process/DiplomaGenerate.ts b/src/app/domain/process/DiplomaGenerate.ts new file mode 100644 index 000000000..15835fdea --- /dev/null +++ b/src/app/domain/process/DiplomaGenerate.ts @@ -0,0 +1,59 @@ +import { ProcessesService } from "src/app/services/processes.service"; + +// check 1 +export class DiplomaGenerates { + + processes: ProcessesService + + /** + * @event 'All' + * @returns + */ + async enviarDiploma({note = '', docs = [], serialnumber}) { + let body = { + "serialNumber": serialnumber, + "action": "Enviar diploma", + "ActionTypeId": 104, + "dataFields": { + "ReviewUserComment": note, + }, + "AttachmentList" : docs, + } + + return await this.processes.CompleteTask(body).toPromise(); + } + + /** + * @event 'All' + * @returns + */ + delegar(task: any, note, EmailAddress) { + let body = { + "SerialNumber": task.SerialNumber, + "DispatchDocId": task.DocId, + "FolderID": task.FolderId || task.FolderID, + "Subject": task.Folio, + "Comment": note, + "DelegatedUserEmail": EmailAddress, + } + + return this.processes.DelegateTask(body).toPromise(); + } + + /** + * @event 'All' + * @returns + */ + async sendExpedienteToPending(serialnumber) { + + this.processes.SetTaskToPending(serialnumber).toPromise(); + + } + + /** + * need to work on + * @event 'All' + * @returns + */ + static async setUpMeeting() {} +} \ No newline at end of file diff --git a/src/app/domain/process/DiplomaSignPr.ts b/src/app/domain/process/DiplomaSignPr.ts new file mode 100644 index 000000000..9bbdb99b4 --- /dev/null +++ b/src/app/domain/process/DiplomaSignPr.ts @@ -0,0 +1,63 @@ +import { AttachmentList } from "src/app/models/Excludetask"; +import { GenericBehaviorProcess } from "src/app/domain/process/GenericBehaviorTaskActions" +import { ProcessesService } from "src/app/services/processes.service"; +// check +export class DiplomasSignPrDomain { + + processes: ProcessesService + + /** + * @event 'Diploma Assinado' + * @description arquivar + * @param note + * @param documents + * @param serialNumber + * @returns + */ + async arquivar(note: string, documents: AttachmentList, serialNumber) { + + let body = { + "serialNumber": serialNumber, + "action": "Arquivo", + "ActionTypeId": 95, + "dataFields": { + "ReviewUserComment": note, + }, + "AttachmentList" :documents, + } + + return this.processes.CompleteTask(body) + } + + /** + * @event 'Diploma Assinado', + * @description Concluir + * @param note + * @param documents + * @param serialNumber + * @returns + */ + async conclude(note: string, documents: any, serialNumber) { + + let body = { + "serialNumber": serialNumber, + "action": "Concluir", + "ActionTypeId": 95, + "dataFields": { + "ReviewUserComment": note, + }, + "AttachmentList": documents, + } + + return await this.processes.CompleteTask(body).toPromise(); + + } + + /** + * @event 'Diploma Assinado', + */ + static async PerformeDispatch(body) { + return GenericBehaviorProcess.PerformeDispatch(body) + } + +} \ No newline at end of file diff --git a/src/app/domain/process/DiplomaToSign.ts b/src/app/domain/process/DiplomaToSign.ts new file mode 100644 index 000000000..0cb7fceb7 --- /dev/null +++ b/src/app/domain/process/DiplomaToSign.ts @@ -0,0 +1,83 @@ +import { AttachmentList } from "src/app/models/Excludetask"; +import { GenericBehaviorProcess } from "src/app/domain/process/GenericBehaviorTaskActions" +import { ProcessesService } from "src/app/services/processes.service"; + +// check +export class DiplomasSignPrDomain { + + + static processes: ProcessesService + + /** + * @description arquivar + * @param note + * @param documents + * @param serialNumber + * @returns + */ + static async archive(note: string, documents: AttachmentList, serialNumber) { + + let body = { + "serialNumber": serialNumber, + "action": "Arquivo", + "ActionTypeId": 95, + "dataFields": { + "ReviewUserComment": note, + }, + "AttachmentList" :documents, + } + + return this.processes.CompleteTask(body).toPromise(); + + } + + /** + * @description Concluir + * @param note + * @param documents + * @param serialNumber + * @returns + */ + static async finish(note: string, documents: any, serialNumber) { + + let body = { + "serialNumber": serialNumber, + "action": "Concluir", + "ActionTypeId": 95, + "dataFields": { + "ReviewUserComment": note, + }, + "AttachmentList": documents, + } + + return await this.processes.CompleteTask(body).toPromise(); + + } + + /** + * @event + */ + static async PerformeDispatch(body) { + return GenericBehaviorProcess.PerformeDispatch(body)} + + + /** + * + * @param param0 + * @returns + */ + static async sign({note, documents, serialNumber, activityInstanceName}) { + let body = { + "serialNumber": serialNumber, + "action": "Assinado", + "ActionTypeId": 99999842, + "dataFields": { + "ReviewUserComment": note, + }, + "AttachmentList" :documents, + } + + return this.processes.CompleteTask(body).toPromise(); + } + +} \ No newline at end of file diff --git a/src/app/domain/process/DiplomasValidate.ts b/src/app/domain/process/DiplomasValidate.ts new file mode 100644 index 000000000..5e43c2b68 --- /dev/null +++ b/src/app/domain/process/DiplomasValidate.ts @@ -0,0 +1,93 @@ +import { AttachmentList } from "src/app/models/Excludetask" +import { GenericBehaviorProcess } from "src/app/domain/process/GenericBehaviorTaskActions" +import { ProcessesService } from "src/app/services/processes.service" + +// check +export class DiplomasValidate { + static processes: ProcessesService + static p: any + + /** + * @pt solicitar assinatura + * @event 'Revisar Diploma' + * @description Solicitar assinatura do Presidente + * @param note + * @param documents + * @param serialNumber + * @returns + */ + static async askSignature(note: string, documents: any, serialNumber) { + let body = { + "serialNumber": serialNumber, + "action": "Aprovar", + "ActionTypeId": 99999840, + "dataFields": { + "ReviewUserComment": note, + }, + "AttachmentList": documents, + } + + return await this.processes.CompleteTask(body).toPromise() + } + + /** + * @event 'Revisar Diploma', + * @description Solicitar alteração + * @param note + * @param documents + * @param serialNumber + * @returns + */ + static async askToChange(note: string, documents: any, serialNumber) { + let body = { + "serialNumber": serialNumber, + "action": "Retificar", + "ActionTypeId": 99999841, + "dataFields": { + "ReviewUserComment": note, + }, + "AttachmentList": documents, + } + + return await this.processes.CompleteTask(body).toPromise() + } + + + /** + * @event 'Revisar Diploma', 'Diploma Assinado', + * @description Arquivar + * @param note + * @param documents + * @param serialNumber + * @returns + */ + static async arquivar(note: string, documents: AttachmentList, serialNumber) { + + let body = { + "serialNumber": serialNumber, + "action": "Arquivo", + "ActionTypeId": 95, + "dataFields": { + "ReviewUserComment": note, + }, + "AttachmentList" :documents, + } + + return this.processes.CompleteTask(body) + + } + + /** + * @event 'Revisar Diploma', 'Diploma Assinado', + */ + static async PerformeDispatch(body) { + return GenericBehaviorProcess.PerformeDispatch(body) + } + + /** + * need to work on + * @event 'Revisar Diploma' + */ + static async setUpMeeting() {} + +} \ No newline at end of file diff --git a/src/app/domain/process/DispatchDomain.ts b/src/app/domain/process/DispatchDomain.ts new file mode 100644 index 000000000..3e0cc119a --- /dev/null +++ b/src/app/domain/process/DispatchDomain.ts @@ -0,0 +1,137 @@ +import { ProcessesService } from "src/app/services/processes.service"; +import { GenericBehaviorProcess } from "src/app/domain/process/GenericBehaviorTaskActions" +import { task } from "src/app/models/ExpedientTaskModalPage"; + +function prohibited (a: any) { + return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) { + console.log("first(): called"); + }; +} + +function permited (a: any) { + return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) { + console.log("first(): called"); + }; +} + +export class DispatchDomain { + + static processes: ProcessesService + + /** + * @pt arquivar + * @event 'Concluir Despacho' + * @param note + * @param documents + * @param serialNumber + * @returns + */ + @prohibited({userRoleId:[], permission:[]}) + static async archive(note:string, documents:any, serialNumber) { + + let body = { + "serialNumber": serialNumber, + "action": "Arquivo", + "ActionTypeId": 95, + "dataFields": { + "ReviewUserComment": note, + }, + "AttachmentList" :documents, + } + + return await this.processes.CompleteTask(body).toPromise() + } + + /** + * @pt executado + * @event 'Tarefa de Despacho', 'Reexecutar Despacho' + * @param note + * @param documents + * @param serialNumber + * @returns + * @emits finish proceses + */ + static async executed(note:string, documents:any, serialNumber) { + let body = { + "serialNumber": serialNumber, + "action": "Conhecimento", + "ActionTypeId": 104, + "dataFields": { + "ReviewUserComment": note, + }, + "AttachmentList" :documents, + } + + return await this.processes.CompleteTask(body).toPromise() + } + + /** + * @pt reexecutar + * @event 'Concluir Despacho' + * @param note + * @param documents + * @param serialNumber + * @returns + */ + static async rerun(note:string, documents:any, serialNumber) { + let body = { + "serialNumber": serialNumber, + "action": "Reexecução", + "ActionTypeId": 100000010, + "dataFields": { + "ReviewUserComment": note, + }, + "AttachmentList" :documents, + } + + return await this.processes.CompleteTask(body).toPromise() + + } + + /** + * @event 'Concluir Despacho', 'Reexecutar Despacho', 'Tarefa de Despacho' + * @param SerialNumber + */ + static async sendToPending(SerialNumber) { + this.processes.SetTaskToPending(SerialNumber).toPromise(); + } + + /** + * @pt pedido de parecer + * @event 'Reexecutar Despacho', 'Tarefa de Despacho' + */ + static async requestAppear() { + return GenericBehaviorProcess.requestAppear(task, {}) + } + + /** + * @pt Efetuar Despacho + * @event 'Concluir Despacho', 'Reexecutar Despacho', 'Tarefa de Despacho' + */ + static async PerformeDispatch(body) { + return GenericBehaviorProcess.PerformeDispatch(body) + } + + /** + * @pt marcar reunião + * @event 'Concluir Despacho', 'Reexecutar Despacho', 'Tarefa de Despacho' + */ + static async setUpMeeting() {} + + /** + * @event 'Reexecutar Despacho' , 'Tarefa de Despacho' + */ + static async Delegar(task, note, taskParticipants) { + let body = { + "SerialNumber": task.SerialNumber, + "DispatchDocId": task.DocId, + "FolderID": task.FolderId || task.FolderID, + "Subject": task.Folio, + "Comment": note, + "DelegatedUserEmail": taskParticipants[0].EmailAddress, + } + + return this.processes.DelegateTask(body).toPromise() + } + +} \ No newline at end of file diff --git a/src/app/domain/process/DispatchPrDomain.ts b/src/app/domain/process/DispatchPrDomain.ts new file mode 100644 index 000000000..403c3961a --- /dev/null +++ b/src/app/domain/process/DispatchPrDomain.ts @@ -0,0 +1,181 @@ +import { GenericBehaviorProcess } from "src/app/domain/process/GenericBehaviorTaskActions" +import { ProcessesService } from "src/app/services/processes.service" + +export class DispatchPrDomain { + static processes: ProcessesService + + /** + * @pt executado + * @event 'Tarefa de Despacho', + * @param note + * @param documents + * @param serialNumber + * @returns + */ + static async executed(note: string, documents: any, serialNumber) { + let body = { + "serialNumber": serialNumber, + "action": "Conhecimento", + "ActionTypeId": 104, + "dataFields": { + "ReviewUserComment": note, + }, + "AttachmentList": documents, + } + + return serialNumber + + } + + + /** + * @pt gerar diploma + * @event 'Tarefa de Despacho', + * @param note + * @param documents + * @param serialNumber + * @returns + */ + static async generateDiploma(note: string, documents: any, serialNumber) { + + let body = { + "serialNumber": serialNumber, + "action": "Reencaminhar", + "ActionTypeId": 99999839, + "dataFields": { + "ReviewUserComment": note, + }, + "AttachmentList" :documents, + } + + + return await this.processes.CompleteTask(body).toPromise() + } + + /** + * @concluir + * @event 'Tarefa de Despacho', + * @param note + * @param documents + * @param serialNumber + * @returns + */ + static async conclude(note: string, documents: any, serialNumber) { + let body = { + "serialNumber": serialNumber, + "action": "Executado", + "ActionTypeId": 104, + "dataFields": { + "ReviewUserComment": note, + }, + "AttachmentList": documents, + } + + return await this.processes.CompleteTask(body).toPromise() + + } + + /** + * @pt reexecutar + * @event 'Concluir Despacho', + * @param note + * @param documents + * @param serialNumber + * @returns + */ + static async rerun(note: string, documents: any, serialNumber) { + let body = { + "serialNumber": serialNumber, + "action": "Reexecução", + "ActionTypeId": 100000010, + "dataFields": { + "ReviewUserComment": note, + }, + "AttachmentList": documents, + } + + return await this.processes.CompleteTask(body).toPromise() + + } + + /** + * @event 'Tarefa de Despacho', + * @param note + * @param documents + * @param serialNumber + * @returns + */ + static async requestAppear(task, postData) { + return GenericBehaviorProcess.requestAppear(task, {}) + } + + + /** + * @event 'Tarefa de Despacho', 'Concluir Despacho' + * @param note + * @param documents + * @param serialNumber + * @returns + */ + static async setUpMeeting() {} + + + /** + * @event 'Concluir Despacho', 'Tarefa de Despacho', + */ + static async sendToPending(serialNumber) { + return GenericBehaviorProcess.SetTaskToPending(serialNumber) + } + + /** + * @pt Marcar como Concluido + * @event 'Concluir Despacho', + */ + static async MarkAsCompleted() { + let body = { + "serialNumber": 'serialNumber', + "action": "Executado", + "ActionTypeId": 104, + "dataFields": { + "ReviewUserComment": 'note', + }, + "AttachmentList": 'documents', + } + return await this.processes.CompleteTask(body).toPromise() + } + + + /** + * @pt Delegar + * @event 'Tarefa de Despacho' + * @param note + * @param documents + * @param serialNumber + * @returns + */ + static async Delegate(task: any, note, taskParticipants) { + let body = { + "SerialNumber": task.SerialNumber, + "DispatchDocId": task.DocId, + "FolderID": task.FolderId || task.FolderID, + "Subject": task.Folio, + "Comment": note, + "DelegatedUserEmail": taskParticipants[0].EmailAddress, + } + + return await this.processes.DelegateTask(body).toPromise() + } + + + /** + * @pt Efetuar Despacho + * @event 'Tarefa de Despacho' + * @param note + * @param documents + * @param serialNumber + * @returns + */ + PerformeDispatch(body) { + return GenericBehaviorProcess.PerformeDispatch(body) + } +} \ No newline at end of file diff --git a/src/app/domain/process/Expediente.ts b/src/app/domain/process/Expediente.ts new file mode 100644 index 000000000..baa4082aa --- /dev/null +++ b/src/app/domain/process/Expediente.ts @@ -0,0 +1,194 @@ +import { ProcessesService } from "src/app/services/processes.service"; +import { GenericBehaviorProcess } from "./GenericBehaviorTaskActions"; + +export class Expediente { + + processes: ProcessesService + // MD + /** + * @Pt Solicitar consideração superior, Aprovar + * @description + * @param note + * @param documents + * @param serialnumber + * @returns + */ + async AskForSupeiorValidaiton(note:string, documents:any, serialnumber) { + let body = { + "serialNumber": serialnumber, + "action": "Aprovar", + "ActionTypeId": 100000004 , + "dataFields": { + "ReviewUserComment": note, + }, + "AttachmentList" :documents, + } + + + + return await this.processes.CompleteTask(body).toPromise(); + + } + + /** + * check + * @PT Submeter para revisão + * @event 'Concluir Despacho', 'Tarefa de Despacho', + */ + async sendToReview(note:string, documents:any, serialnumber) { + let body = { + "serialNumber": serialnumber, + "action": "Retificar", + "ActionTypeId": 99999877, + "dataFields": { + "ReviewUserComment": note, + }, + "AttachmentList" :documents, + } + + + return await this.processes.CompleteTask(body).toPromise() + } + + /** + * check + * @pt Arquivar + * @event 'Concluir Despacho', 'Tarefa de Despacho', + */ + async archive(SerialNumber) { + + let otherbody = { + "serialNumber": SerialNumber, + "action": "Passivo", + "ActionTypeId": 99999877, + "dataFields": { + "Note": "", + } + } + + return await this.processes.CompleteTask(otherbody).toPromise() + } + /** + * @Profile PR + * @event 'Concluir Despacho', 'Tarefa de Despacho', + */ + sendToPending(serialnumber) { + this.processes.SetTaskToPending(serialnumber) + } + + + /** + * @Profile PR + * @pt Pedido de parecer + */ + async RequestOpinion() { + const postData = { + DistributionType: "Paralelo", + CountryCode: 'AO', + Priority: 'this.postData.Priority', + UserEmail: 'this.loggeduser.Email', + UsersSelected: 'attendees', + DispatchFolder: 'this.dispatchFolder', + AttachmentList: 'docs' + } + + let ActionTypeId; + + if('this.loggeduser.Profile'.concat('') != 'PR') { + ActionTypeId = 92 + } else if ('this.loggeduser.Profile'.concat('') == 'PR' ) { + ActionTypeId = 99999881 + } + + let action_parecer = { + "serialNumber": 'this.task.serialNumber', + "action": "Tratado", + "ActionTypeId": ActionTypeId, + "dataFields": { + "Note": 'this.postData.DispatchFolder.Message', + } + } + + if('this.loggeduser.Profile'.concat('') != 'PR') { + let taskResult = await this.processes.postParecer(postData).toPromise(); + } else if ('this.loggeduser.Profile'.concat('') == 'PR' ) { + let taskResult = await this.processes.postParecerPr(postData).toPromise(); + } + + await this.processes.CompleteTask(action_parecer).toPromise(); + } + + /** + * @pt pedidod de deferimetno + */ + async defermentrequest() { + const postData = { + DistributionType: "Paralelo", + CountryCode: 'AO', + Priority: 'this.postData.Priority', + UserEmail: 'this.loggeduser.Email', + UsersSelected: 'attendees', + DispatchFolder: 'this.dispatchFolder', + AttachmentList: 'docs' + } + // + let action_deferimento = { + "serialNumber": 'this.task.serialNumber', + "action": "Tratado", + "ActionTypeId": 93, + "dataFields": { + "Note": 'this.postData.DispatchFolder.Message', + } + } + + await this.processes.postDeferimento(postData).toPromise(); + await this.processes.CompleteTask(action_deferimento).toPromise(); + + } + + /** + * @pt Anexar Documentos + */ + addAttachment() { + let body = { + "InstanceID": 'this.task.InstanceID', + "WorkflowDisplayName": 'this.task.WorkflowName', + "FolderID": 'this.task.FolderId', + "DispatchNumber": 'this.task.DispatchNumber', + "AttachmentsProcessLastInstanceID": 'this.task.AttachmentsProcessLastInstanceID', + "Attachments": [] + } + + // const Attachments = this.searchDocumentPipe.transformToAttachment(element) + // body.Attachments = Attachments; + + // await this.attachmentsService.AddAttachment(body).toPromise() + + } + + async PerformeDispatch(body) { + return await GenericBehaviorProcess.PerformeDispatch(body) + } + + static async requestAppear(task) { + return await GenericBehaviorProcess.requestAppear(task, {}) + } + + static async ApplicationForDeferment(task) { + return await GenericBehaviorProcess.ApplicationForDeferment(task) + } + + static async setUpMeeting(task) { + return await GenericBehaviorProcess.setUpMeeting(task, {}) + } + + /** + * @pr Enviar para pendentes + * @param task + * @returns + */ + static async SetTaskToPending(task) { + return await GenericBehaviorProcess.setUpMeeting(task, {}) + } + +} \ No newline at end of file diff --git a/src/app/domain/process/GenericBehaviorTaskActions.ts b/src/app/domain/process/GenericBehaviorTaskActions.ts new file mode 100644 index 000000000..0acd324c8 --- /dev/null +++ b/src/app/domain/process/GenericBehaviorTaskActions.ts @@ -0,0 +1,310 @@ +import { AttachmentList } from "src/app/models/Excludetask"; +import { ProcessesService } from "src/app/services/processes.service"; + + +export class GenericBehaviorProcess { + + static processes: ProcessesService + static p: any + + static async setUpMeeting(task, createEventFromData) { + const eventBody = { + BodyType: '1', + Text: 'this.postData.Body.Text', + } + + // createEventFromData + const postData = { + EventId: '', + Subject: 'this.postData.Subject', + Body: 'this.eventBody', + Location: 'this.postData.Location', + CalendarId: '', + CalendarName: 'this.postData.CalendarName', + StartDate: 'this.dateStart', + EndDate: 'this.dateEnd', + EventType: 'Reunião', + Attendees: 'Attendees', + IsMeeting: false, + IsRecurring: false, + AppointmentState: 0, + TimeZone: 'UTC', + Organizer: null, + Category: 'Reunião', + HasAttachments: true, + EventRecurrence: { + Type: 'this.EventRecurrenceType', + LastOccurrence: 'this.Occurrence' + }, + } + + if(task.FsId == '8') { + + try { + // const CalendarId = this.selectedCalendarId() + // await this.calendarService.genericPostExpedientEvent(task.DocId, this.postData, "",task.SerialNumber, task.FsId, CalendarId).toPromise(); + + // this.modalController.dismiss(); + //this.httpErroHandle.httpsSucessMessagge('Marcar Reunião') + + } catch (error) { + // this.httpErroHandle.httpStatusHandle(error) + } + finally { + // loader.remove() + } + + + } + else if(task.FsId == '361') { + + try { + + // const CalendarId = this.selectedCalendarId() + // await this.calendarService.genericCreateTaskEvent(task.FolderID | task.FolderId, this.postData, "",task.SerialNumber, task.FsId, CalendarId).toPromise(); + + // this.close(); + // this.httpErroHandle.httpsSucessMessagge('Marcar Reunião') + + } catch (error) { + // this.httpErroHandle.httpStatusHandle(error) + } finally { + // loader.remove() + } + } + + } + + static async SetTaskToPending(serialNumber) { + return await this.processes.SetTaskToPending(serialNumber).toPromise() + } + + /** + * @description arquivar + * @param note + * @param documents + * @param serialNumber + * @returns + */ + static async archive(note: string, documents: AttachmentList, serialNumber) { + + let body = { + "serialNumber": serialNumber, + "action": "Arquivo", + "ActionTypeId": 95, + "dataFields": { + "ReviewUserComment": note, + }, + "AttachmentList" :documents, + } + + return this.processes.CompleteTask(body).toPromise(); + } + + /** + * @pt executado + * @event 'Tarefa de Despacho', 'Reexecutar Despacho' + * @param note + * @param documents + * @param serialNumber + * @returns + * @emits finish proceses + */ + static async executed(note:string, documents:any, serialNumber) { + let body = { + "serialNumber": serialNumber, + "action": "Conhecimento", + "ActionTypeId": 104, + "dataFields": { + "ReviewUserComment": note, + }, + "AttachmentList" :documents, + } + + return await this.processes.CompleteTask(body).toPromise() + } + + /** + * @pt reexecutar + * @event 'Concluir Despacho' + * @param note + * @param documents + * @param serialNumber + * @returns + */ + static async rerun(note:string, documents:any, serialNumber) { + let body = { + "serialNumber": serialNumber, + "action": "Reexecução", + "ActionTypeId": 100000010, + "dataFields": { + "ReviewUserComment": note, + }, + "AttachmentList" :documents, + } + + return await this.processes.CompleteTask(body).toPromise() + + } + + /** + * @event 'Diploma Assinado', + * @description Concluir + * @param note + * @param documents + * @param serialNumber + * @returns + */ + static async conclude(note: string, documents: any, serialNumber) { + + let body = { + "serialNumber": serialNumber, + "action": "Concluir", + "ActionTypeId": 95, + "dataFields": { + "ReviewUserComment": note, + }, + "AttachmentList": documents, + } + + return await this.processes.CompleteTask(body).toPromise(); + + } + + + static async Delegar() { + + let body = { + "SerialNumber": 'this.task.SerialNumber', + "DispatchDocId": 'this.task.DocId', + "FolderID": 'this.task.FolderId' || 'this.task.FolderID', + "Subject": 'this.task.Folio', + "Comment": 'this.note', + "DelegatedUserEmail": 'this.taskParticipants[0].EmailAddress', + } + + return await this.processes.DelegateTask(body).toPromise() + } + + + /** + * @event 'Revisar Diploma', 'Diploma Assinado', + */ + static async PerformeDispatch(body: any) { + + const postData = { + DistributionType: "Paralelo", + CountryCode: 'AO', + Priority: "this.postData.Priority", + UserEmail: "this.loggeduser.Email", + UsersSelected: "attendees", + DispatchFolder: "this.dispatchFolder", + AttachmentList: "docs" + } + + if(this.p.userRole(['PR'])) { + return this.processes.postDespatchoPr(postData).toPromise(); + } else { + return this.processes.postDespatcho(postData).toPromise(); + } + } + + static async requestAppear(task, _postData) { + const postData = { + DistributionType: "Paralelo", + CountryCode: 'AO', + Priority: 'this.postData.Priority', + UserEmail: 'this.loggeduser.Email', + UsersSelected: 'attendees', + DispatchFolder: 'this.dispatchFolder', + AttachmentList: 'docs' + } + + if (task.activityInstanceName == 'Tarefa de Despacho' || task.activityInstanceName == 'Reexecutar Despacho') { + if(this.p.userRole(['PR'])) { + await this.processes.postParecerPr(postData).toPromise(); + } else { + await this.processes.postParecer(postData).toPromise(); + } + let body; + + if(task.activityInstanceName == 'Concluir Despacho' + || task.activityInstanceName == 'Concluir Parecer' + || task.activityInstanceName == 'Concluir Deferimento' + || task.activityInstanceName == 'Tarefa de Deferimento' + ) { + body = { + "serialNumber": task.serialNumber, + "action": "Parecer", + "ActionTypeId": 92, + "dataFields": { + "ReviewUserComment": 'note', + }, + "AttachmentList" :' documents', + } + + } + else { + body = { + "serialNumber": task.serialnumber, + "action": "Conhecimento", + "ActionTypeId": 92, + "dataFields": { + "ReviewUserComment": 'note', + }, + "AttachmentList" : 'documents', + } + + } + + return this.processes.CompleteTask(body).toPromise(); + + } else { + + if(this.p.userRole(['PR'])) { + await this.processes.postParecerPr(postData).toPromise(); + } else { + await this.processes.postParecer(postData).toPromise(); + } + + const body = { + "serialNumber": task.serialNumber, + "action": "Parecer", + "ActionTypeId": 92, // Pedido de parece + "dataFields": { + "ReviewUserComment": 'note', + }, + "AttachmentList" :null, + } + return this.processes.CompleteTask(body).toPromise(); + } + + } + + static async ApplicationForDeferment(task) { + const postData = { + DistributionType: "Paralelo", + CountryCode: 'AO', + Priority: 'this.postData.Priority', + UserEmail: 'this.loggeduser.Email', + UsersSelected: 'attendees', + DispatchFolder: 'this.dispatchFolder', + AttachmentList: 'docs' + } + + await this.processes.postDeferimento(postData).toPromise() + + const body = { + "serialNumber": task.serialNumber, + "action": "Deferimento", + "ActionTypeId": 93, // Pedido de deferimento + "dataFields": { + "ReviewUserComment": 'note', + }, + "AttachmentList" :null, + } + return this.processes.CompleteTask(body).toPromise(); + + } + +} \ No newline at end of file diff --git a/src/app/domain/process/RequestsForDeferment.ts b/src/app/domain/process/RequestsForDeferment.ts new file mode 100644 index 000000000..4896c955d --- /dev/null +++ b/src/app/domain/process/RequestsForDeferment.ts @@ -0,0 +1,82 @@ +import { GenericBehaviorProcess } from "src/app/domain/process/GenericBehaviorTaskActions" +import { ProcessesService } from "src/app/services/processes.service" + +export class RequestForApproval { + static processes: ProcessesService + + /** + * @activityInstanceName 'Tarefa de Deferimento', 'Reapreciar Deferimento', 'Concluir Deferimento' + */ + static Arquivar() { + let body = { + "serialNumber": 'serialNumber', + "action": "Arquivo", + "ActionTypeId": 95, + "dataFields": { + "ReviewUserComment": 'note', + }, + "AttachmentList" :'documents', + } + + return this.processes.CompleteTask(body) + } + + /** + * @activityInstanceName 'Tarefa de Deferimento', 'Reapreciar Deferimento', 'Concluir Deferimento' + */ + static async Delegar() { + let body = { + "serialNumber": 'this.serialNumber', + "action": "Registar", + "ActionTypeId": 104, + "dataFields": { + "ReviewUserComment": 'this.note', + }, + "AttachmentList": 'docs', + } + + return await this.processes.CompleteTask(body).toPromise(); + + } + /** + * @evactivityInstanceNameent 'Tarefa de Deferimento', 'Reapreciar Deferimento', 'Concluir Deferimento' + */ + static EfetuarDespacho(body) { + return GenericBehaviorProcess.PerformeDispatch(body) + } + /** + * @activityInstanceName 'Tarefa de Deferimento', 'Reapreciar Deferimento', 'Concluir Deferimento' + */ + static MarcarReuniao() {} + /** + * @activityInstanceName 'Tarefa de Deferimento', 'Concluir Deferimento', 'Reapreciar Deferimento' + */ + static enviarParaPendente(serialNumber) { + return GenericBehaviorProcess.SetTaskToPending(serialNumber) + } + /** + * @activityInstanceName 'Concluir Deferimento' + */ + static SolicitarParecer(task) { + return GenericBehaviorProcess.requestAppear(task, {}) + } + + /** + * @activityInstanceName 'Concluir Deferimento' + */ + static SolicitarReapreciação() { + let body = { + "serialNumber": 'this.serialnumber', + "action": "Reapreciação", + "ActionTypeId": 100000009, + "dataFields": { + "ReviewUserComment": 'note', + }, + "AttachmentList": 'documents', + } + + return this.processes.CompleteTask(body).toPromise() + } + + +} \ No newline at end of file diff --git a/src/app/domain/process/RequestsForOpinion.ts b/src/app/domain/process/RequestsForOpinion.ts new file mode 100644 index 000000000..269971b90 --- /dev/null +++ b/src/app/domain/process/RequestsForOpinion.ts @@ -0,0 +1,94 @@ +import { GenericBehaviorProcess } from "src/app/domain/process/GenericBehaviorTaskActions" +import { ProcessesService } from "src/app/services/processes.service" + +export class RequestForOpinion { + static processes: ProcessesService + + /** + * @activityInstanceName 'Pedido de Parecer' + */ + static arquivar() { + let body = { + "serialNumber": 'serialNumber', + "action": "Arquivo", + "ActionTypeId": 95, + "dataFields": { + "ReviewUserComment": 'note', + }, + "AttachmentList" :'documents', + } + + return this.processes.CompleteTask(body) + } + /** + * @activityInstanceName 'Pedido de Parecer' + */ + static EfetuarDespacho(body) { + return GenericBehaviorProcess.PerformeDispatch(body)} + /** + * @activityInstanceName 'Pedido de Parecer' + */ + static SolicitarParecer(task) { + return GenericBehaviorProcess.requestAppear(task, {}) + } + /** + * @profile != PR + * @activityInstanceName 'Pedido de Parecer' + */ + static PedidoDedeferimento(task) { + return GenericBehaviorProcess.requestAppear(task, {}) + } + /** + * @activityInstanceName 'Pedido de Parecer' + */ + static setUpMeeting(){} + /** + * @activityInstanceName 'Pedido de Parecer' + */ + static SendToPeding(serialNumber){ + return GenericBehaviorProcess.SetTaskToPending(serialNumber) + } + + + /** + * @activityInstanceName 'Pedido de Parecer', 'Pedido de Parecer do Presidente' + */ + static async DarOMeuParecer() { + let body = { + "serialNumber": 'serialNumber', + "action": "Registar", + "ActionTypeId": 104, + "dataFields": { + "ReviewUserComment": 'note', + }, + "AttachmentList": 'docs', + } + + return await this.processes.CompleteTask(body).toPromise(); + } + /** + * @activityInstanceName 'Pedido de Parecer', 'Pedido de Parecer do Presidente' + */ + static MarcarReuniao() {} + /** + * @Profile PR + * @pt Reencaminhar + * @activityInstanceName 'Pedido de Parecer do Presidente' + */ + static async Reencaminhar() { + + let body = { + "usersSelected": 'attendees', + "serialNumber": 'this.task.SerialNumber', + "action": "Reencaminhar", + "actionTypeId": 98, + "dataFields": { + "ReviewUserComment": 'this.note', + }, + "FolderId": 'this.task.FolderId', + "AttachmentList" : 'docs', + } + + return await this.processes.CompleteParecerPrTask(body).toPromise(); + } +} \ No newline at end of file diff --git a/src/app/modals/delegar/delegar.page.ts b/src/app/modals/delegar/delegar.page.ts index 655c37688..dc108df8f 100644 --- a/src/app/modals/delegar/delegar.page.ts +++ b/src/app/modals/delegar/delegar.page.ts @@ -1,12 +1,9 @@ import { Component, OnInit } from '@angular/core'; -import { Router } from '@angular/router'; -import { AlertController, AnimationController, ModalController, NavParams } from '@ionic/angular'; +import { AlertController, ModalController, NavParams } from '@ionic/angular'; import { Event } from 'src/app/models/event.model' import { EventBody } from 'src/app/models/eventbody.model'; import { ProcessesService } from 'src/app/services/processes.service'; import { EventPerson } from 'src/app/models/eventperson.model'; -import { EventsService } from 'src/app/services/events.service'; -import { AttachmentsService } from 'src/app/services/attachments.service'; import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page'; import { ToastService } from 'src/app/services/toast.service'; import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page'; @@ -45,13 +42,9 @@ export class DelegarPage implements OnInit { constructor( private modalController: ModalController, - private router:Router, private navParams: NavParams, private processes:ProcessesService, - private attachmentsService: AttachmentsService, - private calendarService: EventsService, public alertController: AlertController, - private animationController: AnimationController, private toastService: ToastService, public ThemeService: ThemeService, private httpErrorHandle: HttpErrorHandle @@ -150,7 +143,7 @@ export class DelegarPage implements OnInit { async setContact(data:EventPerson[]) { - if(this.adding == "intervenient"){ + if(this.adding == "intervenient") { this.taskParticipants = data; } else if (this.adding == "CC") { diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html index 599a4ae46..f15cd40ac 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html @@ -75,17 +75,6 @@ - -