Fixes bug#AL4549

master
Fernando Abimael Alvarez Uc 2024-08-07 14:33:45 -06:00
parent 73fb9d5e63
commit 73c7e4ef8f
1 changed files with 12 additions and 7 deletions

View File

@ -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,12 +249,12 @@ 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);
}
@ -263,6 +262,12 @@ public class CotizarExpresoController extends MyGenericForwardComposer{
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;
}