leonardo 2016-12-14 16:23:43 +00:00
parent 911803c7f7
commit d7c2f3599e
1 changed files with 14 additions and 0 deletions

View File

@ -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) {