- 2026-04-24 1.0.0.0 Primera versión estable

This commit is contained in:
2026-04-29 15:34:38 +02:00
parent 6a31fe40be
commit 7b0e488994
15 changed files with 37 additions and 52 deletions

View File

@@ -44,57 +44,33 @@ namespace Servicio_Gestion_Asegasa
if (sStackTrace != "")
Mensaje += Constants.vbCrLf + "|StackTrace: " + sStackTrace;
}
bdAsegasa.db.cuentascorreo? cta = null;
try
{
var bd = tscgestionasegasa.NuevoContexto(ProcesosConf.Conf.NombreConexionBD, true, false, true, "WSAsegasa");
cta = bd.cuentascorreo.First(x => x.Codigo == "DEFECTO");
}
catch
{
}
switch (Tipo)
{
case tsUtilidades.Enumeraciones.TipoLog.Fallo:
Mensaje = "Error WSAsegasa. " + " Enviado desde " + Environment.MachineName + ". Version:" + Assembly.GetEntryAssembly()?.GetName().Version + ". Mensaje: " + Mensaje;
Log.Fatal(Mensaje);
if (cta != null) {
tsUtilidades.TsNotificacionesClient.RegistrarAsync("Error en Servicio Gestion Asegasa", Mensaje, tsUtilidades.TsNotificacionesClient.TipoNotificacionEnum.ERROR);
}
Log.Fatal(Mensaje);
tsUtilidades.TsNotificacionesClient.RegistrarAsync("Error en Servicio Gestion Asegasa", Mensaje, tsUtilidades.TsNotificacionesClient.TipoNotificacionEnum.ERROR);
break;
case tsUtilidades.Enumeraciones.TipoLog.Advertencia:
Mensaje = "Advertencia WSAsegasa. " + " Enviado desde " + Environment.MachineName + ". Version:" + Assembly.GetEntryAssembly()?.GetName().Version + ". " + Mensaje;
Log.Warning(Mensaje);
if (cta != null) {
tsUtilidades.TsNotificacionesClient.RegistrarAsync("Advertencia en Servicio Gestion Asegasa", Mensaje, tsUtilidades.TsNotificacionesClient.TipoNotificacionEnum.ADVERTENCIA);
}
tsUtilidades.TsNotificacionesClient.RegistrarAsync("Advertencia en Servicio Gestion Asegasa", Mensaje, tsUtilidades.TsNotificacionesClient.TipoNotificacionEnum.ADVERTENCIA);
break;
case tsUtilidades.Enumeraciones.TipoLog.InicioServicio:
Mensaje = "Inicio WSAsegasa. " + " Enviado desde " + Environment.MachineName + ". Version:" + Assembly.GetEntryAssembly()?.GetName().Version + ". Mensaje: " + Mensaje;
Log.Information(Mensaje);
if (cta != null) {
tsUtilidades.TsNotificacionesClient.RegistrarAsync("Inicio Servicio Gestion Asegasa", Mensaje, tsUtilidades.TsNotificacionesClient.TipoNotificacionEnum.INFO);
}
tsUtilidades.TsNotificacionesClient.RegistrarAsync("Inicio Servicio Gestion Asegasa", Mensaje, tsUtilidades.TsNotificacionesClient.TipoNotificacionEnum.INFO);
break;
case tsUtilidades.Enumeraciones.TipoLog.FinServicio:
Mensaje = "Finalización WSAsegasa. " + " Enviado desde " + Environment.MachineName + ". Version:" + Assembly.GetEntryAssembly()?.GetName().Version + ". Mensaje: " + Mensaje;
Log.Information(Mensaje);
if (cta != null) {
tsUtilidades.TsNotificacionesClient.RegistrarAsync("Finalización Servicio Gestion Asegasa", Mensaje, tsUtilidades.TsNotificacionesClient.TipoNotificacionEnum.INFO);
}
tsUtilidades.TsNotificacionesClient.RegistrarAsync("Finalización Servicio Gestion Asegasa", Mensaje, tsUtilidades.TsNotificacionesClient.TipoNotificacionEnum.INFO);
break;
default:
Mensaje = Tipo.ToString() + " WSAsegasa. " + " Enviado desde " + Environment.MachineName + ". Version:" + Assembly.GetEntryAssembly()?.GetName().Version + ". " + Mensaje;
Log.Information(Mensaje);
break;
}
}
catch (Exception ex)
{

View File

@@ -104,7 +104,7 @@ namespace Servicio_Gestion_Asegasa.Procesos
catch (Exception ex)
{
ServicioSMSSuspendido = true;
await tsUtilidades.TsNotificacionesClient.RegistrarAsync("SERVICIO SMS SUSPENDIDO", ex.Message, TsNotificacionesClient.TipoNotificacionEnum.ERROR);
await Logs.AñadeLogAsync(tsUtilidades.Enumeraciones.TipoLog.Fallo, ex.Message, ex);
}
}
@@ -112,7 +112,7 @@ namespace Servicio_Gestion_Asegasa.Procesos
}
catch (Exception ex)
{
await tsUtilidades.TsNotificacionesClient.RegistrarAsync("Error", ex.Message, TsNotificacionesClient.TipoNotificacionEnum.ERROR);
await Logs.AñadeLogAsync(tsUtilidades.Enumeraciones.TipoLog.Fallo, ex.Message, ex);
}
}
}

