diff --git a/BLL/Integracion_DGA/BusinessLogic.cs b/BLL/Integracion_DGA/BusinessLogic.cs index 3f97a85..caecaa2 100644 --- a/BLL/Integracion_DGA/BusinessLogic.cs +++ b/BLL/Integracion_DGA/BusinessLogic.cs @@ -40,11 +40,11 @@ namespace BLL.Integracion_DGA { string apiUrlBase = NexusApiUrl.ApiUrl; Dictionary headers = new Dictionary - { - { "nexustoken", NexusApiUrl.ApiKey }, - { "nexusapiversion", NexusApiUrl.Version }, - { "accept", "application/json" } - }; + { + { "nexustoken", NexusApiUrl.ApiKey }, + { "nexusapiversion", NexusApiUrl.Version }, + { "accept", "application/json" } + }; WriteLineAndLog($"Obteniendo Documentos"); string apiUrlDocuments = apiUrlBase + "/api/Documents"; diff --git a/DAL/LogMedicionScadaRepository.cs b/DAL/LogMedicionScadaRepository.cs index 548f83a..e7a67a0 100644 --- a/DAL/LogMedicionScadaRepository.cs +++ b/DAL/LogMedicionScadaRepository.cs @@ -13,7 +13,10 @@ namespace DAL { using (var connection = new SqlConnection(BdConexion.StringConnection)) { - await connection.OpenAsync(); + await connection.OpenAsync(); + + // Truncar la tabla antes de insertar + await connection.ExecuteAsync("TRUNCATE TABLE DGA_LOGS_OPERACION"); // Insertar todos los datos de la lista usando Dapper var sql = @"INSERT INTO dbo.DGA_LOGS_OPERACION (estado_envio, json_enviado, json_recibido, comprobante, fecha_envio, id_medicion_smartscada_operacion) diff --git a/DAS/RegistrarMedicion.cs b/DAS/RegistrarMedicion.cs index 168998a..531c5fc 100644 --- a/DAS/RegistrarMedicion.cs +++ b/DAS/RegistrarMedicion.cs @@ -27,7 +27,7 @@ namespace DAS content.Headers.Add("codigoObra", codigoObra); content.Headers.Add("timeStampOrigen", timeStamp); - var response = await _httpClient.PostAsync($"{SubterraneaApiUrl.BaseUrl}{SubterraneaApiUrl.EndPoint}SSSSSSSSSSSSSSSSS", content); + /*var response = await _httpClient.PostAsync($"{SubterraneaApiUrl.BaseUrl}{SubterraneaApiUrl.EndPoint}", content); string jsonRecibido = await response.Content.ReadAsStringAsync(); string estado = response.IsSuccessStatusCode ? "OK" : "ERROR"; string comprobante = string.Empty; @@ -57,8 +57,8 @@ namespace DAS FechaEnvio = DateTime.UtcNow, IdMedicionSmartscadaOperacion = idMedicion }; - - await _logMedicionScadaRepository.InsertarLogMedicionScadaAsync(logMedicionScada); + */ + //await _logMedicionScadaRepository.InsertarLogMedicionScadaAsync(logMedicionScada); return true; } diff --git a/Integracion_DGA/Program.cs b/Integracion_DGA/Program.cs index 2117aa9..328d5ac 100644 --- a/Integracion_DGA/Program.cs +++ b/Integracion_DGA/Program.cs @@ -47,7 +47,6 @@ namespace Integracion_DGA services.AddScoped(); services.AddScoped(); services.AddScoped(); - services.AddScoped(); }) .Build(); diff --git a/Recuperacion_DGA/Program.cs b/Recuperacion_DGA/Program.cs index 580a484..d8342f2 100644 --- a/Recuperacion_DGA/Program.cs +++ b/Recuperacion_DGA/Program.cs @@ -42,6 +42,7 @@ namespace Recuperacion_DGA services.AddScoped(); services.AddScoped(); services.AddHttpClient(); + services.AddScoped(); }) .Build(); diff --git a/SHARED/DTO/Envios_DGA/MedicionScada.cs b/SHARED/DTO/Envios_DGA/MedicionScada.cs index 4127a3f..b26301a 100644 --- a/SHARED/DTO/Envios_DGA/MedicionScada.cs +++ b/SHARED/DTO/Envios_DGA/MedicionScada.cs @@ -22,6 +22,5 @@ public decimal? Nivel { get; set; } public string? tipo_empresa { get; set; } - public string? nivelFreaticoDelPozo { get; set; } } }