Skip to content

Commit

Permalink
feat: #207 uso firmaElectrónica cert Cumplimiento
Browse files Browse the repository at this point in the history
- Se usa administrativa_amazon para la consulta de jefe de dependecia actual:
   - jefe sección compras para cumplimiento
   - jefe de jurídica para contractual
  ya queda generalizado por cargo en vez de consultar por la persona.
- Para cert cumplimiento, quienes firman quedan de la siguiente manera:
   - firmantes: jefe seccón compras
   - representante: usuario loggeado (su info se consulta desde terceros)
- Teniendo la necesidad de usar terceros, se añade su respectivo servicio.
- Se ajustan pequeños detalles de escritura en cert contractual.
  • Loading branch information
NeFaWaltPint committed Mar 16, 2023
1 parent 17c6e32 commit e1bec4c
Show file tree
Hide file tree
Showing 7 changed files with 130 additions and 26 deletions.
32 changes: 32 additions & 0 deletions src/app/@core/data/terceros.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { Injectable } from '@angular/core';
import { RequestManager } from '../../managers/requestManager';

@Injectable({
providedIn: 'root'
})
export class TercerosService {

constructor(private requestManager: RequestManager) {
this.requestManager.setPath('TERCEROS_SERVICE');
}

get(endpoint) {
this.requestManager.setPath('TERCEROS_SERVICE');
return this.requestManager.get(endpoint);
}

post(endpoint, element) {
this.requestManager.setPath('TERCEROS_SERVICE');
return this.requestManager.post(endpoint, element);
}

put(endpoint, element) {
this.requestManager.setPath('TERCEROS_SERVICE');
return this.requestManager.put(endpoint, element);
}

delete(endpoint, element) {
this.requestManager.setPath('TERCEROS_SERVICE');
return this.requestManager.delete(endpoint, element.Id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import { AdministrativaamazonService } from '../../@core/data/admistrativaamazon
import { NumerosAletrasService } from '../../@core/data/numeros-aletras.service';
import { take } from 'rxjs/operators';
import { GestorDocumentalService } from '../../@core/utils/gestor-documental.service';
import { ImplicitAutenticationService } from '../../@core/utils';
import { TercerosService } from '../../@core/data/terceros.service';

// Set the fonts to use

Expand Down Expand Up @@ -95,13 +97,18 @@ export class CrearCertificacionSinNovedadComponent implements OnInit {
valorAdicion: string[] = [];
listaNovedades: string;

firmantes: any = undefined;
representantes: any = undefined;

constructor(
private gestorDocumental: GestorDocumentalService,
private documentoService: DocumentoService,
private evaluacionMidService: EvaluacionmidService,
private evaluacionCrudService: EvaluacioncrudService,
private AdministrativaAmazon: AdministrativaamazonService,
private NumerosAletrasService: NumerosAletrasService,
private userAuth: ImplicitAutenticationService,
private tercerosService: TercerosService,
) {
this.volverFiltro = new EventEmitter();
this.evaluacionRealizada = {};
Expand Down Expand Up @@ -156,6 +163,8 @@ export class CrearCertificacionSinNovedadComponent implements OnInit {
);

this.consultarDatosContrato();
this.consultarFirmantes();
this.consultarRepresentantes();
}
regresarFiltro() {
this.volverFiltro.emit(true);
Expand Down Expand Up @@ -799,6 +808,8 @@ export class CrearCertificacionSinNovedadComponent implements OnInit {
IdDocumento: 16,
file: blob,
nombre: '',
firmantes: [],
representantes: [],
//documento: response['Enlace'],
};
arreglo2.push(file2);
Expand All @@ -812,22 +823,19 @@ export class CrearCertificacionSinNovedadComponent implements OnInit {
this.cedula +
'_cumplimiento');
file.key = file.Id;
file.firmantes.push(this.firmantes);
file.representantes.push(this.representantes);
});

this.gestorDocumental.uploadFiles(arreglo2)
this.gestorDocumental.uploadFilesElectronicSign(arreglo2)
/* this.nuxeoService
.updateDocument$(arreglo2, this.documentoService) */
.subscribe((response: any[]) => {
if (response[0].Status == "200") {
pdf
.create()
.download(
'Certificacion_' +
this.numeroContrato +
'__' +
this.cedula +
'_cumplimiento',
);
this.gestorDocumental.getByUUID(response[0].res.Enlace)
.subscribe((file) => {
this.download(file, "", 1000, 1000);
});
this.regresarInicio();
} else {
this.openWindow("Fallo en carga a Gestor Documental");
Expand Down Expand Up @@ -856,7 +864,71 @@ export class CrearCertificacionSinNovedadComponent implements OnInit {
});
this.regresarFiltro();
}

download(url, title, w, h) {
const left = screen.width / 2 - w / 2;
const top = screen.height / 2 - h / 2;
window.open(
url,
title,
"toolbar=no," +
"location=no, directories=no, status=no, menubar=no," +
"scrollbars=no, resizable=no, copyhistory=no, " +
"width=" +
w +
", height=" +
h +
", top=" +
top +
", left=" +
left
);
}
consultarFirmantes(){
let IdCargoCompras = 66;
this.AdministrativaAmazon.get('supervisor_contrato?query=CargoId__Id:'+IdCargoCompras+'&sortby=FechaInicio&order=desc&limit=1')
.subscribe((response) => {
if (Object.keys(response[0]).length > 0) {
this.firmantes = {
nombre: response[0].Nombre,
tipoId: "CC",
identificacion: String(response[0].Documento),
cargo: response[0].Cargo
}
} else {
this.firmantes = undefined;
this.openWindow("Sin información de Sección de Compras.");
this.regresarFiltro();
}
}, (error) => {
this.firmantes = undefined;
this.openWindow("Error al traer información de Sección de Compras.");
this.regresarFiltro();
});
}
consultarRepresentantes() {
let infoUser = this.userAuth.getPayload();
if (infoUser.documento) {
this.tercerosService.get('datos_identificacion?query=Numero:'+infoUser.documento)
.subscribe((response)=>{
if (Object.keys(response[0]).length > 0) {
this.representantes = {
nombre: response[0].TerceroId.NombreCompleto,
tipoId: response[0].TipoDocumentoId.CodigoAbreviacion,
identificacion: String(response[0].Numero),
cargo: ""
}
} else {
this.representantes = undefined;
this.openWindow("Error al traer información de usuario");
this.regresarFiltro();
}
}, (error) => {
this.representantes = undefined;
this.openWindow(error.status + ": " + error.message);
this.regresarFiltro();
})
}
}
consultarDatosContrato() {
this.evaluacionMidService
.get(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import { THIS_EXPR } from '@angular/compiler/src/output/output_ast';
import { throwToolbarMixedModesError } from '@angular/material';
import { fontStyle } from 'html2canvas/dist/types/css/property-descriptors/font-style';
import { GestorDocumentalService } from '../../@core/utils/gestor-documental.service';
import { RequestManager } from '../../managers/requestManager';

// Set the fonts to use

Expand Down Expand Up @@ -110,7 +109,6 @@ export class CrearCertificacionComponent implements OnInit {
private NumerosAletrasService: NumerosAletrasService,
private AdministrativaAmazon: AdministrativaamazonService,
private NovedadesService: NovedadesService,
private anyService: RequestManager,
) {
this.volverFiltro = new EventEmitter();
}
Expand All @@ -128,7 +126,7 @@ export class CrearCertificacionComponent implements OnInit {
var cadena1 =
'Que de acuerdo con la información que reposa en la carpeta contractual y en las bases de ' +
'datos que administra la Oficina Asesora Jurídica de la Universidad Distrital Francisco José de Caldas, ';
var cadena2 = ', identicado(a) con cédiula de ciudadanía No. ';
var cadena2 = ', identicado(a) con cédula de ciudadanía No. ';
var cadena3 =
', suscribió en esta Entidad lo siguiente:';
var date = new Date();
Expand Down Expand Up @@ -1399,8 +1397,8 @@ export class CrearCertificacionComponent implements OnInit {
{
text:
textoDuracion +
', contados a partir del acta de inicio, previo cumplimiento' +
'de los requisitos de perfeccionamiento y ejecución, sin superar' +
', contados a partir del acta de inicio, previo cumplimiento ' +
'de los requisitos de perfeccionamiento y ejecución, sin superar ' +
'el tiempo de la vigencia fiscal.',
style: 'tabla2'
}
Expand Down Expand Up @@ -1783,17 +1781,15 @@ export class CrearCertificacionComponent implements OnInit {
}

consultarFirmantes(){
let docSupervisor = "1085248305"
this.anyService.setPath('ADMINISTRATIVA_JBPM_SERVICE');
this.anyService.get('supervisor_contratistas/'+docSupervisor)
let IdCargoJuridica = 78;
this.AdministrativaAmazon.get('supervisor_contrato?query=CargoId__Id:'+IdCargoJuridica+'&sortby=FechaInicio&order=desc&limit=1')
.subscribe((response) => {
if (Object.keys(response.supervisores).length > 0) {
let supervisor = response.supervisores.supervisor_contratista[0].supervisor;
if (Object.keys(response[0]).length > 0) {
this.firmantes = {
nombre: supervisor.nombre,
tipoId: "cc",
identificacion: docSupervisor,
cargo: supervisor.cargo
nombre: response[0].Nombre,
tipoId: "CC",
identificacion: String(response[0].Documento),
cargo: response[0].Cargo
}
} else {
this.firmantes = undefined;
Expand Down Expand Up @@ -1869,7 +1865,7 @@ export class CrearCertificacionComponent implements OnInit {
).subscribe(
(data: any) => {
this.allNovedades = data;
console.info(this.allNovedades);
//console.info(this.allNovedades);
this.datosNovedades.push('Sin novedades');
for (let i = 0; i < data.length; i++) {
switch (data[i].tiponovedad) {
Expand Down
1 change: 1 addition & 0 deletions src/environments/environment.dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const environment = {
DOCUMENTO_SERVICE: 'https://autenticacion.portaloas.udistrital.edu.co/apioas/documento_crud/v2/',
NOVEDADES_SERVICE: 'https://autenticacion.portaloas.udistrital.edu.co/apioas/novedades_mid/v1/',
ADMINISTRATIVA_JBPM_SERVICE: 'https://autenticacion.portaloas.udistrital.edu.co/apioas/administrativa_jbpm/v1/',
TERCEROS_SERVICE: 'https://autenticacion.portaloas.udistrital.edu.co/apioas/terceros_crud/v1/',

SPAGOBI: {
PROTOCOL: 'https',
Expand Down
1 change: 1 addition & 0 deletions src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const environment = {
DOCUMENTO_SERVICE: 'https://autenticacion.portaloas.udistrital.edu.co/apioas/documento_crud/v2/',
NOVEDADES_SERVICE: 'https://autenticacion.portaloas.udistrital.edu.co/apioas/novedades_mid/v1/',
ADMINISTRATIVA_JBPM_SERVICE: 'https://autenticacion.portaloas.udistrital.edu.co/apioas/administrativa_jbpm/v1/',
TERCEROS_SERVICE: 'https://autenticacion.portaloas.udistrital.edu.co/apioas/terceros_crud/v1/',

SPAGOBI: {
PROTOCOL: 'https',
Expand Down
1 change: 1 addition & 0 deletions src/environments/environment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const environment = {
DOCUMENTO_SERVICE: 'https://autenticacion.portaloas.udistrital.edu.co/apioas/documento_crud/v2/',
NOVEDADES_SERVICE: 'https://autenticacion.portaloas.udistrital.edu.co/apioas/novedades_mid/v1/',
ADMINISTRATIVA_JBPM_SERVICE: 'https://autenticacion.portaloas.udistrital.edu.co/apioas/administrativa_jbpm/v1/',
TERCEROS_SERVICE: 'https://autenticacion.portaloas.udistrital.edu.co/apioas/terceros_crud/v1/',

SPAGOBI: {
PROTOCOL: 'https',
Expand Down
1 change: 1 addition & 0 deletions src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const environment = {
DOCUMENTO_SERVICE: 'https://autenticacion.portaloas.udistrital.edu.co/apioas/documento_crud/v2/',
NOVEDADES_SERVICE: 'http://pruebasapi.intranetoas.udistrital.edu.co:8502/v1/',
ADMINISTRATIVA_JBPM_SERVICE: 'https://autenticacion.portaloas.udistrital.edu.co/apioas/administrativa_jbpm/v1/',
TERCEROS_SERVICE: 'http://pruebasapi.intranetoas.udistrital.edu.co:8121/v1/',

SPAGOBI: {
PROTOCOL: 'https',
Expand Down

0 comments on commit e1bec4c

Please sign in to comment.