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);
|
entidad = puntoVentaDAO.suscribir(entidad);
|
||||||
|
|
||||||
|
if (ApplicationProperties.getInstance().integracionAGWS()) {
|
||||||
log.debug("iniciando integração com AG");
|
log.debug("iniciando integração com AG");
|
||||||
integrarClienteAG(entidad);
|
integrarClienteAG(entidad);
|
||||||
if (!entidad.getIndIntegradoAG()){
|
if (!entidad.getIndIntegradoAG()){
|
||||||
throw new IntegracionException(entidad.getMotivoNaoIntegradoAG());
|
throw new IntegracionException(entidad.getMotivoNaoIntegradoAG());
|
||||||
}
|
}
|
||||||
integrarFornecedorAG(entidad);
|
integrarFornecedorAG(entidad);
|
||||||
log.debug("fim da integração com AG");
|
|
||||||
if (!entidad.getIndIntegradoAG()){
|
if (!entidad.getIndIntegradoAG()){
|
||||||
throw new IntegracionException(entidad.getMotivoNaoIntegradoAG());
|
throw new IntegracionException(entidad.getMotivoNaoIntegradoAG());
|
||||||
}
|
}
|
||||||
|
log.debug("fim da integração com AG");
|
||||||
|
}
|
||||||
return entidad;
|
return entidad;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void integrarFornecedorAG(PuntoVenta entidad) {
|
private void integrarFornecedorAG(PuntoVenta entidad) {
|
||||||
if (ApplicationProperties.getInstance().integracionAGWS()) {
|
|
||||||
try{
|
try{
|
||||||
IAGservice service = new IAGserviceLocator();
|
IAGservice service = new IAGserviceLocator();
|
||||||
DaoAG.getInstance().setDBConnection(dataSource.getConnection());
|
DaoAG.getInstance().setDBConnection(dataSource.getConnection());
|
||||||
|
@ -239,10 +239,8 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
||||||
wslog.error(me.toString());
|
wslog.error(me.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void integrarClienteAG(PuntoVenta entidad) {
|
private void integrarClienteAG(PuntoVenta entidad) {
|
||||||
if (ApplicationProperties.getInstance().integracionAGWS()) {
|
|
||||||
try{
|
try{
|
||||||
IAGservice service = new IAGserviceLocator();
|
IAGservice service = new IAGserviceLocator();
|
||||||
DaoAG.getInstance().setDBConnection(dataSource.getConnection());
|
DaoAG.getInstance().setDBConnection(dataSource.getConnection());
|
||||||
|
@ -337,7 +335,6 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
||||||
wslog.error(me.toString());
|
wslog.error(me.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional(noRollbackFor = { IntegracionException.class, ValidacionCampoException.class})
|
@Transactional(noRollbackFor = { IntegracionException.class, ValidacionCampoException.class})
|
||||||
public PuntoVenta actualizacion(PuntoVenta entidad) throws IntegracionException, ValidacionCampoException {
|
public PuntoVenta actualizacion(PuntoVenta entidad) throws IntegracionException, ValidacionCampoException {
|
||||||
|
@ -392,6 +389,7 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
||||||
}
|
}
|
||||||
entidad = puntoVentaDAO.actualizacion(entidad);
|
entidad = puntoVentaDAO.actualizacion(entidad);
|
||||||
|
|
||||||
|
if (ApplicationProperties.getInstance().integracionAGWS()) {
|
||||||
log.debug("iniciando integração com AG");
|
log.debug("iniciando integração com AG");
|
||||||
integrarClienteAG(entidad);
|
integrarClienteAG(entidad);
|
||||||
if (!entidad.getIndIntegradoAG()){
|
if (!entidad.getIndIntegradoAG()){
|
||||||
|
@ -402,6 +400,7 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
||||||
throw new IntegracionException(entidad.getMotivoNaoIntegradoAG());
|
throw new IntegracionException(entidad.getMotivoNaoIntegradoAG());
|
||||||
}
|
}
|
||||||
log.debug("fim da integração com AG");
|
log.debug("fim da integração com AG");
|
||||||
|
}
|
||||||
|
|
||||||
if (respEx != null) {
|
if (respEx != null) {
|
||||||
if (respEx instanceof IntegracionException) {
|
if (respEx instanceof IntegracionException) {
|
||||||
|
|
Loading…
Reference in New Issue