public void execute(GDS_NuevoMundoPersistencia.classSession session, List <GDS_NuevoMundoPersistencia.robotBoletoPendientePago.robotBoletoPendiente> boletos, string fecha) { var logger = new GestorLog(); logger.info(string.Format("Ejecutando ProcesoAvisoNoFacturados [{0}] ", fecha)); try { var boletosNoFacturados = boletos.Where(boleto => boleto.ExistePTA && boleto.MarcaFacturado == 0).ToList(); logger.info(string.Format("Se encontraron {0} boletos No Facturados...", boletosNoFacturados.Count)); if (boletosNoFacturados.Any()) { boletosNoFacturados.ForEach(boleto => logger.info(string.Format("[{0} - {1} - {2} - {3}] :: No Facturado ", boleto.Pseudo, boleto.PNR, boleto.NumeroBoleto, boleto.Vendedor.FirmaAgente, boleto.MarcaFacturado))); string asuntoMail = "Boletos No Facturados [ " + fecha + " ]"; var lstLog = new List <string>(); var lproceso = getReferenciaProceso(fecha); var lPseudosEmisores = boletosNoFacturados.Select(x => x.Pseudo).Distinct().ToList(); foreach (var pseudo in lPseudosEmisores) { var boletosPorPseudo = boletosNoFacturados.Where(x => x.Pseudo.Equals(pseudo)).ToList(); new classBO().EjecutarProcesoAvisoVoideo(boletosPorPseudo, lproceso, asuntoMail, ref lstLog, Configuracion.codigoSeguimiento, Configuracion.idGDS, Configuracion.firmaGDS, Configuracion.firmaBD, Configuracion.EsquemaDB.Actual, session); } } } catch (Exception ex) { logger.info("Ocurrió un error al ejecutar el ProcesoAvisoNoFacturado "); logger.info("Exception: " + ex.ToString()); throw ex; } }
public void execute(GDS_NuevoMundoPersistencia.classSession session, List <GDS_NuevoMundoPersistencia.robotBoletoPendientePago.robotBoletoPendiente> boletos) { var logger = new GestorLog(); const double MONTO_MAXIMO_DEUDA_PENDIENTE = 20; try { var lstLog = new List <string> { }; // Crea una instancia de serviceBoleto para obtener los boletos con deuda pendiente var service = new ServiceBoleto(TipoProceso.AVISO_ANULACION, null); // Obtiene los boletos con deuda pendiente boletos = service.obtenerBoletosDeudaPendiente(boletos); // Si existen boletos con deuda pendiente if (boletos != null && boletos.Any()) { // Envía aviso solo Si los boletos tienen una deuda pendiente mayor al máximo de deuda indicado por la empresa (en este caso 20.00) o el DK es de prueba var boletosAvisoAnulacion = boletos.Where(boleto => boleto.TotalPendiente >= MONTO_MAXIMO_DEUDA_PENDIENTE || boleto.IdCliente == Configuracion.dkPrueba).ToList(); if (boletosAvisoAnulacion.Any()) { logger.info(string.Format("Se encontraron {0} boletos a enviar Aviso de anulación...", boletosAvisoAnulacion.Count)); boletosAvisoAnulacion.ForEach(obj => logger.info(string.Format("[{0} - {1} - {2} - {3}] :: [ Aviso Anulacion ] TotalPendiente: {5} | DK: {6}", obj.Pseudo, obj.PNR, obj.NumeroBoleto, obj.Vendedor.FirmaAgente, obj.MarcaFacturado, obj.TotalPendiente, obj.Cliente.DK))); // Si es AGCORP envía un asunto distinto, ya que por el momento no se está realizando el proceso de voideo a sus clientes var asuntoMailAviso = "NM".Equals(Configuracion.empresa) ? "Boletos sin pago sera anulado" : "Boletos pendientes de pago "; var valor = Configuracion.Gds == GDS.SABRE ? "AVI" : "AVI_A"; // Ejecutar el proceso de envio de correos new classBO().EjecutarProcesoAvisoVoideo(boletosAvisoAnulacion, valor, asuntoMailAviso, ref lstLog, Configuracion.codigoSeguimiento, Configuracion.idGDS, Configuracion.firmaGDS, Configuracion.firmaBD, Configuracion.EsquemaDB.Actual, session); } if ("NM".Equals(Configuracion.empresa)) // Solo para NM { // Si tienen una deuda pendiente menor que 20 se envía un correo solo avisando que debe cancelar la deuda pero no se anulará el boleto var boletosConPendienteMinimo = boletos.Where(boleto => boleto.TotalPendiente < MONTO_MAXIMO_DEUDA_PENDIENTE).ToList(); if (boletosConPendienteMinimo.Any()) { logger.info(string.Format("Se encontraron {0} boletos con deudar menor a {1} ...", boletosConPendienteMinimo.Count, MONTO_MAXIMO_DEUDA_PENDIENTE)); boletosConPendienteMinimo.ForEach(obj => logger.info(string.Format("[{0} - {1} - {2} - {3}] :: [ Aviso Anulacion - Pendiente menor de {7} ] TotalPendiente: {5} | DK: {6}", obj.Pseudo, obj.PNR, obj.NumeroBoleto, obj.Vendedor.FirmaAgente, obj.MarcaFacturado, obj.TotalPendiente, obj.Cliente.DK, MONTO_MAXIMO_DEUDA_PENDIENTE))); var asunto = "Boletos pendientes de Pago "; new classBO().EvaluarBoletosXCliente(boletosConPendienteMinimo, "AVIC", asunto, ref lstLog, Configuracion.codigoSeguimiento, Configuracion.idGDS, Configuracion.firmaGDS, Configuracion.firmaBD, Configuracion.EsquemaDB.Actual, session); } } } MailUtils.getInstance().sendMailConfirmacion(TipoProceso.AVISO_ANULACION); } catch (Exception ex) { logger.info("Ocurrió un error al ejecutar el ProcesoAvisoAnulacion "); logger.info("Exception: " + ex.ToString()); throw ex; } }
public void execute(GDS_NuevoMundoPersistencia.classSession session, List <GDS_NuevoMundoPersistencia.robotBoletoPendientePago.robotBoletoPendiente> boletos) { var logger = new GestorLog(); logger.info("Ejecutando ProcesoAvisoAnulacion..."); try { double MONTO_MAXIMO_DEUDA_PENDIENTE = 20; // Crear instancia de service boleto para obtener boletos con deuda pendiente var service = new ServiceBoleto(TipoProceso.ANULACION, null); // Filtrar boletos con deuda Pendiente boletos = service.obtenerBoletosDeudaPendiente(boletos); // Si existen boletos con deuda pendiente. if (boletos != null && boletos.Any()) { // Anular solo Si los boletos tienen una deuda pendiente mayor al máximo de deuda indicado por la empresa (en este caso 20.00) o el DK es de prueba var boletosAAnular = boletos.Where(boleto => boleto.TotalPendiente >= MONTO_MAXIMO_DEUDA_PENDIENTE || boleto.IdCliente == Configuracion.dkPrueba).ToList(); if (boletosAAnular.Any()) { logger.info(string.Format("Se encontraron {0} boletos a Anular...", boletosAAnular.Count)); // Grabar log de los boletos que va a anular el robot boletosAAnular.ForEach(obj => logger.info(string.Format("[{0} - {1} - {2} - {3}] :: [ Anulacion ] TotalPendiente: {5} | DK: {6}", obj.Pseudo, obj.PNR, obj.NumeroBoleto, obj.Vendedor.FirmaAgente, obj.MarcaFacturado, obj.TotalPendiente, obj.Cliente.DK))); var asunto = "Boletos anulados"; var lstLog = new List <string> { }; // Ejecutar el proceso de anulación new classBO().EjecutarProcesoAvisoVoideo(boletosAAnular, "VOI", asunto, ref lstLog, Configuracion.codigoSeguimiento, Configuracion.idGDS, Configuracion.firmaGDS, Configuracion.firmaBD, Configuracion.EsquemaDB.Actual, session); // Grabar log de las respuestas de los comandos de sabre. lstLog.ForEach(data => logger.info(data)); } } MailUtils.getInstance().sendMailConfirmacion(TipoProceso.ANULACION); } catch (Exception e) { logger.info("Ocurrió un error en el proceso de Anulacion"); throw e; } }
public void execute(GDS_NuevoMundoPersistencia.classSession session, List <GDS_NuevoMundoPersistencia.robotBoletoPendientePago.robotBoletoPendiente> boletos, string fecha) { var logger = new GestorLog(); logger.info(string.Format("Ejecutando ProcesoAvisoNoEnPTA [{0}] ", fecha)); try { var boletosNoFiguranPTA = boletos.Where(obj => !obj.ExistePTA).ToList(); logger.info(string.Format("Se encontraron {0} boletos No En PTA de ...", boletosNoFiguranPTA.Count)); if (boletosNoFiguranPTA.Any()) { var service = new ServiceBoleto(TipoProceso.AVISO_NO_EN_PTA, fecha); boletosNoFiguranPTA = service.filtrarBoletosNoFiguranEnOtroPTA(boletosNoFiguranPTA); logger.info(string.Format("Se encontraron {0} boletos Que No están en Ningún PTA...", boletosNoFiguranPTA.Count)); boletosNoFiguranPTA.ForEach(obj => logger.info(string.Format("[{0} - {1} - {2} - {3}] :: No figura en PTA", obj.Pseudo, obj.PNR, obj.NumeroBoleto, obj.Vendedor.FirmaAgente))); string asuntoMail = "Boletos no figuran en PTA - BACKOFFICE "; var lstLog = new List <string> { }; var lProceso = Configuracion.Gds == GDS.SABRE ? "NBD" : "NBD_A"; var pseudosEmitenBoletos = boletosNoFiguranPTA.Select(x => x.Pseudo).Distinct().ToList(); foreach (var pseudo in pseudosEmitenBoletos) { var boletosPorPseudo = boletosNoFiguranPTA.Where(x => x.Pseudo.Equals(pseudo)).ToList(); new classBO().EjecutarProcesoAvisoVoideo(boletosPorPseudo, lProceso, asuntoMail, ref lstLog, Configuracion.codigoSeguimiento, Configuracion.idGDS, Configuracion.firmaGDS, Configuracion.firmaBD, Configuracion.EsquemaDB.Actual, session); //new classBO().EjecutarProcesoAvisoVoideo(boletosNoFiguranPTA, "NBD", asuntoMail, ref lstLog, Configuracion.codigoSeguimiento, Configuracion.idGDS, Configuracion.firmaGDS, Configuracion.firmaBD, Configuracion.EsquemaDB.Actual, session); } } } catch (Exception ex) { logger.info("Ocurrió un error al ejecutar el ProcesoAvisoNoEnPTA "); logger.info("Exception: " + ex.ToString()); throw ex; } }
public void execute(GDS_NuevoMundoPersistencia.classSession session, List <GDS_NuevoMundoPersistencia.robotBoletoPendientePago.robotBoletoPendiente> boletos) { var logger = new GestorLog(); var encriptador = new EncriptaCadena(); var CLAVE_ENCRYPT = "GDS_S1S73M45"; var wsProcesosGDS = new WS_ProcesosGDS.ProcesosGDS(); wsProcesosGDS.CredencialesValue = new WS_ProcesosGDS.Credenciales { username = encriptador.DES_Encrypt("gd5_3m1s10n3s", CLAVE_ENCRYPT), password = encriptador.DES_Encrypt("pw_gd5_3m1s10n3s", CLAVE_ENCRYPT) }; var boletosVoideados = new List <GDS_NuevoMundoPersistencia.robotBoletoPendientePago.robotBoletoPendiente>(); var agentes = boletos.Select(x => x.Vendedor.FirmaAgente).Distinct().ToList(); foreach (var agente in agentes) { var boletosPorVendedor = boletos.Where(x => x.Vendedor.FirmaAgente.Equals(agente)).ToList(); foreach (var boleto in boletosPorVendedor) { var reservaRQ = new WS_ProcesosGDS.CE_ReservaRQ(); reservaRQ.oDatosAplicacion = new WS_ProcesosGDS.CE_DatosAplicacion(); reservaRQ.oDatosUsuario = new WS_ProcesosGDS.CE_DatosUsuario(); reservaRQ.oDatosAplicacion.strGDS = WS_ProcesosGDS.CE_TipoGDS.GDS_AMADEUS; reservaRQ.oDatosAplicacion.strNameApp = WS_ProcesosGDS.CE_Aplicaciones.InteragenciaExtranet; reservaRQ.oDatosAplicacion.strPNR = boleto.PNR; reservaRQ.oDatosAplicacion.strPseudo = boleto.Pseudo; reservaRQ.oDatosAplicacion.strPseudoVenta = boleto.Pseudo; reservaRQ.oDatosAplicacion.strCodigoSeguimiento = "*****@*****.**"; reservaRQ.oDatosUsuario.strCorreoUsuario = "*****@*****.**"; reservaRQ.oDatosUsuario.idUsuarioPTA = "123"; reservaRQ.CambiarPseudo = true; reservaRQ.RealizarDQB = true; reservaRQ.oDatosCliente = new WS_ProcesosGDS.CE_DatosCliente(); reservaRQ.oDatosCliente.strDKCliente = Convert.ToString(boleto.IdCliente); reservaRQ.oDatosCliente.strDireccion = "Lima"; var dataReserva = wsProcesosGDS.RecuperarReservaGDS(reservaRQ); if (dataReserva != null) { if (dataReserva.CodigoError == 0) { try { var lEstadoActivo = "ACTIVO"; var boletoVoid = dataReserva.lstBoletos.Where(b => b.eTicketNumber.EndsWith(boleto.NumeroBoleto) && b.Estado.Equals(lEstadoActivo)).FirstOrDefault(); if (boletoVoid != null) { boletoVoid.VoidearBoletoEnServicio = true; var listaBoletos = new List <WS_ProcesosGDS.CE_Boleto>(); listaBoletos.Add(boletoVoid); //boleto.NumeroBoleto var objAnulacionBoletoRQ = new WS_ProcesosGDS.CE_VoidearBoletoRQ(); objAnulacionBoletoRQ.oDatosAplicacion = reservaRQ.oDatosAplicacion; objAnulacionBoletoRQ.oDatosCliente = reservaRQ.oDatosCliente; objAnulacionBoletoRQ.oDatosUsuario = reservaRQ.oDatosUsuario; objAnulacionBoletoRQ.lstBoletos = listaBoletos.ToArray(); objAnulacionBoletoRQ.SESSION = dataReserva.SESSION; objAnulacionBoletoRQ.TipoAnulacion = WS_ProcesosGDS.CE_Anulacion.Parcial; var response = wsProcesosGDS.VoidearBoletosGDS(objAnulacionBoletoRQ); if (response != null) { if (response.lstMensajeError == null && response.lstWarning == null) { boletosVoideados.Add(boleto); logger.info("Anulación correcta: " + boleto.NumeroBoleto); } else { logger.info("Ocurrió una incidencia al intentar voidear el boleto : " + boleto.NumeroBoleto); } } } } catch (Exception e) { logger.info(e.ToString()); } } } } if (boletosVoideados.Any()) { new classBO().EnviarCorreoAvisoVoideo(boletosVoideados, "Counter", "VOI", "Boletos anulados", Configuracion.codigoSeguimiento); } } }
public void execute(GDS_NuevoMundoPersistencia.classSession session, List <GDS_NuevoMundoPersistencia.robotBoletoPendientePago.robotBoletoPendiente> boletos, string fecha) { throw new NotImplementedException(); }
public void execute(GDS_NuevoMundoPersistencia.classSession session, List <GDS_NuevoMundoPersistencia.robotBoletoPendientePago.robotBoletoPendiente> boletos) { }
public GestorProceso(GDS_NuevoMundoPersistencia.classSession session) { this.session = session; }