@@ -58,11 +58,55 @@ private static void cadastar() {
5858
5959 private static void consultarVendas () {
6060 System .out .println ("\n \n ========CONSULTAR VENDAS========\n " );
61- ArrayList <Vendas > listaVendas = VendasController .getAll ();
62- for (Vendas v : listaVendas ) {
61+
62+ System .out .println ("(1) TODOS" );
63+ System .out .println ("(2) Vendas por dia" );
64+ System .out .print ("\n Informe a opção desejada: " );
65+ int op = Receber .inteiro ();
66+
67+ switch (op ) {
68+ case 1 : //todos
69+ ArrayList <Veiculo > listaAllVeiculos = VeiculoController .getAll ();
70+ System .out .println ("\n _____TODOS OS VEÍCULOS_____\n " );
71+
72+ ArrayList <Vendas > listaVendas = VendasController .getAll ();
73+
74+ for (int i = 0 ; i < listaVendas .size (); i ++) {
75+ System .out .println ("Venda\n " );
76+ VendasController .imprime (listaVendas .get (i ));
77+ System .out .println ("\n Veiculo\n " );
78+ VeiculoController .imprime (listaAllVeiculos .get (i ));
79+ System .out .println ("_____________________\n " );
80+ }
81+ // for (Vendas v : listaVendas) {
82+ //
83+ // for(Veiculo c : listaAllVeiculos){
84+ //
85+ // }
86+ //
87+ // System.out.println("_____________________");
88+ // }
89+ if (listaVendas .isEmpty ()) {
90+ System .out .println ("\n --Não há Vendas Cadastradas--" );
91+
92+ }
93+ break ;
94+ case 2 : //por dia
95+ System .out .print ("\n Informe a data da seguinte forma aaaa-mm-dd: " );
96+ String dia = Receber .texto ();
97+ ArrayList <Vendas > listaVendasPorDia = VendasController .getVendasPorDia (dia );
98+ for (Vendas v : listaVendasPorDia ) {
6399 VendasController .imprime (v );
64100 System .out .println ("_____________________" );
101+
102+ }
103+ if (listaVendasPorDia .isEmpty ()) {
104+ System .out .println ("\n --Não há Vendas Cadastradas neste Dia--" );
105+
65106 }
107+ break ;
108+ }
109+
66110 }
67111
68112 private static void consultar () {
@@ -87,7 +131,7 @@ private static void consultar() {
87131 }
88132
89133 if (lista .isEmpty ()) {
90- System .out .println ("--Não há Cadastros--" );
134+ System .out .println ("\n --Não há Cadastros--" );
91135 }
92136 break ;
93137 case 2 : //por fabricante
@@ -102,7 +146,7 @@ private static void consultar() {
102146 }
103147
104148 if (lista2 .isEmpty ()) {
105- System .out .println ("--Não há Cadastros com fabricante: " + fabricante + "--" );
149+ System .out .println ("\n --Não há Cadastros com fabricante: " + fabricante + "--" );
106150 }
107151 break ;
108152 case 3 : //por preço máximo
@@ -118,7 +162,7 @@ private static void consultar() {
118162 }
119163
120164 if (lista3 .isEmpty ()) {
121- System .out .println ("--Não há Cadastros até R$ " + valor + "--" );
165+ System .out .println ("\n --Não há Cadastros até R$ " + valor + "--" );
122166 }
123167 break ;
124168 case 4 : //COR
@@ -134,7 +178,7 @@ private static void consultar() {
134178 }
135179
136180 if (lista4 .isEmpty ()) {
137- System .out .println ("--Não há Cadastros até R$ " + cor + "--" );
181+ System .out .println ("\n --Não há Cadastros até R$ " + cor + "--" );
138182 }
139183 break ;
140184 case 5 : //FAIXA DE PREÇO
@@ -152,7 +196,7 @@ private static void consultar() {
152196 }
153197
154198 if (lista5 .isEmpty ()) {
155- System .out .println ("--Não há Cadastros até R$ " + menor + " A " + maior + "--" );
199+ System .out .println ("\n --Não há Cadastros até R$ " + menor + " A " + maior + "--" );
156200 }
157201 break ;
158202 case 6 : //por preço MODELO
@@ -168,7 +212,7 @@ private static void consultar() {
168212 }
169213
170214 if (lista6 .isEmpty ()) {
171- System .out .println ("--Não há Cadastros até R$ " + modelo + "--" );
215+ System .out .println ("\n --Não há Cadastros até R$ " + modelo + "--" );
172216 }
173217 break ;
174218 }
0 commit comments