feat: se ajusta peticion para nuevo endpoint que obtiene los valores en tiempo real

This commit is contained in:
Leonel Toro 2025-07-12 00:49:17 -04:00
parent 90ec8dd344
commit 3745a022d1
2 changed files with 10 additions and 10 deletions

View file

@ -64,16 +64,16 @@ namespace BLL.Integracion_DGA
listTagsID.Add(tag.Uid); listTagsID.Add(tag.Uid);
} }
HistoricRequest historicRequest = new HistoricRequest(); //HistoricRequest historicRequest = new HistoricRequest();
historicRequest.DataSource = NexusApiUrl.DataSource; //historicRequest.DataSource = NexusApiUrl.DataSource;
historicRequest.Resolution = NexusApiUrl.Resolution; //historicRequest.Resolution = NexusApiUrl.Resolution;
historicRequest.Uids = listTagsID; //historicRequest.Uids = listTagsID;
historicRequest.StartTs = dateStart.ToUnixTimeSeconds(); //historicRequest.StartTs = dateStart.ToUnixTimeSeconds();
historicRequest.EndTs = dateEnd.ToUnixTimeSeconds(); //historicRequest.EndTs = dateEnd.ToUnixTimeSeconds();
WriteLineAndLog($"Obteniendo Tagviews Historic"); WriteLineAndLog($"Obteniendo Tagviews Historic");
string apiUrlHistoric = $"{apiUrlBase}/api/Documents/tagviews/{item.uid}/historic"; string apiUrlHistoric = $"{apiUrlBase}/api/Documents/tagviews/{item.uid}/realtime";
responseData = await _apiService.PostApiResponseAsync(apiUrlHistoric, headers, historicRequest); responseData = await _apiService.PostApiResponseAsync(apiUrlHistoric, headers, listTagsID);
List<HistoricResponse> historicResponse = JsonSerializer.Deserialize<List<HistoricResponse>>(responseData, options); List<HistoricResponse> historicResponse = JsonSerializer.Deserialize<List<HistoricResponse>>(responseData, options);
List<DgaMacroResultado> listDgaMacroResultados = new List<DgaMacroResultado>(); List<DgaMacroResultado> listDgaMacroResultados = new List<DgaMacroResultado>();
@ -88,7 +88,7 @@ namespace BLL.Integracion_DGA
DgaMacroResultado dgaMacroResultado = new DgaMacroResultado(); DgaMacroResultado dgaMacroResultado = new DgaMacroResultado();
dgaMacroResultado.TagName = $"SCADA001.{tag.Name}.F_CV"; dgaMacroResultado.TagName = tag.Name;
dgaMacroResultado.Value = historic.Value; dgaMacroResultado.Value = historic.Value;
//dgaMacroResultado.TimeStamp = new DateTime(historic.TimeStamp); //dgaMacroResultado.TimeStamp = new DateTime(historic.TimeStamp);
dgaMacroResultado.TimeStamp = fechaHoraChile; dgaMacroResultado.TimeStamp = fechaHoraChile;

View file

@ -4,6 +4,6 @@
{ {
public string Uid { get; set; } public string Uid { get; set; }
public double? Value { get; set; } public double? Value { get; set; }
public long TimeStamp { get; set; } public double TimeStamp { get; set; }
} }
} }