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