Rev 587 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 587 | Rev 588 | ||
|---|---|---|---|
| Line 1... | Line 1... | ||
| 1 | package br.com.ec.domain.dto; |
1 | package br.com.ec.domain.dto; |
| 2 | 2 | ||
| 3 | import java.util.ArrayList; |
- | |
| 4 | import java.util.List; |
3 | import java.util.List; |
| 5 | 4 | ||
| 6 | import br.com.ec.domain.model.tipos.TipoProduto; |
5 | import br.com.ec.domain.model.tipos.TipoProduto; |
| 7 | 6 | ||
| 8 | public class AlertasGeralDTO { |
7 | public class AlertasGeralDTO { |
| 9 | 8 | ||
| 10 | private Integer quantidadeDiasVendas = 0; |
- | |
| 11 | private Integer tempoDeEstoqueParaAlerta = 0; |
- | |
| 12 | private Boolean adicionarModelosFavoritosSemVendas; |
- | |
| 13 | - | ||
| 14 | private List<TipoProduto> tiposProdutoSelecionados; |
- | |
| - | 9 | // ALERTAS COMPRAS (GERAL)
|
|
| - | 10 | private AlertasComprasDTO alertasComprasDTO; |
|
| 15 | 11 | ||
| 16 | // ALERTAS COMPRAS (CAPAS)
|
12 | // ALERTAS COMPRAS (CAPAS)
|
| - | 13 | private AlertasLogisticaComprasDTO alertasComprasCapasDTO; |
|
| 17 | 14 | ||
| 18 | // ALERTAS COMPRAS (GERAL)
|
- | |
| 19 | private List<AlertasComprasGeralDTO> alertasComprasGeralDTO; |
- | |
| - | 15 | // ALERTAS LOGÍSTICA (CAPAS)
|
|
| - | 16 | private AlertasLogisticaComprasDTO alertasLogisticaCapasDTO; |
|
| 20 | 17 | ||
| 21 | // ALERTAS LOGÍSTICA (CAPAS)
|
- | |
| 22 | // ALERTAS LOGÍSTICA (EXCETO CAPAS)
|
18 | // ALERTAS LOGÍSTICA (EXCETO CAPAS)
|
| 23 | 19 | ||
| 24 | // ALERTAS COMERCIAL
|
20 | // ALERTAS COMERCIAL
|
| 25 | 21 | ||
| 26 | // ALERTAS GESTAO
|
22 | // ALERTAS GESTAO
|
| - | 23 | ||
| - | 24 | private Integer quantidadeDiasVendas = 0; |
|
| - | 25 | private Integer tempoDeEstoqueParaAlerta = 0; |
|
| - | 26 | private Boolean adicionarModelosFavoritosSemVendas; |
|
| - | 27 | ||
| - | 28 | private List<TipoProduto> tiposProdutoSelecionados; |
|
| 27 | 29 | ||
| 28 | public AlertasGeralDTO() { |
30 | public AlertasGeralDTO() { |
| 29 | setAlertasComprasGeralDTO(new ArrayList<AlertasComprasGeralDTO>()); |
- | |
| - | 31 | }
|
|
| - | 32 | ||
| - | 33 | public AlertasComprasDTO getAlertasComprasDTO() { |
|
| - | 34 | return alertasComprasDTO; |
|
| - | 35 | }
|
|
| - | 36 | public void setAlertasComprasDTO(AlertasComprasDTO alertasComprasDTO) { |
|
| - | 37 | this.alertasComprasDTO = alertasComprasDTO; |
|
| - | 38 | }
|
|
| - | 39 | ||
| - | 40 | public AlertasLogisticaComprasDTO getAlertasComprasCapasDTO() { |
|
| - | 41 | return alertasComprasCapasDTO; |
|
| - | 42 | }
|
|
| - | 43 | public void setAlertasComprasCapasDTO(AlertasLogisticaComprasDTO alertasComprasCapasDTO) { |
|
| - | 44 | this.alertasComprasCapasDTO = alertasComprasCapasDTO; |
|
| - | 45 | }
|
|
| - | 46 | ||
| - | 47 | public AlertasLogisticaComprasDTO getAlertasLogisticaCapasDTO() { |
|
| - | 48 | return alertasLogisticaCapasDTO; |
|
| - | 49 | }
|
|
| - | 50 | public void setAlertasLogisticaCapasDTO(AlertasLogisticaComprasDTO alertasLogisticaCapasDTO) { |
|
| - | 51 | this.alertasLogisticaCapasDTO = alertasLogisticaCapasDTO; |
|
| 30 | }
|
52 | }
|
| 31 | 53 | ||
| 32 | public Integer getQuantidadeDiasVendas() { |
54 | public Integer getQuantidadeDiasVendas() { |
| 33 | return quantidadeDiasVendas; |
55 | return quantidadeDiasVendas; |
| 34 | }
|
56 | }
|
| Line 53... | Line 75... | ||
| 53 | public List<TipoProduto> getTiposProdutoSelecionados() { |
75 | public List<TipoProduto> getTiposProdutoSelecionados() { |
| 54 | return tiposProdutoSelecionados; |
76 | return tiposProdutoSelecionados; |
| 55 | }
|
77 | }
|
| 56 | public void setTiposProdutoSelecionados(List<TipoProduto> tiposProdutoSelecionados) { |
78 | public void setTiposProdutoSelecionados(List<TipoProduto> tiposProdutoSelecionados) { |
| 57 | this.tiposProdutoSelecionados = tiposProdutoSelecionados; |
79 | this.tiposProdutoSelecionados = tiposProdutoSelecionados; |
| 58 | }
|
- | |
| 59 | - | ||
| 60 | public List<AlertasComprasGeralDTO> getAlertasComprasGeralDTO() { |
- | |
| 61 | return alertasComprasGeralDTO; |
- | |
| 62 | }
|
- | |
| 63 | public void setAlertasComprasGeralDTO(List<AlertasComprasGeralDTO> alertasComprasGeralDTO) { |
- | |
| 64 | this.alertasComprasGeralDTO = alertasComprasGeralDTO; |
- | |
| 65 | }
|
80 | }
|
| 66 | 81 | ||
| 67 | /************************************************************/
|
82 | /************************************************************/
|
| 68 | - | ||
| 69 | public Integer getQuantidadeTotalAlertasComprasGeral() { |
- | |
| 70 | Integer quantidadeTotalAlertas = 0; |
- | |
| 71 | for (AlertasComprasGeralDTO alertasComprasGeralDTO : getAlertasComprasGeralDTO()) { |
- | |
| 72 | quantidadeTotalAlertas += alertasComprasGeralDTO.getQuantidadeTotalAlertas(); |
- | |
| 73 | }
|
- | |
| 74 | return quantidadeTotalAlertas; |
- | |
| 75 | }
|
- | |
| 76 | - | ||
| 77 | public Integer getQuantidadeTotalAlertasPossiveisComprasGeral() { |
- | |
| 78 | Integer quantidadeTotalAlertasPossiveis = 0; |
- | |
| 79 | for (AlertasComprasGeralDTO alertasComprasGeralDTO : getAlertasComprasGeralDTO()) { |
- | |
| 80 | quantidadeTotalAlertasPossiveis += alertasComprasGeralDTO.getQuantidadeTotalAlertasPossiveis(); |
- | |
| 81 | }
|
- | |
| 82 | return quantidadeTotalAlertasPossiveis; |
- | |
| 83 | }
|
- | |
| 84 | - | ||
| 85 | public Integer getQuantidadeTotalAlertasCriticos() { |
- | |
| 86 | Integer quantidadeTotalAlertasCriticos = 0; |
- | |
| 87 | for (AlertasComprasGeralDTO alertasComprasGeralDTO : getAlertasComprasGeralDTO()) { |
- | |
| 88 | quantidadeTotalAlertasCriticos += alertasComprasGeralDTO.getQuantidadeAlertasCriticos(); |
- | |
| 89 | }
|
- | |
| 90 | return quantidadeTotalAlertasCriticos; |
- | |
| 91 | }
|
- | |
| 92 | - | ||
| 93 | public Double percentualAlertasComprasGeral() { |
- | |
| 94 | Double percentual = new Double(getQuantidadeTotalAlertasComprasGeral())/new Double(getQuantidadeTotalAlertasPossiveisComprasGeral()); |
- | |
| 95 | return 100 - (percentual * 100.0); |
- | |
| 96 | }
|
- | |
| 97 | - | ||
| 98 | public String corPercentualAlertaComprasGeral() { |
- | |
| 99 | Double percentual = percentualAlertasComprasGeral(); |
- | |
| 100 | if (percentual > 90.0) { |
- | |
| 101 | return "green-haze"; |
- | |
| 102 | }
|
- | |
| 103 | if (percentual > 50.0) { |
- | |
| 104 | return "orange"; |
- | |
| 105 | }
|
- | |
| 106 | return "red"; |
- | |
| 107 | }
|
- | |
| 108 | 83 | ||
| 109 | }
|
84 | }
|