Rev 585 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 585 | Rev 588 | ||
|---|---|---|---|
| Line 10... | Line 10... | ||
| 10 | import javax.inject.Named; |
10 | import javax.inject.Named; |
| 11 | 11 | ||
| 12 | import org.springframework.context.annotation.Scope; |
12 | import org.springframework.context.annotation.Scope; |
| 13 | 13 | ||
| 14 | import br.com.ec.core.generic.GenericService; |
14 | import br.com.ec.core.generic.GenericService; |
| 15 | import br.com.ec.domain.dto.AlertasComprasGeralDTO; |
- | |
| 16 | import br.com.ec.domain.dto.AlertasComprasProdutoDTO; |
- | |
| - | 15 | import br.com.ec.core.util.DataUtils; |
|
| 17 | import br.com.ec.domain.dto.AlertasGeralDTO; |
16 | import br.com.ec.domain.dto.AlertasGeralDTO; |
| 18 | import br.com.ec.domain.dto.ProdutoDTO; |
- | |
| - | 17 | import br.com.ec.domain.dto.AlertasLogisticaComprasDTO; |
|
| - | 18 | import br.com.ec.domain.dto.RankingComprasTransferenciasDTO; |
|
| - | 19 | import br.com.ec.domain.dto.RankingModeloDTO; |
|
| - | 20 | import br.com.ec.domain.dto.consulta.ParametrosConsultaModelosMaisVendidosDTO; |
|
| 19 | import br.com.ec.domain.model.tipos.TipoProduto; |
21 | import br.com.ec.domain.model.tipos.TipoProduto; |
| 20 | import br.com.ec.domain.service.AlertasService; |
22 | import br.com.ec.domain.service.AlertasService; |
| 21 | import br.com.ec.domain.service.VendaService; |
23 | import br.com.ec.domain.service.VendaService; |
| 22 | import br.com.ec.web.generic.AbstractBean; |
24 | import br.com.ec.web.generic.AbstractBean; |
| 23 | 25 | ||
| Line 65... | Line 67... | ||
| 65 | public Integer getTempoDeEstoqueParaAlerta() { |
67 | public Integer getTempoDeEstoqueParaAlerta() { |
| 66 | return tempoDeEstoqueParaAlerta; |
68 | return tempoDeEstoqueParaAlerta; |
| 67 | }
|
69 | }
|
| 68 | public void setTempoDeEstoqueParaAlerta(Integer tempoDeEstoqueParaAlerta) { |
70 | public void setTempoDeEstoqueParaAlerta(Integer tempoDeEstoqueParaAlerta) { |
| 69 | this.tempoDeEstoqueParaAlerta = tempoDeEstoqueParaAlerta; |
71 | this.tempoDeEstoqueParaAlerta = tempoDeEstoqueParaAlerta; |
| - | 72 | }
|
|
| - | 73 | ||
| - | 74 | public void verificarAlertasCapas() { |
|
| - | 75 | limparEntidade(); |
|
| - | 76 | ||
| - | 77 | // CONSULTAR MODELOS MAIS VENDIDOS
|
|
| - | 78 | List<RankingModeloDTO> modelosMaisVendidos = new ArrayList<RankingModeloDTO>(); |
|
| - | 79 | ParametrosConsultaModelosMaisVendidosDTO parametrosConsulta = new ParametrosConsultaModelosMaisVendidosDTO(); |
|
| - | 80 | parametrosConsulta.setDataFinal(DataUtils.getDataAtual()); |
|
| - | 81 | parametrosConsulta.setDataInicial(DataUtils.acrescentarDias(DataUtils.getDataAtual(), getEntidade().getQuantidadeDiasVendas()*-1)); |
|
| - | 82 | modelosMaisVendidos.addAll(vendaService.consultarRankingModelos(parametrosConsulta, getEntidade().getAdicionarModelosFavoritosSemVendas())); |
|
| - | 83 | ||
| - | 84 | List<RankingComprasTransferenciasDTO> rankingComprasTransferencias = new ArrayList<RankingComprasTransferenciasDTO>(); |
|
| - | 85 | rankingComprasTransferencias.addAll(vendaService.consultarRankingComprasTransferencias(getEntidade().getQuantidadeDiasVendas(), |
|
| - | 86 | getEntidade().getTempoDeEstoqueParaAlerta(), modelosMaisVendidos, false)); |
|
| - | 87 | ||
| - | 88 | AlertasLogisticaComprasDTO alertasLogisticaComprasDTO = new AlertasLogisticaComprasDTO(); |
|
| - | 89 | alertasLogisticaComprasDTO.setQuantidadeAlertasModelosPossiveis(modelosMaisVendidos.size()); |
|
| - | 90 | alertasLogisticaComprasDTO.setRankingsComprasTransferenciasDTO(rankingComprasTransferencias); |
|
| - | 91 | getEntidade().setAlertasComprasCapasDTO(alertasLogisticaComprasDTO); |
|
| 70 | }
|
92 | }
|
| 71 | 93 | ||
| 72 | public void verificarAlertas() { |
94 | public void verificarAlertas() { |
| 73 | limparEntidade(); |
95 | limparEntidade(); |
| 74 | getEntidade().setTempoDeEstoqueParaAlerta(getTempoDeEstoqueParaAlerta()); |
96 | getEntidade().setTempoDeEstoqueParaAlerta(getTempoDeEstoqueParaAlerta()); |
| 75 | - | ||
| 76 | // LISTA DE TODOS OS TIPOS, EXCETO CAPAS
|
- | |
| 77 | List<TipoProduto> tiposProduto = new ArrayList<TipoProduto>(); |
- | |
| 78 | tiposProduto.addAll(Arrays.asList(TipoProduto.values())); |
- | |
| 79 | for (TipoProduto tipoProduto : tiposProduto) { |
- | |
| 80 | if (!tipoProduto.getValor().equals(TipoProduto.CAPA.getValor())) { |
- | |
| 81 | getEntidade().getTiposProdutoSelecionados().add(tipoProduto); |
- | |
| 82 | }
|
- | |
| 83 | }
|
- | |
| 84 | setEntidade(alertasService.consultarAlertasComprasGeral(getEntidade())); |
- | |
| - | 97 | getEntidade().setAlertasComprasDTO(alertasService.consultarAlertasComprasGeral(getEntidade())); |
|
| 85 | }
|
98 | }
|
| 86 | 99 | ||
| 87 | }
|
100 | }
|