From 73c7e4ef8f8d184212c45800f487e25f249685ff Mon Sep 17 00:00:00 2001 From: Fernando Abimael Alvarez Uc Date: Wed, 7 Aug 2024 14:33:45 -0600 Subject: [PATCH] Fixes bug#AL4549 --- .../expressos/CotizarExpresoController.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/expressos/CotizarExpresoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/expressos/CotizarExpresoController.java index 3006e612d..dd5e0847f 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/expressos/CotizarExpresoController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/expressos/CotizarExpresoController.java @@ -217,12 +217,11 @@ public class CotizarExpresoController extends MyGenericForwardComposer{ } private void enviarEmail() throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException, ClientProtocolException, IOException, InterruptedException { - ConstanteService constanteService = (ConstanteService) AppContext.getApplicationContext().getBean("constanteService"); - String urlAPIRJ = constanteService.buscarPorNomeConstante("URL_API_RJ_INFOBIP").getValorconstante() == null ? null : constanteService.buscarPorNomeConstante("URL_API_RJ_INFOBIP").getValorconstante(); - String credenciais = constanteService.buscarPorNomeConstante("CREDENCIAIS_API_RJ").getValorconstante() == null ? null : constanteService.buscarPorNomeConstante("CREDENCIAIS_API_RJ").getValorconstante(); - String tenant = constanteService.buscarPorNomeConstante("TENANT_API_RJ").getValorconstante() == null ? null : constanteService.buscarPorNomeConstante("TENANT_API_RJ").getValorconstante(); - String empresaId = constanteService.buscarPorNomeConstante("EMPRESA_NOTIFICACOES_BOLIVARIANO").getValorconstante() == null ? null : constanteService.buscarPorNomeConstante("EMPRESA_NOTIFICACOES_BOLIVARIANO").getValorconstante(); + String urlAPIRJ = valorConstante("URL_API_RJ_INFOBIP"); + String credenciais = valorConstante("CREDENCIAIS_API_RJ"); + String tenant = valorConstante("TENANT_API_RJ"); + String empresaId = valorConstante("EMPRESA_NOTIFICACOES_BOLIVARIANO"); urlAPIRJ = urlAPIRJ.concat("EnviarEmailGenerico"); @@ -250,18 +249,24 @@ public class CotizarExpresoController extends MyGenericForwardComposer{ if(response.getStatusLine().getStatusCode() == 200 && response.getStatusLine().getReasonPhrase().equalsIgnoreCase("OK")) { Messagebox.show( - Labels.getLabel("expresoController.MSG.emailEnviado"), + Labels.getLabel("cotizarExpresoController.MSG.emailEnviado"), Labels.getLabel("expresosPorCotizarCotizar.window.title"), Messagebox.OK, Messagebox.INFORMATION); } else { Messagebox.show( - Labels.getLabel("expresoController.MSG.emailNoEnviado"), + Labels.getLabel("cotizarExpresoController.MSG.emailNoEnviado"), Labels.getLabel("expresosPorCotizarCotizar.window.title"), Messagebox.OK, Messagebox.ERROR); } this.closeWindow(); } + + public String valorConstante(String constante) { + ConstanteService constanteService = (ConstanteService) AppContext.getApplicationContext().getBean("constanteService"); + + return constanteService.buscarPorNomeConstante(constante) != null ? constanteService.buscarPorNomeConstante(constante).getValorconstante() : null ; + } public SolicitudExpreso getExpreso() { return expreso;