RAE - Se dentro do período informado não houver nenhum dado, não é necessário
trazer a linha com o serviço git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@30180 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
e37a72e7a7
commit
ca39973bf4
|
@ -93,14 +93,6 @@ public class RelatorioAcompanhamentoEquivalentes extends Relatorio {
|
|||
BigDecimal totalMes = BigDecimal.ZERO;
|
||||
Integer totalDias = 0;
|
||||
|
||||
row.put("LINHA", this.resultSet.getString("SIGLA"));
|
||||
row.put("LOTACAO", this.resultSet.getInt("ASSENTOS"));
|
||||
row.put("SERVICO", this.resultSet.getString("TIPO_SERVICO"));
|
||||
row.put("CODIGO", this.resultSet.getInt("CORRIDA_ID"));
|
||||
row.put("HORARIO", this.resultSet.getString("HORARIO"));
|
||||
row.put("INTERESTADUAL", this.resultSet.getString("INTERESTADUAL"));
|
||||
row.put("GRUPO_LINHA", this.resultSet.getString("GRUPO_LINHA"));
|
||||
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(dataInicial);
|
||||
cal.set(Calendar.DATE, 1);
|
||||
|
@ -115,18 +107,28 @@ public class RelatorioAcompanhamentoEquivalentes extends Relatorio {
|
|||
totalDias++;
|
||||
}
|
||||
|
||||
BigDecimal ZERO = new BigDecimal(0);
|
||||
if (valor != null && !valor.equals(ZERO)) {
|
||||
row.put("LINHA", this.resultSet.getString("SIGLA"));
|
||||
row.put("LOTACAO", this.resultSet.getInt("ASSENTOS"));
|
||||
row.put("SERVICO", this.resultSet.getString("TIPO_SERVICO"));
|
||||
row.put("CODIGO", this.resultSet.getInt("CORRIDA_ID"));
|
||||
row.put("HORARIO", this.resultSet.getString("HORARIO"));
|
||||
row.put("INTERESTADUAL", this.resultSet.getString("INTERESTADUAL"));
|
||||
row.put("GRUPO_LINHA", this.resultSet.getString("GRUPO_LINHA"));
|
||||
|
||||
row.put(String.valueOf(cal.get(Calendar.DATE)), valor);
|
||||
}
|
||||
|
||||
if (cal.get(Calendar.DATE) < cal.getActualMaximum(Calendar.DATE))
|
||||
cal.add(Calendar.DATE, 1);
|
||||
|
||||
}
|
||||
|
||||
if (totalMes != null && !totalMes.equals(BigDecimal.ZERO) && totalDias > 0)
|
||||
if (totalMes != null && !totalMes.equals(BigDecimal.ZERO) && totalDias > 0) {
|
||||
row.put("MEDIA", totalMes.divide(BigDecimal.valueOf(totalDias), 2, RoundingMode.HALF_UP));
|
||||
|
||||
this.dados.add(row);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue