Rev 299 | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 299 | espaco | 1 | package br.com.ec.controller; |
| 2 | |||
| 325 | espaco | 3 | import java.io.ByteArrayInputStream; |
| 299 | espaco | 4 | import java.io.Serializable; |
| 5 | |||
| 325 | espaco | 6 | import javax.faces.context.FacesContext; |
| 299 | espaco | 7 | import javax.inject.Inject; |
| 8 | import javax.inject.Named; |
||
| 325 | espaco | 9 | import javax.servlet.ServletContext; |
| 299 | espaco | 10 | |
| 325 | espaco | 11 | import org.primefaces.model.DefaultStreamedContent; |
| 12 | import org.primefaces.model.StreamedContent; |
||
| 299 | espaco | 13 | import org.springframework.context.annotation.Scope; |
| 14 | |||
| 15 | import br.com.ec.controller.consultademanda.PessoaConsultaPorDemanda; |
||
| 16 | import br.com.ec.core.generic.GenericService; |
||
| 325 | espaco | 17 | import br.com.ec.core.util.ArquivoUtil; |
| 299 | espaco | 18 | import br.com.ec.domain.dto.PessoaDTO; |
| 19 | import br.com.ec.domain.dto.consulta.ParametrosConsultaPessoasDTO; |
||
| 325 | espaco | 20 | import br.com.ec.domain.model.tipos.TipoEscolaridade; |
| 21 | import br.com.ec.domain.model.tipos.TipoEstadoCivil; |
||
| 22 | import br.com.ec.domain.model.tipos.TipoRacaCor; |
||
| 299 | espaco | 23 | import br.com.ec.domain.service.PessoaService; |
| 24 | import br.com.ec.web.generic.AbstractBean; |
||
| 25 | import br.com.ec.web.util.TipoOperacao; |
||
| 26 | |||
| 27 | @Named |
||
| 28 | @Scope("view") |
||
| 29 | public class PessoaBean extends AbstractBean<PessoaDTO> implements Serializable { |
||
| 30 | |||
| 31 | private static final long serialVersionUID = 1L; |
||
| 32 | |||
| 33 | private PessoaService pessoaService; |
||
| 34 | |||
| 35 | private ParametrosConsultaPessoasDTO parametrosConsultaPessoasDTO; |
||
| 36 | private PessoaConsultaPorDemanda lazy; |
||
| 37 | /* |
||
| 38 | private ParametrosConsultaPessoaDTO parametrosConsultaPessoaDTO; |
||
| 39 | |||
| 40 | private UsuarioService usuarioService; |
||
| 41 | private FuncionarioService funcionarioService; |
||
| 42 | private VendedorService vendedorService; |
||
| 43 | private FornecedorService fornecedorService; |
||
| 44 | |||
| 45 | private Endereco endereco; |
||
| 46 | private List<Endereco> enderecos; |
||
| 47 | private DadosBancarios dadosBancarios; |
||
| 48 | private List<DadosBancarios> listaDadosBancarios; |
||
| 49 | private Usuario usuario; |
||
| 50 | private Perfil perfilSelecionado; |
||
| 51 | private Papel papelSelecionado; |
||
| 52 | private Loja lojaSelecionada; |
||
| 53 | private Funcionario funcionario; |
||
| 54 | private Vendedor vendedor; |
||
| 55 | private Fornecedor fornecedor; |
||
| 56 | private List<Pessoa> listaPessoasJuridicas; |
||
| 57 | */ |
||
| 58 | |||
| 59 | @Inject |
||
| 60 | public PessoaBean(PessoaConsultaPorDemanda lazy, PessoaService pessoaService/*, UsuarioService usuarioService, |
||
| 61 | FuncionarioService funcionarioService, VendedorService vendedorService, FornecedorService fornecedorService*/) { |
||
| 62 | this.lazy = lazy; |
||
| 63 | this.pessoaService = pessoaService; |
||
| 64 | // this.usuarioService = usuarioService; |
||
| 65 | // this.funcionarioService = funcionarioService; |
||
| 66 | // this.vendedorService = vendedorService; |
||
| 67 | // this.fornecedorService = fornecedorService; |
||
| 68 | } |
||
| 69 | |||
| 70 | @Override |
||
| 71 | public void preCarregamento() { |
||
| 72 | parametrosConsultaPessoasDTO = new ParametrosConsultaPessoasDTO(); |
||
| 73 | prepararConsultaDemanda(); |
||
| 74 | limparEntidade(); |
||
| 75 | } |
||
| 76 | |||
| 77 | @Override |
||
| 78 | public void limparEntidade() { |
||
| 79 | // Pessoa pessoa = new Pessoa(); |
||
| 80 | // setEnderecos(new ArrayList<Endereco>()); |
||
| 81 | // setListaDadosBancarios(new ArrayList<DadosBancarios>()); |
||
| 82 | // setEntidade(pessoa); |
||
| 83 | // setUsuario(null); |
||
| 84 | // setFuncionario(null); |
||
| 85 | // setVendedor(null); |
||
| 86 | // setFornecedor(null); |
||
| 87 | } |
||
| 88 | |||
| 89 | @Override |
||
| 90 | public GenericService<PessoaDTO> getService() { |
||
| 91 | return null; |
||
| 92 | } |
||
| 93 | |||
| 94 | @Override |
||
| 95 | public PessoaDTO getEntidade() { |
||
| 96 | return entidade; |
||
| 97 | } |
||
| 98 | |||
| 99 | @Override |
||
| 100 | public void preConsultar() { |
||
| 101 | setTipoOperacao(TipoOperacao.CONSULTAR); |
||
| 102 | } |
||
| 103 | |||
| 104 | @Override |
||
| 105 | public PessoaDTO getId() { |
||
| 106 | return getEntidade(); |
||
| 107 | } |
||
| 108 | |||
| 109 | public ParametrosConsultaPessoasDTO getParametrosConsultaPessoasDTO() { |
||
| 110 | return parametrosConsultaPessoasDTO; |
||
| 111 | } |
||
| 112 | public void setParametrosConsultaPessoasDTO(ParametrosConsultaPessoasDTO parametrosConsultaPessoasDTO) { |
||
| 113 | this.parametrosConsultaPessoasDTO = parametrosConsultaPessoasDTO; |
||
| 114 | } |
||
| 115 | |||
| 116 | public PessoaConsultaPorDemanda getLazy() { |
||
| 117 | return lazy; |
||
| 118 | } |
||
| 119 | public void setLazy(PessoaConsultaPorDemanda lazy) { |
||
| 120 | this.lazy = lazy; |
||
| 121 | } |
||
| 122 | public void prepararConsultaDemanda() { |
||
| 123 | lazy.setarParametrosConsulta(getParametrosConsultaPessoasDTO()); |
||
| 124 | } |
||
| 125 | |||
| 325 | espaco | 126 | |
| 127 | |||
| 299 | espaco | 128 | } |