Rev 679 | Rev 730 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 679 | Rev 718 | ||
|---|---|---|---|
| Line 131... | Line 131... | ||
| 131 | }
|
131 | }
|
| 132 | return true;
|
132 | return true;
|
| 133 | }
|
133 | }
|
| 134 | */
|
134 | */
|
| 135 | 135 | ||
| 136 | public void extrairDadosArquivo() { |
- | |
| - | 136 | public void extrairDadosArquivo(Date dataAntecipacao) { |
|
| 137 | List<ExtratoAntecipacaoDTO> extratoAntecipacaoDTOs = new ArrayList<ExtratoAntecipacaoDTO>(); |
137 | List<ExtratoAntecipacaoDTO> extratoAntecipacaoDTOs = new ArrayList<ExtratoAntecipacaoDTO>(); |
| 138 | // setDadosExtratoBancoDTO(new ArrayList<ExtratoBancoDTO>());
|
138 | // setDadosExtratoBancoDTO(new ArrayList<ExtratoBancoDTO>());
|
| 139 | // getDadosExtratoBancoDTO().addAll(extrairDadosItau(extratosAnexadosAnteriormente));
|
139 | // getDadosExtratoBancoDTO().addAll(extrairDadosItau(extratosAnexadosAnteriormente));
|
| 140 | Long sequencial = new Long(1); |
140 | Long sequencial = new Long(1); |
| 141 | for (String linha : this.getLinhasArquivo()) { |
141 | for (String linha : this.getLinhasArquivo()) { |
| Line 173... | Line 173... | ||
| 173 | // [29] antecipada 758
|
173 | // [29] antecipada 758
|
| 174 | }
|
174 | }
|
| 175 | }
|
175 | }
|
| 176 | }
|
176 | }
|
| 177 | }
|
177 | }
|
| 178 | - | ||
| 179 | /*
|
- | |
| 180 | StringBuilder sqlConsulta = new StringBuilder();
|
- | |
| 181 | sqlConsulta.append("SELECT * FROM sc_sec.sec_parcela ");
|
- | |
| 182 | sqlConsulta.append("WHERE dat_pagamento IS NULL AND (");
|
- | |
| 183 | for (ExtratoAntecipacaoDTO extratoAntecipacaoDTO : extratoAntecipacaoDTOs) {
|
- | |
| 184 | // System.out.println(extratoAntecipacaoDTO.getSequencial() + " : " + extratoAntecipacaoDTO.getDataVencimento() + " : " + extratoAntecipacaoDTO.getValorLiquido() + " : " + extratoAntecipacaoDTO.getBandeira() + " : " + extratoAntecipacaoDTO.getNumeroDaParcela() + "/" + extratoAntecipacaoDTO.getQuantidadeParcelas());
|
- | |
| 185 | Double valorInicial = extratoAntecipacaoDTO.getValorLiquido() - 0.10;
|
- | |
| 186 | Double valorFinal = extratoAntecipacaoDTO.getValorLiquido() + 0.10;
|
- | |
| 187 | sqlConsulta.append("(dat_vencimento = '" + DateUtil.formatDate(extratoAntecipacaoDTO.getDataVencimento(), "yyyy-MM-dd") + "' AND ");
|
- | |
| 188 | sqlConsulta.append("val_valor >= " + valorInicial + " AND val_valor <= " + valorFinal + " AND ");
|
- | |
| 189 | sqlConsulta.append("dsc_observacao LIKE 'CRÉDITO " + extratoAntecipacaoDTO.getNumeroDaParcela() + "/" + extratoAntecipacaoDTO.getQuantidadeParcelas() + "%" + extratoAntecipacaoDTO.getBandeira() + "%') ");
|
- | |
| 190 | sqlConsulta.append("OR ");
|
- | |
| 191 | }
|
- | |
| 192 | sqlConsulta.append(")");
|
- | |
| 193 | // System.out.println(sqlConsulta.toString().replace("OR )", ")"));
|
- | |
| 194 | setSqlConsultaParcelas(sqlConsulta.toString().replace("OR )", ")"));
|
- | |
| 195 | */
|
- | |
| 196 | - | ||
| 197 | /*
|
- | |
| 198 | StringBuilder sqlConsulta = new StringBuilder();
|
- | |
| 199 | sqlConsulta.append("SELECT * FROM Parcela p");
|
- | |
| 200 | sqlConsulta.append("WHERE p.dataPagamento IS NULL AND (");
|
- | |
| 201 | for (ExtratoAntecipacaoDTO extratoAntecipacaoDTO : extratoAntecipacaoDTOs) {
|
- | |
| 202 | // System.out.println(extratoAntecipacaoDTO.getSequencial() + " : " + extratoAntecipacaoDTO.getDataVencimento() + " : " + extratoAntecipacaoDTO.getValorLiquido() + " : " + extratoAntecipacaoDTO.getBandeira() + " : " + extratoAntecipacaoDTO.getNumeroDaParcela() + "/" + extratoAntecipacaoDTO.getQuantidadeParcelas());
|
- | |
| 203 | Double valorInicial = extratoAntecipacaoDTO.getValorLiquido() - 0.10;
|
- | |
| 204 | Double valorFinal = extratoAntecipacaoDTO.getValorLiquido() + 0.10;
|
- | |
| 205 | sqlConsulta.append("(p.dataVencimento = '" + DateUtil.formatDate(extratoAntecipacaoDTO.getDataVencimento(), "yyyy-MM-dd") + "' AND ");
|
- | |
| 206 | sqlConsulta.append("p.valor >= " + valorInicial + " AND p.valor <= " + valorFinal + " AND ");
|
- | |
| 207 | sqlConsulta.append("p.observacao LIKE 'CRÉDITO " + extratoAntecipacaoDTO.getNumeroDaParcela() + "/" + extratoAntecipacaoDTO.getQuantidadeParcelas() + "%" + extratoAntecipacaoDTO.getBandeira() + "%') ");
|
- | |
| 208 | sqlConsulta.append("OR ");
|
- | |
| 209 | }
|
- | |
| 210 | sqlConsulta.append(")");
|
- | |
| 211 | System.out.println(sqlConsulta.toString().replace("OR )", ")"));
|
- | |
| 212 | */
|
- | |
| 213 | 178 | ||
| 214 | StringBuilder sqlConsulta = new StringBuilder(); |
179 | StringBuilder sqlConsulta = new StringBuilder(); |
| 215 | sqlConsulta.append("SELECT new br.com.ec.domain.dto.ParcelaDTO("); |
180 | sqlConsulta.append("SELECT new br.com.ec.domain.dto.ParcelaDTO("); |
| 216 | sqlConsulta.append(ParcelaDTO.CONSULTA_SEM_CATEGORIA_DTO); |
181 | sqlConsulta.append(ParcelaDTO.CONSULTA_SEM_CATEGORIA_DTO); |
| 217 | sqlConsulta.append(") FROM Parcela e "); |
182 | sqlConsulta.append(") FROM Parcela e "); |
| 218 | sqlConsulta.append("WHERE e.indicadorAtivo IS TRUE AND e.dataPagamento IS NULL AND ("); |
183 | sqlConsulta.append("WHERE e.indicadorAtivo IS TRUE AND e.dataPagamento IS NULL AND ("); |
| 219 | for (ExtratoAntecipacaoDTO extratoAntecipacaoDTO : extratoAntecipacaoDTOs) { |
184 | for (ExtratoAntecipacaoDTO extratoAntecipacaoDTO : extratoAntecipacaoDTOs) { |
| 220 | Double valorInicial = extratoAntecipacaoDTO.getValorLiquido() - 0.10; |
185 | Double valorInicial = extratoAntecipacaoDTO.getValorLiquido() - 0.10; |
| 221 | Double valorFinal = extratoAntecipacaoDTO.getValorLiquido() + 0.10; |
186 | Double valorFinal = extratoAntecipacaoDTO.getValorLiquido() + 0.10; |
| 222 | sqlConsulta.append("(e.dataVencimento = '" + DateUtil.formatDate(extratoAntecipacaoDTO.getDataVencimento(), "yyyy-MM-dd") + "' AND "); |
- | |
| - | 187 | sqlConsulta.append("("); |
|
| - | 188 | sqlConsulta.append("(e.dataVencimento = '" + DateUtil.formatDate(extratoAntecipacaoDTO.getDataVencimento(), "yyyy-MM-dd") + "' OR "); |
|
| - | 189 | sqlConsulta.append("e.dataVencimento = '" + DateUtil.formatDate(dataAntecipacao, "yyyy-MM-dd") + "'"); |
|
| - | 190 | sqlConsulta.append(") AND "); |
|
| 223 | sqlConsulta.append("e.valor >= " + valorInicial + " AND e.valor <= " + valorFinal + " AND "); |
191 | sqlConsulta.append("e.valor >= " + valorInicial + " AND e.valor <= " + valorFinal + " AND "); |
| 224 | sqlConsulta.append("e.observacao LIKE 'CRÉDITO " + extratoAntecipacaoDTO.getNumeroDaParcela() + "/" + extratoAntecipacaoDTO.getQuantidadeParcelas() + "%" + extratoAntecipacaoDTO.getBandeira() + "%') "); |
192 | sqlConsulta.append("e.observacao LIKE 'CRÉDITO " + extratoAntecipacaoDTO.getNumeroDaParcela() + "/" + extratoAntecipacaoDTO.getQuantidadeParcelas() + "%" + extratoAntecipacaoDTO.getBandeira() + "%') "); |
| 225 | sqlConsulta.append("OR "); |
193 | sqlConsulta.append("OR "); |
| 226 | }
|
194 | }
|
| 227 | sqlConsulta.append(")"); |
195 | sqlConsulta.append(")"); |
| 228 | // System.out.println(sqlConsulta.toString().replace("OR )", ")"));
|
- | |
| - | 196 | System.out.println(sqlConsulta.toString().replace("OR )", ")")); |
|
| 229 | 197 | ||
| 230 | setDadosExtratoAntecipacaoDTOSemConciliacao(extratoAntecipacaoDTOs); |
198 | setDadosExtratoAntecipacaoDTOSemConciliacao(extratoAntecipacaoDTOs); |
| 231 | setSqlConsultaParcelas(sqlConsulta.toString().replace("OR )", ")")); |
199 | setSqlConsultaParcelas(sqlConsulta.toString().replace("OR )", ")")); |
| 232 | }
|
200 | }
|
| 233 | 201 | ||