Merge branch 'Desarrollo' into DEV-LT

This commit is contained in:
Leonel Toro 2025-07-02 11:45:37 -04:00
commit e916948c4c
6 changed files with 11 additions and 13 deletions

View file

@ -40,11 +40,11 @@ namespace BLL.Integracion_DGA
{ {
string apiUrlBase = NexusApiUrl.ApiUrl; string apiUrlBase = NexusApiUrl.ApiUrl;
Dictionary<string, string> headers = new Dictionary<string, string> Dictionary<string, string> headers = new Dictionary<string, string>
{ {
{ "nexustoken", NexusApiUrl.ApiKey }, { "nexustoken", NexusApiUrl.ApiKey },
{ "nexusapiversion", NexusApiUrl.Version }, { "nexusapiversion", NexusApiUrl.Version },
{ "accept", "application/json" } { "accept", "application/json" }
}; };
WriteLineAndLog($"Obteniendo Documentos"); WriteLineAndLog($"Obteniendo Documentos");
string apiUrlDocuments = apiUrlBase + "/api/Documents"; string apiUrlDocuments = apiUrlBase + "/api/Documents";

View file

@ -13,10 +13,7 @@ namespace DAL
{ {
using (var connection = new SqlConnection(BdConexion.StringConnection)) 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 // Insertar todos los datos de la lista usando Dapper
var sql = @"INSERT INTO dbo.DGA_LOGS_OPERACION var sql = @"INSERT INTO dbo.DGA_LOGS_OPERACION
(estado_envio, json_enviado, json_recibido, comprobante, fecha_envio, id_medicion_smartscada_operacion) (estado_envio, json_enviado, json_recibido, comprobante, fecha_envio, id_medicion_smartscada_operacion)

View file

@ -27,7 +27,7 @@ namespace DAS
content.Headers.Add("codigoObra", codigoObra); content.Headers.Add("codigoObra", codigoObra);
content.Headers.Add("timeStampOrigen", timeStamp); content.Headers.Add("timeStampOrigen", timeStamp);
/*var response = await _httpClient.PostAsync($"{SubterraneaApiUrl.BaseUrl}{SubterraneaApiUrl.EndPoint}", content); var response = await _httpClient.PostAsync($"{SubterraneaApiUrl.BaseUrl}{SubterraneaApiUrl.EndPoint}SSSSSSSSSSSSSSSSS", content);
string jsonRecibido = await response.Content.ReadAsStringAsync(); string jsonRecibido = await response.Content.ReadAsStringAsync();
string estado = response.IsSuccessStatusCode ? "OK" : "ERROR"; string estado = response.IsSuccessStatusCode ? "OK" : "ERROR";
string comprobante = string.Empty; string comprobante = string.Empty;
@ -57,8 +57,8 @@ namespace DAS
FechaEnvio = DateTime.UtcNow, FechaEnvio = DateTime.UtcNow,
IdMedicionSmartscadaOperacion = idMedicion IdMedicionSmartscadaOperacion = idMedicion
}; };
*/
//await _logMedicionScadaRepository.InsertarLogMedicionScadaAsync(logMedicionScada); await _logMedicionScadaRepository.InsertarLogMedicionScadaAsync(logMedicionScada);
return true; return true;
} }

View file

@ -47,6 +47,7 @@ namespace Integracion_DGA
services.AddScoped<LogMedicionScadaRepository>(); services.AddScoped<LogMedicionScadaRepository>();
services.AddScoped<ApiService>(); services.AddScoped<ApiService>();
services.AddScoped<BusinessLogic>(); services.AddScoped<BusinessLogic>();
services.AddScoped<MedicionScadaVilosRepository>();
}) })
.Build(); .Build();

View file

@ -42,7 +42,6 @@ namespace Recuperacion_DGA
services.AddScoped<MedicionScadaVilosRepository>(); services.AddScoped<MedicionScadaVilosRepository>();
services.AddScoped<EnvioDGA>(); services.AddScoped<EnvioDGA>();
services.AddHttpClient<RegistrarMedicion>(); services.AddHttpClient<RegistrarMedicion>();
services.AddScoped<LogMedicionScadaRepository>(); services.AddScoped<LogMedicionScadaRepository>();
}) })
.Build(); .Build();

View file

@ -22,5 +22,6 @@
public decimal? Nivel { get; set; } public decimal? Nivel { get; set; }
public string? tipo_empresa { get; set; } public string? tipo_empresa { get; set; }
public string? nivelFreaticoDelPozo { get; set; }
} }
} }