Created
August 6, 2013 01:18
-
-
Save marciojrtorres/6161206 to your computer and use it in GitHub Desktop.
Tornando os comentários desnecessários com refatorações
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Contabil { | |
// relatório de lançamentos não contabilizados | |
void relatorio() { | |
// lançamentos deste ano, desde o início do ano até a data atual | |
List<Lancamento> l1 = lancamentoService.lancamentos( | |
new Date(new Date().getYear(), 1, 1), new Date()); | |
// lançamentos não contabilizados | |
List<Lancamento> l2 = new ArrayList<Lancamento>(); | |
for (Lancamento l : l1) { | |
// 1: contabilizado, 2: nao contabilizado | |
// se está contabilizado | |
// 0: ativo, 1:cancelada, 2:inativo | |
// tem que estar não contabilizado e não cancelado para enviar | |
// para o relatório | |
if (l.getStatus() == 2 && l.getArquivo() != 1) { | |
l2.add(l); | |
} | |
} | |
reportService.send(l2); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Contabil { | |
void relatorioLancamentosNaoContabilizados() { | |
Date hoje = new Date(); | |
Date inicioAno = new Date(hoje.getYear(), 1, 1); | |
Intervalo anoAtual = new Intervalo(inicioAno, hoje); | |
List<Lancamento> lancamentosDoAno = lancamentoService.lancamentos(anoAtual); | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment