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.controller.managedbean.consultademanda.PessoaConsultaPorDemanda; |
18 | import br.com.ec.controller.managedbean.consultademanda.PessoaConsultaPorDemanda; |
| 19 | import br.com.ec.core.exception.NegocioException; |
19 | import br.com.ec.core.exception.NegocioException; |
| 20 | import br.com.ec.core.generic.GenericService; |
20 | import br.com.ec.core.generic.GenericService; |
| 21 | import br.com.ec.core.util.ArquivoUtil; |
21 | import br.com.ec.core.util.ArquivoUtil; |
| - | 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.ParametrosConsultaPessoaDTO; |
24 | import br.com.ec.domain.dto.ParametrosConsultaPessoaDTO; |
| 24 | import br.com.ec.domain.model.DadosBancarios; |
25 | import br.com.ec.domain.model.DadosBancarios; |
| 25 | import br.com.ec.domain.model.Endereco; |
26 | import br.com.ec.domain.model.Endereco; |
| 26 | import br.com.ec.domain.model.Fornecedor; |
27 | import br.com.ec.domain.model.Fornecedor; |
| Line 517... | Line 518... | ||
| 517 | return funcionarioService.consultarFuncionarioPorPessoa(pessoa); |
518 | return funcionarioService.consultarFuncionarioPorPessoa(pessoa); |
| 518 | }
|
519 | }
|
| 519 | 520 | ||
| 520 | public StreamedContent emitirFichaColaboradorEsocial() throws Exception { |
521 | public StreamedContent emitirFichaColaboradorEsocial() throws Exception { |
| 521 | ByteArrayInputStream input = new ByteArrayInputStream(pessoaService.emitirFichaColaboradorEsocial((ServletContext)FacesContext.getCurrentInstance().getExternalContext().getContext(), getEntidade())); |
522 | ByteArrayInputStream input = new ByteArrayInputStream(pessoaService.emitirFichaColaboradorEsocial((ServletContext)FacesContext.getCurrentInstance().getExternalContext().getContext(), getEntidade())); |
| 522 | return new DefaultStreamedContent(input, ArquivoUtil.retornarContentTypeArquivo("doc"), "formulario_esocial.doc"); |
- | |
| - | 523 | return DefaultStreamedContent.builder() |
|
| - | 524 | .contentType(TipoExtensao.WORD.getDescricao()) |
|
| - | 525 | .name("formulario_esocial.doc") |
|
| - | 526 | .stream(() -> input).build(); |
|
| 523 | }
|
527 | }
|
| 524 | 528 | ||
| 525 | public StreamedContent emitirExameAdmissional() throws Exception { |
529 | public StreamedContent emitirExameAdmissional() throws Exception { |
| 526 | ByteArrayInputStream input = new ByteArrayInputStream(pessoaService.emitirTermoAdmissional((ServletContext)FacesContext.getCurrentInstance().getExternalContext().getContext(), getEntidade())); |
530 | ByteArrayInputStream input = new ByteArrayInputStream(pessoaService.emitirTermoAdmissional((ServletContext)FacesContext.getCurrentInstance().getExternalContext().getContext(), getEntidade())); |
| 527 | return new DefaultStreamedContent(input, ArquivoUtil.retornarContentTypeArquivo("docx"), "exameAdmissional.docx"); |
- | |
| - | 531 | return DefaultStreamedContent.builder() |
|
| - | 532 | .contentType(TipoExtensao.WORD.getDescricao()) |
|
| - | 533 | .name("exameAdmissional.docx") |
|
| - | 534 | .stream(() -> input).build(); |
|
| 528 | }
|
535 | }
|
| 529 | 536 | ||
| 530 | public StreamedContent emitirExameDemissional() throws Exception { |
537 | public StreamedContent emitirExameDemissional() throws Exception { |
| 531 | ByteArrayInputStream input = new ByteArrayInputStream(pessoaService.emitirTermoDemissional((ServletContext)FacesContext.getCurrentInstance().getExternalContext().getContext(), getEntidade())); |
538 | ByteArrayInputStream input = new ByteArrayInputStream(pessoaService.emitirTermoDemissional((ServletContext)FacesContext.getCurrentInstance().getExternalContext().getContext(), getEntidade())); |
| 532 | return new DefaultStreamedContent(input, ArquivoUtil.retornarContentTypeArquivo("docx"), "exameDemissional.docx"); |
- | |
| - | 539 | return DefaultStreamedContent.builder() |
|
| - | 540 | .contentType(TipoExtensao.WORD.getDescricao()) |
|
| - | 541 | .name("exameDemissional.docx") |
|
| - | 542 | .stream(() -> input).build(); |
|
| 533 | }
|
543 | }
|
| 534 | 544 | ||
| 535 | }
|
545 | }
|