Rev 195 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 195 | Rev 266 | ||
|---|---|---|---|
| Line 4... | Line 4... | ||
| 4 | import br.com.ec.domain.model.Loja; |
4 | import br.com.ec.domain.model.Loja; |
| - | 5 | import br.com.ec.domain.model.Produto; |
|
| 5 | 6 | ||
| 6 | public class RankingProdutoPorLojaDTO implements Comparable<RankingProdutoPorLojaDTO> { |
7 | public class RankingProdutoPorLojaDTO implements Comparable<RankingProdutoPorLojaDTO> { |
| 7 | 8 | ||
| - | 9 | private Produto produto; |
|
| 8 | private Loja loja; |
10 | private Loja loja; |
| 9 | private Long quantidadeVendas; |
11 | private Long quantidadeVendas; |
| 10 | private Long quantidadeEstoque; |
12 | private Long quantidadeEstoque; |
| 11 | 13 | ||
| 12 | private Integer quantidadeMinimaTransferir = 1; |
14 | private Integer quantidadeMinimaTransferir = 1; |
| - | 15 | private Long quantidadeSugeridaParaTransferir; |
|
| 13 | 16 | ||
| 14 | public RankingProdutoPorLojaDTO() {} |
17 | public RankingProdutoPorLojaDTO() {} |
| 15 | 18 | ||
| 16 | public RankingProdutoPorLojaDTO(Loja loja, Long quantidadeVendas, Long quantidadeEstoque) { |
19 | public RankingProdutoPorLojaDTO(Loja loja, Long quantidadeVendas, Long quantidadeEstoque) { |
| 17 | this.loja = loja; |
20 | this.loja = loja; |
| 18 | this.quantidadeVendas = quantidadeVendas; |
21 | this.quantidadeVendas = quantidadeVendas; |
| 19 | this.quantidadeEstoque = quantidadeEstoque; |
22 | this.quantidadeEstoque = quantidadeEstoque; |
| - | 23 | }
|
|
| - | 24 | ||
| - | 25 | public Produto getProduto() { |
|
| - | 26 | return produto; |
|
| - | 27 | }
|
|
| - | 28 | public void setProduto(Produto produto) { |
|
| - | 29 | this.produto = produto; |
|
| 20 | }
|
30 | }
|
| 21 | 31 | ||
| 22 | public Loja getLoja() { |
32 | public Loja getLoja() { |
| 23 | return loja; |
33 | return loja; |
| 24 | }
|
34 | }
|
| Line 43... | Line 53... | ||
| 43 | public Integer getQuantidadeMinimaTransferir() { |
53 | public Integer getQuantidadeMinimaTransferir() { |
| 44 | return quantidadeMinimaTransferir; |
54 | return quantidadeMinimaTransferir; |
| 45 | }
|
55 | }
|
| 46 | public void setQuantidadeMinimaTransferir(Integer quantidadeMinimaTransferir) { |
56 | public void setQuantidadeMinimaTransferir(Integer quantidadeMinimaTransferir) { |
| 47 | this.quantidadeMinimaTransferir = quantidadeMinimaTransferir; |
57 | this.quantidadeMinimaTransferir = quantidadeMinimaTransferir; |
| - | 58 | }
|
|
| - | 59 | ||
| - | 60 | public Long getQuantidadeSugeridaParaTransferir() { |
|
| - | 61 | return quantidadeSugeridaParaTransferir; |
|
| - | 62 | }
|
|
| - | 63 | public void setQuantidadeSugeridaParaTransferir(Long quantidadeSugeridaParaTransferir) { |
|
| - | 64 | this.quantidadeSugeridaParaTransferir = quantidadeSugeridaParaTransferir; |
|
| 48 | }
|
65 | }
|
| 49 | 66 | ||
| 50 | public Integer quantidadeParaComprar(Integer quantidadeVendas, Integer quantidadeEstoque) { |
67 | public Integer quantidadeParaComprar(Integer quantidadeVendas, Integer quantidadeEstoque) { |
| 51 | return (getQuantidadeMinimaTransferir() * quantidadeVendas) - quantidadeEstoque; |
68 | return (getQuantidadeMinimaTransferir() * quantidadeVendas) - quantidadeEstoque; |
| 52 | }
|
69 | }
|