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 | 2 | |
3 | 3 | import java.math.BigDecimal; |
4 | 4 | |
5 | +import javax.persistence.CascadeType; | |
5 | 6 | import javax.persistence.Entity; |
6 | 7 | import javax.persistence.FetchType; |
7 | 8 | import javax.persistence.GeneratedValue; |
... | ... | @@ -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 | 48 | * @since 29/04/2016 - 09:06:28 |
36 | 49 | * |
37 | 50 | * @version 1.0.0 |
... | ... | @@ -52,30 +65,32 @@ public class MaterialLocalEstoque extends PersistentObjectAuditOrganizacao { |
52 | 65 | @GeneratedValue(strategy = GenerationType.AUTO) |
53 | 66 | @JsonView({ Views.GenericView.class }) |
54 | 67 | private Long id; |
55 | - | |
68 | + | |
56 | 69 | /** Atributo materialEstoque. */ |
57 | - @OneToOne(fetch = FetchType.LAZY, optional = false) | |
70 | + @OneToOne(fetch = FetchType.LAZY, optional = false, cascade = CascadeType.PERSIST) | |
58 | 71 | private MaterialEstoque materialEstoque; |
59 | - | |
72 | + | |
60 | 73 | /** Atributo materialEstoqueInativo. */ |
61 | 74 | @ManyToOne(fetch = FetchType.LAZY, optional = true) |
62 | 75 | private MaterialEstoque materialEstoqueInativo; |
63 | - | |
76 | + | |
64 | 77 | /** Atributo endereco. */ |
65 | 78 | @OneToOne(fetch = FetchType.LAZY, optional = false) |
66 | 79 | private EnderecoEstoque endereco; |
67 | - | |
80 | + | |
68 | 81 | /** Atributo enderecoInativo. */ |
69 | 82 | @ManyToOne(fetch = FetchType.LAZY, optional = true) |
70 | 83 | private EnderecoEstoque enderecoInativo; |
71 | - | |
84 | + | |
72 | 85 | /** Atributo quantidade. */ |
73 | 86 | private BigDecimal quantidade; |
74 | - | |
87 | + | |
75 | 88 | /** Atributo unidadeMedidaEntrada. */ |
76 | - @ManyToOne(fetch = FetchType.LAZY, optional = false) | |
89 | + @ManyToOne(fetch = FetchType.LAZY, optional = false) | |
77 | 90 | private UnidadeMedida unidadeMedidaEntrada; |
78 | 91 | |
92 | + private Boolean localPrincipal; | |
93 | + | |
79 | 94 | /** |
80 | 95 | * Retorna o valor do atributo <code>id</code> |
81 | 96 | * |
... | ... | @@ -95,48 +110,44 @@ public class MaterialLocalEstoque extends PersistentObjectAuditOrganizacao { |
95 | 110 | |
96 | 111 | this.id = id; |
97 | 112 | } |
98 | - | |
113 | + | |
99 | 114 | /** |
100 | 115 | * Retorna o valor do atributo <code>endereco</code> |
101 | 116 | * |
102 | 117 | * @return <code>EnderecoEstoque</code> |
103 | 118 | */ |
104 | 119 | public EnderecoEstoque getEndereco() { |
105 | - | |
120 | + | |
106 | 121 | return endereco; |
107 | 122 | } |
108 | 123 | |
109 | - | |
110 | 124 | /** |
111 | 125 | * Define o valor do atributo <code>endereco</code>. |
112 | 126 | * |
113 | - * @param endereco | |
127 | + * @param endereco | |
114 | 128 | */ |
115 | 129 | public void setEndereco(EnderecoEstoque endereco) { |
116 | - | |
130 | + | |
117 | 131 | this.endereco = endereco; |
118 | 132 | } |
119 | 133 | |
120 | - | |
121 | - | |
122 | 134 | /** |
123 | 135 | * Retorna o valor do atributo <code>enderecoInativo</code> |
124 | 136 | * |
125 | 137 | * @return <code>EnderecoEstoque</code> |
126 | 138 | */ |
127 | 139 | public EnderecoEstoque getEnderecoInativo() { |
128 | - | |
140 | + | |
129 | 141 | return enderecoInativo; |
130 | 142 | } |
131 | 143 | |
132 | - | |
133 | 144 | /** |
134 | 145 | * Define o valor do atributo <code>enderecoInativo</code>. |
135 | 146 | * |
136 | - * @param enderecoInativo | |
147 | + * @param enderecoInativo | |
137 | 148 | */ |
138 | 149 | public void setEnderecoInativo(EnderecoEstoque enderecoInativo) { |
139 | - | |
150 | + | |
140 | 151 | this.enderecoInativo = enderecoInativo; |
141 | 152 | } |
142 | 153 | |
... | ... | @@ -146,85 +157,86 @@ public class MaterialLocalEstoque extends PersistentObjectAuditOrganizacao { |
146 | 157 | * @return <code>BigDecimal</code> |
147 | 158 | */ |
148 | 159 | public BigDecimal getQuantidade() { |
149 | - | |
160 | + | |
150 | 161 | return quantidade; |
151 | 162 | } |
152 | 163 | |
153 | - | |
154 | 164 | /** |
155 | 165 | * Define o valor do atributo <code>quantidade</code>. |
156 | 166 | * |
157 | - * @param quantidade | |
167 | + * @param quantidade | |
158 | 168 | */ |
159 | 169 | public void setQuantidade(BigDecimal quantidade) { |
160 | - | |
170 | + | |
161 | 171 | this.quantidade = quantidade; |
162 | 172 | } |
163 | 173 | |
164 | - | |
165 | 174 | /** |
166 | 175 | * Retorna o valor do atributo <code>unidadeMedidaEntrada</code> |
167 | 176 | * |
168 | 177 | * @return <code>UnidadeMedida</code> |
169 | 178 | */ |
170 | 179 | public UnidadeMedida getUnidadeMedidaEntrada() { |
171 | - | |
180 | + | |
172 | 181 | return unidadeMedidaEntrada; |
173 | 182 | } |
174 | 183 | |
175 | - | |
176 | 184 | /** |
177 | 185 | * Define o valor do atributo <code>unidadeMedidaEntrada</code>. |
178 | 186 | * |
179 | - * @param unidadeMedidaEntrada | |
187 | + * @param unidadeMedidaEntrada | |
180 | 188 | */ |
181 | 189 | public void setUnidadeMedidaEntrada(UnidadeMedida unidadeMedidaEntrada) { |
182 | - | |
190 | + | |
183 | 191 | this.unidadeMedidaEntrada = unidadeMedidaEntrada; |
184 | 192 | } |
185 | 193 | |
186 | - | |
187 | 194 | /** |
188 | 195 | * Retorna o valor do atributo <code>materialEstoque</code> |
189 | 196 | * |
190 | 197 | * @return <code>MaterialEstoque</code> |
191 | 198 | */ |
192 | 199 | public MaterialEstoque getMaterialEstoque() { |
193 | - | |
200 | + | |
194 | 201 | return materialEstoque; |
195 | 202 | } |
196 | 203 | |
197 | - | |
198 | 204 | /** |
199 | 205 | * Define o valor do atributo <code>materialEstoque</code>. |
200 | 206 | * |
201 | - * @param materialEstoque | |
207 | + * @param materialEstoque | |
202 | 208 | */ |
203 | 209 | public void setMaterialEstoque(MaterialEstoque materialEstoque) { |
204 | - | |
210 | + | |
205 | 211 | this.materialEstoque = materialEstoque; |
206 | 212 | } |
207 | 213 | |
208 | - | |
209 | 214 | /** |
210 | 215 | * Retorna o valor do atributo <code>materialEstoqueInativo</code> |
211 | 216 | * |
212 | 217 | * @return <code>MaterialEstoque</code> |
213 | 218 | */ |
214 | 219 | public MaterialEstoque getMaterialEstoqueInativo() { |
215 | - | |
220 | + | |
216 | 221 | return materialEstoqueInativo; |
217 | 222 | } |
218 | 223 | |
219 | - | |
220 | 224 | /** |
221 | 225 | * Define o valor do atributo <code>materialEstoqueInativo</code>. |
222 | 226 | * |
223 | - * @param materialEstoqueInativo | |
227 | + * @param materialEstoqueInativo | |
224 | 228 | */ |
225 | 229 | public void setMaterialEstoqueInativo(MaterialEstoque materialEstoqueInativo) { |
226 | - | |
230 | + | |
227 | 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 @@ |
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 @@ |
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 | +}]); | ... | ... |