2023-06-23 11:47:20 +01:00
|
|
|
import { ProcessesService } from "src/app/services/processes.service";
|
|
|
|
|
import { GenericBehaviorProcess } from "./GenericBehaviorTaskActions";
|
|
|
|
|
|
|
|
|
|
export class Expediente {
|
|
|
|
|
|
|
|
|
|
processes: ProcessesService
|
2023-06-23 13:56:34 +01:00
|
|
|
|
2023-06-23 11:47:20 +01:00
|
|
|
/**
|
|
|
|
|
* @Pt Solicitar consideração superior, Aprovar
|
|
|
|
|
* @description
|
|
|
|
|
* @param note
|
|
|
|
|
* @param documents
|
|
|
|
|
* @param serialnumber
|
|
|
|
|
* @returns
|
2023-06-23 13:56:34 +01:00
|
|
|
* @Profile != PR
|
2023-06-23 11:47:20 +01:00
|
|
|
*/
|
|
|
|
|
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
|
2023-06-23 13:56:34 +01:00
|
|
|
* @activityInstanceName 'Concluir Despacho', 'Tarefa de Despacho',
|
2023-06-23 11:47:20 +01:00
|
|
|
*/
|
2023-06-23 12:14:24 +01:00
|
|
|
async SendToReview(note:string, documents:any, serialnumber) {
|
2023-06-23 11:47:20 +01:00
|
|
|
let body = {
|
|
|
|
|
"serialNumber": serialnumber,
|
|
|
|
|
"action": "Retificar",
|
|
|
|
|
"ActionTypeId": 99999877,
|
|
|
|
|
"dataFields": {
|
|
|
|
|
"ReviewUserComment": note,
|
|
|
|
|
},
|
|
|
|
|
"AttachmentList" :documents,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return await this.processes.CompleteTask(body).toPromise()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* check
|
|
|
|
|
* @pt Arquivar
|
2023-06-23 13:56:34 +01:00
|
|
|
* @activityInstanceName 'Concluir Despacho', 'Tarefa de Despacho',
|
2023-06-23 11:47:20 +01:00
|
|
|
*/
|
2023-06-23 12:14:24 +01:00
|
|
|
async Archive(SerialNumber) {
|
2023-06-23 11:47:20 +01:00
|
|
|
|
|
|
|
|
let otherbody = {
|
|
|
|
|
"serialNumber": SerialNumber,
|
|
|
|
|
"action": "Passivo",
|
|
|
|
|
"ActionTypeId": 99999877,
|
|
|
|
|
"dataFields": {
|
|
|
|
|
"Note": "",
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return await this.processes.CompleteTask(otherbody).toPromise()
|
|
|
|
|
}
|
|
|
|
|
/**
|
2023-06-23 13:56:34 +01:00
|
|
|
* @pt Enviar para pendentes
|
2023-06-23 11:47:20 +01:00
|
|
|
* @Profile PR
|
2023-06-23 13:56:34 +01:00
|
|
|
* @activityInstanceName 'Concluir Despacho', 'Tarefa de Despacho',
|
2023-06-23 11:47:20 +01:00
|
|
|
*/
|
2023-06-23 12:14:24 +01:00
|
|
|
SendToPending(serialnumber) {
|
2023-06-23 11:47:20 +01:00
|
|
|
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) {
|
2023-06-23 12:14:24 +01:00
|
|
|
return await GenericBehaviorProcess.RequestAppear(task, {})
|
2023-06-23 11:47:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static async ApplicationForDeferment(task) {
|
2023-06-23 12:14:24 +01:00
|
|
|
return await GenericBehaviorProcess.ApplicationForDeferment(task, [], [], {}, '', '')
|
2023-06-23 11:47:20 +01:00
|
|
|
}
|
|
|
|
|
|
2023-06-23 12:14:24 +01:00
|
|
|
static async SetUpMeeting(task) {
|
|
|
|
|
return await GenericBehaviorProcess.SetUpMeeting(task, {})
|
2023-06-23 11:47:20 +01:00
|
|
|
}
|
|
|
|
|
|
2023-06-23 12:14:24 +01:00
|
|
|
|
2023-06-23 11:47:20 +01:00
|
|
|
|
|
|
|
|
}
|