diff --git a/Contracts/Operaciones/IOpViajesRepository.cs b/Contracts/Operaciones/IOpViajesRepository.cs index ad085eb..61d8ca9 100644 --- a/Contracts/Operaciones/IOpViajesRepository.cs +++ b/Contracts/Operaciones/IOpViajesRepository.cs @@ -8,6 +8,7 @@ namespace AOLBackend.Contracts.Operaciones public Task> AppendServicio(DTOOpViajesServicios data); public Task> GetAll(); public Task> GetAllServices(); + public Task GetLastTrailerBox(int idViaje); public Task Delete(int id); public Task DeleteService(int id); } diff --git a/Controllers/Operaciones/OpViajesController.cs b/Controllers/Operaciones/OpViajesController.cs index 60f75c1..76d77bd 100644 --- a/Controllers/Operaciones/OpViajesController.cs +++ b/Controllers/Operaciones/OpViajesController.cs @@ -47,6 +47,15 @@ namespace AOLBackend.Controllers.Operaciones return entrada; } + [HttpGet] + [Route("GetLastTrailerBox")] + public async Task GetLastTrailerBox(int idViaje) + { + var entrada = await _Repo.GetLastTrailerBox(idViaje); + return entrada; + } + + [HttpDelete("Delete/{id}")] public async Task Delete(int id) { diff --git a/DTO/Operaciones/DTOOpViajes.cs b/DTO/Operaciones/DTOOpViajes.cs index d8163a3..ab4aaa0 100644 --- a/DTO/Operaciones/DTOOpViajes.cs +++ b/DTO/Operaciones/DTOOpViajes.cs @@ -5,15 +5,9 @@ namespace AOLBackend.DTO.Operaciones public int id { get; set; } = 0; public string FAlta { get; set; } = null!; public int Usuario { get; set; } = 0; - public string FCruce { get; set; } = null!; public string RefAgenciaAduanal { get; set; } = null!; public int Cliente { get; set; } = 0; public string? sCliente { get; set; } = null!; - public int Proveedor { get; set; } = 0; - public string? sProveedor { get; set; } = null!; - public byte Hazmat { get; set; } = 0; - public int Servicio { get; set; } = 0; - public string? sServicio { get; set; } = null!; public byte TipoUnidad { get; set; } = 0; public string? sTipoUnidad { get; set; } = null!; public string NoCaja { get; set; } = null!; @@ -22,5 +16,10 @@ namespace AOLBackend.DTO.Operaciones public string? sOrigen { get; set; } = null!; public int Destino { get; set; } = 0; public string? sDestino { get; set; } = null!; + public byte Hazmat { get; set; } = 0; + public byte TipoOperacion { get; set; } = 1; + public string Pedimento { get; set; } = null!; + public int Status { get; set; } = 0; + public int Activo { get; set; } = 0; } } \ No newline at end of file diff --git a/DTO/Operaciones/DTOOpViajesServicios.cs b/DTO/Operaciones/DTOOpViajesServicios.cs index 02440e3..1eed4cb 100644 --- a/DTO/Operaciones/DTOOpViajesServicios.cs +++ b/DTO/Operaciones/DTOOpViajesServicios.cs @@ -10,6 +10,7 @@ namespace AOLBackend.DTO.Operaciones public string Comentarios { get; set; } = null!; public int IdProveedor { get; set; } = 0; public string sProveedor { get; set; } = null!; + public string NoCaja { get; set; } = null!; public byte Activo { get; set; } = 1; } } \ No newline at end of file diff --git a/DTO/Operaciones/DTOUltimaCaja.cs b/DTO/Operaciones/DTOUltimaCaja.cs new file mode 100644 index 0000000..9834a88 --- /dev/null +++ b/DTO/Operaciones/DTOUltimaCaja.cs @@ -0,0 +1,7 @@ +namespace AOLBackend.DTO.Operaciones +{ + public class DTOUltimaCaja + { + public string UltimaCaja { get; set; } = null!; + } +} \ No newline at end of file diff --git a/Repository/Operaciones/OpViajesRepository.cs b/Repository/Operaciones/OpViajesRepository.cs index c8c5a7e..c6c3004 100644 --- a/Repository/Operaciones/OpViajesRepository.cs +++ b/Repository/Operaciones/OpViajesRepository.cs @@ -16,7 +16,6 @@ namespace AOLBackend.Repository.Operaciones _context = context; _config = config; } - public async Task Append(DTOOpViajes data) { var query = "[Operaciones.Viajes.Append]"; @@ -25,21 +24,19 @@ namespace AOLBackend.Repository.Operaciones { @id = data.id, @Usuario = data.Usuario, - @FCruce = data.FCruce, @RefAgenciaAduanal = data.RefAgenciaAduanal, @Cliente = data.Cliente, - @Proveedor = data.Proveedor, - @HazMat = data.Hazmat, - @Servicio = data.Servicio, @TipoUnidad = data.TipoUnidad, @NoCaja = data.NoCaja, @PickUpNumber = data.PickUpNumber, @Origen = data.Origen, - @Destino = data.Destino + @Destino = data.Destino, + @Hazmat = data.Hazmat, + @TipoOperacion = data.TipoOperacion, + @Pedimento = data.Pedimento, }, commandType: CommandType.StoredProcedure); return entrada.First(); } - public async Task> AppendServicio(DTOOpViajesServicios data) { var query = "[Operaciones.Viajes.Servicios.Append]"; @@ -51,7 +48,8 @@ namespace AOLBackend.Repository.Operaciones @IdServicio = data.IdServicio, @Aduana = data.Aduana, @Comentarios = data.Comentarios, - @IdProveedor = data.IdProveedor + @IdProveedor = data.IdProveedor, + @NoCaja = data.NoCaja }, commandType: CommandType.StoredProcedure); return entrada.ToList(); } @@ -69,6 +67,13 @@ namespace AOLBackend.Repository.Operaciones var entrada = await connection.QueryAsync(query, new { }, commandType: CommandType.StoredProcedure); return entrada; } + public async Task GetLastTrailerBox(int idViaje) + { + var query = "[Operaciones.Viajes.GetLastTrailerBox]"; + using var connection = _context.CreateConnection(); + var entrada = await connection.QueryAsync(query, new { @IdViaje = idViaje }, commandType: CommandType.StoredProcedure); + return entrada.First(); + } public async Task Delete(int id) { var query = "[Operaciones.Viajes.Delete]"; diff --git a/bin/Debug/net6.0/AOLBackend.dll b/bin/Debug/net6.0/AOLBackend.dll index 4be3d7f..fc5026e 100644 Binary files a/bin/Debug/net6.0/AOLBackend.dll and b/bin/Debug/net6.0/AOLBackend.dll differ diff --git a/bin/Debug/net6.0/AOLBackend.pdb b/bin/Debug/net6.0/AOLBackend.pdb index 12a9604..8e88947 100644 Binary files a/bin/Debug/net6.0/AOLBackend.pdb and b/bin/Debug/net6.0/AOLBackend.pdb differ diff --git a/obj/Debug/net6.0/AOLBackend.csproj.CoreCompileInputs.cache b/obj/Debug/net6.0/AOLBackend.csproj.CoreCompileInputs.cache index 18857be..1cb0512 100644 --- a/obj/Debug/net6.0/AOLBackend.csproj.CoreCompileInputs.cache +++ b/obj/Debug/net6.0/AOLBackend.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -e348d4166e48aebdcd2c8d25447e64abd2cc26a9 +c0f740fe94be39b114995af40d7aa7f7834175d9 diff --git a/obj/Debug/net6.0/AOLBackend.dll b/obj/Debug/net6.0/AOLBackend.dll index 4be3d7f..fc5026e 100644 Binary files a/obj/Debug/net6.0/AOLBackend.dll and b/obj/Debug/net6.0/AOLBackend.dll differ diff --git a/obj/Debug/net6.0/AOLBackend.pdb b/obj/Debug/net6.0/AOLBackend.pdb index 12a9604..8e88947 100644 Binary files a/obj/Debug/net6.0/AOLBackend.pdb and b/obj/Debug/net6.0/AOLBackend.pdb differ diff --git a/obj/Debug/net6.0/ref/AOLBackend.dll b/obj/Debug/net6.0/ref/AOLBackend.dll index 90ea3a5..59ec3a9 100644 Binary files a/obj/Debug/net6.0/ref/AOLBackend.dll and b/obj/Debug/net6.0/ref/AOLBackend.dll differ diff --git a/obj/Debug/net6.0/refint/AOLBackend.dll b/obj/Debug/net6.0/refint/AOLBackend.dll index 90ea3a5..59ec3a9 100644 Binary files a/obj/Debug/net6.0/refint/AOLBackend.dll and b/obj/Debug/net6.0/refint/AOLBackend.dll differ diff --git a/obj/staticwebassets.pack.sentinel b/obj/staticwebassets.pack.sentinel index e977edb..f5bd0d9 100644 --- a/obj/staticwebassets.pack.sentinel +++ b/obj/staticwebassets.pack.sentinel @@ -111,3 +111,16 @@ 2.0 2.0 2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0