feat: migracion y ajustes de configuracion, servicios y el sistema de logueo a la nueva app
This commit is contained in:
parent
45f5ec5f84
commit
3348272225
92 changed files with 2676 additions and 19 deletions
55
BLL/Recuperacion_DGA/EnvioDGA.cs
Normal file
55
BLL/Recuperacion_DGA/EnvioDGA.cs
Normal file
|
@ -0,0 +1,55 @@
|
|||
using Microsoft.Extensions.Configuration;
|
||||
using Shared.DTO;
|
||||
using DAL;
|
||||
using DAS;
|
||||
using Shared.DTO.Envios_DGA;
|
||||
|
||||
namespace BLL.Recuperacion_DGA
|
||||
{
|
||||
public class EnvioDGA
|
||||
{
|
||||
private readonly MedicionScadaRepository _dGAMedicionScadaRepository;
|
||||
private readonly RegistrarMedicion _registrarMedicion;
|
||||
|
||||
public EnvioDGA(MedicionScadaRepository dGAMedicionScadaRepository, RegistrarMedicion registrarMedicion)
|
||||
{
|
||||
_dGAMedicionScadaRepository = dGAMedicionScadaRepository;
|
||||
_registrarMedicion = registrarMedicion;
|
||||
}
|
||||
|
||||
public async Task<List<MedicionScada>> ObtenerMedicionesAsync()
|
||||
{
|
||||
var mediciones = await _dGAMedicionScadaRepository.ObtenerMedicionesAsync();
|
||||
|
||||
foreach (var medicion in mediciones)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(medicion.Code))
|
||||
{
|
||||
var body = new MedicionSubterraneaRequest
|
||||
{
|
||||
Autenticacion = new Autenticacion
|
||||
{
|
||||
Password = string.Empty,
|
||||
RutEmpresa = string.Empty,
|
||||
RutUsuario = string.Empty
|
||||
},
|
||||
MedicionSubterranea = new Medicion
|
||||
{
|
||||
Caudal = medicion.Caudal.ToString() ?? "",
|
||||
FechaMedicion = medicion.DateOrigen?.ToString("yyyy-MM-dd") ?? "",
|
||||
HoraMedicion = medicion.DateOrigen?.ToString("HH:mm:ss") ?? "",
|
||||
NivelFreaticoDelPozo = "",
|
||||
Totalizador = medicion.Totalizador.ToString() ?? "",
|
||||
}
|
||||
};
|
||||
|
||||
await _registrarMedicion.EnviarMedicionAsync(medicion.Code, body);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
return mediciones;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue