Subversion Repositories Integrator Subversion

Rev

Rev 583 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 583 Rev 585
Line 27... Line 27...
27
27
28
        private static final long serialVersionUID = 1L;
28
        private static final long serialVersionUID = 1L;
29
       
29
       
30
        private AlertasService alertasService;
30
        private AlertasService alertasService;
31
        private VendaService vendaService;
31
        private VendaService vendaService;
-
 
32
       
-
 
33
        private Integer tempoDeEstoqueParaAlerta = 30;
32
34
33
        @Inject
35
        @Inject
34
        public AlertasComprasBean(AlertasService alertasService, VendaService vendaService) {
36
        public AlertasComprasBean(AlertasService alertasService, VendaService vendaService) {
35
                this.alertasService = alertasService;
37
                this.alertasService = alertasService;
36
                this.vendaService = vendaService;
38
                this.vendaService = vendaService;
Line 56... Line 58...
56
        }
58
        }
57
       
59
       
58
        @PostConstruct
60
        @PostConstruct
59
        private void iniciarConsolidacoes() {
61
        private void iniciarConsolidacoes() {
60
                limparEntidade();
62
                limparEntidade();
61
                teste();
-
 
-
 
63
        }
-
 
64
       
-
 
65
        public Integer getTempoDeEstoqueParaAlerta() {
-
 
66
                return tempoDeEstoqueParaAlerta;
-
 
67
        }
-
 
68
        public void setTempoDeEstoqueParaAlerta(Integer tempoDeEstoqueParaAlerta) {
-
 
69
                this.tempoDeEstoqueParaAlerta = tempoDeEstoqueParaAlerta;
62
        }
70
        }
63
       
71
       
64
        public void verificarAlertas() {
72
        public void verificarAlertas() {
65
                limparEntidade();
73
                limparEntidade();
66
                /*
-
 
67
                List<TipoProduto> tiposProduto = new ArrayList<TipoProduto>();
-
 
68
                tiposProduto.addAll(Arrays.asList(TipoProduto.values()));
-
 
69
                for (TipoProduto tipoProduto : tiposProduto) {
-
 
70
                        if (!tipoProduto.getValor().equals(TipoProduto.CAPA.getValor())) {
-
 
71
                                AlertasComprasGeralDTO alertasComprasGeralDTO = new AlertasComprasGeralDTO();
-
 
72
                                alertasComprasGeralDTO.setTipoProduto(tipoProduto);
-
 
73
                               
-
 
74
                                AlertasComprasProdutoDTO alertaComprasProdutoDTO = new AlertasComprasProdutoDTO();
-
 
75
                                ProdutoDTO produto = new ProdutoDTO();
-
 
76
                                produto.SET
-
 
77
                                produto.setDescricao("");
-
 
78
//                              038839 : CABO DE DADOS TIPO C PARA TIPO C 3.0A 1.0M REFORÇADO TRANÇADO (ATB) (PRETA) :: TIPO C PARA TIPO C TRANÇADO - VENDAS: 46, ESTOQUE: 91
-
 
79
//                              038450 : CABO DE DADOS TIPO C PARA TIPO C PD 60W 1.5M REFORÇADO TRANÇADO ENERGY E2U-TT3 (BRANCA) :: TIPO C PARA TIPO C TRANÇADO - VENDAS: 42, ESTOQUE: 8
-
 
80
                                alertaComprasProdutoDTO.setProduto(produto);
-
 
81
//                              RankingProdutoDTO rankingProdutoDTO = new RankingProdutoDTO();
-
 
82
//                              rankingProdutoDTO.set
-
 
83
                        }
-
 
84
                }
-
 
85
                */
-
 
-
 
74
                getEntidade().setTempoDeEstoqueParaAlerta(getTempoDeEstoqueParaAlerta());
86
               
75
               
87
                // LISTA DE TODOS OS TIPOS, EXCETO CAPAS
76
                // LISTA DE TODOS OS TIPOS, EXCETO CAPAS
88
                List<TipoProduto> tiposProduto = new ArrayList<TipoProduto>();
77
                List<TipoProduto> tiposProduto = new ArrayList<TipoProduto>();
89
                tiposProduto.addAll(Arrays.asList(TipoProduto.values()));
78
                tiposProduto.addAll(Arrays.asList(TipoProduto.values()));
90
                for (TipoProduto tipoProduto : tiposProduto) {
79
                for (TipoProduto tipoProduto : tiposProduto) {
91
                        if (!tipoProduto.getValor().equals(TipoProduto.CAPA.getValor())) {
80
                        if (!tipoProduto.getValor().equals(TipoProduto.CAPA.getValor())) {
92
                                getEntidade().getTiposProdutoSelecionados().add(tipoProduto);
81
                                getEntidade().getTiposProdutoSelecionados().add(tipoProduto);
93
                        }
82
                        }
94
                }
83
                }
95
               
-
 
96
                setEntidade(alertasService.consultarAlertasComprasGeral(getEntidade()));
84
                setEntidade(alertasService.consultarAlertasComprasGeral(getEntidade()));
97
        }
-
 
98
       
-
 
99
        public void teste() {
-
 
100
                limparEntidade();
-
 
101
               
-
 
102
        }
85
        }
103
       
86
       
104
}
87
}