View File

@@ -40,7 +40,7 @@ namespace Servicio_Gestion_Asegasa
catch (Exception ex)
{
Debug.WriteLine(@"Procesar: EXCEPCIÓN: " + ex.Message + " " + ex.StackTrace);
await Logs.AñadeLogAsync(tsUtilidades.Enumeraciones.TipoLog.Fallo, ex.Message,ex);
}
finally
{

View File

@@ -1,11 +1,14 @@
using Servicio_Gestion_Asegasa;
using Microsoft.Extensions.Hosting;
var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddHostedService<Worker>();
builder.Services.Configure<Configuracion>(
builder.Configuration.GetSection("Configuracion"));
builder.Services.AddWindowsService(); // <-- NECESARIO EN .NET 8
var host = builder.Build();
host.Run();

View File

@@ -2,7 +2,11 @@
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<PackageReleaseNotes>
- 2026-04-24 1.0.0.0 Primera versión estable
</PackageReleaseNotes>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>dotnet-Servicio_Gestion_Asegasa-408b0288-12a3-42df-8545-97be3626a4a9</UserSecretsId>
<RootNamespace>Servicio_Gestion_Asegasa</RootNamespace>
@@ -10,10 +14,11 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.1" />
<PackageReference Include="Quartz" Version="3.15.0" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="9.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
<PackageReference Include="tsUtilidades" Version="1.1.10" />
<PackageReference Include="tsUtilidades" Version="1.1.14" />
</ItemGroup>
<ItemGroup>

View File

@@ -2,7 +2,7 @@
"Configuracion": {
"SegundosMinimosEntreProcesos": "60",
"HoraProcesosDiarios": "06:30",
"NombreConexionBD": "Producción Remoto"
"NombreConexionBD": "Producción"
},
"Logging": {
"LogLevel": {
@@ -12,8 +12,9 @@
},
"TsNotificaciones": {
//"ApiUrl": "http://192.168.41.32:5000/", prod
"ApiUrl": "https://catcher.tecnosis.online",
"IdAplicacion": 2,
"ApiKey": "0a47a1eada0143278b9d4de4e8911100"
"ApiUrl": "https://apinotificaciones.tecnosis.online",
"IdAplicacion": 12,
"Aplicacion": "Servicio Asegasa",
"ApiKey": "33357e95a8384ac99f7fa1d66b0033f3"
}
}