Se agregó el inicio de sesion de google
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// src/excel/excel.controller.ts
|
||||
import { Controller, Post, Get, UseGuards, Request, Res, UploadedFile, UseInterceptors, HttpStatus, Param, ParseIntPipe, Body, BadRequestException } from '@nestjs/common';
|
||||
import { Controller, Post, Get, UseGuards, Request, Res, UploadedFile, UseInterceptors, HttpStatus, Param, ParseIntPipe, Body, BadRequestException, Delete } from '@nestjs/common';
|
||||
import { AuthGuard } from '@nestjs/passport';
|
||||
import { ApiBearerAuth } from '@nestjs/swagger';
|
||||
import { FileInterceptor } from '@nestjs/platform-express';
|
||||
@@ -69,6 +69,7 @@ export class ExcelController {
|
||||
@ExcelDocumentation.loadExcel()
|
||||
async loadExcel(@Request() req, @UploadedFile() file: Express.Multer.File) {
|
||||
const origen = req.user.origen; // ahora sí existe
|
||||
|
||||
if (origen != 'LOAD') {
|
||||
await this.movimientoService.log(
|
||||
origen,
|
||||
@@ -78,6 +79,7 @@ export class ExcelController {
|
||||
throw new Error('Origen no permitido para carga.');
|
||||
}
|
||||
try {
|
||||
|
||||
const result = await this.excelService.loadFile(file.buffer);
|
||||
//Actualizar el estado de los movimientos
|
||||
if (!result) {
|
||||
@@ -120,6 +122,24 @@ export class ExcelController {
|
||||
});
|
||||
|
||||
await this.excelService.enviarCargaMasiva();
|
||||
|
||||
|
||||
await this.excelService.enviarInforme('AT',"Carga de datos en Servicios PCpuma",
|
||||
`Se ha hecho una carga en el sistema \n ${result.conteoTiposAt}`
|
||||
)
|
||||
|
||||
await this.excelService.enviarInforme('RED',"Carga de datos en Servicios PCpuma",
|
||||
`Se ha hecho una carga en el sistema \n ${result.conteoTiposRed}`
|
||||
)
|
||||
|
||||
await this.excelService.enviarInforme('SOLICITA',"Carga de datos en Servicios PCpuma",
|
||||
`Se ha hecho una carga en el sistema \n ${result.conteoTiposCorreo}`
|
||||
)
|
||||
|
||||
await this.excelService.enviarInforme('CORREO',"Carga de datos en Servicios PCpuma",
|
||||
`Se ha hecho una carga en el sistema \n ${result.conteoTiposCorreo}`
|
||||
)
|
||||
|
||||
|
||||
|
||||
return result
|
||||
@@ -300,6 +320,11 @@ export class ExcelController {
|
||||
|
||||
}
|
||||
|
||||
// @Delete()
|
||||
// async borrar(){
|
||||
// return await this.excelService.borrarUsers()
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user