fix-dga #7
3 changed files with 7 additions and 19 deletions
|
@ -38,10 +38,11 @@ namespace BLL.Recuperacion_DGA
|
|||
var logsEnviados = new List<LogMedicionEnvio>();
|
||||
|
||||
var pageNumber = 1;
|
||||
var fechaInicio = DateTime.UtcNow;
|
||||
|
||||
while (true)
|
||||
{
|
||||
var mediciones = await _dGAMedicionRepository.ObtenerMedicionesPorLoteAsync(pageNumber);
|
||||
var mediciones = await _dGAMedicionRepository.ObtenerMedicionesPorLoteAsync(pageNumber, fechaInicio);
|
||||
|
||||
if (mediciones == null || mediciones.Count == 0)
|
||||
{
|
||||
|
|
|
@ -8,27 +8,16 @@ namespace DAL
|
|||
{
|
||||
public class MedicionDGARepository
|
||||
{
|
||||
public async Task<List<DatoDGA>> ObtenerMedicionesAsync()
|
||||
public async Task<List<DatoDGATemporal>> ObtenerMedicionesPorLoteAsync(int pageNumber, DateTime fecha)
|
||||
{
|
||||
await using var connection = new SqlConnection(BdConexion.StringConnection);
|
||||
|
||||
var result = await connection.QueryAsync<DatoDGA>(
|
||||
"SP_OBTENER_DGA_DATOS",
|
||||
commandType: CommandType.StoredProcedure);
|
||||
|
||||
return result.ToList();
|
||||
}
|
||||
|
||||
public async Task<List<DatoDGATemporal>> ObtenerMedicionesPorLoteAsync(int pageNumber)
|
||||
{
|
||||
var nroPagina = new DynamicParameters();
|
||||
nroPagina.Add("@PageNumber", pageNumber);
|
||||
|
||||
var parameters = new DynamicParameters();
|
||||
parameters.Add("@PageNumber", pageNumber);
|
||||
parameters.Add("@FechaInicio", fecha);
|
||||
await using var connection = new SqlConnection(BdConexion.StringConnection);
|
||||
|
||||
var resultado = await connection.QueryAsync<DatoDGATemporal>(
|
||||
"SP_OBTENER_LOTE_DGA_DATOS",
|
||||
nroPagina,
|
||||
parameters,
|
||||
commandType: CommandType.StoredProcedure);
|
||||
|
||||
return resultado.ToList();
|
||||
|
|
|
@ -20,7 +20,5 @@
|
|||
public string? HoraMedicion { get; set; }
|
||||
public string? NivelFreaticoDelPozo { get; set; }
|
||||
public string? Totalizador { get; set; }
|
||||
public string? TipoEmpresa { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue