Commit 05217b71adc453de682bf15d60905a60b3527771
1 parent
0b81b937
Exists in
master
redmine #4738 Adicionado os atributos 'private final Long TIPO_NUMERICO_INTEIRO …
…= new Long (1l);', 'private final Long TIPO_NUMERICO_DECIMAL = new Long (2l);', 'private BigDecimal quantidadeInteiro;', 'private BigDecimal quantidadeDecimal;'
Showing
1 changed file
with
37 additions
and
3 deletions
Show diff stats
cit-tabelas-corp-api/src/main/java/br/com/centralit/api/model/UnidadeMedida.java
@@ -9,15 +9,16 @@ import javax.persistence.GeneratedValue; | @@ -9,15 +9,16 @@ import javax.persistence.GeneratedValue; | ||
9 | import javax.persistence.GenerationType; | 9 | import javax.persistence.GenerationType; |
10 | import javax.persistence.Id; | 10 | import javax.persistence.Id; |
11 | import javax.persistence.ManyToOne; | 11 | import javax.persistence.ManyToOne; |
12 | +import javax.persistence.Transient; | ||
12 | 13 | ||
13 | import org.hibernate.envers.Audited; | 14 | import org.hibernate.envers.Audited; |
14 | 15 | ||
16 | +import com.fasterxml.jackson.annotation.JsonView; | ||
17 | + | ||
15 | import br.com.centralit.framework.json.Views; | 18 | import br.com.centralit.framework.json.Views; |
16 | import br.com.centralit.framework.model.Dominio; | 19 | import br.com.centralit.framework.model.Dominio; |
17 | import br.com.centralit.framework.model.arquitetura.PersistentObject; | 20 | import br.com.centralit.framework.model.arquitetura.PersistentObject; |
18 | 21 | ||
19 | -import com.fasterxml.jackson.annotation.JsonView; | ||
20 | - | ||
21 | /** | 22 | /** |
22 | * <p> | 23 | * <p> |
23 | * <img src="http://centralit.com.br/images/logo_central.png"> | 24 | * <img src="http://centralit.com.br/images/logo_central.png"> |
@@ -56,7 +57,12 @@ public class UnidadeMedida extends PersistentObject { | @@ -56,7 +57,12 @@ public class UnidadeMedida extends PersistentObject { | ||
56 | 57 | ||
57 | /** Atributo serialVersionUID. */ | 58 | /** Atributo serialVersionUID. */ |
58 | private static final long serialVersionUID = -7573208249312737668L; | 59 | private static final long serialVersionUID = -7573208249312737668L; |
59 | - | 60 | + |
61 | + @Transient | ||
62 | + private final Long TIPO_NUMERICO_INTEIRO = new Long (1l); | ||
63 | + @Transient | ||
64 | + private final Long TIPO_NUMERICO_DECIMAL = new Long (2l); | ||
65 | + | ||
60 | /** Atributo id. */ | 66 | /** Atributo id. */ |
61 | @Id | 67 | @Id |
62 | @GeneratedValue(strategy = GenerationType.AUTO) | 68 | @GeneratedValue(strategy = GenerationType.AUTO) |
@@ -85,7 +91,15 @@ public class UnidadeMedida extends PersistentObject { | @@ -85,7 +91,15 @@ public class UnidadeMedida extends PersistentObject { | ||
85 | @Column(name = "isUnidadePadrao") | 91 | @Column(name = "isUnidadePadrao") |
86 | @JsonView({ Views.GenericView.class }) | 92 | @JsonView({ Views.GenericView.class }) |
87 | private Boolean isUnidadePadrao; | 93 | private Boolean isUnidadePadrao; |
94 | + | ||
95 | + @Transient | ||
96 | + @JsonView({ Views.GenericView.class }) | ||
97 | + private BigDecimal quantidadeInteiro; | ||
88 | 98 | ||
99 | + @Transient | ||
100 | + @JsonView({ Views.GenericView.class }) | ||
101 | + private BigDecimal quantidadeDecimal; | ||
102 | + | ||
89 | /** | 103 | /** |
90 | * Responsável pela criação de novas instâncias desta classe. | 104 | * Responsável pela criação de novas instâncias desta classe. |
91 | */ | 105 | */ |
@@ -226,5 +240,25 @@ public class UnidadeMedida extends PersistentObject { | @@ -226,5 +240,25 @@ public class UnidadeMedida extends PersistentObject { | ||
226 | public void setIsUnidadePadrao(Boolean isUnidadePadrao) { | 240 | public void setIsUnidadePadrao(Boolean isUnidadePadrao) { |
227 | this.isUnidadePadrao = isUnidadePadrao; | 241 | this.isUnidadePadrao = isUnidadePadrao; |
228 | } | 242 | } |
243 | + | ||
244 | + public BigDecimal getQuantidadeInteiro() { | ||
245 | + return quantidadePadrao; | ||
246 | + } | ||
229 | 247 | ||
248 | + public void setQuantidadeInteiro(BigDecimal quantidadeInteiro) { | ||
249 | + if(this.tipoNumerico != null && this.tipoNumerico.getCodigo().equals(TIPO_NUMERICO_INTEIRO)){ | ||
250 | + this.quantidadePadrao = quantidadeInteiro; | ||
251 | + } | ||
252 | + } | ||
253 | + | ||
254 | + public BigDecimal getQuantidadeDecimal() { | ||
255 | + return quantidadePadrao; | ||
256 | + } | ||
257 | + | ||
258 | + public void setQuantidadeDecimal(BigDecimal quantidadeDecimal) { | ||
259 | + if(this.tipoNumerico != null && this.tipoNumerico.getCodigo().equals(TIPO_NUMERICO_DECIMAL)){ | ||
260 | + this.quantidadePadrao = quantidadeDecimal; | ||
261 | + } | ||
262 | + } | ||
263 | + | ||
230 | } | 264 | } |