diff --git a/Contracts/Reportes/GC50/IReporteGC50Repository.cs b/Contracts/Reportes/GC50/IReporteGC50Repository.cs index b876d28..bd7399e 100644 --- a/Contracts/Reportes/GC50/IReporteGC50Repository.cs +++ b/Contracts/Reportes/GC50/IReporteGC50Repository.cs @@ -1,8 +1,9 @@ using CORRESPONSALBackend.DTO.Corresponsales; using CORRESPONSALBackend.DTO.Reportes; +using CORRESPONSALBackend.DTO.Reportes.GC50; namespace CORRESPONSALBackend.Contracts.Reportes.GC50{ public interface IReporteGC50Repository{ - public Task> GetAllCorresponsalesTraficos(DTOReporteCorresponsales data); + public Task> GetAllCorresponsalesTraficos(DTOReporteCorresponsales data); } } \ No newline at end of file diff --git a/Controllers/Reportes/ReporteGC50Controller.cs b/Controllers/Reportes/ReporteGC50Controller.cs index b559171..14a45cd 100644 --- a/Controllers/Reportes/ReporteGC50Controller.cs +++ b/Controllers/Reportes/ReporteGC50Controller.cs @@ -1,6 +1,7 @@ using CORRESPONSALBackend.Contracts.Reportes.GC50; using CORRESPONSALBackend.DTO.Corresponsales; using CORRESPONSALBackend.DTO.Reportes; +using CORRESPONSALBackend.DTO.Reportes.GC50; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using OfficeOpenXml; @@ -19,7 +20,7 @@ namespace CORRESPONSALBackend.Controllers.Reportes{ } [HttpGet] - public async Task> GetAllCorresponsalesTraficos([FromQuery] DTOReporteCorresponsales data) + public async Task> GetAllCorresponsalesTraficos([FromQuery] DTOReporteCorresponsales data) { var entrada = await _reportesRepo.GetAllCorresponsalesTraficos(data); return entrada; @@ -35,7 +36,7 @@ namespace CORRESPONSALBackend.Controllers.Reportes{ var worksheet = excelPackage.Workbook.Worksheets.Add("sheet1"); worksheet.Cells["A1"].LoadFromCollection(traficos, true); //Se crea la tabla en el rango de celdas donde se mostrara la inforamcion. - ExcelRange range = worksheet.Cells[1, 1,traficos.Count() + 1, 46]; + ExcelRange range = worksheet.Cells[1, 1,traficos.Count() + 1, 23]; ExcelTable tab = worksheet.Tables.Add(range, "Table1"); tab.TableStyle = TableStyles.Light1; worksheet.Cells[worksheet.Dimension.Address].AutoFitColumns(); diff --git a/DTO/Reportes/GC50/DTOReporteGC50.cs b/DTO/Reportes/GC50/DTOReporteGC50.cs new file mode 100644 index 0000000..61644b9 --- /dev/null +++ b/DTO/Reportes/GC50/DTOReporteGC50.cs @@ -0,0 +1,27 @@ +namespace CORRESPONSALBackend.DTO.Reportes.GC50{ + public class DTOReporteGC50{ + public string Trafico { get; set; } + public string Corresponsal { get; set; } + public int Aduana { get; set; } + public int Patente { get; set; } + public string PedimentoCorresponsal { get; set; } + public string PedimentoCorresponsalR1 { get; set; } + public string? FechaPago { get; set; } + public string? FechaAnticipo { get; set; } + public double SumaAnticipoCorresponsalFinanciado { get; set; } + public string? FechaAlta { get; set; } + public string UsuarioAlta { get; set; } + public int Cliente { get; set; } + public string NombreCliente { get; set; } + public string Cuenta { get; set; } + public string TipoOperacion { get; set; } + public string Terminado { get; set; } + public string? FechaTerminado { get; set; } + public string? FechaRegistroContabilizar { get; set; } + public string? FechaContabilizado { get; set; } + public string? FechaFacturaCorresponsal { get; set; } + public string MotivoCuentaRechazada { get; set; } + public string EstatusOperacion { get; set; } + public string CargoShipper { get; set; } + } +} \ No newline at end of file diff --git a/DTO/Reportes/GC50/ReporteGC50.cs b/DTO/Reportes/GC50/ReporteGC50.cs deleted file mode 100644 index e69de29..0000000 diff --git a/Repository/Reportes/GC50/ReporteGC50Repository.cs b/Repository/Reportes/GC50/ReporteGC50Repository.cs index f2cc352..9afe02c 100644 --- a/Repository/Reportes/GC50/ReporteGC50Repository.cs +++ b/Repository/Reportes/GC50/ReporteGC50Repository.cs @@ -3,6 +3,7 @@ using CORRESPONSALBackend.Context; using CORRESPONSALBackend.Contracts.Reportes.GC50; using CORRESPONSALBackend.DTO.Corresponsales; using CORRESPONSALBackend.DTO.Reportes; +using CORRESPONSALBackend.DTO.Reportes.GC50; using Dapper; namespace CORRESPONSALBackend.Repository.Reportes.GC50{ @@ -10,11 +11,11 @@ namespace CORRESPONSALBackend.Repository.Reportes.GC50{ { private readonly DapperContext _context; public ReporteGC50Repository(DapperContext context) { _context = context; } - public async Task> GetAllCorresponsalesTraficos(DTOReporteCorresponsales data) + public async Task> GetAllCorresponsalesTraficos(DTOReporteCorresponsales data) { var query = "[Reportes.GC50.GetTraficos]"; using var connection = _context.CreateConnection(); - var entrada = await connection.QueryAsync(query, new + var entrada = await connection.QueryAsync(query, new { @Inicio = data.Inicio, @Fin = data.Fin,