diff --git a/Contracts/Corresponsalias/ICorresponsaliasTraficosRepository.cs b/Contracts/Corresponsalias/ICorresponsaliasTraficosRepository.cs index 17a9892..f9633d7 100644 --- a/Contracts/Corresponsalias/ICorresponsaliasTraficosRepository.cs +++ b/Contracts/Corresponsalias/ICorresponsaliasTraficosRepository.cs @@ -9,7 +9,7 @@ namespace CORRESPONSALBackend.Contracts.Corresponsalias public interface ICorresponsaliasTraficosRepository { public Task Get(int id); - public Task GetByPedimento(int pedimento); + public Task GetByPedimento(int pedimento, int aduana, int patente); public Task GetByReferencia(string referencia); public Task GetAll(int Mode); public Task> GetRectificaciones(int id); diff --git a/Controllers/Corresponsalias/TraficosController.cs b/Controllers/Corresponsalias/TraficosController.cs index c917133..0851ba7 100644 --- a/Controllers/Corresponsalias/TraficosController.cs +++ b/Controllers/Corresponsalias/TraficosController.cs @@ -69,9 +69,9 @@ namespace CORRESPONSALBackend.Controllers.Corresponsalias [HttpGet] [Route("GetByPedimento")] - public async Task GetByPedimento([FromQuery] int pedimento) + public async Task GetByPedimento([FromQuery] int pedimento, int aduana, int patente) { - var entrada = await _Repo.GetByPedimento(pedimento); + var entrada = await _Repo.GetByPedimento(pedimento, aduana, patente); return entrada; } diff --git a/Repository/Corresponsalias/CorresponsaliasTraficosRepository.cs b/Repository/Corresponsalias/CorresponsaliasTraficosRepository.cs index 289499c..65d835e 100644 --- a/Repository/Corresponsalias/CorresponsaliasTraficosRepository.cs +++ b/Repository/Corresponsalias/CorresponsaliasTraficosRepository.cs @@ -39,13 +39,15 @@ namespace CORRESPONSALBackend.Repository.Corresponsalias return entrada.FirstOrDefault(new ITrafico { }); } - public async Task GetByPedimento(int pedimento) + public async Task GetByPedimento(int pedimento, int aduana, int patente) { var query = "[Corresponsales.Trafico.GetByPedimento]"; using var connection = _context.CreateConnection(); var entrada = await connection.QueryAsync(query, new { - @pedimento + @pedimento, + @aduana, + @patente }, commandType: CommandType.StoredProcedure); return entrada.FirstOrDefault(new DTOReporteSemanalNewell { }); diff --git a/Services/Reportes/Newell/Semanal/ReporteSemanalService.cs b/Services/Reportes/Newell/Semanal/ReporteSemanalService.cs index a974793..b072d18 100644 --- a/Services/Reportes/Newell/Semanal/ReporteSemanalService.cs +++ b/Services/Reportes/Newell/Semanal/ReporteSemanalService.cs @@ -36,11 +36,18 @@ namespace CORRESPONSALBackend.Services.Reportes.Newell.Semanal{ var start = worksheet.Dimension.Start; var end = worksheet.Dimension.End; int initialRow = start.Row+1; + var aduana = worksheet.Cells[$"A2"].Value.ToString(); + var patente = worksheet.Cells[$"B2"].Value.ToString(); + worksheet.Cells[$"S1"].Value = "Referencia"; + worksheet.Cells[$"T1"].Value = "Contenedor"; + worksheet.Cells[$"U1"].Value = "Cuenta de Gastos"; + worksheet.Cells[$"V1"].Value = "Estado"; + worksheet.Cells[$"W1"].Value = "Maniobras"; for (int currentRow = initialRow; currentRow <= end.Row; currentRow++)// Recorrer renglon por renglon - { + { if(!string.IsNullOrWhiteSpace(worksheet.Cells[$"C{currentRow}"].Value?.ToString()) && !string.IsNullOrEmpty(worksheet.Cells[$"C{currentRow}"].Value?.ToString())){ var pedimento = worksheet.Cells[$"C{currentRow}"].Value.ToString(); - var dto = await _traficosRepository.GetByPedimento(int.Parse(pedimento)); + var dto = await _traficosRepository.GetByPedimento(int.Parse(pedimento), int.Parse(aduana), int.Parse(patente)); worksheet.Cells[$"S{currentRow}"].Value = dto.GC; worksheet.Cells[$"T{currentRow}"].Value = dto.Contenedor; worksheet.Cells[$"U{currentRow}"].Value = dto.CuentaDeGastos;