fixes bug#6252
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@43592 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
76a85c8a28
commit
a8e0007c29
|
@ -75,44 +75,45 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
|||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
Exception respEx = null;
|
||||
try {
|
||||
if (entidad.getIndIntegracion() == TipoRetorno.PENDENTE.getValor()
|
||||
|| entidad.getIndIntegracion() == TipoRetorno.ERRO.getValor()) {
|
||||
String resp = integracionTotvs(entidad);
|
||||
|
||||
TipoRetorno retornoTotvs = RetornoTotvs.validaRetornoTotvs(resp);
|
||||
|
||||
switch (retornoTotvs) {
|
||||
case CONCLUIDA:
|
||||
entidad.setIndIntegracion(TipoRetorno.CONCLUIDA.getValor());
|
||||
break;
|
||||
|
||||
case JA_CADASTRADA:
|
||||
entidad.setIndIntegracion(TipoRetorno.JA_CADASTRADA.getValor());
|
||||
respEx = new IntegracionException(Atributos.MSG_ERRO_JA_CADASTRADO);
|
||||
break;
|
||||
|
||||
case ERRO:
|
||||
entidad.setIndIntegracion(TipoRetorno.ERRO.getValor());
|
||||
respEx = new IntegracionException(Atributos.MSG_ERRO_GENERICA + resp);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
if (ApplicationProperties.getInstance().integracionTotvs()) {
|
||||
try {
|
||||
if (entidad.getIndIntegracion() == TipoRetorno.PENDENTE.getValor()
|
||||
|| entidad.getIndIntegracion() == TipoRetorno.ERRO.getValor()) {
|
||||
String resp = integracionTotvs(entidad);
|
||||
|
||||
TipoRetorno retornoTotvs = RetornoTotvs.validaRetornoTotvs(resp);
|
||||
|
||||
switch (retornoTotvs) {
|
||||
case CONCLUIDA:
|
||||
entidad.setIndIntegracion(TipoRetorno.CONCLUIDA.getValor());
|
||||
break;
|
||||
|
||||
case JA_CADASTRADA:
|
||||
entidad.setIndIntegracion(TipoRetorno.JA_CADASTRADA.getValor());
|
||||
respEx = new IntegracionException(Atributos.MSG_ERRO_JA_CADASTRADO);
|
||||
break;
|
||||
|
||||
case ERRO:
|
||||
entidad.setIndIntegracion(TipoRetorno.ERRO.getValor());
|
||||
respEx = new IntegracionException(Atributos.MSG_ERRO_GENERICA + resp);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
respEx = new IntegracionException(Atributos.MSG_ERRO_NAO_ENVIO);
|
||||
}
|
||||
} else {
|
||||
respEx = new IntegracionException(Atributos.MSG_ERRO_NAO_ENVIO);
|
||||
} catch (ValidacionCampoException ev) {
|
||||
entidad.setIndIntegracion(TipoRetorno.ERRO.getValor());
|
||||
respEx = ev;
|
||||
|
||||
} catch (Exception e) {
|
||||
entidad.setIndIntegracion(TipoRetorno.ERRO.getValor());
|
||||
log.error(Atributos.MSG_ERRO_GENERICA, e);
|
||||
respEx = new IntegracionException(Atributos.MSG_ERRO_GENERICA + e.getMessage());
|
||||
}
|
||||
} catch (ValidacionCampoException ev) {
|
||||
entidad.setIndIntegracion(TipoRetorno.ERRO.getValor());
|
||||
respEx = ev;
|
||||
|
||||
} catch (Exception e) {
|
||||
entidad.setIndIntegracion(TipoRetorno.ERRO.getValor());
|
||||
log.error(Atributos.MSG_ERRO_GENERICA, e);
|
||||
respEx = new IntegracionException(Atributos.MSG_ERRO_GENERICA + e.getMessage());
|
||||
}
|
||||
|
||||
entidad = puntoVentaDAO.suscribir(entidad);
|
||||
|
||||
if (respEx != null) {
|
||||
|
@ -131,44 +132,48 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
|||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
|
||||
Exception respEx = null;
|
||||
try {
|
||||
if (entidad.getIndIntegracion() == TipoRetorno.PENDENTE.getValor()
|
||||
|| entidad.getIndIntegracion() == TipoRetorno.ERRO.getValor()) {
|
||||
String resp = integracionTotvs(entidad);
|
||||
|
||||
TipoRetorno retornoTotvs = RetornoTotvs.validaRetornoTotvs(resp);
|
||||
|
||||
switch (retornoTotvs) {
|
||||
case CONCLUIDA:
|
||||
entidad.setIndIntegracion(TipoRetorno.CONCLUIDA.getValor());
|
||||
break;
|
||||
|
||||
case JA_CADASTRADA:
|
||||
entidad.setIndIntegracion(TipoRetorno.JA_CADASTRADA.getValor());
|
||||
respEx = new IntegracionException(Atributos.MSG_ERRO_JA_CADASTRADO);
|
||||
break;
|
||||
|
||||
case ERRO:
|
||||
entidad.setIndIntegracion(TipoRetorno.ERRO.getValor());
|
||||
respEx = new IntegracionException(Atributos.MSG_ERRO_GENERICA + resp);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
if (ApplicationProperties.getInstance().integracionTotvs()) {
|
||||
|
||||
try {
|
||||
if (entidad.getIndIntegracion() == TipoRetorno.PENDENTE.getValor()
|
||||
|| entidad.getIndIntegracion() == TipoRetorno.ERRO.getValor()) {
|
||||
String resp = integracionTotvs(entidad);
|
||||
|
||||
TipoRetorno retornoTotvs = RetornoTotvs.validaRetornoTotvs(resp);
|
||||
|
||||
switch (retornoTotvs) {
|
||||
case CONCLUIDA:
|
||||
entidad.setIndIntegracion(TipoRetorno.CONCLUIDA.getValor());
|
||||
break;
|
||||
|
||||
case JA_CADASTRADA:
|
||||
entidad.setIndIntegracion(TipoRetorno.JA_CADASTRADA.getValor());
|
||||
respEx = new IntegracionException(Atributos.MSG_ERRO_JA_CADASTRADO);
|
||||
break;
|
||||
|
||||
case ERRO:
|
||||
entidad.setIndIntegracion(TipoRetorno.ERRO.getValor());
|
||||
respEx = new IntegracionException(Atributos.MSG_ERRO_GENERICA + resp);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
respEx = new IntegracionException(Atributos.MSG_ERRO_NAO_ENVIO);
|
||||
}
|
||||
} else {
|
||||
respEx = new IntegracionException(Atributos.MSG_ERRO_NAO_ENVIO);
|
||||
} catch (ValidacionCampoException e) {
|
||||
entidad.setIndIntegracion(TipoRetorno.ERRO.getValor());
|
||||
respEx = e;
|
||||
|
||||
} catch (Exception e) {
|
||||
entidad.setIndIntegracion(TipoRetorno.ERRO.getValor());
|
||||
log.error(Atributos.MSG_ERRO_GENERICA, e);
|
||||
respEx = new IntegracionException(Atributos.MSG_ERRO_GENERICA + e.getMessage());
|
||||
}
|
||||
} catch (ValidacionCampoException e) {
|
||||
entidad.setIndIntegracion(TipoRetorno.ERRO.getValor());
|
||||
respEx = e;
|
||||
|
||||
} catch (Exception e) {
|
||||
entidad.setIndIntegracion(TipoRetorno.ERRO.getValor());
|
||||
log.error(Atributos.MSG_ERRO_GENERICA, e);
|
||||
respEx = new IntegracionException(Atributos.MSG_ERRO_GENERICA + e.getMessage());
|
||||
}
|
||||
|
||||
entidad = puntoVentaDAO.actualizacion(entidad);
|
||||
|
|
Loading…
Reference in New Issue