feature/creacion del reporte semanal de newell

feature/Reporte_Relacion_Facturas_Alen
Felix Morales 1 year ago
parent 2ece74d717
commit 6eb89d4e69
  1. 2
      Contracts/Corresponsalias/ICorresponsaliasTraficosRepository.cs
  2. 9
      Controllers/Corresponsalias/TraficosController.cs
  3. 8
      Controllers/FileManagerController.cs
  4. 10
      DTO/Reportes/DTOReporteSemanalNewel.cs
  5. 13
      Repository/Corresponsalias/CorresponsaliasTraficosRepository.cs

@ -2,12 +2,14 @@ using CORRESPONSALBackend.Models;
using CORRESPONSALBackend.DTO.Corresponsales;
using CORRESPONSALBackend.Models.Corresponsales;
using CORRESPONSALBackend.Repository.Corresponsalias;
using CORRESPONSALBackend.DTO.Reportes;
namespace CORRESPONSALBackend.Contracts.Corresponsalias
{
public interface ICorresponsaliasTraficosRepository
{
public Task<ITrafico> Get(int id);
public Task<DTOReporteSemanalNewell> GetByPedimento(int pedimento);
public Task<DashboardTotal> GetAll(int Mode);
public Task<IEnumerable<ICorRectificaciones>> GetRectificaciones(int id);
public Task<ICorRectificaciones> AddRectificacion(int id);

@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using CORRESPONSALBackend.Services.C1896;
using CORRESPONSALBackend.Repository.Corresponsalias;
using CORRESPONSALBackend.DTO.Reportes;
namespace CORRESPONSALBackend.Controllers.Corresponsalias
{
@ -45,6 +46,14 @@ namespace CORRESPONSALBackend.Controllers.Corresponsalias
return entrada;
}
[HttpGet]
[Route("GetByPedimento")]
public async Task<DTOReporteSemanalNewell> GetByPedimento([FromQuery] int pedimento)
{
var entrada = await _Repo.GetByPedimento(pedimento);
return entrada;
}
[HttpPut("AddRectificacion/{id}")]
public async Task<ICorRectificaciones> AddRectificacion(int id)
{

@ -7,6 +7,7 @@ using CORRESPONSALBackend.Contracts.Utils;
using CORRESPONSALBackend.Models.Utils;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http.HttpResults;
namespace CORRESPONSALBackend.Controllers
{
@ -57,8 +58,9 @@ namespace CORRESPONSALBackend.Controllers
[Route("AppendFileByProcess")]
[HttpPost]
public async Task<FileManager> AppendFileByProcess(IFormFile file, int IdUsuario, int Proceso, string Tags, int crud)
public async Task<dynamic> AppendFileByProcess(IFormFile file, int IdUsuario, int Proceso, string Tags, int crud)
{
try{
DateTime time = DateTime.Now;
FilePaths4Process RelativePath = await _RepoRelativePath.getPaths4ProcessById(Proceso);
string fullPath = "";
@ -92,6 +94,10 @@ namespace CORRESPONSALBackend.Controllers
}
}
return data;
}catch(Exception ex){
return Ok(ex.Message);
}
}

@ -0,0 +1,10 @@
namespace CORRESPONSALBackend.DTO.Reportes
{
public class DTOReporteSemanalNewell{
public string GC {get;set;}
public string Contenedor { get; set; }
public string CuentaDeGastos { get; set; }
public string Razon { get; set; }
public float Maniobras { get; set; }
}
}

@ -6,6 +6,7 @@ using CORRESPONSALBackend.Models;
using CORRESPONSALBackend.DTO.Corresponsales;
using System.Data;
using CORRESPONSALBackend.Models.Corresponsales;
using CORRESPONSALBackend.DTO.Reportes;
namespace CORRESPONSALBackend.Repository.Corresponsalias
{
@ -38,6 +39,18 @@ namespace CORRESPONSALBackend.Repository.Corresponsalias
return entrada.FirstOrDefault(new ITrafico { });
}
public async Task<DTOReporteSemanalNewell> GetByPedimento(int pedimento)
{
var query = "[Corresponsales.Trafico.GetByPedimento]";
using var connection = _context.CreateConnection();
var entrada = await connection.QueryAsync<DTOReporteSemanalNewell>(query, new
{
@pedimento
},
commandType: CommandType.StoredProcedure);
return entrada.FirstOrDefault(new DTOReporteSemanalNewell { });
}
public async Task<IEnumerable<ICorRectificaciones>> GetRectificaciones(int id)
{
var query = "[Corresponsales.Trafico.Rectificacion.GetAll]";

Loading…
Cancel
Save