fixes bug#22868
dev: Celio qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@108569 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
56a7576556
commit
53e31c40ae
|
@ -11,4 +11,6 @@ public interface SapDAO extends GenericDAO<FechamentoCntcorrente, Long> {
|
||||||
|
|
||||||
public List<FechamentoCntCorrenteVO> obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, Boolean reenviar);
|
public List<FechamentoCntCorrenteVO> obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, Boolean reenviar);
|
||||||
|
|
||||||
|
public boolean atualizaFechamento(Long fechamentocntcorrenteId) throws Exception;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.Statement;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -108,4 +110,25 @@ public class SapHibernateDAO extends GenericHibernateDAO<FechamentoCntcorrente,
|
||||||
return retorno;
|
return retorno;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean atualizaFechamento(Long fechamentocntcorrenteId) throws Exception {
|
||||||
|
|
||||||
|
if(fechamentocntcorrenteId == null ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
Connection con = getSession().connection();
|
||||||
|
Statement stmt = con.createStatement();
|
||||||
|
con.setAutoCommit(false);
|
||||||
|
|
||||||
|
stmt.addBatch("UPDATE FECHAMENTO_CNTCORRENTE SET INDINTEGRADOSAP = 1 WHERE FECHAMENTOCNTCORRENTE_ID = " + fechamentocntcorrenteId);
|
||||||
|
|
||||||
|
stmt.executeBatch();
|
||||||
|
con.commit();
|
||||||
|
stmt.close();
|
||||||
|
|
||||||
|
return Boolean.TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -78,9 +78,7 @@ public class SapServiceImpl implements SapService{
|
||||||
if(integrado == null) {
|
if(integrado == null) {
|
||||||
throw new RuntimeException("Erro no envio/retorno da requisicao para integração SAP");
|
throw new RuntimeException("Erro no envio/retorno da requisicao para integração SAP");
|
||||||
}else if(integrado.getString("Integration").equals("S")) {
|
}else if(integrado.getString("Integration").equals("S")) {
|
||||||
FechamentoCntcorrente registro = obtenerID(fechamentoCntcorrente.getFechamentocntcorrenteId());
|
atualizaFechamento(fechamentoCntcorrente.getFechamentocntcorrenteId());
|
||||||
registro.setIntegradoSap(true);
|
|
||||||
suscribir(registro);
|
|
||||||
contador++;
|
contador++;
|
||||||
}else if(integrado.getString("Integration").equals("E")) {
|
}else if(integrado.getString("Integration").equals("E")) {
|
||||||
throw new RuntimeException("Retorno enviado pelo SAP: \r\n"+integrado.getString("Message"));
|
throw new RuntimeException("Retorno enviado pelo SAP: \r\n"+integrado.getString("Message"));
|
||||||
|
@ -96,6 +94,10 @@ public class SapServiceImpl implements SapService{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean atualizaFechamento(Long fechamentocntcorrenteId) throws Exception {
|
||||||
|
return sapDAO.atualizaFechamento( fechamentocntcorrenteId);
|
||||||
|
}
|
||||||
|
|
||||||
private String buscaConstante(String constanteString) {
|
private String buscaConstante(String constanteString) {
|
||||||
Constante constante = constanteDAO.buscarPorNomeConstante(constanteString);
|
Constante constante = constanteDAO.buscarPorNomeConstante(constanteString);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue