Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1abf4d4e9c | |||
| 3ef076111e | |||
| a387f11302 | |||
| e336f0bb86 | |||
| e5f98c9596 | |||
| 24717cf931 | |||
| b6e7525dc2 | |||
| bc975bc295 | |||
| cb82dd3354 | |||
| a18fbe441d | |||
| c42c87e080 | |||
| 3bc245e1f7 | |||
| 5c5e7b3f0f |
+3
-2
@@ -2,7 +2,8 @@
|
|||||||
/dist
|
/dist
|
||||||
/node_modules
|
/node_modules
|
||||||
/build
|
/build
|
||||||
|
/server/uploads
|
||||||
|
/server
|
||||||
# Logs
|
# Logs
|
||||||
logs
|
logs
|
||||||
*.log
|
*.log
|
||||||
@@ -13,7 +14,7 @@ yarn-error.log*
|
|||||||
lerna-debug.log*
|
lerna-debug.log*
|
||||||
|
|
||||||
/initdb/init.sql
|
/initdb/init.sql
|
||||||
|
/initdb2
|
||||||
# OS
|
# OS
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
|||||||
@@ -18,9 +18,11 @@ import { FilterCasoEspecialDto } from './dto/filter-caso-especial.dto';
|
|||||||
import { arch } from 'os';
|
import { arch } from 'os';
|
||||||
import { SendMailDto } from 'src/helpers.services/dto/send-email.dto';
|
import { SendMailDto } from 'src/helpers.services/dto/send-email.dto';
|
||||||
const {
|
const {
|
||||||
|
|
||||||
terminoValidado
|
terminoValidado
|
||||||
} = require('./../helpers.services/msjCorreos');
|
} = require('./../helpers.services/msjCorreos');
|
||||||
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class CasoEspecialService {
|
export class CasoEspecialService {
|
||||||
constructor(
|
constructor(
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ export class CreateCasoEspecialDto {
|
|||||||
idStatus: number;
|
idStatus: number;
|
||||||
|
|
||||||
@IsString()
|
@IsString()
|
||||||
@Length(9, 9)
|
|
||||||
@Matches(/^\d+$/, { message: 'solo puede contener números' })
|
@Matches(/^\d+$/, { message: 'solo puede contener números' })
|
||||||
numeroCuenta: string;
|
numeroCuenta: string;
|
||||||
|
|
||||||
|
|||||||
@@ -1,145 +1,143 @@
|
|||||||
import { Servicio } from "src/servicio/entities/servicio.entity";
|
import { Servicio } from 'src/servicio/entities/servicio.entity';
|
||||||
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
|
||||||
|
|
||||||
@Entity('cuestionario_alumno_2')
|
@Entity('cuestionario_alumno_2')
|
||||||
export class CuestionarioAlumno2 {
|
export class CuestionarioAlumno2 {
|
||||||
|
|
||||||
@PrimaryGeneratedColumn()
|
@PrimaryGeneratedColumn()
|
||||||
idCuestionarioAlumno2: number;
|
idCuestionarioAlumno2: number;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 100, nullable: false })
|
@Column({ type: 'text', nullable: true })
|
||||||
p1: string;
|
p1: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 50, nullable: false })
|
@Column({ type: 'varchar', length: 200, nullable: true })
|
||||||
p2: string;
|
p2: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 5, nullable: false })
|
@Column({ type: 'varchar', length: 200, nullable: true })
|
||||||
p4: string;
|
p4: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 50, nullable: true })
|
@Column({ type: 'varchar', length: 500, nullable: true })
|
||||||
p5: string;
|
p5: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 5, nullable: false })
|
@Column({ type: 'varchar', length: 200, nullable: true })
|
||||||
p6: string;
|
p6: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 5, nullable: false })
|
@Column({ type: 'varchar', length: 200, nullable: true })
|
||||||
p7: string;
|
p7: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 50, nullable: true })
|
@Column({ type: 'varchar', length: 500, nullable: true })
|
||||||
p8: string;
|
p8: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 5, nullable: false })
|
@Column({ type: 'varchar', length: 200, nullable: true })
|
||||||
p9: string;
|
p9: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 5, nullable: false })
|
@Column({ type: 'varchar', length: 50, nullable: true })
|
||||||
p3_1: string;
|
p3_1: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 5, nullable: false })
|
@Column({ type: 'varchar', length: 50, nullable: true })
|
||||||
p3_2: string;
|
p3_2: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 5, nullable: false })
|
@Column({ type: 'varchar', length: 50, nullable: true })
|
||||||
p3_3: string;
|
p3_3: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 5, nullable: false })
|
@Column({ type: 'varchar', length: 50, nullable: true })
|
||||||
p3_4: string;
|
p3_4: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 5, nullable: false })
|
@Column({ type: 'varchar', length: 20, nullable: true })
|
||||||
p10_1: string;
|
p10_1: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 5, nullable: false })
|
@Column({ type: 'varchar', length: 20, nullable: true })
|
||||||
p10_2: string;
|
p10_2: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 5, nullable: false })
|
@Column({ type: 'varchar', length: 20, nullable: true })
|
||||||
p10_3: string;
|
p10_3: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 20, nullable: false })
|
@Column({ type: 'varchar', length: 20, nullable: true })
|
||||||
p11_1: string;
|
p11_1: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 20, nullable: false })
|
@Column({ type: 'varchar', length: 20, nullable: true })
|
||||||
p11_2: string;
|
p11_2: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 20, nullable: false })
|
@Column({ type: 'varchar', length: 20, nullable: true })
|
||||||
p11_3: string;
|
p11_3: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 20, nullable: false })
|
@Column({ type: 'varchar', length: 20, nullable: true })
|
||||||
p11_4: string;
|
p11_4: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 20, nullable: false })
|
@Column({ type: 'varchar', length: 20, nullable: true })
|
||||||
p12_A_1: string;
|
p12_A_1: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 20, nullable: false })
|
@Column({ type: 'varchar', length: 20, nullable: true })
|
||||||
p12_A_2: string;
|
p12_A_2: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 20, nullable: false })
|
@Column({ type: 'varchar', length: 20, nullable: true })
|
||||||
p12_A_3: string;
|
p12_A_3: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 20, nullable: false })
|
@Column({ type: 'varchar', length: 20, nullable: true })
|
||||||
p12_A_4: string;
|
p12_A_4: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 20, nullable: false })
|
@Column({ type: 'varchar', length: 20, nullable: true })
|
||||||
p12_B_1: string;
|
p12_B_1: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 20, nullable: false })
|
@Column({ type: 'varchar', length: 20, nullable: true })
|
||||||
p12_B_2: string;
|
p12_B_2: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 20, nullable: false })
|
@Column({ type: 'varchar', length: 20, nullable: true })
|
||||||
p12_B_3: string;
|
p12_B_3: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 20, nullable: false })
|
@Column({ type: 'varchar', length: 20, nullable: true })
|
||||||
p12_B_4: string;
|
p12_B_4: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 20, nullable: false })
|
@Column({ type: 'varchar', length: 20, nullable: true })
|
||||||
p12_C_1: string;
|
p12_C_1: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 20, nullable: false })
|
@Column({ type: 'varchar', length: 20, nullable: true })
|
||||||
p12_C_2: string;
|
p12_C_2: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 20, nullable: false })
|
@Column({ type: 'varchar', length: 20, nullable: true })
|
||||||
p12_C_3: string;
|
p12_C_3: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 20, nullable: false })
|
@Column({ type: 'varchar', length: 20, nullable: true })
|
||||||
p12_C_4: string;
|
p12_C_4: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 20, nullable: false })
|
@Column({ type: 'varchar', length: 50, nullable: true })
|
||||||
p12_D_1: string;
|
p12_D_1: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 20, nullable: false })
|
@Column({ type: 'varchar', length: 50, nullable: true })
|
||||||
p12_D_2: string;
|
p12_D_2: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 20, nullable: false })
|
@Column({ type: 'varchar', length: 50, nullable: true })
|
||||||
p12_D_3: string;
|
p12_D_3: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 20, nullable: false })
|
@Column({ type: 'varchar', length: 50, nullable: true })
|
||||||
p12_D_4: string;
|
p12_D_4: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 20, nullable: false })
|
@Column({ type: 'varchar', length: 50, nullable: true })
|
||||||
p12_D_5: string;
|
p12_D_5: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 100, nullable: false })
|
@Column({ type: 'varchar', length: 200, nullable: true })
|
||||||
p13: string;
|
p13: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 100, nullable: false })
|
@Column({ type: 'varchar', length: 200, nullable: true })
|
||||||
p14: string;
|
p14: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 5, nullable: false })
|
@Column({ type: 'varchar', length: 200, nullable: true })
|
||||||
p15: string;
|
p15: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 50, nullable: true })
|
@Column({ type: 'varchar', length: 500, nullable: true })
|
||||||
p16: string;
|
p16: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 5, nullable: false })
|
@Column({ type: 'varchar', length: 20, nullable: true })
|
||||||
p17_1: string;
|
p17_1: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 5, nullable: false })
|
@Column({ type: 'varchar', length: 20, nullable: true })
|
||||||
p17_2: string;
|
p17_2: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 5, nullable: false })
|
@Column({ type: 'varchar', length: 20, nullable: true })
|
||||||
p17_3: string;
|
p17_3: string;
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 50, nullable: true })
|
@Column({ type: 'varchar', length: 500, nullable: true })
|
||||||
p18: string;
|
p18: string;
|
||||||
|
|
||||||
@OneToMany(() => Servicio, (servicio) => servicio.cuestionarioAlumno2)
|
@OneToMany(() => Servicio, (servicio) => servicio.cuestionarioAlumno2)
|
||||||
servicio: Servicio[];
|
servicio: Servicio[];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1581,76 +1581,76 @@ export class ServicioService {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// @Cron('0 0 * * *')
|
@Cron('0 0 * * *')
|
||||||
// async diario(): Promise<void> {
|
async diario(): Promise<void> {
|
||||||
// const now = moment().startOf('day');
|
const now = moment().startOf('day');
|
||||||
// let mensaje = '';
|
let mensaje = '';
|
||||||
|
|
||||||
// const servicios = await this.servicioRepo.find({
|
const servicios = await this.servicioRepo.find({
|
||||||
// where: { status: { idStatus: 3 } },
|
where: { status: { idStatus: 3 } },
|
||||||
// relations: [
|
relations: [
|
||||||
// 'status',
|
'status',
|
||||||
// 'usuario',
|
'usuario',
|
||||||
// 'programa',
|
'programa',
|
||||||
// 'programa.usuario',
|
'programa.usuario',
|
||||||
// ],
|
],
|
||||||
// });
|
});
|
||||||
|
|
||||||
// for (const servicio of servicios) {
|
for (const servicio of servicios) {
|
||||||
// const fechaFin = moment(servicio.fechaFin).startOf('day');
|
const fechaFin = moment(servicio.fechaFin).startOf('day');
|
||||||
|
|
||||||
// const diferencia = fechaFin.diff(now, 'days');
|
const diferencia = fechaFin.diff(now, 'days');
|
||||||
|
|
||||||
// console.log("diferencia:", diferencia)
|
console.log("diferencia:", diferencia)
|
||||||
|
|
||||||
// // ===== 7 días antes =====
|
// ===== 7 días antes =====
|
||||||
// if (diferencia === 7) {
|
if (diferencia === 7) {
|
||||||
// const correoAlumno = avisoTerminoAlumno(
|
const correoAlumno = avisoTerminoAlumno(
|
||||||
// servicio.usuario.nombre,
|
servicio.usuario.nombre,
|
||||||
// );
|
);
|
||||||
|
|
||||||
// const correoResponsable = avisoTerminoResponsable(
|
const correoResponsable = avisoTerminoResponsable(
|
||||||
// servicio.usuario.nombre,
|
servicio.usuario.nombre,
|
||||||
// );
|
);
|
||||||
|
|
||||||
// mensaje +=
|
mensaje +=
|
||||||
// `Se envió correo al alumno ${servicio.usuario.usuario} ` +
|
`Se envió correo al alumno ${servicio.usuario.usuario} ` +
|
||||||
// `con id ${servicio.usuario.idUsuario} al correo ${servicio.correo} ` +
|
`con id ${servicio.usuario.idUsuario} al correo ${servicio.correo} ` +
|
||||||
// `y al responsable ${servicio.programa.usuario.nombre} ` +
|
`y al responsable ${servicio.programa.usuario.nombre} ` +
|
||||||
// `con id ${servicio.programa.usuario.idUsuario} ` +
|
`con id ${servicio.programa.usuario.idUsuario} ` +
|
||||||
// `y correo ${servicio.programa.usuario.usuario}\n\n`;
|
`y correo ${servicio.programa.usuario.usuario}\n\n`;
|
||||||
|
|
||||||
// await this.gmailService.enviarCorreo({
|
await this.gmailService.enviarCorreo({
|
||||||
// subject: correoAlumno.subject,
|
subject: correoAlumno.subject,
|
||||||
// to: servicio.correo,
|
to: servicio.correo,
|
||||||
// text: correoAlumno.msj,
|
text: correoAlumno.msj,
|
||||||
// fecha_recibido: new Date(),
|
fecha_recibido: new Date(),
|
||||||
// });
|
});
|
||||||
|
|
||||||
// await this.gmailService.enviarCorreo({
|
await this.gmailService.enviarCorreo({
|
||||||
// subject: correoResponsable.subject,
|
subject: correoResponsable.subject,
|
||||||
// to: servicio.programa.usuario.usuario,
|
to: servicio.programa.usuario.usuario,
|
||||||
// text: correoResponsable.msj,
|
text: correoResponsable.msj,
|
||||||
// fecha_recibido: new Date(),
|
fecha_recibido: new Date(),
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
|
|
||||||
// // ===== Servicio vencido =====
|
// ===== Servicio vencido =====
|
||||||
// else if (diferencia <= 0) {
|
else if (diferencia <= 0) {
|
||||||
// mensaje +=
|
mensaje +=
|
||||||
// `El servicio con id ${servicio.idServicio} ` +
|
`El servicio con id ${servicio.idServicio} ` +
|
||||||
// `del alumno ${servicio.usuario.usuario} ` +
|
`del alumno ${servicio.usuario.usuario} ` +
|
||||||
// `con id ${servicio.usuario.idUsuario} ` +
|
`con id ${servicio.usuario.idUsuario} ` +
|
||||||
// `pasó al status 4\n\n`;
|
`pasó al status 4\n\n`;
|
||||||
|
|
||||||
// await this.servicioRepo.update(
|
await this.servicioRepo.update(
|
||||||
// { idServicio: servicio.idServicio },
|
{ idServicio: servicio.idServicio },
|
||||||
// { status: { idStatus: 4 } },
|
{ status: { idStatus: 4 } },
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
// // ===== Reporte =====
|
// ===== Reporte =====
|
||||||
// console.log("se realizo carga masiva")
|
console.log("se realizo carga masiva")
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ export class UsuarioService {
|
|||||||
});
|
});
|
||||||
alum = await this.userRepo.save(nuevoUsuario);
|
alum = await this.userRepo.save(nuevoUsuario);
|
||||||
}
|
}
|
||||||
console.log("Alumno:", alumno);
|
console.log("el alumno es:", alumno);
|
||||||
return { ...alumno, idUsuario: alum.idUsuario };
|
return { ...alumno, idUsuario: alum.idUsuario };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user