Totvs - WS Fornecedor / WS Cliente / WS Pedido Compra (bug #6127 )

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@42985 d1611594-4594-4d17-8e1d-87c2c4800839
master
julio 2015-04-10 15:00:32 +00:00
parent 0b7f65a218
commit e4d123cf56
1 changed files with 18 additions and 8 deletions

View File

@ -73,13 +73,13 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
return puntoVentaDAO.obtenerID(id); return puntoVentaDAO.obtenerID(id);
} }
@Transactional(noRollbackFor = { IntegracionException.class }) @Transactional(noRollbackFor = { IntegracionException.class, ValidacionCampoException.class })
public PuntoVenta suscribir(PuntoVenta entidad) throws IntegracionException, ValidacionCampoException { public PuntoVenta suscribir(PuntoVenta entidad) throws IntegracionException, ValidacionCampoException {
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
entidad.setFecmodif(Calendar.getInstance().getTime()); entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.TRUE); entidad.setActivo(Boolean.TRUE);
IntegracionException respEx = null; Exception respEx = null;
try { try {
if (entidad.getIndIntegracion() != TipoRetorno.CONCLUIDA.getValor()) { if (entidad.getIndIntegracion() != TipoRetorno.CONCLUIDA.getValor()) {
String resp = integracionTotvs(entidad); String resp = integracionTotvs(entidad);
@ -108,7 +108,8 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
respEx = new IntegracionException(Atributos.MSG_ERRO_NAO_ENVIO); respEx = new IntegracionException(Atributos.MSG_ERRO_NAO_ENVIO);
} }
} catch (ValidacionCampoException ev) { } catch (ValidacionCampoException ev) {
throw ev; entidad.setIndIntegracion(TipoRetorno.ERRO.getValor());
respEx = ev;
} catch (Exception e) { } catch (Exception e) {
entidad.setIndIntegracion(TipoRetorno.ERRO.getValor()); entidad.setIndIntegracion(TipoRetorno.ERRO.getValor());
@ -119,19 +120,23 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
entidad = puntoVentaDAO.suscribir(entidad); entidad = puntoVentaDAO.suscribir(entidad);
if (respEx != null) { if (respEx != null) {
throw respEx; if (respEx instanceof IntegracionException) {
throw (IntegracionException) respEx;
} else if (respEx instanceof ValidacionCampoException) {
throw (ValidacionCampoException) respEx;
}
} }
return entidad; return entidad;
} }
@Transactional(noRollbackFor = { IntegracionException.class }) @Transactional(noRollbackFor = { IntegracionException.class, ValidacionCampoException.class })
public PuntoVenta actualizacion(PuntoVenta entidad) throws IntegracionException, ValidacionCampoException { public PuntoVenta actualizacion(PuntoVenta entidad) throws IntegracionException, ValidacionCampoException {
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
entidad.setFecmodif(Calendar.getInstance().getTime()); entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.TRUE); entidad.setActivo(Boolean.TRUE);
IntegracionException respEx = null; Exception respEx = null;
try { try {
if (entidad.getIndIntegracion() != TipoRetorno.CONCLUIDA.getValor()) { if (entidad.getIndIntegracion() != TipoRetorno.CONCLUIDA.getValor()) {
String resp = integracionTotvs(entidad); String resp = integracionTotvs(entidad);
@ -160,7 +165,8 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
respEx = new IntegracionException(Atributos.MSG_ERRO_NAO_ENVIO); respEx = new IntegracionException(Atributos.MSG_ERRO_NAO_ENVIO);
} }
} catch (ValidacionCampoException e) { } catch (ValidacionCampoException e) {
throw e; entidad.setIndIntegracion(TipoRetorno.ERRO.getValor());
respEx = e;
} catch (Exception e) { } catch (Exception e) {
entidad.setIndIntegracion(TipoRetorno.ERRO.getValor()); entidad.setIndIntegracion(TipoRetorno.ERRO.getValor());
@ -171,7 +177,11 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
entidad = puntoVentaDAO.actualizacion(entidad); entidad = puntoVentaDAO.actualizacion(entidad);
if (respEx != null) { if (respEx != null) {
throw respEx; if (respEx instanceof IntegracionException) {
throw (IntegracionException) respEx;
} else if (respEx instanceof ValidacionCampoException) {
throw (ValidacionCampoException) respEx;
}
} }
return entidad; return entidad;