Rev 667 | Rev 669 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 667 | Rev 668 | ||
|---|---|---|---|
| Line 1... | Line 1... | ||
| 1 | package br.com.ec.domain.dto; |
1 | package br.com.ec.domain.dto; |
| 2 | 2 | ||
| 3 | import java.util.ArrayList; |
3 | import java.util.ArrayList; |
| 4 | import java.util.List; |
4 | import java.util.List; |
| 5 | 5 | ||
| - | 6 | import org.apache.commons.httpclient.util.DateUtil; |
|
| 6 | import org.primefaces.model.file.UploadedFile; |
7 | import org.primefaces.model.file.UploadedFile; |
| 7 | 8 | ||
| 8 | import br.com.ec.core.util.DataUtils; |
9 | import br.com.ec.core.util.DataUtils; |
| - | 10 | import br.com.ec.core.util.StringUtil; |
|
| 9 | import br.com.ec.core.util.VerificadorUtil; |
11 | import br.com.ec.core.util.VerificadorUtil; |
| 10 | import br.com.ec.domain.model.tipos.TipoConciliacao; |
12 | import br.com.ec.domain.model.tipos.TipoConciliacao; |
| 11 | import br.com.ec.domain.model.tipos.TipoExtratoBancarioCsv; |
13 | import br.com.ec.domain.model.tipos.TipoExtratoBancarioCsv; |
| 12 | import br.com.ec.domain.model.tipos.TipoExtratoBanco; |
14 | import br.com.ec.domain.model.tipos.TipoExtratoBanco; |
| 13 | import br.com.ec.web.util.DataUtil; |
15 | import br.com.ec.web.util.DataUtil; |
| Line 101... | Line 103... | ||
| 101 | if (VerificadorUtil.naoEstaNuloOuVazio(dadosSeparados[7])) { |
103 | if (VerificadorUtil.naoEstaNuloOuVazio(dadosSeparados[7])) { |
| 102 | String valorLinha = dadosSeparados[7].replace("R$", "").trim(); |
104 | String valorLinha = dadosSeparados[7].replace("R$", "").trim(); |
| 103 | valor = new Double(valorLinha.replace(".", "").replace(",", ".") ); |
105 | valor = new Double(valorLinha.replace(".", "").replace(",", ".") ); |
| 104 | }
|
106 | }
|
| 105 | extratoAntecipacaoDTO.setValorLiquido(valor); |
107 | extratoAntecipacaoDTO.setValorLiquido(valor); |
| - | 108 | extratoAntecipacaoDTO.setBandeira(StringUtil.setarUpperCaseComTrim(dadosSeparados[21])); |
|
| - | 109 | extratoAntecipacaoDTO.setQuantidadeParcelas(new Integer(dadosSeparados[22])); |
|
| - | 110 | extratoAntecipacaoDTO.setNumeroDaParcela(new Integer(dadosSeparados[23])); |
|
| 106 | extratoAntecipacaoDTOs.add(extratoAntecipacaoDTO); |
111 | extratoAntecipacaoDTOs.add(extratoAntecipacaoDTO); |
| 107 | // [20] Débito ou Crédito
|
112 | // [20] Débito ou Crédito
|
| 108 | // [21] Elo, Hipercard, Mastercard, Visa...
|
113 | // [21] Elo, Hipercard, Mastercard, Visa...
|
| 109 | // [22] Qnt de parcelas
|
114 | // [22] Qnt de parcelas
|
| 110 | // [23] Número da parcela
|
115 | // [23] Número da parcela
|
| Line 112... | Line 117... | ||
| 112 | }
|
117 | }
|
| 113 | }
|
118 | }
|
| 114 | }
|
119 | }
|
| 115 | }
|
120 | }
|
| 116 | 121 | ||
| - | 122 | StringBuilder sqlConsulta = new StringBuilder(); |
|
| - | 123 | sqlConsulta.append("SELECT * FROM sc_sec.sec_parcela "); |
|
| - | 124 | sqlConsulta.append("WHERE dat_pagamento IS NULL AND ("); |
|
| 117 | for (ExtratoAntecipacaoDTO extratoAntecipacaoDTO : extratoAntecipacaoDTOs) { |
125 | for (ExtratoAntecipacaoDTO extratoAntecipacaoDTO : extratoAntecipacaoDTOs) { |
| 118 | System.out.println(extratoAntecipacaoDTO.getSequencial() + " : " + extratoAntecipacaoDTO.getDataVencimento() + " : " + extratoAntecipacaoDTO.getValorLiquido()); |
- | |
| 119 | - | ||
| - | 126 | // System.out.println(extratoAntecipacaoDTO.getSequencial() + " : " + extratoAntecipacaoDTO.getDataVencimento() + " : " + extratoAntecipacaoDTO.getValorLiquido() + " : " + extratoAntecipacaoDTO.getBandeira() + " : " + extratoAntecipacaoDTO.getNumeroDaParcela() + "/" + extratoAntecipacaoDTO.getQuantidadeParcelas());
|
|
| - | 127 | Double valorInicial = extratoAntecipacaoDTO.getValorLiquido() - 0.10; |
|
| - | 128 | Double valorFinal = extratoAntecipacaoDTO.getValorLiquido() + 0.10; |
|
| - | 129 | sqlConsulta.append("(dat_vencimento = '" + DateUtil.formatDate(extratoAntecipacaoDTO.getDataVencimento(), "yyyy-MM-dd") + "' AND "); |
|
| - | 130 | sqlConsulta.append("val_valor >= " + valorInicial + " AND val_valor <= " + valorFinal + " AND "); |
|
| - | 131 | sqlConsulta.append("dsc_observacao LIKE 'CRÉDITO " + extratoAntecipacaoDTO.getNumeroDaParcela() + "/" + extratoAntecipacaoDTO.getQuantidadeParcelas() + "%" + extratoAntecipacaoDTO.getBandeira() + "%') "); |
|
| - | 132 | sqlConsulta.append("OR "); |
|
| 120 | }
|
133 | }
|
| - | 134 | sqlConsulta.append(")"); |
|
| - | 135 | System.out.println(sqlConsulta.toString().replace("OR )", ")")); |
|
| - | 136 | ||
| - | 137 | /*
|
|
| - | 138 | StringBuilder sqlConsulta = new StringBuilder();
|
|
| - | 139 | sqlConsulta.append("SELECT * FROM Parcela p");
|
|
| - | 140 | sqlConsulta.append("WHERE p.dataPagamento IS NULL AND (");
|
|
| - | 141 | for (ExtratoAntecipacaoDTO extratoAntecipacaoDTO : extratoAntecipacaoDTOs) {
|
|
| - | 142 | // System.out.println(extratoAntecipacaoDTO.getSequencial() + " : " + extratoAntecipacaoDTO.getDataVencimento() + " : " + extratoAntecipacaoDTO.getValorLiquido() + " : " + extratoAntecipacaoDTO.getBandeira() + " : " + extratoAntecipacaoDTO.getNumeroDaParcela() + "/" + extratoAntecipacaoDTO.getQuantidadeParcelas());
|
|
| - | 143 | Double valorInicial = extratoAntecipacaoDTO.getValorLiquido() - 0.10;
|
|
| - | 144 | Double valorFinal = extratoAntecipacaoDTO.getValorLiquido() + 0.10;
|
|
| - | 145 | sqlConsulta.append("(p.dataVencimento = '" + DateUtil.formatDate(extratoAntecipacaoDTO.getDataVencimento(), "yyyy-MM-dd") + "' AND ");
|
|
| - | 146 | sqlConsulta.append("p.valor >= " + valorInicial + " AND p.valor <= " + valorFinal + " AND ");
|
|
| - | 147 | sqlConsulta.append("p.observacao LIKE 'CRÉDITO " + extratoAntecipacaoDTO.getNumeroDaParcela() + "/" + extratoAntecipacaoDTO.getQuantidadeParcelas() + "%" + extratoAntecipacaoDTO.getBandeira() + "%') ");
|
|
| - | 148 | sqlConsulta.append("OR ");
|
|
| - | 149 | }
|
|
| - | 150 | sqlConsulta.append(")");
|
|
| - | 151 | System.out.println(sqlConsulta.toString().replace("OR )", ")"));
|
|
| - | 152 | */
|
|
| - | 153 | ||
| - | 154 | // CONSULTA COM AS PARCELAS
|
|
| - | 155 | ||
| - | 156 | // IDENTIFICAÇÃO DAS PARCELAS
|
|
| - | 157 | ||
| - | 158 | // CONCILIAÇÃO
|
|
| 121 | }
|
159 | }
|
| 122 | 160 | ||
| 123 | public void extrairDados(List<ExtratoAntecipacaoArquivoDTO> extratosAnexadosAnteriormente) { |
161 | public void extrairDados(List<ExtratoAntecipacaoArquivoDTO> extratosAnexadosAnteriormente) { |
| 124 | // if (getTipoExtratoBancarioCsv().equals(TipoExtratoBancarioCsv.EXTRATO_BANCARIO_CSV_ITAU.getValor())) {
|
162 | // if (getTipoExtratoBancarioCsv().equals(TipoExtratoBancarioCsv.EXTRATO_BANCARIO_CSV_ITAU.getValor())) {
|
| 125 | // setDadosExtratoBancoDTO(new ArrayList<ExtratoBancoDTO>());
|
163 | // setDadosExtratoBancoDTO(new ArrayList<ExtratoBancoDTO>());
|