diff --git a/Asegasa.sln b/Asegasa.sln index 55b31d3..bed68ab 100644 --- a/Asegasa.sln +++ b/Asegasa.sln @@ -3,8 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 18 VisualStudioVersion = 18.1.11312.151 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WSAsegasa", "WSAsegasa\WSAsegasa.csproj", "{C891F2E3-60D2-449F-962A-BF78F58C67D6}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bdAsegasa", "bdAsegasa\bdAsegasa.csproj", "{E42D668E-CB26-498B-89AF-8A205528C4EF}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "APIFicheros", "APIFicheros\APIFicheros.csproj", "{729F814F-BBAF-A079-B0A1-D5890DA11543}" @@ -21,10 +19,6 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {C891F2E3-60D2-449F-962A-BF78F58C67D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C891F2E3-60D2-449F-962A-BF78F58C67D6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C891F2E3-60D2-449F-962A-BF78F58C67D6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C891F2E3-60D2-449F-962A-BF78F58C67D6}.Release|Any CPU.Build.0 = Release|Any CPU {E42D668E-CB26-498B-89AF-8A205528C4EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E42D668E-CB26-498B-89AF-8A205528C4EF}.Debug|Any CPU.Build.0 = Debug|Any CPU {E42D668E-CB26-498B-89AF-8A205528C4EF}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/Servicio Gestion Asegasa/Logs.cs b/Servicio Gestion Asegasa/Logs.cs index e09e015..85ad44b 100644 --- a/Servicio Gestion Asegasa/Logs.cs +++ b/Servicio Gestion Asegasa/Logs.cs @@ -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) { diff --git a/Servicio Gestion Asegasa/Procesos/ProcesosMensajes.cs b/Servicio Gestion Asegasa/Procesos/ProcesosMensajes.cs index d40549e..f41385a 100644 --- a/Servicio Gestion Asegasa/Procesos/ProcesosMensajes.cs +++ b/Servicio Gestion Asegasa/Procesos/ProcesosMensajes.cs @@ -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); } } } diff --git a/Servicio Gestion Asegasa/ProcesosConf.cs b/Servicio Gestion Asegasa/ProcesosConf.cs index d4dcafe..051912d 100644 --- a/Servicio Gestion Asegasa/ProcesosConf.cs +++ b/Servicio Gestion Asegasa/ProcesosConf.cs @@ -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 { diff --git a/Servicio Gestion Asegasa/Program.cs b/Servicio Gestion Asegasa/Program.cs index 9f9d6fe..f0f5d7a 100644 --- a/Servicio Gestion Asegasa/Program.cs +++ b/Servicio Gestion Asegasa/Program.cs @@ -1,11 +1,14 @@ using Servicio_Gestion_Asegasa; +using Microsoft.Extensions.Hosting; var builder = Host.CreateApplicationBuilder(args); + builder.Services.AddHostedService(); + builder.Services.Configure( builder.Configuration.GetSection("Configuracion")); +builder.Services.AddWindowsService(); // <-- NECESARIO EN .NET 8 + var host = builder.Build(); host.Run(); - - diff --git a/Servicio Gestion Asegasa/Servicio Gestion Asegasa.csproj b/Servicio Gestion Asegasa/Servicio Gestion Asegasa.csproj index 620c4a3..d3311e2 100644 --- a/Servicio Gestion Asegasa/Servicio Gestion Asegasa.csproj +++ b/Servicio Gestion Asegasa/Servicio Gestion Asegasa.csproj @@ -2,7 +2,11 @@ net8.0 - enable + 1.0.0.0 + + - 2026-04-24 1.0.0.0 Primera versión estable + + enable enable dotnet-Servicio_Gestion_Asegasa-408b0288-12a3-42df-8545-97be3626a4a9 Servicio_Gestion_Asegasa @@ -10,10 +14,11 @@ + - + diff --git a/Servicio Gestion Asegasa/appsettings.json b/Servicio Gestion Asegasa/appsettings.json index 7968cb6..dcb44fb 100644 --- a/Servicio Gestion Asegasa/appsettings.json +++ b/Servicio Gestion Asegasa/appsettings.json @@ -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" } } diff --git a/bdAsegasa/Extensiones/detallesamortizacionrecibos.cs b/bdAsegasa/Extensiones/detallesamortizacionrecibos.cs index e1168d5..ee9a114 100644 --- a/bdAsegasa/Extensiones/detallesamortizacionrecibos.cs +++ b/bdAsegasa/Extensiones/detallesamortizacionrecibos.cs @@ -21,7 +21,7 @@ namespace bdAsegasa.db public int? idRecibo { get; set; } public DateOnly FechaInicioAmortizacion { get; set; } public DateOnly FechaFinAmortizacion { get; set; } - public double PorcentajeAnual { get; set; } + public double? PorcentajeAnual { get; set; } public DateOnly? FechaBaja { get; set; } public int? idMotivoBaja { get; set; } public int idEmpresa { get; set; } diff --git a/bdAsegasa/Extensiones/enumeraciones.cs b/bdAsegasa/Extensiones/enumeraciones.cs index 57b35f2..2f8b47a 100644 --- a/bdAsegasa/Extensiones/enumeraciones.cs +++ b/bdAsegasa/Extensiones/enumeraciones.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.ComponentModel.DataAnnotations.Schema; using System.Linq; namespace bdAsegasa.db @@ -22,6 +23,7 @@ namespace bdAsegasa.db } } + [NotMapped] public int? ValorEntero1 { get diff --git a/bdAsegasa/bdAsegasa.csproj b/bdAsegasa/bdAsegasa.csproj index fe84cd0..762199d 100644 --- a/bdAsegasa/bdAsegasa.csproj +++ b/bdAsegasa/bdAsegasa.csproj @@ -16,7 +16,7 @@ - + diff --git a/bdAsegasa/db/amortizacionrecibos.cs b/bdAsegasa/db/amortizacionrecibos.cs index 2327304..07ad54d 100644 --- a/bdAsegasa/db/amortizacionrecibos.cs +++ b/bdAsegasa/db/amortizacionrecibos.cs @@ -15,7 +15,7 @@ public partial class amortizacionrecibos public DateOnly FechaFinAmortizacion { get; set; } - public double PorcentajeAnual { get; set; } + public double? PorcentajeAnual { get; set; } public DateOnly? FechaBaja { get; set; } diff --git a/bdAsegasa/db/pagostelematicos.cs b/bdAsegasa/db/pagostelematicos.cs index 2923241..6662e7d 100644 --- a/bdAsegasa/db/pagostelematicos.cs +++ b/bdAsegasa/db/pagostelematicos.cs @@ -39,5 +39,7 @@ public partial class pagostelematicos public string? Telefono { get; set; } + public int TipoPago { get; set; } + public virtual recibos? idReciboNavigation { get; set; } } diff --git a/bdAsegasa/dbcontext/gestionasegasaContext.cs b/bdAsegasa/dbcontext/gestionasegasaContext.cs index ac6fe94..f8ff186 100644 --- a/bdAsegasa/dbcontext/gestionasegasaContext.cs +++ b/bdAsegasa/dbcontext/gestionasegasaContext.cs @@ -3618,6 +3618,7 @@ public partial class gestionasegasaContext : DbContext entity.Property(e => e.Referencia).HasMaxLength(100); entity.Property(e => e.RespuestaPasarela).HasMaxLength(4096); entity.Property(e => e.Telefono).HasMaxLength(20); + entity.Property(e => e.TipoPago).HasColumnType("int(11)"); entity.Property(e => e.idEmailAvisoAPagador).HasColumnType("int(11)"); entity.Property(e => e.idEmailAvisoContabilidad).HasColumnType("int(11)"); entity.Property(e => e.idRecibo).HasColumnType("int(11)"); diff --git a/bdAsegasa/efpt.config.json b/bdAsegasa/efpt.config.json index 8eb4c1a..17a7c47 100644 --- a/bdAsegasa/efpt.config.json +++ b/bdAsegasa/efpt.config.json @@ -5,7 +5,7 @@ "FilterSchemas": false, "IncludeConnectionString": false, "IrregularWords": null, - "MinimumProductVersion": "2.6.1248", + "MinimumProductVersion": "2.6.1382", "ModelNamespace": null, "OutputContextPath": "dbcontext", "OutputPath": "db", @@ -817,5 +817,6 @@ "UseSchemaNamespaces": false, "UseSpatial": false, "UseT4": true, - "UseT4Split": false + "UseT4Split": false, + "UseTypedTvpParameters": true } \ No newline at end of file diff --git a/itsm/itsm.csproj b/itsm/itsm.csproj index c5789d4..b98af41 100644 --- a/itsm/itsm.csproj +++ b/itsm/itsm.csproj @@ -9,6 +9,6 @@ - + \ No newline at end of file