Se corrige error en el reporte semanal de newel al buscar los datos de un trafico en base a su pedimento

feature/solicitar_reapertura_de_cuenta_20240206
Felix Morales 8 months ago
parent 7b81e1c16c
commit ba01950af5
  1. 2
      Contracts/Corresponsalias/ICorresponsaliasTraficosRepository.cs
  2. 4
      Controllers/Corresponsalias/TraficosController.cs
  3. 6
      Repository/Corresponsalias/CorresponsaliasTraficosRepository.cs
  4. 9
      Services/Reportes/Newell/Semanal/ReporteSemanalService.cs

@ -9,7 +9,7 @@ namespace CORRESPONSALBackend.Contracts.Corresponsalias
public interface ICorresponsaliasTraficosRepository
{
public Task<ITrafico> Get(int id);
public Task<DTOReporteSemanalNewell> GetByPedimento(int pedimento);
public Task<DTOReporteSemanalNewell> GetByPedimento(int pedimento, int aduana, int patente);
public Task<ITrafico> GetByReferencia(string referencia);
public Task<DashboardTotal> GetAll(int Mode);
public Task<IEnumerable<ICorRectificaciones>> GetRectificaciones(int id);

@ -69,9 +69,9 @@ namespace CORRESPONSALBackend.Controllers.Corresponsalias
[HttpGet]
[Route("GetByPedimento")]
public async Task<DTOReporteSemanalNewell> GetByPedimento([FromQuery] int pedimento)
public async Task<DTOReporteSemanalNewell> GetByPedimento([FromQuery] int pedimento, int aduana, int patente)
{
var entrada = await _Repo.GetByPedimento(pedimento);
var entrada = await _Repo.GetByPedimento(pedimento, aduana, patente);
return entrada;
}

@ -39,13 +39,15 @@ namespace CORRESPONSALBackend.Repository.Corresponsalias
return entrada.FirstOrDefault(new ITrafico { });
}
public async Task<DTOReporteSemanalNewell> GetByPedimento(int pedimento)
public async Task<DTOReporteSemanalNewell> GetByPedimento(int pedimento, int aduana, int patente)
{
var query = "[Corresponsales.Trafico.GetByPedimento]";
using var connection = _context.CreateConnection();
var entrada = await connection.QueryAsync<DTOReporteSemanalNewell>(query, new
{
@pedimento
@pedimento,
@aduana,
@patente
},
commandType: CommandType.StoredProcedure);
return entrada.FirstOrDefault(new DTOReporteSemanalNewell { });

@ -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;

Loading…
Cancel
Save