fixes bug #8607
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@65456 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
d1ed528cd4
commit
35b7d2efaa
|
@ -151,22 +151,22 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
|||
}
|
||||
entidad = puntoVentaDAO.suscribir(entidad);
|
||||
|
||||
if (ApplicationProperties.getInstance().integracionAGWS()) {
|
||||
log.debug("iniciando integração com AG");
|
||||
integrarClienteAG(entidad);
|
||||
if (!entidad.getIndIntegradoAG()){
|
||||
throw new IntegracionException(entidad.getMotivoNaoIntegradoAG());
|
||||
}
|
||||
integrarFornecedorAG(entidad);
|
||||
log.debug("fim da integração com AG");
|
||||
if (!entidad.getIndIntegradoAG()){
|
||||
throw new IntegracionException(entidad.getMotivoNaoIntegradoAG());
|
||||
}
|
||||
|
||||
log.debug("fim da integração com AG");
|
||||
}
|
||||
return entidad;
|
||||
}
|
||||
|
||||
private void integrarFornecedorAG(PuntoVenta entidad) {
|
||||
if (ApplicationProperties.getInstance().integracionAGWS()) {
|
||||
try{
|
||||
IAGservice service = new IAGserviceLocator();
|
||||
DaoAG.getInstance().setDBConnection(dataSource.getConnection());
|
||||
|
@ -239,10 +239,8 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
|||
wslog.error(me.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void integrarClienteAG(PuntoVenta entidad) {
|
||||
if (ApplicationProperties.getInstance().integracionAGWS()) {
|
||||
try{
|
||||
IAGservice service = new IAGserviceLocator();
|
||||
DaoAG.getInstance().setDBConnection(dataSource.getConnection());
|
||||
|
@ -337,7 +335,6 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
|||
wslog.error(me.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(noRollbackFor = { IntegracionException.class, ValidacionCampoException.class})
|
||||
public PuntoVenta actualizacion(PuntoVenta entidad) throws IntegracionException, ValidacionCampoException {
|
||||
|
@ -392,6 +389,7 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
|||
}
|
||||
entidad = puntoVentaDAO.actualizacion(entidad);
|
||||
|
||||
if (ApplicationProperties.getInstance().integracionAGWS()) {
|
||||
log.debug("iniciando integração com AG");
|
||||
integrarClienteAG(entidad);
|
||||
if (!entidad.getIndIntegradoAG()){
|
||||
|
@ -402,6 +400,7 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
|||
throw new IntegracionException(entidad.getMotivoNaoIntegradoAG());
|
||||
}
|
||||
log.debug("fim da integração com AG");
|
||||
}
|
||||
|
||||
if (respEx != null) {
|
||||
if (respEx instanceof IntegracionException) {
|
||||
|
|
Loading…
Reference in New Issue