dga y dgp a espera de soap conexión
This commit is contained in:
parent
ea5b636bc6
commit
5eb2fef2f1
@ -1836,7 +1836,6 @@ INSERT INTO institucion_dia(id_institucion, id_dia) VALUES(1, 2);
|
|||||||
INSERT INTO institucion_dia(id_institucion, id_dia) VALUES(1, 3);
|
INSERT INTO institucion_dia(id_institucion, id_dia) VALUES(1, 3);
|
||||||
INSERT INTO institucion_dia(id_institucion, id_dia) VALUES(1, 4);
|
INSERT INTO institucion_dia(id_institucion, id_dia) VALUES(1, 4);
|
||||||
INSERT INTO institucion_dia(id_institucion, id_dia) VALUES(1, 5);
|
INSERT INTO institucion_dia(id_institucion, id_dia) VALUES(1, 5);
|
||||||
INSERT INTO institucion_dia(id_institucion, id_dia) VALUES(1, 5);
|
|
||||||
INSERT INTO institucion_dia(id_institucion, id_dia) VALUES(2, 1);
|
INSERT INTO institucion_dia(id_institucion, id_dia) VALUES(2, 1);
|
||||||
INSERT INTO institucion_dia(id_institucion, id_dia) VALUES(2, 2);
|
INSERT INTO institucion_dia(id_institucion, id_dia) VALUES(2, 2);
|
||||||
INSERT INTO institucion_dia(id_institucion, id_dia) VALUES(2, 3);
|
INSERT INTO institucion_dia(id_institucion, id_dia) VALUES(2, 3);
|
||||||
|
@ -37,7 +37,11 @@ export class InstitucionUsuarioService {
|
|||||||
campo: string,
|
campo: string,
|
||||||
) {
|
) {
|
||||||
return this.repository
|
return this.repository
|
||||||
.findOne({ usuario, institucionCarrera })
|
.findOne({
|
||||||
|
activo: true,
|
||||||
|
institucionCarrera,
|
||||||
|
usuario,
|
||||||
|
})
|
||||||
.then((institucionUsuario) => {
|
.then((institucionUsuario) => {
|
||||||
if (!institucionUsuario)
|
if (!institucionUsuario)
|
||||||
throw new ConflictException(
|
throw new ConflictException(
|
||||||
|
@ -298,7 +298,7 @@ export class UploadFileService {
|
|||||||
(carrera && !institucionCarrera)
|
(carrera && !institucionCarrera)
|
||||||
) {
|
) {
|
||||||
if (!tipoUsuario) error += ' no existe este tipo de usuario.';
|
if (!tipoUsuario) error += ' no existe este tipo de usuario.';
|
||||||
if (tipoUsuario.id_tipo_usuario < 5)
|
else if (tipoUsuario.id_tipo_usuario < 5)
|
||||||
' no se puede asignar este tipo de usuario a este usuario.';
|
' no se puede asignar este tipo de usuario a este usuario.';
|
||||||
if (!carrera) error += ' falta del campo carrera para el alumno.';
|
if (!carrera) error += ' falta del campo carrera para el alumno.';
|
||||||
if (carrera && !institucionCarrera)
|
if (carrera && !institucionCarrera)
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
import { IsString } from 'class-validator';
|
import { IsString } from 'class-validator';
|
||||||
|
|
||||||
export class DgpInputDto {
|
export class DgpInputDto {
|
||||||
|
@IsString()
|
||||||
|
id_institucion: string;
|
||||||
|
|
||||||
@IsString()
|
@IsString()
|
||||||
rfc: string;
|
rfc: string;
|
||||||
|
|
||||||
|
@ -1,22 +1,16 @@
|
|||||||
import { Expose, Type } from 'class-transformer';
|
import { Expose, Type } from 'class-transformer';
|
||||||
import { InstitucionCarreaOutputDto } from '../../../institucion-carrera/dto/output/institucion-carrera.dto';
|
import { InstitucionCarreaOutputDto } from '../../../institucion-carrera/dto/output/institucion-carrera.dto';
|
||||||
import { TipoUsuarioOutputDto } from '../../../tipo-usuario/dto/output/tipo-usuario.dto';
|
import { UsuariosOutputDto } from './usuarios.dto';
|
||||||
|
|
||||||
export class EscolaresOutputDto {
|
export class EscolaresOutputDto {
|
||||||
@Expose()
|
@Expose()
|
||||||
id_usuario;
|
id_institucion_usuario;
|
||||||
|
|
||||||
@Expose()
|
|
||||||
nombre;
|
|
||||||
|
|
||||||
@Expose()
|
|
||||||
usuario;
|
|
||||||
|
|
||||||
@Expose()
|
@Expose()
|
||||||
@Type(() => InstitucionCarreaOutputDto)
|
@Type(() => InstitucionCarreaOutputDto)
|
||||||
institucionCarrera;
|
institucionCarrera;
|
||||||
|
|
||||||
@Expose()
|
@Expose()
|
||||||
@Type(() => TipoUsuarioOutputDto)
|
@Type(() => UsuariosOutputDto)
|
||||||
tipoUsuario;
|
usuario;
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,11 @@ export class UsuarioController {
|
|||||||
})
|
})
|
||||||
@ApiQuery({ description: 'RFC del profesor.', name: 'rfc', type: 'string' })
|
@ApiQuery({ description: 'RFC del profesor.', name: 'rfc', type: 'string' })
|
||||||
dgp(@Query() query: DgpInputDto) {
|
dgp(@Query() query: DgpInputDto) {
|
||||||
return this.usuarioService.DGP(query.usuario, query.rfc);
|
return this.usuarioService.DGP(
|
||||||
|
parseInt(query.id_institucion),
|
||||||
|
query.usuario,
|
||||||
|
query.rfc,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Post('registrar')
|
@Post('registrar')
|
||||||
|
@ -75,39 +75,37 @@ export class UsuarioService {
|
|||||||
id_institucion_carrera,
|
id_institucion_carrera,
|
||||||
);
|
);
|
||||||
|
|
||||||
return this.findByUsuario(usuario, true, true).then(
|
return this.findByUsuario(usuario, true).then(async (existeUsuario) => {
|
||||||
async (existeUsuario) => {
|
/* Falta conexión a soap */
|
||||||
/* Falta conexión a soap */
|
if (existeUsuario.password)
|
||||||
if (existeUsuario.password)
|
throw new ConflictException('Ya fue regisrado este número de cuenta.');
|
||||||
throw new ConflictException(
|
return this.institucionUsuarioService.findByUsuarioIdInstitucionCarrera(
|
||||||
'Ya fue regisrado este número de cuenta.',
|
existeUsuario,
|
||||||
);
|
institucionCarrera,
|
||||||
return this.institucionUsuarioService.findByUsuarioIdInstitucionCarrera(
|
'cuenta',
|
||||||
existeUsuario,
|
);
|
||||||
institucionCarrera,
|
});
|
||||||
'cuenta',
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async DGP(usuario: string, rfc: string) {
|
async DGP(id_institucion: number, usuario: string, rfc: string) {
|
||||||
const institucionCarrera = await this.institucionCarreraService.findById(1);
|
const institucionCarrera =
|
||||||
|
await this.institucionCarreraService.findByIdInstitucionIdCarrera(
|
||||||
|
id_institucion,
|
||||||
|
1,
|
||||||
|
);
|
||||||
|
|
||||||
return this.findByUsuario(usuario, true, true).then(
|
return this.findByUsuario(usuario, true).then(async (existeUsuario) => {
|
||||||
async (existeUsuario) => {
|
/* Falta conexión a soap */
|
||||||
/* Falta conexión a soap */
|
if (existeUsuario.password)
|
||||||
if (existeUsuario.password)
|
throw new ConflictException(
|
||||||
throw new ConflictException(
|
'Ya fue regisrado este número de trabajador.',
|
||||||
'Ya fue regisrado este número de trabajador.',
|
|
||||||
);
|
|
||||||
return this.institucionUsuarioService.findByUsuarioIdInstitucionCarrera(
|
|
||||||
existeUsuario,
|
|
||||||
institucionCarrera,
|
|
||||||
'trabajador',
|
|
||||||
);
|
);
|
||||||
},
|
return this.institucionUsuarioService.findByUsuarioIdInstitucionCarrera(
|
||||||
);
|
existeUsuario,
|
||||||
|
institucionCarrera,
|
||||||
|
'trabajador',
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async findAll(filtros: {
|
async findAll(filtros: {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
numero_cuenta,nombres,apellido_p,apellido_m,carrera,tipo_usuario
|
numero_cuenta,nombres,apellido_p,apellido_m,carrera,tipo_usuario
|
||||||
313144567,Nombre 1,Apellido_p 1,Apellido_m 1,MATEMATICAS APLICADAS Y COMPUTACION,Alumno
|
316313528,MARQUEZ,ROSAS,LEMUEL HELON,MATEMATICAS APLICADAS Y COMPUTACION,Alumno
|
||||||
415895839,Nombre 2,Apellido_p 2,Apellido_m 2,MEDICINA VETERINARIA Y ZOOTECNIA,Posgrado
|
316019251,ROMERO,VAZQUEZ,MARCO ANTONIO,ACTUARIA,Alumno
|
||||||
813573,Nombre 3,Apellido_p 3,Apellido_m 3,,Profesor
|
316304326,CARRERA,SERRANO,JEREMY,ARQUITECTURA,Alumno
|
||||||
|
419085500,SAAVEDRA,TREJO,ANDRES HERNAN,,Profesor
|
||||||
|
|
Loading…
Reference in New Issue
Block a user