Commit 1e934841c88916c70f88d29d8e6b277a4f06cbc7
1 parent
3206897c
Exists in
master
[Redmine Atendimento #4788]Material Endereço Estoque
Showing
3 changed files
with
94 additions
and
45 deletions
Show diff stats
cit-almoxarifado-api/src/main/java/br/com/centralit/api/model/MaterialLocalEstoque.java
@@ -2,6 +2,7 @@ package br.com.centralit.api.model; | @@ -2,6 +2,7 @@ package br.com.centralit.api.model; | ||
2 | 2 | ||
3 | import java.math.BigDecimal; | 3 | import java.math.BigDecimal; |
4 | 4 | ||
5 | +import javax.persistence.CascadeType; | ||
5 | import javax.persistence.Entity; | 6 | import javax.persistence.Entity; |
6 | import javax.persistence.FetchType; | 7 | import javax.persistence.FetchType; |
7 | import javax.persistence.GeneratedValue; | 8 | import javax.persistence.GeneratedValue; |
@@ -20,18 +21,30 @@ import com.fasterxml.jackson.annotation.JsonView; | @@ -20,18 +21,30 @@ import com.fasterxml.jackson.annotation.JsonView; | ||
20 | 21 | ||
21 | /** | 22 | /** |
22 | * | 23 | * |
23 | - * <p><img src="http://centralit.com.br/images/logo_central.png"></p> | 24 | + * <p> |
25 | + * <img src="http://centralit.com.br/images/logo_central.png"> | ||
26 | + * </p> | ||
24 | * | 27 | * |
25 | - * <p><b>Company: </b> Central IT - Governança Corporativa - </p> | 28 | + * <p> |
29 | + * <b>Company: </b> Central IT - Governança Corporativa - | ||
30 | + * </p> | ||
26 | * | 31 | * |
27 | - * <p><b>Title: </b></p> | 32 | + * <p> |
33 | + * <b>Title: </b> | ||
34 | + * </p> | ||
28 | * | 35 | * |
29 | - * <p><b>Description: </b></p> | 36 | + * <p> |
37 | + * <b>Description: </b> | ||
38 | + * </p> | ||
30 | * | 39 | * |
31 | - * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p> | 40 | + * <p> |
41 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | ||
42 | + * </p> | ||
32 | * | 43 | * |
33 | - * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p> | ||
34 | - * | 44 | + * <p> |
45 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | ||
46 | + * </p> | ||
47 | + * | ||
35 | * @since 29/04/2016 - 09:06:28 | 48 | * @since 29/04/2016 - 09:06:28 |
36 | * | 49 | * |
37 | * @version 1.0.0 | 50 | * @version 1.0.0 |
@@ -52,30 +65,32 @@ public class MaterialLocalEstoque extends PersistentObjectAuditOrganizacao { | @@ -52,30 +65,32 @@ public class MaterialLocalEstoque extends PersistentObjectAuditOrganizacao { | ||
52 | @GeneratedValue(strategy = GenerationType.AUTO) | 65 | @GeneratedValue(strategy = GenerationType.AUTO) |
53 | @JsonView({ Views.GenericView.class }) | 66 | @JsonView({ Views.GenericView.class }) |
54 | private Long id; | 67 | private Long id; |
55 | - | 68 | + |
56 | /** Atributo materialEstoque. */ | 69 | /** Atributo materialEstoque. */ |
57 | - @OneToOne(fetch = FetchType.LAZY, optional = false) | 70 | + @OneToOne(fetch = FetchType.LAZY, optional = false, cascade = CascadeType.PERSIST) |
58 | private MaterialEstoque materialEstoque; | 71 | private MaterialEstoque materialEstoque; |
59 | - | 72 | + |
60 | /** Atributo materialEstoqueInativo. */ | 73 | /** Atributo materialEstoqueInativo. */ |
61 | @ManyToOne(fetch = FetchType.LAZY, optional = true) | 74 | @ManyToOne(fetch = FetchType.LAZY, optional = true) |
62 | private MaterialEstoque materialEstoqueInativo; | 75 | private MaterialEstoque materialEstoqueInativo; |
63 | - | 76 | + |
64 | /** Atributo endereco. */ | 77 | /** Atributo endereco. */ |
65 | @OneToOne(fetch = FetchType.LAZY, optional = false) | 78 | @OneToOne(fetch = FetchType.LAZY, optional = false) |
66 | private EnderecoEstoque endereco; | 79 | private EnderecoEstoque endereco; |
67 | - | 80 | + |
68 | /** Atributo enderecoInativo. */ | 81 | /** Atributo enderecoInativo. */ |
69 | @ManyToOne(fetch = FetchType.LAZY, optional = true) | 82 | @ManyToOne(fetch = FetchType.LAZY, optional = true) |
70 | private EnderecoEstoque enderecoInativo; | 83 | private EnderecoEstoque enderecoInativo; |
71 | - | 84 | + |
72 | /** Atributo quantidade. */ | 85 | /** Atributo quantidade. */ |
73 | private BigDecimal quantidade; | 86 | private BigDecimal quantidade; |
74 | - | 87 | + |
75 | /** Atributo unidadeMedidaEntrada. */ | 88 | /** Atributo unidadeMedidaEntrada. */ |
76 | - @ManyToOne(fetch = FetchType.LAZY, optional = false) | 89 | + @ManyToOne(fetch = FetchType.LAZY, optional = false) |
77 | private UnidadeMedida unidadeMedidaEntrada; | 90 | private UnidadeMedida unidadeMedidaEntrada; |
78 | 91 | ||
92 | + private Boolean localPrincipal; | ||
93 | + | ||
79 | /** | 94 | /** |
80 | * Retorna o valor do atributo <code>id</code> | 95 | * Retorna o valor do atributo <code>id</code> |
81 | * | 96 | * |
@@ -95,48 +110,44 @@ public class MaterialLocalEstoque extends PersistentObjectAuditOrganizacao { | @@ -95,48 +110,44 @@ public class MaterialLocalEstoque extends PersistentObjectAuditOrganizacao { | ||
95 | 110 | ||
96 | this.id = id; | 111 | this.id = id; |
97 | } | 112 | } |
98 | - | 113 | + |
99 | /** | 114 | /** |
100 | * Retorna o valor do atributo <code>endereco</code> | 115 | * Retorna o valor do atributo <code>endereco</code> |
101 | * | 116 | * |
102 | * @return <code>EnderecoEstoque</code> | 117 | * @return <code>EnderecoEstoque</code> |
103 | */ | 118 | */ |
104 | public EnderecoEstoque getEndereco() { | 119 | public EnderecoEstoque getEndereco() { |
105 | - | 120 | + |
106 | return endereco; | 121 | return endereco; |
107 | } | 122 | } |
108 | 123 | ||
109 | - | ||
110 | /** | 124 | /** |
111 | * Define o valor do atributo <code>endereco</code>. | 125 | * Define o valor do atributo <code>endereco</code>. |
112 | * | 126 | * |
113 | - * @param endereco | 127 | + * @param endereco |
114 | */ | 128 | */ |
115 | public void setEndereco(EnderecoEstoque endereco) { | 129 | public void setEndereco(EnderecoEstoque endereco) { |
116 | - | 130 | + |
117 | this.endereco = endereco; | 131 | this.endereco = endereco; |
118 | } | 132 | } |
119 | 133 | ||
120 | - | ||
121 | - | ||
122 | /** | 134 | /** |
123 | * Retorna o valor do atributo <code>enderecoInativo</code> | 135 | * Retorna o valor do atributo <code>enderecoInativo</code> |
124 | * | 136 | * |
125 | * @return <code>EnderecoEstoque</code> | 137 | * @return <code>EnderecoEstoque</code> |
126 | */ | 138 | */ |
127 | public EnderecoEstoque getEnderecoInativo() { | 139 | public EnderecoEstoque getEnderecoInativo() { |
128 | - | 140 | + |
129 | return enderecoInativo; | 141 | return enderecoInativo; |
130 | } | 142 | } |
131 | 143 | ||
132 | - | ||
133 | /** | 144 | /** |
134 | * Define o valor do atributo <code>enderecoInativo</code>. | 145 | * Define o valor do atributo <code>enderecoInativo</code>. |
135 | * | 146 | * |
136 | - * @param enderecoInativo | 147 | + * @param enderecoInativo |
137 | */ | 148 | */ |
138 | public void setEnderecoInativo(EnderecoEstoque enderecoInativo) { | 149 | public void setEnderecoInativo(EnderecoEstoque enderecoInativo) { |
139 | - | 150 | + |
140 | this.enderecoInativo = enderecoInativo; | 151 | this.enderecoInativo = enderecoInativo; |
141 | } | 152 | } |
142 | 153 | ||
@@ -146,85 +157,86 @@ public class MaterialLocalEstoque extends PersistentObjectAuditOrganizacao { | @@ -146,85 +157,86 @@ public class MaterialLocalEstoque extends PersistentObjectAuditOrganizacao { | ||
146 | * @return <code>BigDecimal</code> | 157 | * @return <code>BigDecimal</code> |
147 | */ | 158 | */ |
148 | public BigDecimal getQuantidade() { | 159 | public BigDecimal getQuantidade() { |
149 | - | 160 | + |
150 | return quantidade; | 161 | return quantidade; |
151 | } | 162 | } |
152 | 163 | ||
153 | - | ||
154 | /** | 164 | /** |
155 | * Define o valor do atributo <code>quantidade</code>. | 165 | * Define o valor do atributo <code>quantidade</code>. |
156 | * | 166 | * |
157 | - * @param quantidade | 167 | + * @param quantidade |
158 | */ | 168 | */ |
159 | public void setQuantidade(BigDecimal quantidade) { | 169 | public void setQuantidade(BigDecimal quantidade) { |
160 | - | 170 | + |
161 | this.quantidade = quantidade; | 171 | this.quantidade = quantidade; |
162 | } | 172 | } |
163 | 173 | ||
164 | - | ||
165 | /** | 174 | /** |
166 | * Retorna o valor do atributo <code>unidadeMedidaEntrada</code> | 175 | * Retorna o valor do atributo <code>unidadeMedidaEntrada</code> |
167 | * | 176 | * |
168 | * @return <code>UnidadeMedida</code> | 177 | * @return <code>UnidadeMedida</code> |
169 | */ | 178 | */ |
170 | public UnidadeMedida getUnidadeMedidaEntrada() { | 179 | public UnidadeMedida getUnidadeMedidaEntrada() { |
171 | - | 180 | + |
172 | return unidadeMedidaEntrada; | 181 | return unidadeMedidaEntrada; |
173 | } | 182 | } |
174 | 183 | ||
175 | - | ||
176 | /** | 184 | /** |
177 | * Define o valor do atributo <code>unidadeMedidaEntrada</code>. | 185 | * Define o valor do atributo <code>unidadeMedidaEntrada</code>. |
178 | * | 186 | * |
179 | - * @param unidadeMedidaEntrada | 187 | + * @param unidadeMedidaEntrada |
180 | */ | 188 | */ |
181 | public void setUnidadeMedidaEntrada(UnidadeMedida unidadeMedidaEntrada) { | 189 | public void setUnidadeMedidaEntrada(UnidadeMedida unidadeMedidaEntrada) { |
182 | - | 190 | + |
183 | this.unidadeMedidaEntrada = unidadeMedidaEntrada; | 191 | this.unidadeMedidaEntrada = unidadeMedidaEntrada; |
184 | } | 192 | } |
185 | 193 | ||
186 | - | ||
187 | /** | 194 | /** |
188 | * Retorna o valor do atributo <code>materialEstoque</code> | 195 | * Retorna o valor do atributo <code>materialEstoque</code> |
189 | * | 196 | * |
190 | * @return <code>MaterialEstoque</code> | 197 | * @return <code>MaterialEstoque</code> |
191 | */ | 198 | */ |
192 | public MaterialEstoque getMaterialEstoque() { | 199 | public MaterialEstoque getMaterialEstoque() { |
193 | - | 200 | + |
194 | return materialEstoque; | 201 | return materialEstoque; |
195 | } | 202 | } |
196 | 203 | ||
197 | - | ||
198 | /** | 204 | /** |
199 | * Define o valor do atributo <code>materialEstoque</code>. | 205 | * Define o valor do atributo <code>materialEstoque</code>. |
200 | * | 206 | * |
201 | - * @param materialEstoque | 207 | + * @param materialEstoque |
202 | */ | 208 | */ |
203 | public void setMaterialEstoque(MaterialEstoque materialEstoque) { | 209 | public void setMaterialEstoque(MaterialEstoque materialEstoque) { |
204 | - | 210 | + |
205 | this.materialEstoque = materialEstoque; | 211 | this.materialEstoque = materialEstoque; |
206 | } | 212 | } |
207 | 213 | ||
208 | - | ||
209 | /** | 214 | /** |
210 | * Retorna o valor do atributo <code>materialEstoqueInativo</code> | 215 | * Retorna o valor do atributo <code>materialEstoqueInativo</code> |
211 | * | 216 | * |
212 | * @return <code>MaterialEstoque</code> | 217 | * @return <code>MaterialEstoque</code> |
213 | */ | 218 | */ |
214 | public MaterialEstoque getMaterialEstoqueInativo() { | 219 | public MaterialEstoque getMaterialEstoqueInativo() { |
215 | - | 220 | + |
216 | return materialEstoqueInativo; | 221 | return materialEstoqueInativo; |
217 | } | 222 | } |
218 | 223 | ||
219 | - | ||
220 | /** | 224 | /** |
221 | * Define o valor do atributo <code>materialEstoqueInativo</code>. | 225 | * Define o valor do atributo <code>materialEstoqueInativo</code>. |
222 | * | 226 | * |
223 | - * @param materialEstoqueInativo | 227 | + * @param materialEstoqueInativo |
224 | */ | 228 | */ |
225 | public void setMaterialEstoqueInativo(MaterialEstoque materialEstoqueInativo) { | 229 | public void setMaterialEstoqueInativo(MaterialEstoque materialEstoqueInativo) { |
226 | - | 230 | + |
227 | this.materialEstoqueInativo = materialEstoqueInativo; | 231 | this.materialEstoqueInativo = materialEstoqueInativo; |
228 | } | 232 | } |
229 | 233 | ||
234 | + public Boolean getLocalPrincipal() { | ||
235 | + return localPrincipal; | ||
236 | + } | ||
237 | + | ||
238 | + public void setLocalPrincipal(Boolean localPrincipal) { | ||
239 | + this.localPrincipal = localPrincipal; | ||
240 | + } | ||
241 | + | ||
230 | } | 242 | } |
cit-almoxarifado-web/src/main/java/br/com/centralit/controller/MaterialEnderecoEstoqueController.java
0 → 100644
@@ -0,0 +1,25 @@ | @@ -0,0 +1,25 @@ | ||
1 | +package br.com.centralit.controller; | ||
2 | + | ||
3 | +import org.springframework.beans.factory.annotation.Autowired; | ||
4 | +import org.springframework.stereotype.Controller; | ||
5 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
6 | + | ||
7 | +import br.com.centralit.api.model.MaterialEstoque; | ||
8 | +import br.com.centralit.api.service.MaterialEstoqueService; | ||
9 | +import br.com.centralit.framework.controller.GenericController; | ||
10 | + | ||
11 | +@Controller | ||
12 | +@RequestMapping("/rest/materialEnderecoEstoque") | ||
13 | +public class MaterialEnderecoEstoqueController extends GenericController<MaterialEstoque>{ | ||
14 | + | ||
15 | + private MaterialEstoqueService materialEstoqueService; | ||
16 | + | ||
17 | + | ||
18 | + @Autowired | ||
19 | + public MaterialEnderecoEstoqueController(MaterialEstoqueService materialEstoqueService) { | ||
20 | + super(materialEstoqueService); | ||
21 | + this.materialEstoqueService = materialEstoqueService; | ||
22 | + } | ||
23 | + | ||
24 | + | ||
25 | +} |
cit-almoxarifado-web/src/main/webapp/assets/js/angular/custom/repository/MaterialEnderecoEstoqueRepository.js
0 → 100644
@@ -0,0 +1,12 @@ | @@ -0,0 +1,12 @@ | ||
1 | +'use strict'; | ||
2 | + | ||
3 | +citApp.factory('MaterialEnderecoEstoqueRepository', ['RestangularAlmoxarifado', 'AbstractRepository', function (restangularAlmoxarifado, AbstractRepository) { | ||
4 | + | ||
5 | + function MaterialEnderecoEstoqueRepository() { | ||
6 | + AbstractRepository.call(this, restangularAlmoxarifado, 'rest/materialEnderecoEstoque'); | ||
7 | + } | ||
8 | + | ||
9 | + AbstractRepository.extend(MaterialEnderecoEstoqueRepository); | ||
10 | + | ||
11 | + return new MaterialEnderecoEstoqueRepository(); | ||
12 | +}]); |