cambio de proceso polizas vencidas
This commit is contained in:
@@ -24,35 +24,31 @@ namespace Servicio_Gestion_Asegasa.Procesos
|
||||
{
|
||||
DateOnly hoy = DateOnly.FromDateTime(DateTime.Now);
|
||||
|
||||
List<polizassg> listadoPolizasVencidas = bd.polizassg.Where(x => x.idTipoCobro == 272 && x.FechaVencimiento < hoy).ToList();
|
||||
|
||||
var lr = bd.polizassg.Include(x => x.entidadespolizas).ThenInclude(x => x.idEntidadNavigation).Include(x => x.idRamoNavigation).Include(x => x.idAgenteNavigation).ToList()
|
||||
.Where(x => x.idTipoCobro == 272 && x.FechaVencimiento < hoy).Select(x => new PolizaPagoUnicoExcel{
|
||||
NumeroPoliza = x.NumeroPoliza ?? "",
|
||||
var lr = bd.recibos.Include(x => x.idPolizaNavigation).ThenInclude(x => x.entidadespolizas).ThenInclude(x => x.idEntidadNavigation).Include(x => x.idPolizaNavigation)
|
||||
.ThenInclude(x => x.idCompaniaNavigation).Include(x => x.idAgenteNavigation).Where(x => x.idPolizaNavigation.idTipoCobro == 272 && x.FechaVencimiento < hoy).Select(x => new PolizaPagoUnicoExcel{
|
||||
NumeroPoliza = x.idPolizaNavigation.NumeroPoliza ?? "",
|
||||
|
||||
RazonSocial = x.Tomador?.RazonSocial ?? "",
|
||||
RazonSocial = x.idPolizaNavigation.Tomador.RazonSocial ?? "",
|
||||
|
||||
FechaEfecto = x.FechaEfecto,
|
||||
|
||||
FechaVencimiento = x.FechaVencimiento,
|
||||
|
||||
Descripcion = x.idRamoNavigation?.Descripcion ?? "",
|
||||
Descripcion = x.idPolizaNavigation.idRamoNavigation.Descripcion ?? "",
|
||||
|
||||
NombreAgente = x.idAgenteNavigation?.Nombre ?? "",
|
||||
NombreAgente = x.idPolizaNavigation.idAgenteNavigation.Nombre ?? "",
|
||||
|
||||
CiaNumeroPolizaSuplemento = x.CiaNumeroPolizaSuplemento
|
||||
CiaNumeroPolizaSuplemento = x.idPolizaNavigation.CiaNumeroPolizaSuplemento
|
||||
}).ToList();
|
||||
|
||||
byte[] f = tsUtilidades.Excel.IEnumerableAExcel(lr);
|
||||
|
||||
string sFichero = @"C:\temp\listadoPolizas.xlsx";
|
||||
File.WriteAllBytes(sFichero, f);
|
||||
byte[] excelPolizas = tsUtilidades.Excel.IEnumerableAExcel(lr);
|
||||
|
||||
|
||||
//await bd.polizassg.Where(x => x.idTipoCobro == 272 && x.FechaVencimiento < hoy).ExecuteUpdateAsync(setters => setters
|
||||
// .SetProperty(x => x.FechaBaja, x => x.FechaVencimiento)
|
||||
// .SetProperty(x => x.idCausaBaja, 784));
|
||||
|
||||
//await bd.polizassg.Where(x => x.idTipoCobro == 272 && x.recibos.Any(r => r.FechaVencimiento < hoy)).ExecuteUpdateAsync(setters => setters
|
||||
// .SetProperty(x => x.FechaBaja, hoy)
|
||||
// .SetProperty(x => x.idCausaBaja, 784));
|
||||
|
||||
string sDireccionesEnvio = "davidperea@tecnosis.net";
|
||||
string sServidorSMTP = "mail.tecnosis.net";
|
||||
@@ -64,7 +60,7 @@ namespace Servicio_Gestion_Asegasa.Procesos
|
||||
listadoFicheros.Add(new tsUtilidades.Correo.FicheroAdjunto
|
||||
{
|
||||
NombreFichero = "FicherosVencidos.xlsx",
|
||||
Fichero = f
|
||||
Fichero = excelPolizas
|
||||
});
|
||||
|
||||
tsUtilidades.Correo.Funciones.EnviaCorreoVariosAdjuntos(sServidorSMTP, sRemitente, sDireccionesEnvio, Asunto, Cuerpo, listadoFicheros);
|
||||
|
||||
@@ -30,12 +30,11 @@ namespace Servicio_Gestion_Asegasa
|
||||
|
||||
try
|
||||
{
|
||||
await ComprobarPolizasPagoUnico();
|
||||
|
||||
if (ProcesosConf.Conf.HoraProcesosDiarios != null)
|
||||
{
|
||||
Mensaje += " Hora Procesos Programados: " + ProcesosConf.Conf.HoraProcesosDiarios;
|
||||
CreaTareaProcesosDiarios();
|
||||
await CreaTareaProcesosDiariosAsync();
|
||||
}
|
||||
|
||||
await Logs.A<EFBFBD>adeLogAsync(tsUtilidades.Enumeraciones.TipoLog.InicioServicio, "Inicio " + Mensaje);
|
||||
@@ -67,7 +66,7 @@ namespace Servicio_Gestion_Asegasa
|
||||
|
||||
|
||||
|
||||
private void CreaTareaProcesosDiarios()
|
||||
private async Task CreaTareaProcesosDiariosAsync()
|
||||
{
|
||||
ISchedulerFactory schedulerFactory = new StdSchedulerFactory();
|
||||
IScheduler scheduler = schedulerFactory.GetScheduler().Result;
|
||||
@@ -78,6 +77,8 @@ namespace Servicio_Gestion_Asegasa
|
||||
.Build();
|
||||
// Crear un trigger que se ejecute diariamente a una hora espec<65>fica
|
||||
|
||||
await ComprobarPolizasPagoUnico();
|
||||
|
||||
|
||||
int Hora = int.Parse(ProcesosConf.Conf.HoraProcesosDiarios.Split(":")[0]);
|
||||
int Minutos = int.Parse(ProcesosConf.Conf.HoraProcesosDiarios.Split(":")[1]);
|
||||
|
||||
@@ -333,7 +333,7 @@ namespace bdAsegasa.db
|
||||
}
|
||||
}
|
||||
}
|
||||
public string CiaNumeroPolizaSuplemento
|
||||
public string CiaNumeroPolizaSuplemento
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ using bdAsegasa.Informes;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using tsEFCore8;
|
||||
@@ -18,6 +19,7 @@ namespace bdAsegasa.db
|
||||
|
||||
// Revisado
|
||||
#region Contabilidad
|
||||
[NotMapped]
|
||||
|
||||
public string Tomador
|
||||
{
|
||||
@@ -33,6 +35,7 @@ namespace bdAsegasa.db
|
||||
}
|
||||
}
|
||||
}
|
||||
[NotMapped]
|
||||
|
||||
public double LiquidoCia
|
||||
{
|
||||
@@ -43,6 +46,7 @@ namespace bdAsegasa.db
|
||||
return Math.Round(total - comision, 2, MidpointRounding.AwayFromZero);
|
||||
}
|
||||
}
|
||||
[NotMapped]
|
||||
|
||||
public int NumeroDiasRemesaPago
|
||||
{
|
||||
@@ -504,7 +508,7 @@ namespace bdAsegasa.db
|
||||
|
||||
|
||||
#region Comisiones
|
||||
|
||||
[NotMapped]
|
||||
public bool BloquearFacturacion
|
||||
{
|
||||
get
|
||||
@@ -541,6 +545,8 @@ namespace bdAsegasa.db
|
||||
}
|
||||
}
|
||||
}
|
||||
[NotMapped]
|
||||
|
||||
public int? idAgente_Nulable
|
||||
{
|
||||
get
|
||||
@@ -669,6 +675,8 @@ namespace bdAsegasa.db
|
||||
tsUtilidades.TsNotificacionesClient.RegistrarAsync( "En GuardandoCambios", ex.Message + sListaCambios, tsUtilidades.TsNotificacionesClient.TipoNotificacionEnum.ERROR);
|
||||
}
|
||||
}
|
||||
[NotMapped]
|
||||
|
||||
public string NombreSubAgente
|
||||
{
|
||||
get
|
||||
@@ -1043,6 +1051,7 @@ namespace bdAsegasa.db
|
||||
}
|
||||
}
|
||||
|
||||
[NotMapped]
|
||||
|
||||
public string DescripcionSuplemento
|
||||
{
|
||||
@@ -1262,6 +1271,7 @@ namespace bdAsegasa.db
|
||||
}
|
||||
|
||||
|
||||
[NotMapped]
|
||||
|
||||
public FormaComunicacionEnum FormaComunicacionTMP { get; set; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user