Rev 264 | Go to most recent revision | Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 261 | 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.core.generic.GenericService; |
||
| 11 | import br.com.ec.domain.dto.consulta.ParametrosConsultaVendasDTO; |
||
| 12 | import br.com.ec.domain.dto.consulta.ParametrosPeriodoDTO; |
||
| 13 | import br.com.ec.domain.dto.grafico.GraficoBarraDTO; |
||
| 14 | import br.com.ec.domain.model.tipos.TipoProduto; |
||
| 15 | import br.com.ec.domain.service.GraficoService; |
||
| 16 | import br.com.ec.domain.service.VendaService; |
||
| 17 | import br.com.ec.web.generic.AbstractBean; |
||
| 18 | |||
| 19 | @Named |
||
| 20 | @Scope("view") |
||
| 21 | public class RelatorioVendasBean extends AbstractBean<ParametrosConsultaVendasDTO> implements Serializable { |
||
| 22 | |||
| 23 | private static final long serialVersionUID = 1L; |
||
| 24 | |||
| 25 | /* |
||
| 26 | private List<FuncionarioDTO> listaFuncionariosDTO; |
||
| 27 | private Long sequencialFuncionarioSelecionado; |
||
| 28 | private FuncionarioDTO funcionarioSelecionado; |
||
| 29 | |||
| 30 | private FuncionarioService funcionarioService; |
||
| 31 | */ |
||
| 32 | private ParametrosPeriodoDTO parametrosPeriodoDTO; |
||
| 33 | private Boolean graficoConsultado; |
||
| 34 | |||
| 35 | private GraficoBarraDTO graficoVendas; |
||
| 36 | |||
| 37 | private VendaService vendaService; |
||
| 38 | private GraficoService graficoService; |
||
| 39 | |||
| 40 | @Inject |
||
| 41 | public RelatorioVendasBean(VendaService vendaService, GraficoService graficoService) { |
||
| 42 | this.vendaService = vendaService; |
||
| 43 | this.graficoService = graficoService; |
||
| 44 | } |
||
| 45 | |||
| 46 | @Override |
||
| 47 | public GenericService<ParametrosConsultaVendasDTO> getService() { |
||
| 48 | return null; |
||
| 49 | } |
||
| 50 | |||
| 51 | @Override |
||
| 52 | public ParametrosConsultaVendasDTO getId() { |
||
| 53 | return null; |
||
| 54 | } |
||
| 55 | |||
| 56 | @Override |
||
| 57 | public void preCarregamento() { |
||
| 58 | limparEntidade(); |
||
| 59 | } |
||
| 60 | |||
| 61 | @Override |
||
| 62 | public void limparEntidade() { |
||
| 63 | setEntidade(new ParametrosConsultaVendasDTO()); |
||
| 64 | setGraficoConsultado(false); |
||
| 65 | } |
||
| 66 | |||
| 67 | public ParametrosPeriodoDTO getParametrosPeriodoDTO() { |
||
| 68 | return parametrosPeriodoDTO; |
||
| 69 | } |
||
| 70 | public void setParametrosPeriodoDTO(ParametrosPeriodoDTO parametrosPeriodoDTO) { |
||
| 71 | this.parametrosPeriodoDTO = parametrosPeriodoDTO; |
||
| 72 | } |
||
| 73 | |||
| 74 | public TipoProduto[] getTiposProduto() { |
||
| 75 | return TipoProduto.values(); |
||
| 76 | } |
||
| 77 | |||
| 78 | public Boolean getGraficoConsultado() { |
||
| 79 | return graficoConsultado; |
||
| 80 | } |
||
| 81 | public void setGraficoConsultado(Boolean graficoConsultado) { |
||
| 82 | this.graficoConsultado = graficoConsultado; |
||
| 83 | } |
||
| 84 | |||
| 85 | public GraficoBarraDTO getGraficoVendas() { |
||
| 86 | return graficoVendas; |
||
| 87 | } |
||
| 88 | public void setGraficoVendas(GraficoBarraDTO graficoVendas) { |
||
| 89 | this.graficoVendas = graficoVendas; |
||
| 90 | } |
||
| 91 | |||
| 92 | /**********************************/ |
||
| 93 | |||
| 94 | public void gerarGraficos() { |
||
| 95 | setGraficoConsultado(true); |
||
| 96 | setGraficoVendas(new GraficoBarraDTO(getEntidade())); |
||
| 97 | setGraficoVendas(graficoService.gerarGraficoVendas(getGraficoVendas().getParametrosConsulta())); |
||
| 98 | /* |
||
| 99 | BarChartModel graficoComparativoCustosLucro = funcionarioService.consultarGraficoComparativoCustosLucro(getFuncionarioSelecionado().getSequencialFuncionario(), getParametrosPeriodoDTO()); |
||
| 100 | getFuncionarioSelecionado().setGraficoComparativoCustosLucro(graficoComparativoCustosLucro); |
||
| 101 | |||
| 102 | PieChartModel graficoTiposProdutos = funcionarioService.consultarGraficoTiposProdutos(getFuncionarioSelecionado().getSequencialFuncionario(), getParametrosPeriodoDTO(), Arrays.asList(getTiposProduto())); |
||
| 103 | getFuncionarioSelecionado().setGraficoTiposProdutos(graficoTiposProdutos); |
||
| 104 | |||
| 105 | PieChartModel graficoFormasPagamento = funcionarioService.consultarGraficoFormasPagamento(getFuncionarioSelecionado().getSequencialFuncionario(), getParametrosPeriodoDTO()); |
||
| 106 | getFuncionarioSelecionado().setGraficoFormasPagamento(graficoFormasPagamento); |
||
| 107 | */ |
||
| 108 | } |
||
| 109 | |||
| 110 | } |