diff --git a/pom.xml b/pom.xml
index 942b34d7c..9fb3f3993 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
4.0.0
br.com.rjconsultores
ventaboletosadm
- 1.24.0
+ 1.24.1
war
diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioAproveitamentoFinanceiroTrecho.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioAproveitamentoFinanceiroTrecho.java
index f2a414fa0..22d97a805 100644
--- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioAproveitamentoFinanceiroTrecho.java
+++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioAproveitamentoFinanceiroTrecho.java
@@ -1,6 +1,3 @@
-/**
- *
- */
package com.rjconsultores.ventaboletos.relatorios.impl;
import java.math.BigDecimal;
@@ -47,8 +44,10 @@ public class RelatorioAproveitamentoFinanceiroTrecho extends Relatorio {
Map> mapRutaTrecho = (Map>) parametros.get("MAPRUTATRECHO");
for (Entry> entry : mapRutaTrecho.entrySet()) {
- if(entry.getValue() != null && !entry.getValue().isEmpty()) {
+ if(entry.getValue() != null && !entry.getValue().isEmpty()&& !entry.getValue().isEmpty()) {
paradasIds.append(entry.getValue().get(0).getOrigenId()+","+entry.getValue().get(entry.getValue().size()-1).getOrigenId()+",");
+ }else {
+ continue;
}
if (paradasIds.length() > 0) {
paradasIds.delete(paradasIds.length() - 1, paradasIds.length());
@@ -56,7 +55,7 @@ public class RelatorioAproveitamentoFinanceiroTrecho extends Relatorio {
String sqlCombinacoes = gerarCombinacaoTrechos(parametros);
StringBuilder sql = getSQL(parametros, sqlCombinacoes, paradasIds, entry.getKey() );
- paradasIds = new StringBuilder();
+
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql.toString());
@@ -70,6 +69,7 @@ public class RelatorioAproveitamentoFinanceiroTrecho extends Relatorio {
while (rset2.next()) {
Map dataResult = new HashMap();
+
dataResult.put("LINHA", rset2.getString("linha"));
dataResult.put("NUMLINHA", rset2.getString("numLinha"));
dataResult.put("SENTIDO", rset2.getString("sentido"));
@@ -176,8 +176,60 @@ public class RelatorioAproveitamentoFinanceiroTrecho extends Relatorio {
this.dados.add(dataResult);
}
+
+ StringBuilder sql2 = buscarTotalViagem(parametros, paradasIds, entry.getKey() );
+ stmt = new NamedParameterStatement(conexao, sql2.toString());
+ stmt.setInt("EMPRESA_ID", Integer.valueOf(parametros.get("EMPRESA_ID").toString()));
+ stmt.setTimestamp("DATA_INICIAL", new Timestamp(DateUtil.inicioFecha((Date) parametros.get("DATA_INICIAL")).getTime()));
+ stmt.setTimestamp("DATA_FINAL", new Timestamp(DateUtil.fimFecha((Date) parametros.get("DATA_FINAL")).getTime()));
+ ResultSet rset3 = stmt.executeQuery();
+
+ List