Rev 670 | Rev 678 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 670 | Rev 671 | ||
|---|---|---|---|
| Line 2... | Line 2... | ||
| 2 | 2 | ||
| 3 | import java.util.ArrayList; |
3 | import java.util.ArrayList; |
| - | 4 | import java.util.Date; |
|
| 4 | import java.util.List; |
5 | import java.util.List; |
| 5 | 6 | ||
| 6 | import org.apache.commons.httpclient.util.DateUtil; |
7 | import org.apache.commons.httpclient.util.DateUtil; |
| 7 | import org.primefaces.model.file.UploadedFile; |
8 | import org.primefaces.model.file.UploadedFile; |
| 8 | 9 | ||
| Line 10... | Line 11... | ||
| 10 | import br.com.ec.core.util.VerificadorUtil; |
11 | import br.com.ec.core.util.VerificadorUtil; |
| 11 | import br.com.ec.web.util.DataUtil; |
12 | import br.com.ec.web.util.DataUtil; |
| 12 | 13 | ||
| 13 | public class ExtratoAntecipacaoArquivoDTO { |
14 | public class ExtratoAntecipacaoArquivoDTO { |
| 14 | 15 | ||
| - | 16 | private Date dataRecebimento; |
|
| 15 | private ContaBancariaDTO contaBancariaDTO; |
17 | private ContaBancariaDTO contaBancariaDTO; |
| 16 | private UploadedFile arquivoAntecipacao; |
18 | private UploadedFile arquivoAntecipacao; |
| 17 | private List<String> linhasArquivo; |
19 | private List<String> linhasArquivo; |
| 18 | private String sqlConsultaParcelas; |
20 | private String sqlConsultaParcelas; |
| - | 21 | private String sqlAtualizacaoParcelas; |
|
| 19 | 22 | ||
| 20 | private List<ExtratoAntecipacaoDTO> dadosExtratoAntecipacaoDTO; |
23 | private List<ExtratoAntecipacaoDTO> dadosExtratoAntecipacaoDTO; |
| 21 | private List<ExtratoAntecipacaoDTO> dadosExtratoAntecipacaoDTOSemConciliacao; |
24 | private List<ExtratoAntecipacaoDTO> dadosExtratoAntecipacaoDTOSemConciliacao; |
| 22 | 25 | ||
| 23 | public ExtratoAntecipacaoArquivoDTO() { |
26 | public ExtratoAntecipacaoArquivoDTO() { |
| Line 25... | Line 28... | ||
| 25 | }
|
28 | }
|
| 26 | 29 | ||
| 27 | public ExtratoAntecipacaoArquivoDTO(UploadedFile arquivoAntecipacao) { |
30 | public ExtratoAntecipacaoArquivoDTO(UploadedFile arquivoAntecipacao) { |
| 28 | super(); |
31 | super(); |
| 29 | this.arquivoAntecipacao = arquivoAntecipacao; |
32 | this.arquivoAntecipacao = arquivoAntecipacao; |
| - | 33 | }
|
|
| - | 34 | ||
| - | 35 | public Date getDataRecebimento() { |
|
| - | 36 | return dataRecebimento; |
|
| - | 37 | }
|
|
| - | 38 | public void setDataRecebimento(Date dataRecebimento) { |
|
| - | 39 | this.dataRecebimento = dataRecebimento; |
|
| 30 | }
|
40 | }
|
| 31 | 41 | ||
| 32 | public ContaBancariaDTO getContaBancariaDTO() { |
42 | public ContaBancariaDTO getContaBancariaDTO() { |
| 33 | return contaBancariaDTO; |
43 | return contaBancariaDTO; |
| 34 | }
|
44 | }
|
| Line 53... | Line 63... | ||
| 53 | public String getSqlConsultaParcelas() { |
63 | public String getSqlConsultaParcelas() { |
| 54 | return sqlConsultaParcelas; |
64 | return sqlConsultaParcelas; |
| 55 | }
|
65 | }
|
| 56 | public void setSqlConsultaParcelas(String sqlConsultaParcelas) { |
66 | public void setSqlConsultaParcelas(String sqlConsultaParcelas) { |
| 57 | this.sqlConsultaParcelas = sqlConsultaParcelas; |
67 | this.sqlConsultaParcelas = sqlConsultaParcelas; |
| - | 68 | }
|
|
| - | 69 | ||
| - | 70 | public String getSqlAtualizacaoParcelas() { |
|
| - | 71 | return sqlAtualizacaoParcelas; |
|
| - | 72 | }
|
|
| - | 73 | public void setSqlAtualizacaoParcelas(String sqlAtualizacaoParcelas) { |
|
| - | 74 | this.sqlAtualizacaoParcelas = sqlAtualizacaoParcelas; |
|
| 58 | }
|
75 | }
|
| 59 | 76 | ||
| 60 | public List<ExtratoAntecipacaoDTO> getDadosExtratoAntecipacaoDTO() { |
77 | public List<ExtratoAntecipacaoDTO> getDadosExtratoAntecipacaoDTO() { |
| 61 | return dadosExtratoAntecipacaoDTO; |
78 | return dadosExtratoAntecipacaoDTO; |
| 62 | }
|
79 | }
|
| Line 84... | Line 101... | ||
| 84 | }
|
101 | }
|
| 85 | return true;
|
102 | return true;
|
| 86 | }
|
103 | }
|
| 87 | */
|
104 | */
|
| 88 | 105 | ||
| 89 | public void extrairConsultaSQL() { |
- | |
| - | 106 | public void extrairDadosArquivo() { |
|
| 90 | List<ExtratoAntecipacaoDTO> extratoAntecipacaoDTOs = new ArrayList<ExtratoAntecipacaoDTO>(); |
107 | List<ExtratoAntecipacaoDTO> extratoAntecipacaoDTOs = new ArrayList<ExtratoAntecipacaoDTO>(); |
| 91 | // setDadosExtratoBancoDTO(new ArrayList<ExtratoBancoDTO>());
|
108 | // setDadosExtratoBancoDTO(new ArrayList<ExtratoBancoDTO>());
|
| 92 | // getDadosExtratoBancoDTO().addAll(extrairDadosItau(extratosAnexadosAnteriormente));
|
109 | // getDadosExtratoBancoDTO().addAll(extrairDadosItau(extratosAnexadosAnteriormente));
|
| 93 | Long sequencial = new Long(1); |
110 | Long sequencial = new Long(1); |
| 94 | for (String linha : this.getLinhasArquivo()) { |
111 | for (String linha : this.getLinhasArquivo()) { |
| Line 100... | Line 117... | ||
| 100 | if (VerificadorUtil.naoEstaNuloOuVazio(dadosSeparados[2])) { |
117 | if (VerificadorUtil.naoEstaNuloOuVazio(dadosSeparados[2])) { |
| 101 | if (dadosSeparados[29].contains("antecipada")) { |
118 | if (dadosSeparados[29].contains("antecipada")) { |
| 102 | ExtratoAntecipacaoDTO extratoAntecipacaoDTO = new ExtratoAntecipacaoDTO(); |
119 | ExtratoAntecipacaoDTO extratoAntecipacaoDTO = new ExtratoAntecipacaoDTO(); |
| 103 | extratoAntecipacaoDTO.setSequencial(sequencial); |
120 | extratoAntecipacaoDTO.setSequencial(sequencial); |
| 104 | sequencial++;
|
121 | sequencial++;
|
| - | 122 | extratoAntecipacaoDTO.setDataRecebimento(DataUtil.retornarDataApartirString("dd/MM/yyyy", dadosSeparados[0])); |
|
| 105 | extratoAntecipacaoDTO.setDataVencimento(DataUtil.retornarDataApartirString("dd/MM/yyyy", dadosSeparados[2])); |
123 | extratoAntecipacaoDTO.setDataVencimento(DataUtil.retornarDataApartirString("dd/MM/yyyy", dadosSeparados[2])); |
| 106 | Double valor = 0.0; |
124 | Double valor = 0.0; |
| 107 | if (VerificadorUtil.naoEstaNuloOuVazio(dadosSeparados[7])) { |
125 | if (VerificadorUtil.naoEstaNuloOuVazio(dadosSeparados[7])) { |
| 108 | String valorLinha = dadosSeparados[7].replace("R$", "").trim(); |
126 | String valorLinha = dadosSeparados[7].replace("R$", "").trim(); |
| 109 | valor = new Double(valorLinha.replace(".", "").replace(",", ".") ); |
127 | valor = new Double(valorLinha.replace(".", "").replace(",", ".") ); |