Rev 289 | Rev 337 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 289 | Rev 328 | ||
|---|---|---|---|
| Line 35... | Line 35... | ||
| 35 | import br.com.ec.domain.model.ItemAvaliacao; |
35 | import br.com.ec.domain.model.ItemAvaliacao; |
| 36 | import br.com.ec.domain.model.Loja; |
36 | import br.com.ec.domain.model.Loja; |
| 37 | import br.com.ec.domain.model.Pessoa; |
37 | import br.com.ec.domain.model.Pessoa; |
| 38 | import br.com.ec.domain.model.Vendedor; |
38 | import br.com.ec.domain.model.Vendedor; |
| 39 | import br.com.ec.domain.model.Vigencia; |
39 | import br.com.ec.domain.model.Vigencia; |
| - | 40 | import br.com.ec.domain.model.tipos.TipoComissionamento; |
|
| 40 | import br.com.ec.domain.model.tipos.TipoFaixaComissao; |
41 | import br.com.ec.domain.model.tipos.TipoFaixaComissao; |
| 41 | import br.com.ec.domain.service.avaliacao.AvaliacaoService; |
42 | import br.com.ec.domain.service.avaliacao.AvaliacaoService; |
| 42 | import br.com.ec.domain.service.avaliacaofuncionario.AvaliacaoFuncionarioService; |
43 | import br.com.ec.domain.service.avaliacaofuncionario.AvaliacaoFuncionarioService; |
| 43 | import br.com.ec.domain.service.avaliacaoloja.AvaliacaoLojaService; |
44 | import br.com.ec.domain.service.avaliacaoloja.AvaliacaoLojaService; |
| 44 | import br.com.ec.domain.service.itemavaliacao.ItemAvaliacaoService; |
45 | import br.com.ec.domain.service.itemavaliacao.ItemAvaliacaoService; |
| Line 478... | Line 479... | ||
| 478 | public StreamedContent emitirRelatorioImportacaoFolhaPagamento(final String codigoEmpresa) { |
479 | public StreamedContent emitirRelatorioImportacaoFolhaPagamento(final String codigoEmpresa) { |
| 479 | return new VerificadorLancamentoException().verificarLancamentoException(new CommandRelatorioStreamedContent() { |
480 | return new VerificadorLancamentoException().verificarLancamentoException(new CommandRelatorioStreamedContent() { |
| 480 | @Override |
481 | @Override |
| 481 | public StreamedContent execute() { |
482 | public StreamedContent execute() { |
| 482 | String nomeArquivo = ""; |
483 | String nomeArquivo = ""; |
| - | 484 | Long empresa = null; |
|
| 483 | if (ConstantesSEC.Empresa.CODIGO_EMPRESA_ESPACO_CASE_1.equals(new Long(codigoEmpresa))) { |
485 | if (ConstantesSEC.Empresa.CODIGO_EMPRESA_ESPACO_CASE_1.equals(new Long(codigoEmpresa))) { |
| 484 | nomeArquivo = "Relatório de Importação - Folha de Pagamento Espaço Case.xls"; |
486 | nomeArquivo = "Relatório de Importação - Folha de Pagamento Espaço Case.xls"; |
| - | 487 | empresa = TipoComissionamento.COMISSSIONAMENTO_ESPACO_CASE.getEmpresa(); |
|
| 485 | } else if (ConstantesSEC.Empresa.CODIGO_EMPRESA_CASA_DAS_CAPAS_4.equals(new Long(codigoEmpresa))) { |
488 | } else if (ConstantesSEC.Empresa.CODIGO_EMPRESA_CASA_DAS_CAPAS_4.equals(new Long(codigoEmpresa))) { |
| 486 | nomeArquivo = "Relatório de Importação - Folha de Pagamento Casa das Capas.xls"; |
489 | nomeArquivo = "Relatório de Importação - Folha de Pagamento Casa das Capas.xls"; |
| - | 490 | empresa = TipoComissionamento.COMISSSIONAMENTO_CASA_DAS_CAPAS.getEmpresa(); |
|
| 487 | }
|
491 | }
|
| 488 | try { |
492 | try { |
| 489 | ByteArrayInputStream input = new ByteArrayInputStream(avaliacaoService.emitirRelatorioImportacaoFolhaPagamento((ServletContext)FacesContext.getCurrentInstance().getExternalContext().getContext(), getEntidade())); |
- | |
| - | 493 | ByteArrayInputStream input = new ByteArrayInputStream(avaliacaoService.emitirRelatorioImportacaoFolhaPagamento((ServletContext)FacesContext.getCurrentInstance().getExternalContext().getContext(), getEntidade(), empresa)); |
|
| 490 | return new DefaultStreamedContent(input, ArquivoUtil.retornarContentTypeArquivo("xls"), nomeArquivo); |
494 | return new DefaultStreamedContent(input, ArquivoUtil.retornarContentTypeArquivo("xls"), nomeArquivo); |
| 491 | } catch (IOException e) { |
495 | } catch (IOException e) { |
| 492 | e.printStackTrace(); |
496 | e.printStackTrace(); |
| 493 | } catch (NegocioException nex) { |
497 | } catch (NegocioException nex) { |
| 494 | LancadorMensagem.lancarErro(nex.getMessage()); |
498 | LancadorMensagem.lancarErro(nex.getMessage()); |