Rev 343 | Rev 383 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 343 | Rev 382 | ||
|---|---|---|---|
| Line 61... | Line 61... | ||
| 61 | query.setParameter("dataInicial", parametrosConsultaParcelasDTO.getDataInicial()); |
61 | query.setParameter("dataInicial", parametrosConsultaParcelasDTO.getDataInicial()); |
| 62 | query.setParameter("dataFinal", parametrosConsultaParcelasDTO.getDataFinal()); |
62 | query.setParameter("dataFinal", parametrosConsultaParcelasDTO.getDataFinal()); |
| 63 | }
|
63 | }
|
| 64 | }
|
64 | }
|
| 65 | return query.getResultList(); |
65 | return query.getResultList(); |
| - | 66 | } catch(Exception ex) { |
|
| - | 67 | ex.printStackTrace(); |
|
| - | 68 | return null; |
|
| - | 69 | }
|
|
| - | 70 | }
|
|
| - | 71 | ||
| - | 72 | @Override |
|
| - | 73 | public List<ParcelaDTO> consultarParcelas(Long sequencialContaBancaria, Date dataRecebimento, List<FormaPagamentoDTO> formasDePagamento) { |
|
| - | 74 | StringBuilder sql = new StringBuilder(); |
|
| - | 75 | sql.append("SELECT new br.com.ec.domain.dto.ParcelaDTO("); |
|
| - | 76 | sql.append(ParcelaDTO.CONSULTA_SEM_CATEGORIA_DTO); |
|
| - | 77 | sql.append(") FROM Parcela e "); |
|
| - | 78 | sql.append("WHERE e.contaBancaria.sequencial = :sequencialContaBancaria "); |
|
| - | 79 | sql.append("AND e.dataVencimento = :dataVencimento "); |
|
| - | 80 | sql.append("AND (e.dataPagamento is null OR e.dataPagamento = :dataVencimento) "); |
|
| - | 81 | sql.append(setarParametrosFormasDePagamento("e", formasDePagamento)); |
|
| - | 82 | sql.append("AND e.indicadorAtivo is true "); |
|
| - | 83 | sql.append("ORDER BY e.dataVencimento "); |
|
| - | 84 | try { |
|
| - | 85 | return getEntityManager().createQuery(sql.toString(), ParcelaDTO.class) |
|
| - | 86 | .setParameter("sequencialContaBancaria", sequencialContaBancaria) |
|
| - | 87 | .setParameter("dataVencimento", dataRecebimento) |
|
| - | 88 | .getResultList(); |
|
| 66 | } catch(Exception ex) { |
89 | } catch(Exception ex) { |
| 67 | ex.printStackTrace(); |
90 | ex.printStackTrace(); |
| 68 | return null; |
91 | return null; |
| 69 | }
|
92 | }
|
| 70 | }
|
93 | }
|