Rev 568 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 568 | Rev 587 | ||
|---|---|---|---|
| Line 4... | Line 4... | ||
| 4 | import java.util.List; |
4 | import java.util.List; |
| - | 5 | ||
| - | 6 | import br.com.ec.domain.model.tipos.TipoAlertaComprasTransferencias; |
|
| 5 | 7 | ||
| 6 | public class AlertasLogisticaComprasDTO { |
8 | public class AlertasLogisticaComprasDTO { |
| 7 | 9 | ||
| 8 | private List<RankingComprasTransferenciasDTO> rankingsComprasTransferenciasDTO; |
10 | private List<RankingComprasTransferenciasDTO> rankingsComprasTransferenciasDTO; |
| 9 | private Integer quantidadeAlertasModelosPossiveis; |
11 | private Integer quantidadeAlertasModelosPossiveis; |
| Line 45... | Line 47... | ||
| 45 | for (RankingComprasTransferenciasDTO ranking : getRankingsComprasTransferenciasDTO()) { |
47 | for (RankingComprasTransferenciasDTO ranking : getRankingsComprasTransferenciasDTO()) { |
| 46 | quantidadeTotalAlertasPossiveis += ranking.getQuantidadeAlertasPossiveis(); |
48 | quantidadeTotalAlertasPossiveis += ranking.getQuantidadeAlertasPossiveis(); |
| 47 | }
|
49 | }
|
| 48 | }
|
50 | }
|
| 49 | return quantidadeTotalAlertasPossiveis + getQuantidadeTotalAlertas(); |
51 | return quantidadeTotalAlertasPossiveis + getQuantidadeTotalAlertas(); |
| - | 52 | }
|
|
| - | 53 | ||
| - | 54 | public Integer getQuantidadeTotalAlertasCriticos() { |
|
| - | 55 | Integer quantidadeTotalAlertas = 0; |
|
| - | 56 | if (!getRankingsComprasTransferenciasDTO().isEmpty()) { |
|
| - | 57 | for (RankingComprasTransferenciasDTO ranking : getRankingsComprasTransferenciasDTO()) { |
|
| - | 58 | for (RankingComprasTransferenciasAlertaDTO alerta : ranking.getAlertas()) { |
|
| - | 59 | if (alerta.getTipoAlertaComprasTransferencias().getValor().equals(TipoAlertaComprasTransferencias.TRANSFERIR.getValor())) { |
|
| - | 60 | quantidadeTotalAlertas++;
|
|
| - | 61 | }
|
|
| - | 62 | }
|
|
| - | 63 | }
|
|
| - | 64 | }
|
|
| - | 65 | return quantidadeTotalAlertas; |
|
| 50 | }
|
66 | }
|
| 51 | 67 | ||
| 52 | public Double percentualAlertas() { |
68 | public Double percentualAlertas() { |
| 53 | Double percentual = new Double(getQuantidadeTotalAlertas())/new Double(getQuantidadeTotalAlertasPossiveis()); |
69 | Double percentual = new Double(getQuantidadeTotalAlertas())/new Double(getQuantidadeTotalAlertasPossiveis()); |
| 54 | return 100 - (percentual * 100.0); |
70 | return 100 - (percentual * 100.0); |