Rev 568 | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 567 | blopes | 1 | package br.com.ec.controller; |
| 2 | |||
| 3 | import java.io.Serializable; |
||
| 4 | import java.util.ArrayList; |
||
| 5 | import java.util.List; |
||
| 6 | |||
| 7 | import javax.annotation.PostConstruct; |
||
| 8 | import javax.inject.Inject; |
||
| 9 | import javax.inject.Named; |
||
| 10 | |||
| 11 | import org.springframework.context.annotation.Scope; |
||
| 12 | |||
| 13 | import br.com.ec.core.generic.GenericService; |
||
| 14 | import br.com.ec.core.util.DataUtils; |
||
| 588 | blopes | 15 | import br.com.ec.domain.dto.AlertasGeralDTO; |
| 568 | blopes | 16 | import br.com.ec.domain.dto.AlertasLogisticaComprasDTO; |
| 567 | blopes | 17 | import br.com.ec.domain.dto.RankingComprasTransferenciasDTO; |
| 18 | import br.com.ec.domain.dto.RankingModeloDTO; |
||
| 19 | import br.com.ec.domain.dto.consulta.ParametrosConsultaModelosMaisVendidosDTO; |
||
| 588 | blopes | 20 | import br.com.ec.domain.service.AlertasService; |
| 567 | blopes | 21 | import br.com.ec.domain.service.VendaService; |
| 22 | import br.com.ec.web.generic.AbstractBean; |
||
| 23 | |||
| 24 | @Named |
||
| 25 | @Scope("view") |
||
| 588 | blopes | 26 | public class AlertasLogisticaBean extends AbstractBean<AlertasGeralDTO> implements Serializable { |
| 567 | blopes | 27 | |
| 28 | private static final long serialVersionUID = 1L; |
||
| 29 | |||
| 30 | private Boolean adicionarModelosFavoritosSemVendas; |
||
| 31 | private Integer quantidadeDiasVendas = 0; |
||
| 32 | private Integer quantidadeDiasParaAlerta = 0; |
||
| 588 | blopes | 33 | |
| 34 | private AlertasService alertasService; |
||
| 567 | blopes | 35 | |
| 36 | @Inject |
||
| 588 | blopes | 37 | public AlertasLogisticaBean(AlertasService alertasService) { |
| 38 | this.alertasService = alertasService; |
||
| 567 | blopes | 39 | } |
| 40 | |||
| 41 | @Override |
||
| 588 | blopes | 42 | public GenericService<AlertasGeralDTO> getService() { |
| 567 | blopes | 43 | return null; |
| 44 | } |
||
| 45 | |||
| 46 | @Override |
||
| 588 | blopes | 47 | public AlertasGeralDTO getId() { |
| 567 | blopes | 48 | return null; |
| 49 | } |
||
| 50 | |||
| 51 | @Override |
||
| 52 | public void limparEntidade() { |
||
| 588 | blopes | 53 | setEntidade(new AlertasGeralDTO()); |
| 567 | blopes | 54 | setQuantidadeDiasVendas(30); |
| 55 | setQuantidadeDiasParaAlerta(10); |
||
| 56 | setAdicionarModelosFavoritosSemVendas(false); |
||
| 57 | } |
||
| 58 | |||
| 59 | @PostConstruct |
||
| 60 | private void iniciarConsolidacoes() { |
||
| 61 | limparEntidade(); |
||
| 62 | } |
||
| 63 | |||
| 64 | public Boolean getAdicionarModelosFavoritosSemVendas() { |
||
| 65 | return adicionarModelosFavoritosSemVendas; |
||
| 66 | } |
||
| 67 | public void setAdicionarModelosFavoritosSemVendas(Boolean adicionarModelosFavoritosSemVendas) { |
||
| 68 | this.adicionarModelosFavoritosSemVendas = adicionarModelosFavoritosSemVendas; |
||
| 69 | } |
||
| 70 | |||
| 71 | public Integer getQuantidadeDiasVendas() { |
||
| 72 | return quantidadeDiasVendas; |
||
| 73 | } |
||
| 74 | public void setQuantidadeDiasVendas(Integer quantidadeDiasVendas) { |
||
| 75 | this.quantidadeDiasVendas = quantidadeDiasVendas; |
||
| 76 | } |
||
| 77 | |||
| 78 | public Integer getQuantidadeDiasParaAlerta() { |
||
| 79 | return quantidadeDiasParaAlerta; |
||
| 80 | } |
||
| 81 | public void setQuantidadeDiasParaAlerta(Integer quantidadeDiasParaAlerta) { |
||
| 82 | this.quantidadeDiasParaAlerta = quantidadeDiasParaAlerta; |
||
| 83 | } |
||
| 84 | |||
| 85 | public void verificarAlertas() { |
||
| 86 | limparEntidade(); |
||
| 588 | blopes | 87 | getEntidade().setAlertasLogisticaCapasDTO(alertasService.consultarAlertasLogistica(getQuantidadeDiasVendas(), getQuantidadeDiasParaAlerta(), getAdicionarModelosFavoritosSemVendas())); |
| 567 | blopes | 88 | } |
| 89 | |||
| 90 | } |