Skip to content

Commit d436a79

Browse files
AmahitsuAMANDA HIRATA MEDEIROS
andauthored
imp tela para criar a matéria-prima (#36)
- esta conectada ao menu principal Co-authored-by: AMANDA HIRATA MEDEIROS <[email protected]>
1 parent 4a71e95 commit d436a79

File tree

10 files changed

+365
-271
lines changed

10 files changed

+365
-271
lines changed

MoonlightApp/src/main/java/com/moonlight/moonlightapp/services/materiasprimas/AtualizarMateriaPrimaService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public BaseDTO atualizar(AtualizarMateriaPrimaDTO dto) {
3333
return BaseDTO.buildFalha("matéria-prima não encontrado");
3434
}
3535

36-
if (!unidadeMedidaDAO.isCadastradoPorNome(dto.getSiglaUnidadeMedida())) {
36+
if (!unidadeMedidaDAO.isCadastrado(dto.getSiglaUnidadeMedida())) {
3737
return BaseDTO.buildFalha("unidade de medida não encontrada");
3838
}
3939

MoonlightApp/src/main/java/com/moonlight/moonlightapp/views/materiaprimas/AtualizarMateriaPrimaView.form

Lines changed: 76 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@
66
</Component>
77
</NonVisualComponents>
88
<Properties>
9-
<Property name="defaultCloseOperation" type="int" value="3"/>
9+
<Property name="defaultCloseOperation" type="int" value="2"/>
10+
<Property name="title" type="java.lang.String" value="Atualizar Mat&#xe9;ria-Prima"/>
1011
</Properties>
1112
<SyntheticProperties>
1213
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
13-
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
14+
<SyntheticProperty name="generateCenter" type="boolean" value="true"/>
1415
</SyntheticProperties>
16+
<Events>
17+
<EventHandler event="windowOpened" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowOpened"/>
18+
</Events>
1519
<AuxValues>
1620
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
1721
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
@@ -34,24 +38,16 @@
3438
<Component id="lblNomeMateriaPrima" min="-2" max="-2" attributes="0"/>
3539
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
3640
</Group>
37-
<Group type="102" attributes="0">
38-
<Group type="103" groupAlignment="0" attributes="0">
39-
<Component id="lblDescricaoMateriaPrima" min="-2" max="-2" attributes="0"/>
40-
<Component id="lblUnidadeMedidaMateriaPrima" alignment="0" min="-2" max="-2" attributes="0"/>
41-
</Group>
42-
<EmptySpace max="32767" attributes="0"/>
43-
<Component id="cbSelecionarMateriaPrima" min="-2" pref="291" max="-2" attributes="0"/>
44-
<EmptySpace max="-2" attributes="0"/>
45-
</Group>
4641
<Group type="102" alignment="0" attributes="0">
4742
<Group type="103" groupAlignment="0" attributes="0">
4843
<Component id="lblTipoMateriaPrima" alignment="0" min="-2" max="-2" attributes="0"/>
4944
<Component id="lblValorMateriaPrima" alignment="0" min="-2" max="-2" attributes="0"/>
5045
</Group>
5146
<EmptySpace min="-2" pref="101" max="-2" attributes="0"/>
5247
<Group type="103" groupAlignment="0" attributes="0">
53-
<Group type="102" alignment="0" attributes="0">
54-
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
48+
<Group type="102" attributes="0">
49+
<Component id="cbTipoMateriaPrima" min="-2" pref="217" max="-2" attributes="0"/>
50+
<EmptySpace max="32767" attributes="0"/>
5551
<Component id="btnAtualizar" min="-2" pref="112" max="-2" attributes="0"/>
5652
<EmptySpace min="-2" pref="55" max="-2" attributes="0"/>
5753
<Component id="btnVoltar" min="-2" pref="103" max="-2" attributes="0"/>
@@ -60,11 +56,9 @@
6056
<Group type="102" attributes="0">
6157
<Group type="103" groupAlignment="0" attributes="0">
6258
<Group type="103" groupAlignment="0" max="-2" attributes="0">
63-
<Component id="TxtDescricaoMateriaPrima" alignment="0" max="32767" attributes="0"/>
59+
<Component id="txtDescricaoMateriaPrima" alignment="0" max="32767" attributes="0"/>
6460
<Component id="txtNomeMateriaPrima" alignment="0" pref="312" max="32767" attributes="0"/>
6561
</Group>
66-
<Component id="cbUnidadeMedidaMateriaPrima" alignment="0" min="-2" pref="217" max="-2" attributes="0"/>
67-
<Component id="cbTipoMateriaPrima" min="-2" pref="217" max="-2" attributes="0"/>
6862
<Component id="txtValorMateriaPrima" min="-2" pref="217" max="-2" attributes="0"/>
6963
</Group>
7064
<EmptySpace pref="68" max="32767" attributes="0"/>
@@ -73,13 +67,32 @@
7367
</Group>
7468
</Group>
7569
</Group>
70+
<Group type="102" attributes="0">
71+
<Group type="103" groupAlignment="0" attributes="0">
72+
<Group type="102" alignment="0" attributes="0">
73+
<Component id="lblUnidadeMedidaMateriaPrima" min="-2" max="-2" attributes="0"/>
74+
<EmptySpace max="-2" attributes="0"/>
75+
<Component id="cbUnidadeMedidaMateriaPrima" min="-2" pref="217" max="-2" attributes="0"/>
76+
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
77+
</Group>
78+
<Group type="102" attributes="0">
79+
<Group type="103" groupAlignment="0" attributes="0">
80+
<Component id="lblDescricaoMateriaPrima" min="-2" max="-2" attributes="0"/>
81+
<Component id="lblQuantidade" alignment="0" min="-2" max="-2" attributes="0"/>
82+
</Group>
83+
<EmptySpace min="-2" pref="45" max="-2" attributes="0"/>
84+
<Component id="txtQuantidade" min="-2" pref="217" max="-2" attributes="0"/>
85+
<EmptySpace pref="148" max="32767" attributes="0"/>
86+
<Group type="103" groupAlignment="0" attributes="0">
87+
<Component id="cbSelecionarMateriaPrima" alignment="1" min="-2" pref="291" max="-2" attributes="0"/>
88+
<Component id="lblSelecioneMateriaPrima" alignment="1" min="-2" max="-2" attributes="0"/>
89+
</Group>
90+
</Group>
91+
</Group>
92+
<EmptySpace max="-2" attributes="0"/>
93+
</Group>
7694
</Group>
7795
</Group>
78-
<Group type="102" alignment="1" attributes="0">
79-
<EmptySpace max="32767" attributes="0"/>
80-
<Component id="lblSelecioneMateriaPrima" min="-2" max="-2" attributes="0"/>
81-
<EmptySpace max="-2" attributes="0"/>
82-
</Group>
8396
</Group>
8497
</DimensionLayout>
8598
<DimensionLayout dim="1">
@@ -107,36 +120,40 @@
107120
</Group>
108121
<Group type="103" groupAlignment="0" attributes="0">
109122
<Component id="lblDescricaoMateriaPrima" alignment="0" min="-2" max="-2" attributes="0"/>
110-
<Component id="TxtDescricaoMateriaPrima" alignment="0" min="-2" pref="176" max="-2" attributes="0"/>
123+
<Component id="txtDescricaoMateriaPrima" alignment="0" min="-2" pref="176" max="-2" attributes="0"/>
111124
</Group>
112-
<EmptySpace type="separate" max="-2" attributes="0"/>
113-
<Group type="103" groupAlignment="1" attributes="0">
114-
<Component id="txtValorMateriaPrima" min="-2" pref="36" max="-2" attributes="0"/>
115-
<Component id="lblValorMateriaPrima" min="-2" max="-2" attributes="0"/>
125+
<EmptySpace min="-2" pref="26" max="-2" attributes="0"/>
126+
<Group type="103" groupAlignment="3" attributes="0">
127+
<Component id="lblValorMateriaPrima" alignment="3" min="-2" max="-2" attributes="0"/>
128+
<Component id="txtValorMateriaPrima" alignment="3" min="-2" pref="36" max="-2" attributes="0"/>
116129
</Group>
117130
<EmptySpace max="-2" attributes="0"/>
118-
<Component id="lblSelecioneMateriaPrima" min="-2" max="-2" attributes="0"/>
119-
<EmptySpace max="-2" attributes="0"/>
120-
<Group type="103" groupAlignment="0" attributes="0">
121-
<Group type="102" alignment="1" attributes="0">
122-
<Group type="103" groupAlignment="1" max="-2" attributes="0">
123-
<Component id="cbUnidadeMedidaMateriaPrima" pref="25" max="32767" attributes="0"/>
124-
<Component id="cbSelecionarMateriaPrima" max="32767" attributes="0"/>
125-
</Group>
126-
<EmptySpace min="-2" pref="33" max="-2" attributes="0"/>
127-
<Group type="103" groupAlignment="3" attributes="0">
128-
<Component id="cbTipoMateriaPrima" alignment="3" min="-2" pref="28" max="-2" attributes="0"/>
129-
<Component id="lblTipoMateriaPrima" alignment="3" min="-2" max="-2" attributes="0"/>
130-
</Group>
131+
<Group type="103" groupAlignment="1" attributes="0">
132+
<Group type="102" attributes="0">
133+
<Component id="lblSelecioneMateriaPrima" min="-2" max="-2" attributes="0"/>
134+
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
135+
<Component id="cbSelecionarMateriaPrima" min="-2" pref="25" max="-2" attributes="0"/>
136+
</Group>
137+
<Group type="103" groupAlignment="3" attributes="0">
138+
<Component id="lblQuantidade" alignment="3" min="-2" max="-2" attributes="0"/>
139+
<Component id="txtQuantidade" alignment="3" min="-2" pref="36" max="-2" attributes="0"/>
131140
</Group>
132-
<Component id="lblUnidadeMedidaMateriaPrima" min="-2" max="-2" attributes="0"/>
133141
</Group>
134-
<EmptySpace min="-2" pref="21" max="-2" attributes="0"/>
142+
<EmptySpace min="-2" pref="36" max="-2" attributes="0"/>
143+
<Group type="103" groupAlignment="3" attributes="0">
144+
<Component id="lblUnidadeMedidaMateriaPrima" alignment="3" min="-2" max="-2" attributes="0"/>
145+
<Component id="cbUnidadeMedidaMateriaPrima" alignment="3" pref="25" max="32767" attributes="0"/>
146+
</Group>
147+
<EmptySpace type="separate" max="-2" attributes="0"/>
135148
<Group type="103" groupAlignment="0" max="-2" attributes="0">
149+
<Component id="btnAtualizar" pref="45" max="32767" attributes="0"/>
136150
<Component id="btnVoltar" pref="45" max="32767" attributes="0"/>
137-
<Component id="btnAtualizar" alignment="0" max="32767" attributes="0"/>
151+
<Group type="103" alignment="0" groupAlignment="3" attributes="0">
152+
<Component id="cbTipoMateriaPrima" alignment="3" min="-2" pref="28" max="-2" attributes="0"/>
153+
<Component id="lblTipoMateriaPrima" alignment="3" min="-2" max="-2" attributes="0"/>
154+
</Group>
138155
</Group>
139-
<EmptySpace pref="67" max="32767" attributes="0"/>
156+
<EmptySpace pref="56" max="32767" attributes="0"/>
140157
</Group>
141158
</Group>
142159
</DimensionLayout>
@@ -211,10 +228,7 @@
211228
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;TipoMateriaPrimaModel&gt;"/>
212229
</AuxValues>
213230
</Component>
214-
<Component class="javax.swing.JTextField" name="TxtDescricaoMateriaPrima">
215-
<Events>
216-
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="TxtDescricaoMateriaPrimaActionPerformed"/>
217-
</Events>
231+
<Component class="javax.swing.JTextField" name="txtDescricaoMateriaPrima">
218232
</Component>
219233
<Component class="javax.swing.JButton" name="btnAtualizar">
220234
<Properties>
@@ -233,6 +247,9 @@
233247
<StringArray count="0"/>
234248
</Property>
235249
</Properties>
250+
<Events>
251+
<EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="cbSelecionarMateriaPrimaItemStateChanged"/>
252+
</Events>
236253
<AuxValues>
237254
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;MateriaPrimaModel&gt;"/>
238255
</AuxValues>
@@ -244,9 +261,7 @@
244261
<Component class="javax.swing.JComboBox" name="cbUnidadeMedidaMateriaPrima">
245262
<Properties>
246263
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
247-
<StringArray count="1">
248-
<StringItem index="0" value=" "/>
249-
</StringArray>
264+
<StringArray count="0"/>
250265
</Property>
251266
</Properties>
252267
<AuxValues>
@@ -258,8 +273,18 @@
258273
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
259274
<Font name="Segoe UI" size="18" style="1"/>
260275
</Property>
261-
<Property name="text" type="java.lang.String" value="Atualizar Mat&#xe9;ria-Prima"/>
276+
<Property name="text" type="java.lang.String" value="Selecione a Mat&#xe9;ria-Prima"/>
277+
</Properties>
278+
</Component>
279+
<Component class="javax.swing.JLabel" name="lblQuantidade">
280+
<Properties>
281+
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
282+
<Font name="Segoe UI" size="18" style="1"/>
283+
</Property>
284+
<Property name="text" type="java.lang.String" value="Quantidade"/>
262285
</Properties>
263286
</Component>
287+
<Component class="javax.swing.JTextField" name="txtQuantidade">
288+
</Component>
264289
</SubComponents>
265290
</Form>

0 commit comments

Comments
 (0)