Rev 200 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 200 | Rev 204 | ||
|---|---|---|---|
| Line 17... | Line 17... | ||
| 17 | 17 | ||
| 18 | import br.com.ec.core.consulta.ParametrosConsulta; |
18 | import br.com.ec.core.consulta.ParametrosConsulta; |
| 19 | import br.com.ec.core.generic.GenericService; |
19 | import br.com.ec.core.generic.GenericService; |
| 20 | import br.com.ec.core.util.ArquivoUtil; |
20 | import br.com.ec.core.util.ArquivoUtil; |
| 21 | import br.com.ec.core.util.StringUtil; |
21 | import br.com.ec.core.util.StringUtil; |
| - | 22 | import br.com.ec.core.util.TipoExtensao; |
|
| 22 | import br.com.ec.core.util.VerificadorUtil; |
23 | import br.com.ec.core.util.VerificadorUtil; |
| 23 | import br.com.ec.domain.dto.ParametrosConsultaVendasDTO; |
24 | import br.com.ec.domain.dto.ParametrosConsultaVendasDTO; |
| 24 | import br.com.ec.domain.dto.ParametrosConsultaVendasVivoDTO; |
25 | import br.com.ec.domain.dto.ParametrosConsultaVendasVivoDTO; |
| 25 | import br.com.ec.domain.dto.RankingVendedorDTO; |
26 | import br.com.ec.domain.dto.RankingVendedorDTO; |
| 26 | import br.com.ec.domain.model.Avaliacao; |
27 | import br.com.ec.domain.model.Avaliacao; |
| Line 468... | Line 469... | ||
| 468 | }
|
469 | }
|
| 469 | }); |
470 | }); |
| 470 | }
|
471 | }
|
| 471 | 472 | ||
| 472 | public StreamedContent emitirRelatorioImportacaoFolhaPagamento(String codigoEmpresa) throws Exception { |
473 | public StreamedContent emitirRelatorioImportacaoFolhaPagamento(String codigoEmpresa) throws Exception { |
| 473 | String nomeArquivo = ""; |
- | |
| - | 474 | String nomeDoArquivo = ""; |
|
| 474 | if (ConstantesSEC.Empresa.CODIGO_EMPRESA_ESPACO_CASE_1.equals(new Long(codigoEmpresa))) { |
475 | if (ConstantesSEC.Empresa.CODIGO_EMPRESA_ESPACO_CASE_1.equals(new Long(codigoEmpresa))) { |
| 475 | nomeArquivo = "Relatório de Importação - Folha de Pagamento Espaço Case.xls"; |
- | |
| - | 476 | nomeDoArquivo = "Relatório de Importação - Folha de Pagamento Espaço Case.xls"; |
|
| 476 | } else if (ConstantesSEC.Empresa.CODIGO_EMPRESA_CASA_DAS_CAPAS_4.equals(new Long(codigoEmpresa))) { |
477 | } else if (ConstantesSEC.Empresa.CODIGO_EMPRESA_CASA_DAS_CAPAS_4.equals(new Long(codigoEmpresa))) { |
| 477 | nomeArquivo = "Relatório de Importação - Folha de Pagamento Casa das Capas.xls"; |
- | |
| - | 478 | nomeDoArquivo = "Relatório de Importação - Folha de Pagamento Casa das Capas.xls"; |
|
| 478 | }
|
479 | }
|
| 479 | ByteArrayInputStream input = new ByteArrayInputStream(avaliacaoService.emitirRelatorioImportacaoFolhaPagamento((ServletContext)FacesContext.getCurrentInstance().getExternalContext().getContext(), getEntidade())); |
480 | ByteArrayInputStream input = new ByteArrayInputStream(avaliacaoService.emitirRelatorioImportacaoFolhaPagamento((ServletContext)FacesContext.getCurrentInstance().getExternalContext().getContext(), getEntidade())); |
| 480 | return new DefaultStreamedContent(input, ArquivoUtil.retornarContentTypeArquivo("xls"), nomeArquivo); |
- | |
| - | 481 | return DefaultStreamedContent.builder() |
|
| - | 482 | .contentType(TipoExtensao.EXCEL.getDescricao()) |
|
| - | 483 | .name(nomeDoArquivo) |
|
| - | 484 | .stream(() -> input).build(); |
|
| 481 | }
|
485 | }
|
| 482 | 486 | ||
| 483 | }
|
487 | }
|