fixes bug#21344
dev: Celio qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@107203 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
8d3446bea0
commit
35d74525b8
|
@ -10,8 +10,10 @@ import java.sql.SQLException;
|
|||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.DataSource;
|
||||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
|
||||
|
@ -68,6 +70,7 @@ public class RelatorioResumoLinhasAnaliticoSumarizado extends Relatorio {
|
|||
rset = stmt.executeQuery();
|
||||
|
||||
lsDadosRelatorio = new ArrayList<RelatorioResumoLinhasBean>();
|
||||
Set<RelatorioResumoLinhasBean> setDadosRelatorio = new HashSet<RelatorioResumoLinhasBean>();
|
||||
|
||||
RelatorioResumoLinhasBean relatorioBean = null;
|
||||
while (rset.next()) {
|
||||
|
@ -75,18 +78,14 @@ public class RelatorioResumoLinhasAnaliticoSumarizado extends Relatorio {
|
|||
Boolean isMesmaLinhaIdaVolta = relatorioBean !=null && rset.getString("PREFIXO") != null &&
|
||||
rset.getString("PREFIXO").equals(relatorioBean.getPREFIXO()) ? Boolean.TRUE : Boolean.FALSE;
|
||||
|
||||
if (!isMesmaLinhaIdaVolta) {
|
||||
if(relatorioBean !=null) {
|
||||
lsDadosRelatorio.add(relatorioBean);
|
||||
}
|
||||
relatorioBean = preencheAgrupaRelatorioBeanPorIdaVolta(rset, isMesmaLinhaIdaVolta, null);
|
||||
} else {
|
||||
relatorioBean= preencheAgrupaRelatorioBeanPorIdaVolta(rset, isMesmaLinhaIdaVolta, relatorioBean);
|
||||
}
|
||||
relatorioBean = preencheAgrupaRelatorioBeanPorIdaVolta(rset, isMesmaLinhaIdaVolta, relatorioBean);
|
||||
|
||||
setDadosRelatorio.add(relatorioBean);
|
||||
}
|
||||
if (lsDadosRelatorio.size() > 0) {
|
||||
setLsDadosRelatorio(lsDadosRelatorio);
|
||||
|
||||
if (setDadosRelatorio.size() > 0) {
|
||||
lsDadosRelatorio.addAll(setDadosRelatorio);
|
||||
setLsDadosRelatorio( lsDadosRelatorio );
|
||||
}else {
|
||||
//tratado caso onde filtra a linha (apenas uma linha)
|
||||
if(rset.getRow() ==0 && rutaId !=null && relatorioBean!=null) {
|
||||
|
|
|
@ -2,7 +2,7 @@ package com.rjconsultores.ventaboletos.relatorios.utilitarios;
|
|||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class RelatorioResumoLinhasBean {
|
||||
public class RelatorioResumoLinhasBean implements Comparable<RelatorioResumoLinhasBean>{
|
||||
|
||||
private BigDecimal INDSENTIDOIDA;
|
||||
private BigDecimal RUTA_ID;
|
||||
|
@ -298,5 +298,14 @@ public class RelatorioResumoLinhasBean {
|
|||
// TODO Auto-generated method stub
|
||||
return getRUTA_ID() + getDESCRUTA();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(RelatorioResumoLinhasBean o) {
|
||||
if( this == null || o == null) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return this.getPREFIXO().compareTo(o.getPREFIXO());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue