Rev 585 | Rev 587 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 585 | Rev 586 | ||
|---|---|---|---|
| Line 63... | Line 63... | ||
| 63 | parametrosConsulta.setTipoProduto(tipoProdutoSelecionado.getValor()); |
63 | parametrosConsulta.setTipoProduto(tipoProdutoSelecionado.getValor()); |
| 64 | rankingProdutosDTO.addAll(vendaService.consultarProdutosVendidos(parametrosConsulta)); |
64 | rankingProdutosDTO.addAll(vendaService.consultarProdutosVendidos(parametrosConsulta)); |
| 65 | }
|
65 | }
|
| 66 | 66 | ||
| 67 | // RETIRAR SUBTIPOS DAS PELÍCULAS (PARA ANÁLISE INDIVIDUAL)
|
67 | // RETIRAR SUBTIPOS DAS PELÍCULAS (PARA ANÁLISE INDIVIDUAL)
|
| - | 68 | /*
|
|
| 68 | for (RankingProdutoDTO rankingProdutoDTO : rankingProdutosDTO) { |
69 | for (RankingProdutoDTO rankingProdutoDTO : rankingProdutosDTO) {
|
| 69 | if (rankingProdutoDTO.getProduto().getTipo().equals(TipoProduto.PELICULA.getValor())) { |
70 | if (rankingProdutoDTO.getProduto().getTipo().equals(TipoProduto.PELICULA.getValor())) {
|
| 70 | rankingProdutoDTO.getProduto().setSubtipoProduto(null); |
71 | rankingProdutoDTO.getProduto().setSubtipoProduto(null);
|
| 71 | }
|
72 | }
|
| 72 | }
|
- | |
| - | 73 | }*/
|
|
| 73 | 74 | ||
| 74 | // CONSULTAR SUBTIPOS
|
75 | // CONSULTAR SUBTIPOS
|
| 75 | // VERIFICAR ITENS POR TIPO, SEM SUBTIPO
|
76 | // VERIFICAR ITENS POR TIPO, SEM SUBTIPO
|
| 76 | Integer quantidadeAlertasPossiveisSemSubtipo = 0; |
- | |
| 77 | Integer quantidadeAlertasPossiveisComSubtipo = 0; |
- | |
| 78 | for (TipoProduto tipoProdutoSelecionado : alertasGeralDTO.getTiposProdutoSelecionados()) { |
77 | for (TipoProduto tipoProdutoSelecionado : alertasGeralDTO.getTiposProdutoSelecionados()) { |
| - | 78 | Integer quantidadeAlertasPossiveisSemSubtipo = 0; |
|
| - | 79 | Integer quantidadeAlertasPossiveisComSubtipo = 0; |
|
| 79 | AlertasComprasGeralDTO alertasComprasGeralDTO = new AlertasComprasGeralDTO(); |
80 | AlertasComprasGeralDTO alertasComprasGeralDTO = new AlertasComprasGeralDTO(); |
| 80 | alertasComprasGeralDTO.setTipoProduto(tipoProdutoSelecionado); |
81 | alertasComprasGeralDTO.setTipoProduto(tipoProdutoSelecionado); |
| 81 | 82 | ||
| 82 | List<SubtipoProduto> subtiposProduto = subtipoProdutoService.consultarPorTipo(tipoProdutoSelecionado.getValor()); |
83 | List<SubtipoProduto> subtiposProduto = subtipoProdutoService.consultarPorTipo(tipoProdutoSelecionado.getValor()); |
| 83 | List<RankingProdutoDTO> rankingProdutosDTOComSubtipo = new ArrayList<RankingProdutoDTO>(); |
84 | List<RankingProdutoDTO> rankingProdutosDTOComSubtipo = new ArrayList<RankingProdutoDTO>(); |
| Line 88... | Line 89... | ||
| 88 | // ALERTA PARA CADA PRODUTO COM MENOS DE DIAS PRE-DEFINIDO
|
89 | // ALERTA PARA CADA PRODUTO COM MENOS DE DIAS PRE-DEFINIDO
|
| 89 | if (rankingProdutoDTO.getTempoEstoque() <= alertasGeralDTO.getTempoDeEstoqueParaAlerta()) { |
90 | if (rankingProdutoDTO.getTempoEstoque() <= alertasGeralDTO.getTempoDeEstoqueParaAlerta()) { |
| 90 | alertasComprasGeralDTO.getAlertasProdutosSemSubtipo().add(rankingProdutoDTO); |
91 | alertasComprasGeralDTO.getAlertasProdutosSemSubtipo().add(rankingProdutoDTO); |
| 91 | }
|
92 | }
|
| 92 | } else { |
93 | } else { |
| - | 94 | if (tipoProdutoSelecionado.getValor().equals(TipoProduto.PELICULA.getValor())) { |
|
| - | 95 | quantidadeAlertasPossiveisSemSubtipo++;
|
|
| - | 96 | }
|
|
| 93 | rankingProdutosDTOComSubtipo.add(rankingProdutoDTO); |
97 | rankingProdutosDTOComSubtipo.add(rankingProdutoDTO); |
| 94 | }
|
98 | }
|
| 95 | }
|
99 | }
|
| 96 | }
|
100 | }
|
| 97 | 101 | ||
| 98 | for (SubtipoProduto subtipoProduto : subtiposProduto) { |
102 | for (SubtipoProduto subtipoProduto : subtiposProduto) { |
| 99 | quantidadeAlertasPossiveisComSubtipo++;
|
- | |
| - | 103 | if (!tipoProdutoSelecionado.getValor().equals(TipoProduto.PELICULA.getValor())) { |
|
| - | 104 | quantidadeAlertasPossiveisComSubtipo++;
|
|
| - | 105 | }
|
|
| 100 | AlertasComprasGeralSubTipoDTO alertasComprasGeralSubTipoDTO = new AlertasComprasGeralSubTipoDTO(); |
106 | AlertasComprasGeralSubTipoDTO alertasComprasGeralSubTipoDTO = new AlertasComprasGeralSubTipoDTO(); |
| 101 | alertasComprasGeralSubTipoDTO.setSubtipoProduto(subtipoProduto); |
107 | alertasComprasGeralSubTipoDTO.setSubtipoProduto(subtipoProduto); |
| 102 | for (RankingProdutoDTO rankingProdutoDTOComSubtipo : rankingProdutosDTOComSubtipo) { |
108 | for (RankingProdutoDTO rankingProdutoDTOComSubtipo : rankingProdutosDTOComSubtipo) { |
| 103 | if (subtipoProduto.equals(rankingProdutoDTOComSubtipo.getProduto().getSubtipoProduto())) { |
- | |
| - | 109 | if ((!tipoProdutoSelecionado.getValor().equals(TipoProduto.PELICULA.getValor()) && |
|
| - | 110 | subtipoProduto.equals(rankingProdutoDTOComSubtipo.getProduto().getSubtipoProduto())) || |
|
| - | 111 | (tipoProdutoSelecionado.getValor().equals(TipoProduto.PELICULA.getValor()) && |
|
| - | 112 | subtipoProduto.equals(rankingProdutoDTOComSubtipo.getProduto().getSubtipoProduto()) && |
|
| - | 113 | rankingProdutoDTOComSubtipo.getTempoEstoque() <= alertasGeralDTO.getTempoDeEstoqueParaAlerta())) { |
|
| 104 | alertasComprasGeralSubTipoDTO.getRankingProdutosDTO().add(rankingProdutoDTOComSubtipo); |
114 | alertasComprasGeralSubTipoDTO.getRankingProdutosDTO().add(rankingProdutoDTOComSubtipo); |
| 105 | }
|
115 | }
|
| 106 | }
|
116 | }
|
| 107 | if (!alertasComprasGeralSubTipoDTO.getRankingProdutosDTO().isEmpty() && |
117 | if (!alertasComprasGeralSubTipoDTO.getRankingProdutosDTO().isEmpty() && |
| 108 | alertasComprasGeralSubTipoDTO.getQuantidadeTotalTempoEstoque() <= alertasGeralDTO.getTempoDeEstoqueParaAlerta()) { |
- | |
| - | 118 | (tipoProdutoSelecionado.getValor().equals(TipoProduto.PELICULA.getValor()) || |
|
| - | 119 | alertasComprasGeralSubTipoDTO.getQuantidadeTotalTempoEstoque() <= alertasGeralDTO.getTempoDeEstoqueParaAlerta())) { |
|
| 109 | alertasComprasGeralDTO.getAlertasComprasGeralSubTipoDTO().add(alertasComprasGeralSubTipoDTO); |
120 | alertasComprasGeralDTO.getAlertasComprasGeralSubTipoDTO().add(alertasComprasGeralSubTipoDTO); |
| 110 | }
|
121 | }
|
| 111 | }
|
122 | }
|
| 112 | alertasComprasGeralDTO.setQuantidadeAlertasPossiveis(quantidadeAlertasPossiveisSemSubtipo); |
123 | alertasComprasGeralDTO.setQuantidadeAlertasPossiveis(quantidadeAlertasPossiveisSemSubtipo); |
| 113 | alertasComprasGeralDTO.setQuantidadeAlertasPossiveisComSubtipo(quantidadeAlertasPossiveisComSubtipo); |
124 | alertasComprasGeralDTO.setQuantidadeAlertasPossiveisComSubtipo(quantidadeAlertasPossiveisComSubtipo); |