save
This commit is contained in:
parent
3b3948135c
commit
9c7353a91e
@ -13,39 +13,36 @@ export class SoapClientService {
|
||||
) {}
|
||||
|
||||
dgae(cta: string, plt: string, crr: string, nvl: string) {
|
||||
return this.soapDgae.return_vigencia(
|
||||
{
|
||||
key: sha1(this.configService.get<string>('SOAP_DGAE_KEY')),
|
||||
cta,
|
||||
plt,
|
||||
crr,
|
||||
nvl,
|
||||
},
|
||||
(err, res) => {
|
||||
console.log(res);
|
||||
if (err) return err;
|
||||
return res;
|
||||
},
|
||||
);
|
||||
return new Promise((resolve, reject) => {
|
||||
this.soapDgae.return_vigencia(
|
||||
{
|
||||
key: sha1(this.configService.get<string>('SOAP_DGAE_KEY')),
|
||||
cta,
|
||||
plt,
|
||||
crr,
|
||||
nvl,
|
||||
},
|
||||
(err, res) => (err ? reject(err) : resolve(res)),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
dgp(rfcNumEmp: string) {
|
||||
return this.soapDpg.PlazaTrab(
|
||||
{
|
||||
rfcNumEmp,
|
||||
usuario: this.configService.get<string>('SOAP_DGP_USERNAME'),
|
||||
contrasenia: this.configService.get<string>('SOAP_DGP_PASSWORD'),
|
||||
hash: md5(
|
||||
this.configService.get<string>('SOAP_DGP_MD5_INI') +
|
||||
rfcNumEmp +
|
||||
this.configService.get<string>('SOAP_DGP_MD5_FIN') +
|
||||
this.configService.get<string>('SOAP_DGP_USERNAME'),
|
||||
),
|
||||
},
|
||||
(err, res) => {
|
||||
console.log(err);
|
||||
console.log(res);
|
||||
},
|
||||
);
|
||||
return new Promise((resolve, reject) => {
|
||||
this.soapDpg.PlazaTrab(
|
||||
{
|
||||
rfcNumEmp,
|
||||
usuario: this.configService.get<string>('SOAP_DGP_USERNAME'),
|
||||
contrasenia: this.configService.get<string>('SOAP_DGP_PASSWORD'),
|
||||
hash: md5(
|
||||
this.configService.get<string>('SOAP_DGP_MD5_INI') +
|
||||
rfcNumEmp +
|
||||
this.configService.get<string>('SOAP_DGP_MD5_FIN') +
|
||||
this.configService.get<string>('SOAP_DGP_USERNAME'),
|
||||
),
|
||||
},
|
||||
(err, res) => (err ? reject(err) : resolve(res)),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -79,7 +79,31 @@ export class UsuarioService {
|
||||
<p>Pc Puma Solicita</p>`;
|
||||
}
|
||||
|
||||
async dgaeDgp(usuario: string) {}
|
||||
dgaeDgp(usuario: string) {
|
||||
return this.findByUsuario(usuario).then(async (existeUsuario) => {
|
||||
if (!existeUsuario) {
|
||||
let esAlumno = false;
|
||||
|
||||
await this.soapClientService
|
||||
.dgp(usuario)
|
||||
.then((res) => {
|
||||
if (!res) return this.soapClientService.dgp(usuario);
|
||||
esAlumno = true;
|
||||
return res;
|
||||
})
|
||||
.then((res) => {
|
||||
if (!res)
|
||||
throw new ConflictException('No es un número de cuenta válido.');
|
||||
|
||||
// const data = {usuario,id_institucion:200,};
|
||||
// return this.create(usuario,, 5);
|
||||
});
|
||||
}
|
||||
if (existeUsuario.password)
|
||||
throw new ConflictException('Ya fue regisrado este usuario.');
|
||||
return existeUsuario;
|
||||
});
|
||||
}
|
||||
|
||||
async findAll(filtros: {
|
||||
pagina: string;
|
||||
|
Loading…
Reference in New Issue
Block a user