Rev 583 | Rev 587 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 583 | Rev 585 | ||
|---|---|---|---|
| Line 59... | Line 59... | ||
| 59 | public List<AlertasComprasGeralDTO> getAlertasComprasGeralDTO() { |
59 | public List<AlertasComprasGeralDTO> getAlertasComprasGeralDTO() { |
| 60 | return alertasComprasGeralDTO; |
60 | return alertasComprasGeralDTO; |
| 61 | }
|
61 | }
|
| 62 | public void setAlertasComprasGeralDTO(List<AlertasComprasGeralDTO> alertasComprasGeralDTO) { |
62 | public void setAlertasComprasGeralDTO(List<AlertasComprasGeralDTO> alertasComprasGeralDTO) { |
| 63 | this.alertasComprasGeralDTO = alertasComprasGeralDTO; |
63 | this.alertasComprasGeralDTO = alertasComprasGeralDTO; |
| - | 64 | }
|
|
| - | 65 | ||
| - | 66 | /************************************************************/
|
|
| - | 67 | ||
| - | 68 | public Integer getQuantidadeTotalAlertasComprasGeral() { |
|
| - | 69 | Integer quantidadeTotalAlertas = 0; |
|
| - | 70 | for (AlertasComprasGeralDTO alertasComprasGeralDTO : getAlertasComprasGeralDTO()) { |
|
| - | 71 | quantidadeTotalAlertas += alertasComprasGeralDTO.getQuantidadeTotalAlertas(); |
|
| - | 72 | }
|
|
| - | 73 | return quantidadeTotalAlertas; |
|
| - | 74 | }
|
|
| - | 75 | ||
| - | 76 | public Integer getQuantidadeTotalAlertasPossiveisComprasGeral() { |
|
| - | 77 | Integer quantidadeTotalAlertasPossiveis = 0; |
|
| - | 78 | for (AlertasComprasGeralDTO alertasComprasGeralDTO : getAlertasComprasGeralDTO()) { |
|
| - | 79 | quantidadeTotalAlertasPossiveis += alertasComprasGeralDTO.getQuantidadeTotalAlertasPossiveis(); |
|
| - | 80 | }
|
|
| - | 81 | return quantidadeTotalAlertasPossiveis; |
|
| - | 82 | }
|
|
| - | 83 | ||
| - | 84 | public Double percentualAlertasComprasGeral() { |
|
| - | 85 | Double percentual = new Double(getQuantidadeTotalAlertasComprasGeral())/new Double(getQuantidadeTotalAlertasPossiveisComprasGeral()); |
|
| - | 86 | return 100 - (percentual * 100.0); |
|
| - | 87 | }
|
|
| - | 88 | ||
| - | 89 | public String corPercentualAlertaComprasGeral() { |
|
| - | 90 | Double percentual = percentualAlertasComprasGeral(); |
|
| - | 91 | if (percentual > 90.0) { |
|
| - | 92 | return "green-haze"; |
|
| - | 93 | }
|
|
| - | 94 | if (percentual > 50.0) { |
|
| - | 95 | return "orange"; |
|
| - | 96 | }
|
|
| - | 97 | return "red"; |
|
| 64 | }
|
98 | }
|
| 65 | 99 | ||
| 66 | }
|
100 | }
|