From c529ac873277681a87e1b6a7c7cf1ae30de244eb Mon Sep 17 00:00:00 2001 From: fabio Date: Mon, 7 Nov 2022 15:05:28 +0000 Subject: [PATCH] fixes bug#al-1726 dev: Celio qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@115202 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../ventaboletos/service/SapService.java | 4 ++-- .../ventaboletos/service/impl/SapServiceImpl.java | 14 +++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/com/rjconsultores/ventaboletos/service/SapService.java b/src/com/rjconsultores/ventaboletos/service/SapService.java index 62448c5e7..69c0674cf 100644 --- a/src/com/rjconsultores/ventaboletos/service/SapService.java +++ b/src/com/rjconsultores/ventaboletos/service/SapService.java @@ -9,8 +9,8 @@ import com.rjconsultores.ventaboletos.entidad.PuntoVenta; import com.rjconsultores.ventaboletos.vo.integracao.FechamentoCntCorrenteVO; public interface SapService extends GenericService { - - public int remessa(List fechamentos) throws Exception ; + + public int remessa(List fechamentos, boolean processoManual) throws Exception ; public List obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, String status); diff --git a/src/com/rjconsultores/ventaboletos/service/impl/SapServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/SapServiceImpl.java index d4e9fbc69..4edf334a1 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/SapServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/SapServiceImpl.java @@ -72,9 +72,9 @@ public class SapServiceImpl implements SapService{ public List obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, String status, PuntoVenta puntoVenta) { return sapDAO.obtenerTodosParaRemessa(empresa, dataDe, dataAte, status, puntoVenta); } - + @Override - public int remessa(List fechamentos) throws Exception { + public int remessa(List fechamentos, boolean processoManual) throws Exception { try { int contador = 0; IntegracaoSapRest integracaoSapRest = IntegracaoSapRest.getInstance(); @@ -88,14 +88,18 @@ public class SapServiceImpl implements SapService{ if(integrado == null) { atualizaFechamento(fechamentoCntcorrente.getFechamentocntcorrenteId(), StatusIntegracaoSap.NAO_ENVIADO.ordinal()); log.error("Erro no envio/retorno da requisicao para integracao SAP do fechamentoID: "+fechamentoCntcorrente.getFechamentocntcorrenteId()); - throw new RuntimeException("Erro no envio/retorno da requisicao para integracao SAP do fechamentoID: "+fechamentoCntcorrente.getFechamentocntcorrenteId()); + if(processoManual) { + throw new RuntimeException("Erro no envio/retorno da requisicao para integracao SAP do fechamentoID: "+fechamentoCntcorrente.getFechamentocntcorrenteId()); + } }else if(integrado.getString("Integration").equals("S")) { atualizaFechamento(fechamentoCntcorrente.getFechamentocntcorrenteId(), StatusIntegracaoSap.INTEGRADO.ordinal()); contador++; }else if(integrado.getString("Integration").equals("E")) { atualizaFechamento(fechamentoCntcorrente.getFechamentocntcorrenteId(), StatusIntegracaoSap.RECUSADO.ordinal()); log.warn("Retorno enviado pelo SAP: \r\n"+integrado.getString("Message")); - throw new RuntimeException("Fechamento: "+fechamentoCntcorrente.getFechamentocntcorrenteId()+"\r\nRetorno enviado pelo SAP: \r\n"+integrado.getString("Message")); + if(processoManual) { + throw new RuntimeException("Fechamento: "+fechamentoCntcorrente.getFechamentocntcorrenteId()+"\r\nRetorno enviado pelo SAP: \r\n"+integrado.getString("Message")); + } } } } @@ -130,7 +134,7 @@ public class SapServiceImpl implements SapService{ log.info("IntegracaoSap: Registro a enviar:"+listaPendente.size()); try { - remessa(listaPendente); + remessa(listaPendente, false); } catch (Exception e) { throw e; }