Modificacines en los reportes se agregaron nuevos campos asi como la vista de consulta de informacion de los servicios
This commit is contained in:
+1048
-13892
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+1048
-1033
File diff suppressed because it is too large
Load Diff
+13892
-13892
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+1048
-1033
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,21 @@
|
||||
numeroCuenta,nombre,licenciatura,correo,fechaInicio,fechaFin,fechaLiberacion,institucion,dependencia,programa,profesor,clave,status
|
||||
315040357,RAMIREZ AVILA MELANY BETSABE,LIC. EN HISTORIA,424018289@pcpuma.acatlan.unam.mx,29/7/2024,3/12/2025,"",Instituto Nacional De Antropologia E Historia,Museo Nacional De Antropologia,"Investigación, conservación y difusión del patrimonio arqueológico y etnográfico de México","",2024-21/7-1471,Pre-Termino
|
||||
319304899,ASCENCIO DIAZ ENRIQUE,LIC. EN ACTUARIA,424018289@pcpuma.acatlan.unam.mx,27/10/2024,1/12/2025,"",UNAM,FES ACATLAN,Acatlán Contigo,Act. Jorge Carmona Mendoza,2025-12/145-24,Cancelado
|
||||
421039812,ARTEAGA GONZALEZ RUBEN MAURICIO,LIC. EN COMUNICACION,424018289@pcpuma.acatlan.unam.mx,29/12/2024,"","",UNAM,FES ACATLAN,Acatlán Contigo,MTRO. SERGIO ARTEMIO GUILLERMO VALENTÍN,2024-12/20-530,Pre-Termino
|
||||
319302187,PEREZ CENTENO JORGE,LIC. EN CIENCIAS POLITICAS Y ADMON PUB,pcentenojorge15@gmail.com,1/12/2025,8/12/2025,"",UNAM,FES ACATLAN,Acatlán Contigo,Antonio Faustino Torres,2025-12/145-24,Pre-Registro
|
||||
413076379,JIMENEZ GONZALEZ JAZMIN ALEJANDRA,LIC. EN MATEMATICAS APLICADAS Y COMP.,424018289@pcpuma.acatlan.unam.mx,1/12/2025,4/12/2025,"",UNAM,FES ACATLAN,Acatlán Contigo,xxxx,2025-12/145-24,Carta Aceptación Rechazada
|
||||
421162888,DREW IBARRA EDUARDO CARLOS,LIC. ENSEÑANZA DE ESPAÑOL(LENG. EXTRANJ),424018289@pcpuma.acatlan.unam.mx,17/12/2025,11/12/2025,"",UNIVERSIDAD NACIONAL AUTONOMA DE MEXICO,ESCUELA DE EXTENSIÓN EN CHICAGO,Enseñanza de Español como Lengua Extranjera,"",2024-12/226-2509,Pre-Termino
|
||||
419089577,GUTIERREZ GUTIERREZ DIANA ANGELICA,LIC. EN ARQUITECTURA,320154041@pcpuma.acatlan.unam.mx,19/12/2025,18/6/2026,"",UNAM,FES ACATLAN,Titulación por servicio social,LIC. MARCELA MARTÍNEZ RANGEL,2023-12/20-222,Cancelado
|
||||
422116468,CONTRERAS GONZALEZ ANA CRISTINA,LIC. EN ECONOMIA,424018289@pcpuma.acatlan.unam.mx,28/12/2025,"","",Secretaria De Agricultura Y Desarrollo Rural,Liconsa. S.a De C.v.,SERVICIO SOCIAL LICONSA OFICINA CENTRAL,"",2025-192/1-2689,Pre-Registro
|
||||
numeroCuenta,nombre,licenciatura,correo,fechaInicio,fechaFin,fechaLiberacion,AcatlanContigo,programaInterno,responsable,institucion,dependencia,programa,profesor,clave,status
|
||||
315040357,RAMIREZ AVILA MELANY BETSABE,LIC. EN HISTORIA,424018289@pcpuma.acatlan.unam.mx,1/1/2025,1/1/2026,"",No,"",RAMIREZ AVILA MELANY BETSABE,Instituto Nacional De Antropologia E Historia,Museo Nacional De Antropologia,"Investigación, conservación y difusión del patrimonio arqueológico y etnográfico de México","",2024-21/7-1471,Pre-Termino
|
||||
318194514,MUÑOZ JIMENEZ ALEXA JUDITH,LIC. EN RELACIONES INTERNACIONALES,eleccion16@pcpuma.acatlan.unam.mx,1/6/2025,8/12/2025,13/1/2026,No,"",MUÑOZ JIMENEZ ALEXA JUDITH,Secretaria De Relaciones Exteriores,Dirección De Servicios Al Personal,APOYO INTEGRAL A LA SECRETARÍA DE RELACIONES EXTERIORES,"",2025-2/2-1107,Liberación
|
||||
320313259,ROMERO ARRIAGA VALERIA YANIN,LIC. EN ACTUARIA,eleccion13@pcpuma.acatlan.unam.mx,1/6/2025,9/12/2025,"",Sí,DE APOYO PROPEDEUTICO EN MATERIAS CON ALTOS INDICES DE REPROBACION,ROMERO ARRIAGA VALERIA YANIN,UNAM,FES ACATLAN,Acatlán Contigo,Act. Jorge Carmona Mendoza ,2025-12/145-24,Registro
|
||||
319224719,SANTIAGO GARCIA JESUS ENRIQUE,LIC. EN ACTUARIA,eleccion13@pcpuma.acatlan.unam.mx,1/6/2025,9/12/2025,"",Sí,ANÁLISIS Y EVALUACIÓN DE LA TRAYECTORIA ACADÉMICA,SANTIAGO GARCIA JESUS ENRIQUE,UNAM,FES ACATLAN,Acatlán Contigo,Act. Jorge Carmona Mendoza,2025-12/145-24,Registro
|
||||
319096992,GONZALEZ CASTRO JADE,LIC. EN ACTUARIA,424018289@pcpuma.acatlan.unam.mx,1/6/2025,9/12/2025,"",Sí,ANÁLISIS Y EVALUACIÓN DE LA TRAYECTORIA ACADÉMICA,GONZALEZ CASTRO JADE,UNAM,FES ACATLAN,Acatlán Contigo,Act. Jorge Carmona Mendoza,2025-12/145-24,Pre-Termino
|
||||
318563963,MEJIA BUSTOS REBECA,LIC. EN RELACIONES INTERNACIONALES,eleccion5@pcpuma.acatlan.unam.mx,1/6/2025,8/12/2025,14/1/2026,No,"",MEJIA BUSTOS REBECA,Organizaciones Sociales Sin Fines De Lucro,"Inroads De México, A.c.",Gestión de Proyectos / Project Manager,"",2025-5/92-1617,Liberación
|
||||
316207375,BAUTISTA CARMONA KEVIN YAIR,LIC. EN HISTORIA,eleccion5@pcpuma.acatlan.unam.mx,1/6/2025,8/12/2025,14/1/2026,No,"",BAUTISTA CARMONA KEVIN YAIR,Instituto Nacional De Antropologia E Historia,Museo Nacional De Antropologia,"Investigación, conservación y difusión del patrimonio arqueológico y etnográfico de México","",2025-18/4-1574,Liberación
|
||||
319021745,GUTIERREZ GONZALEZ JAVIER,LIC. EN ACTUARIA,eleccion9@pcpuma.acatlan.unam.mx,16/6/2025,16/12/2025,"",Sí,ANÁLISIS Y EVALUACIÓN DE LA TRAYECTORIA ACADÉMICA,GUTIERREZ GONZALEZ JAVIER,UNAM,FES ACATLAN,Acatlán Contigo,Act. Jorge Carmona Mendoza,2025-12/145-24,Pre-Termino
|
||||
317126765,LUNA MOLINA JENNIFER LIZETTE,LIC. EN COMUNICACION,eleccion6@pcpuma.acatlan.unam.mx,1/8/2025,28/2/2026,2/3/2026,Sí,CEC Creativo ,LUNA MOLINA JENNIFER LIZETTE,UNAM,FES ACATLAN,Acatlán Contigo,LIC. FABIOLA VIRGINIA LARA TREVIÑO,2024-12/20-530,Liberación
|
||||
423027361,RANGEL BLANCAS AXEL,LIC. EN MATEMATICAS APLICADAS Y COMP.,eleccion4@pcpuma.acatlan.unam.mx,7/8/2025,28/2/2026,"",No,"",RANGEL BLANCAS AXEL,Secretaria De La Defensa Nacional,Direccion General De Ingenieros,DIRECCION GENERAL DE INGENIEROS,"",2026-63/14-1685,Pre-Termino
|
||||
307042219,GUEVARA MOYSEN JORGE ISAAC,LIC. EN MATEMATICAS APLICADAS Y COMP.,eleccion5@pcpuma.acatlan.unam.mx,7/8/2025,28/2/2026,"",Sí,SI,GUEVARA MOYSEN JORGE ISAAC,UNAM,FES ACATLAN,Acatlan Contigo,MARCELA MTZ,2026-12/145-1,Pre-Termino
|
||||
319302187,PEREZ CENTENO JORGE,LIC. EN CIENCIAS POLITICAS Y ADMON PUB,pcentenojorge15@gmail.com,1/12/2025,8/12/2025,"",Sí,"Instituciones, Democracia y Participación Política en el gobierno de Andrés Manuel López Obrador",PEREZ CENTENO JORGE,UNAM,FES ACATLAN,Acatlán Contigo,Antonio Faustino Torres,2025-12/145-24,Pre-Registro
|
||||
413076379,JIMENEZ GONZALEZ JAZMIN ALEJANDRA,LIC. EN MATEMATICAS APLICADAS Y COMP.,lucel21@hotmail.com,1/12/2025,4/12/2025,"",Sí,xxxx,JIMENEZ GONZALEZ JAZMIN ALEJANDRA,UNAM,FES ACATLAN,Acatlán Contigo,xxxx,2025-12/145-24,Pre-Registro
|
||||
421162888,DREW IBARRA EDUARDO CARLOS,LIC. ENSEÑANZA DE ESPAÑOL(LENG. EXTRANJ),424018289@pcpuma.acatlan.unam.mx,17/12/2025,11/12/2025,"",No,"",DREW IBARRA EDUARDO CARLOS,UNIVERSIDAD NACIONAL AUTONOMA DE MEXICO,ESCUELA DE EXTENSIÓN EN CHICAGO,Enseñanza de Español como Lengua Extranjera,"",2024-12/226-2509,Pre-Termino
|
||||
419089577,GUTIERREZ GUTIERREZ DIANA ANGELICA,LIC. EN ARQUITECTURA,320154041@pcpuma.acatlan.unam.mx,19/12/2025,18/6/2026,"",Sí,"Propuesta de sistemas urbanos y arquitectónicos sostenibles en la zona de consolidación y mejoramiento de Atizapán para el corredor urbano ""Los Jardines""",GUTIERREZ GUTIERREZ DIANA ANGELICA,UNAM,FES ACATLAN,Titulación por servicio social,LIC. MARCELA MARTÍNEZ RANGEL,2023-12/20-222,Cancelado
|
||||
422116468,CONTRERAS GONZALEZ ANA CRISTINA,LIC. EN ECONOMIA,424018289@pcpuma.acatlan.unam.mx,28/12/2025,19/3/2026,"",No,"",CONTRERAS GONZALEZ ANA CRISTINA,Secretaria De Agricultura Y Desarrollo Rural,Liconsa. S.a De C.v.,SERVICIO SOCIAL LICONSA OFICINA CENTRAL,"",2025-192/1-2689,Pre-Registro
|
||||
422016698,GARCIA VAZQUEZ FATIMA,LIC. EN PEDAGOGÍA,424018289@pcpuma.acatlan.unam.mx,1/1/2026,"","",Sí,FES Acatlán,GARCIA VAZQUEZ FATIMA,UNAM,FES ACATLAN,Acatlán Contigo,Lic. Bertha Hurtado Jacinto,2024-12/20-530,Pre-Termino
|
||||
316710570,AGUILAR GALINDO VALERIA,LIC. EN RELACIONES INTERNACIONALES,eleccion15@pcpuma.acatlan.unam.mx,12/1/2026,12/7/2026,"",No,"",AGUILAR GALINDO VALERIA,Secretaria De Relaciones Exteriores,Dirección De Servicios Al Personal,APOYO INTEGRAL A LA SECRETARÍA DE RELACIONES EXTERIORES,"",2025-2/2-1107,Pre-Termino
|
||||
423046391,VAZQUEZ SARABIA ALEJANDRA MARIANA,LIC. EN ECONOMIA,eleccion10@pcpuma.acatlan.unam.mx,16/1/2026,16/7/2026,"",No,"",VAZQUEZ SARABIA ALEJANDRA MARIANA,Secretaria De La Defensa Nacional,Test1,Desarrrollo,"",2026-63/157-2,Cancelado
|
||||
423046391,VAZQUEZ SARABIA ALEJANDRA MARIANA,LIC. EN ECONOMIA,424018289@pcpuma.acatlan.unam.mx,16/1/2026,16/7/2026,"",No,"",VAZQUEZ SARABIA ALEJANDRA MARIANA,Secretaria De La Defensa Nacional,Test1,Desarrrollo,"",2026-63/157-2,Registro
|
||||
|
||||
|
+1
-1
@@ -30,7 +30,7 @@ import { ScheduleModule } from '@nestjs/schedule';
|
||||
database: process.env.DB_DATABASE,
|
||||
password: process.env.DB_PASSWORD,
|
||||
port: Number(process.env.DB_PORT),
|
||||
synchronize: false, //Lo ponemos en false para no afectar
|
||||
synchronize: true, //Lo ponemos en false para no afectar
|
||||
dropSchema: false,
|
||||
autoLoadEntities: true,
|
||||
logger: 'advanced-console',
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import { CasoEspecial } from 'src/caso-especial/entities/caso-especial.entity';
|
||||
import { CuestionarioAlumno } from 'src/cuestionario-alumno/entities/cuestionario-alumno.entity';
|
||||
import { CuestionarioAlumno2 } from 'src/cuestionario-alumno2/entities/cuestionario-alumno2.entity';
|
||||
import { CuestionarioPrograma } from 'src/cuestionario-programa/entities/cuestionario-programa.entity';
|
||||
import { CuestionarioPrograma2 } from 'src/cuestionario-programa2/entities/cuestionario-programa2.entity';
|
||||
import { Servicio } from 'src/servicio/entities/servicio.entity';
|
||||
import { Entity, PrimaryGeneratedColumn, Column, OneToMany } from 'typeorm';
|
||||
|
||||
@@ -15,4 +19,16 @@ export class Carrera {
|
||||
|
||||
@OneToMany(() => Servicio, (servicio) => servicio.carrera)
|
||||
servicios: Servicio[];
|
||||
|
||||
@OneToMany(() => CuestionarioAlumno2, (cuestionarioAlumno2) => cuestionarioAlumno2.carrera)
|
||||
cuestionarioAlumno2: CuestionarioAlumno2[];
|
||||
|
||||
@OneToMany(() => CuestionarioAlumno, (cuestionarioAlumno) => cuestionarioAlumno.carrera)
|
||||
cuestionarioAlumno: CuestionarioAlumno[];
|
||||
|
||||
@OneToMany(() => CuestionarioPrograma2, (cuestionarioPrograma2) => cuestionarioPrograma2.carrera)
|
||||
cuestionarioPrograma2: CuestionarioPrograma2[];
|
||||
|
||||
@OneToMany(() => CuestionarioPrograma, (CuestionarioPrograma) => CuestionarioPrograma.carrera)
|
||||
cuestionarioPrograma: CuestionarioPrograma[];
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Carrera } from 'src/carrera/entities/carrera.entity';
|
||||
import { Servicio } from 'src/servicio/entities/servicio.entity';
|
||||
import {
|
||||
Entity,
|
||||
@@ -5,6 +6,8 @@ import {
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
OneToMany,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
} from 'typeorm';
|
||||
|
||||
@Entity('cuestionario_alumno')
|
||||
@@ -121,4 +124,8 @@ export class CuestionarioAlumno {
|
||||
|
||||
@OneToMany(() => Servicio, (servicio) => servicio.cuestionarioAlumno2)
|
||||
servicio: Servicio[];
|
||||
|
||||
@ManyToOne(() => Carrera, (carrera) => carrera.cuestionarioAlumno2)
|
||||
@JoinColumn({ name: 'idCarrera' }) // nombre EXACTO de la columna en tu tabla
|
||||
carrera: Carrera;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import { messageByStatus } from 'src/messageByStatus';
|
||||
import { ArchivoService } from 'src/helpers.services/archivo.service';
|
||||
import { ValidacionService } from 'src/helpers.services/validacion.service';
|
||||
import { convertArrayToCSV } from 'convert-array-to-csv';
|
||||
import { Carrera } from 'src/carrera/entities/carrera.entity';
|
||||
|
||||
@Injectable()
|
||||
export class CuestionarioAlumno2Service {
|
||||
@@ -121,6 +122,7 @@ export class CuestionarioAlumno2Service {
|
||||
where: {
|
||||
idCuestionarioAlumno: Not(IsNull()),
|
||||
},
|
||||
relations: ["carrera"] // "carrera.facultad", "servicio", "servicio.status
|
||||
});
|
||||
}
|
||||
|
||||
@@ -129,6 +131,7 @@ export class CuestionarioAlumno2Service {
|
||||
where: {
|
||||
idCuestionarioAlumno2: Not(IsNull()),
|
||||
},
|
||||
relations: ["carrera"]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -136,7 +139,17 @@ export class CuestionarioAlumno2Service {
|
||||
throw new BadRequestException('No hay datos para exportar');
|
||||
}
|
||||
|
||||
const data = temp.map((item) => ({ ...item }));
|
||||
console.log('Datos obtenidos para exportar:', temp[0]);
|
||||
|
||||
const data = temp.map((item => {
|
||||
const { servicio, carrera, ...rest } = item;
|
||||
return {
|
||||
...rest,
|
||||
carrera: carrera ? carrera.carrera : 'N/A',
|
||||
};
|
||||
}));
|
||||
|
||||
console.log("Datos del reporte alumnos: ", data[20])
|
||||
|
||||
await this.archivoService.eliminarArchivo(path).catch(() => null);
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Carrera } from "src/carrera/entities/carrera.entity";
|
||||
import { Servicio } from "src/servicio/entities/servicio.entity";
|
||||
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
||||
import { Column, Entity, JoinColumn, ManyToOne, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
||||
|
||||
@Entity('cuestionario_alumno_2')
|
||||
export class CuestionarioAlumno2 {
|
||||
@@ -140,6 +141,10 @@ export class CuestionarioAlumno2 {
|
||||
p18: string;
|
||||
|
||||
@OneToMany(()=>Servicio,(servicio)=>servicio.cuestionarioAlumno2)
|
||||
// @JoinColumn({ name: 'idServicio' })
|
||||
servicio:Servicio[];
|
||||
|
||||
@ManyToOne(()=>Carrera, (carrera)=>carrera.cuestionarioAlumno2)
|
||||
@JoinColumn({ name: 'idCarrera' }) // nombre EXACTO de la columna en tu tabla
|
||||
carrera: Carrera;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import { Carrera } from 'src/carrera/entities/carrera.entity';
|
||||
import { Servicio } from 'src/servicio/entities/servicio.entity';
|
||||
import {
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
Entity,
|
||||
JoinColumn,
|
||||
ManyToOne,
|
||||
OneToMany,
|
||||
PrimaryGeneratedColumn,
|
||||
} from 'typeorm';
|
||||
@@ -42,5 +45,10 @@ export class CuestionarioPrograma {
|
||||
// faltaba createdAT
|
||||
|
||||
@OneToMany(() => Servicio, (servicio) => servicio.cuestionarioPrograma)
|
||||
// @JoinColumn({ name: 'idServicio' })
|
||||
servicio: Servicio[];
|
||||
|
||||
@ManyToOne(() => Carrera, (carrera) => carrera.cuestionarioPrograma)
|
||||
@JoinColumn({ name: 'idCarrera' })
|
||||
carrera: Carrera;
|
||||
}
|
||||
|
||||
@@ -7,11 +7,15 @@ import {
|
||||
Param,
|
||||
Delete,
|
||||
UseGuards,
|
||||
Query,
|
||||
Res,
|
||||
} from '@nestjs/common';
|
||||
import { CuestionarioPrograma2Service } from './cuestionario-programa2.service';
|
||||
import { CreateCuestionarioPrograma2Dto } from './dto/create-cuestionario-programa2.dto';
|
||||
import { AuthGuard } from '@nestjs/passport';
|
||||
import { findCuestionarioProgama2Dto } from './dto/find.dto';
|
||||
import { Response } from 'express';
|
||||
|
||||
|
||||
@Controller('cuestionario-programa2')
|
||||
export class CuestionarioPrograma2Controller {
|
||||
@@ -31,8 +35,12 @@ export class CuestionarioPrograma2Controller {
|
||||
|
||||
@Get()
|
||||
@UseGuards(AuthGuard('jwt'))
|
||||
findAll(@Body() cuestionario: findCuestionarioProgama2Dto) {
|
||||
return this.cuestionarioPrograma2Service.getCuestionario(cuestionario);
|
||||
async findAll(@Query() cuestionario: findCuestionarioProgama2Dto, @Res() res: Response) {
|
||||
// console.log('datos para el reporte programa', cuestionario);
|
||||
// return this.cuestionarioPrograma2Service.getCuestionario(cuestionario);
|
||||
const path = await this.cuestionarioPrograma2Service.getCuestionario(cuestionario);
|
||||
|
||||
return res.download(path);
|
||||
}
|
||||
|
||||
// @Get(':id')
|
||||
|
||||
@@ -2,7 +2,7 @@ import { BadRequestException, Injectable } from '@nestjs/common';
|
||||
import { CreateCuestionarioPrograma2Dto } from './dto/create-cuestionario-programa2.dto';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { CuestionarioPrograma } from 'src/cuestionario-programa/entities/cuestionario-programa.entity';
|
||||
import { Not, Repository } from 'typeorm';
|
||||
import { IsNull, Not, Repository } from 'typeorm';
|
||||
import { CuestionarioPrograma2 } from './entities/cuestionario-programa2.entity';
|
||||
import { ArchivoService } from 'src/helpers.services/archivo.service';
|
||||
import { ValidacionService } from 'src/helpers.services/validacion.service';
|
||||
@@ -10,6 +10,7 @@ import { Servicio } from 'src/servicio/entities/servicio.entity';
|
||||
import { messageByStatus } from 'src/messageByStatus';
|
||||
import { convertArrayToCSV } from 'convert-array-to-csv';
|
||||
import { ServicioService } from 'src/servicio/servicio.service';
|
||||
import { Carrera } from 'src/carrera/entities/carrera.entity';
|
||||
|
||||
@Injectable()
|
||||
export class CuestionarioPrograma2Service {
|
||||
@@ -76,26 +77,52 @@ export class CuestionarioPrograma2Service {
|
||||
return respuestasRegistradas;
|
||||
}
|
||||
|
||||
async getCuestionario(dto: { version: string; year: string }) {
|
||||
const { version, year } = dto;
|
||||
const filePath = `server/uploads/${year}_cuestionario_programa.csv`;
|
||||
async getCuestionario(dto: { version: string; anio: string }) {
|
||||
const { version, anio } = dto;
|
||||
const filePath = `server/uploads/${anio}_cuestionario_programa.csv`;
|
||||
|
||||
let registros: any[];
|
||||
|
||||
if (version === 'v1') {
|
||||
registros = await this.cuestionarioRepo.find();
|
||||
registros = await this.cuestionarioRepo.find({
|
||||
where: {
|
||||
idCuestionarioPrograma: Not(IsNull()),
|
||||
},
|
||||
relations: ['carrera', 'servicio'],
|
||||
select: {
|
||||
servicio: {
|
||||
profesor: true,
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (version === 'v2') {
|
||||
registros = await this.cuestionario2Repo.find();
|
||||
registros = await this.cuestionario2Repo.find({
|
||||
where: {
|
||||
idCuestionarioPrograma2: Not(IsNull()),
|
||||
},
|
||||
relations: ['carrera', 'servicio'],
|
||||
});
|
||||
} else {
|
||||
throw new BadRequestException('Versión inválida');
|
||||
}
|
||||
|
||||
const data = registros.map((item) => ({ ...item }));
|
||||
const data = registros.map( item => {
|
||||
const { servicio, ...rest } = item;
|
||||
return {
|
||||
...rest,
|
||||
responsable: servicio?.profesor || 'N/A',
|
||||
carrera: item.carrera ? item.carrera.carrera : 'N/A',
|
||||
}
|
||||
} );
|
||||
|
||||
console.log("Informacion del reporte programa: ", data[20])
|
||||
|
||||
await this.archivoService.eliminarArchivo(filePath).catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
|
||||
return this.archivoService.crearArchivo(filePath, convertArrayToCSV(data));
|
||||
await this.archivoService.crearArchivo(filePath, convertArrayToCSV(data));
|
||||
|
||||
return filePath;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,10 +6,12 @@ enum Version {
|
||||
}
|
||||
|
||||
export class findCuestionarioProgama2Dto {
|
||||
@IsEnum(Version, { message: 'La version debe ser v1 o v2' })
|
||||
// @IsEnum(Version, { message: 'La version debe ser v1 o v2' })
|
||||
@IsString()
|
||||
@Length(2, 2, { message: 'La version debe ser v1 o v2' })
|
||||
version: Version;
|
||||
|
||||
@IsString()
|
||||
@Length(4, 4, { message: 'El número debe tener exactamente 4 dígitos' })
|
||||
year: string;
|
||||
anio: string;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import { Carrera } from 'src/carrera/entities/carrera.entity';
|
||||
import { Servicio } from 'src/servicio/entities/servicio.entity';
|
||||
import {
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
Entity,
|
||||
JoinColumn,
|
||||
ManyToOne,
|
||||
OneToMany,
|
||||
PrimaryGeneratedColumn,
|
||||
} from 'typeorm';
|
||||
@@ -90,6 +93,11 @@ export class CuestionarioPrograma2 {
|
||||
@Column({ name: 'p7', type: 'varchar', length: 200, nullable: true })
|
||||
p7?: string;
|
||||
|
||||
@OneToMany(() => Servicio, (servicio) => servicio.cuestionarioAlumno2)
|
||||
@OneToMany(() => Servicio, (servicio) => servicio.cuestionarioPrograma2)
|
||||
// @JoinColumn({ name: 'idServicio' })
|
||||
servicio: Servicio[];
|
||||
|
||||
@ManyToOne(() => Carrera, (carrera) => carrera.cuestionarioPrograma2)
|
||||
@JoinColumn({ name: 'idCarrera' })
|
||||
carrera: Carrera;
|
||||
}
|
||||
|
||||
@@ -167,6 +167,8 @@ export class ServicioService {
|
||||
'servicio.idCuestionarioAlumno2',
|
||||
'servicio.idCuestionarioPrograma',
|
||||
'servicio.idCuestionarioPrograma2',
|
||||
'servicio.programaInterno',
|
||||
'servicio.profesor',
|
||||
|
||||
'usuario.idUsuario',
|
||||
'usuario.usuario',
|
||||
@@ -1295,6 +1297,9 @@ export class ServicioService {
|
||||
fechaLiberacion: s.fechaLiberacion
|
||||
? this.archivoService.crearDDMMAAAA(s.fechaLiberacion)
|
||||
: '',
|
||||
AcatlanContigo: s.programa.acatlan ? 'Sí' : 'No',
|
||||
programaInterno: s.programaInterno,
|
||||
responsable: s.usuario.nombre,
|
||||
institucion: s.programa.institucion,
|
||||
dependencia: s.programa.dependencia,
|
||||
programa: s.programa.programa,
|
||||
|
||||
Reference in New Issue
Block a user