From d7c2f3599efa8334403570ee93e78b1ac928a8da Mon Sep 17 00:00:00 2001 From: leonardo Date: Wed, 14 Dec 2016 16:23:43 +0000 Subject: [PATCH] bug #7788 git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@63668 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../service/impl/PuntoVentaServiceImpl.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PuntoVentaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PuntoVentaServiceImpl.java index c90119a9c..f1e7ba183 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/PuntoVentaServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/PuntoVentaServiceImpl.java @@ -7,10 +7,12 @@ package com.rjconsultores.ventaboletos.service.impl; import java.net.MalformedURLException; import java.net.URL; import java.rmi.RemoteException; +import java.sql.SQLException; import java.text.Normalizer; import java.util.Calendar; import java.util.List; +import javax.sql.DataSource; import javax.xml.rpc.ServiceException; import org.apache.commons.lang.StringUtils; @@ -77,6 +79,8 @@ public class PuntoVentaServiceImpl implements PuntoVentaService { private EstacionService estacionService; @Autowired private UsuarioUbicacionDAO usuarioUbicacionDAO; + @Autowired + private DataSource dataSource; // FIXME : Remover esse método de quem está usando. Esse método carrega muitos dados @Deprecated @@ -146,8 +150,10 @@ public class PuntoVentaServiceImpl implements PuntoVentaService { } entidad = puntoVentaDAO.suscribir(entidad); + log.debug("iniciando integração com AG"); integrarClienteAG(entidad); integrarFornecedorAG(entidad); + log.debug("fim da integração com AG"); return entidad; } @@ -156,6 +162,7 @@ public class PuntoVentaServiceImpl implements PuntoVentaService { if (ApplicationProperties.getInstance().integracionAGWS()) { try{ IAGservice service = new IAGserviceLocator(); + DaoAG.getInstance().setDBConnection(dataSource.getConnection()); IAG iag = service.getIAGPort(new URL(DaoAG.getInstance().obterConstante(Constantes.URL_WS_AG))); TFornecedor fornecedor = null; try{ @@ -215,6 +222,8 @@ public class PuntoVentaServiceImpl implements PuntoVentaService { log.error("", se.toString()); } catch (MalformedURLException me){ log.error("", me.toString()); + } catch (SQLException me){ + log.error("", me.toString()); } } } @@ -223,6 +232,7 @@ public class PuntoVentaServiceImpl implements PuntoVentaService { if (ApplicationProperties.getInstance().integracionAGWS()) { try{ IAGservice service = new IAGserviceLocator(); + DaoAG.getInstance().setDBConnection(dataSource.getConnection()); IAG iag = service.getIAGPort(new URL(DaoAG.getInstance().obterConstante(Constantes.URL_WS_AG))); TCliente cli = null; try{ @@ -304,6 +314,8 @@ public class PuntoVentaServiceImpl implements PuntoVentaService { log.error("", se.toString()); } catch (MalformedURLException me){ log.error("", me.toString()); + } catch (SQLException me){ + log.error("", me.toString()); } } } @@ -359,8 +371,10 @@ public class PuntoVentaServiceImpl implements PuntoVentaService { entidad = puntoVentaDAO.actualizacion(entidad); + log.debug("iniciando integração com AG"); integrarClienteAG(entidad); integrarFornecedorAG(entidad); + log.debug("fim da integração com AG"); if (respEx != null) { if (respEx instanceof IntegracionException) {