bug#20781

dev:wilian
qua:

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@103920 d1611594-4594-4d17-8e1d-87c2c4800839
master
wilian 2020-10-23 15:09:11 +00:00
parent 4af7671e4e
commit 5e8402d64a
2 changed files with 27 additions and 18 deletions

View File

@ -293,7 +293,7 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
variavel = idRemessa; variavel = idRemessa;
String codEmpresaBanco = tupla[2] != null ? tupla[2].toString() : "0"; String codEmpresaBanco = tupla[2] != null ? tupla[2].toString() : "0";
String nomeEmpresa = tupla[3].toString(); String nomeEmpresa = tupla[3].toString();
Integer codigoTransmissao = Integer.valueOf(tupla[26].toString()); Integer codigoTransmissao = tupla[26] != null ? Integer.valueOf(tupla[26].toString()) : 0;
if(!tupla[8].toString().contains("-")){ if(!tupla[8].toString().contains("-")){
log.error("NossoNumero não está no formato correto: " + tupla[8].toString() + ". Ignorando o registro FechamentoBoletoId = " + tupla[0].toString()); log.error("NossoNumero não está no formato correto: " + tupla[8].toString() + ". Ignorando o registro FechamentoBoletoId = " + tupla[0].toString());
@ -928,6 +928,7 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
sb.append(" LEFT JOIN CIUDAD ci on ci.CIUDAD_ID = pa.CIUDAD_ID AND ci.ACTIVO = 1 "); sb.append(" LEFT JOIN CIUDAD ci on ci.CIUDAD_ID = pa.CIUDAD_ID AND ci.ACTIVO = 1 ");
sb.append(" LEFT JOIN PLAZA pl on pl.PLAZA_ID = ci.PLAZA_ID AND pl.ACTIVO = 1 "); sb.append(" LEFT JOIN PLAZA pl on pl.PLAZA_ID = ci.PLAZA_ID AND pl.ACTIVO = 1 ");
sb.append(" LEFT JOIN ESTADO es on es.ESTADO_ID = ci.ESTADO_ID AND es.ACTIVO = 1 "); sb.append(" LEFT JOIN ESTADO es on es.ESTADO_ID = ci.ESTADO_ID AND es.ACTIVO = 1 ");
sb.append(" LEFT JOIN EMPRESA_CONTABANCARIA ecb ON emp.EMPRESA_ID = ecb.EMPRESA_ID AND ifi.INSTIFINANCEIRA_ID = ecb.INSTIFINANCEIRA_ID AND ecb.ACTIVO = 1 ");
sb.append(" WHERE fb.activo = 1 "); sb.append(" WHERE fb.activo = 1 ");
if(!reenviar){ if(!reenviar){
@ -1007,6 +1008,10 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
@Override @Override
public Boolean atualizaRemessa(Empresa empresa, ArquivoRemessa arquivoRemessa) throws Exception { public Boolean atualizaRemessa(Empresa empresa, ArquivoRemessa arquivoRemessa) throws Exception {
if(arquivoRemessa == null || arquivoRemessa.getItens() == null) {
return false;
}
String ids = ""; String ids = "";
int count = 0; int count = 0;
int seqRemessa = 0; int seqRemessa = 0;

View File

@ -106,6 +106,7 @@ public class ArquivoRemessaCNABImpl implements ArquivoRemessaCNAB {
BancoLayout banco = null; BancoLayout banco = null;
boolean toReturn = Boolean.TRUE; boolean toReturn = Boolean.TRUE;
if(boletos != null && !boletos.isEmpty()) {
for (java.util.Iterator<FechamentoBoleto> it = boletos.iterator(); it.hasNext();) { for (java.util.Iterator<FechamentoBoleto> it = boletos.iterator(); it.hasNext();) {
FechamentoBoleto fechamentoBoleto = it.next(); FechamentoBoleto fechamentoBoleto = it.next();
@ -119,6 +120,7 @@ public class ArquivoRemessaCNABImpl implements ArquivoRemessaCNAB {
toReturn = Boolean.FALSE; toReturn = Boolean.FALSE;
} }
} }
}
return toReturn; return toReturn;
} }
@ -128,6 +130,7 @@ public class ArquivoRemessaCNABImpl implements ArquivoRemessaCNAB {
boolean toReturn = Boolean.FALSE; boolean toReturn = Boolean.FALSE;
if(boletos != null && !boletos.isEmpty()) {
for (java.util.Iterator<FechamentoBoleto> it = boletos.iterator(); it.hasNext();) { for (java.util.Iterator<FechamentoBoleto> it = boletos.iterator(); it.hasNext();) {
FechamentoBoleto fechamentoBoleto = it.next(); FechamentoBoleto fechamentoBoleto = it.next();
@ -136,6 +139,7 @@ public class ArquivoRemessaCNABImpl implements ArquivoRemessaCNAB {
return Boolean.TRUE; return Boolean.TRUE;
} }
} }
}
return toReturn; return toReturn;
} }