fixes bug#13945
dev:lucas qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@92890 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
5cb57130be
commit
1c5192f5c6
|
@ -4,6 +4,7 @@ import java.sql.Connection;
|
|||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.ArrayDataSource;
|
||||
|
@ -35,6 +36,7 @@ public class RelatorioQuadroDemonstrativoMovimentoPassageiros extends Relatorio
|
|||
ResultSet rset = ps.executeQuery();
|
||||
|
||||
while (rset.next()) {
|
||||
boolean agrupar = false;
|
||||
Map<String, Object> dataResult = new HashMap<String, Object>();
|
||||
|
||||
dataResult.put("origem", rset.getString("origem"));
|
||||
|
@ -43,9 +45,33 @@ public class RelatorioQuadroDemonstrativoMovimentoPassageiros extends Relatorio
|
|||
dataResult.put("totalida", rset.getLong("totalida"));
|
||||
dataResult.put("totalvolta", rset.getLong("totalvolta"));
|
||||
|
||||
for (Iterator iterator = dados.iterator(); iterator.hasNext();) {
|
||||
|
||||
Map<String, Object> map = (Map<String, Object>) iterator.next();
|
||||
String origem = map.get("origem").toString();
|
||||
String destino = map.get("destino").toString();
|
||||
Long ida = (Long) map.get("totalida");
|
||||
Long volta = (Long) map.get("totalvolta");
|
||||
|
||||
if (origem.equals(rset.getString("destino")) && destino.equals(rset.getString("origem"))) {
|
||||
agrupar = true;
|
||||
if (ida == 0) {
|
||||
map.put("totalida", rset.getLong("totalida"));
|
||||
}
|
||||
if (volta == 0) {
|
||||
map.put("totalvolta", rset.getLong("totalvolta"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!agrupar) {
|
||||
this.dados.add(dataResult);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.resultSet = rset;
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue