From 78675fdee3240db2c0dbc6136218f03758cdea70 Mon Sep 17 00:00:00 2001
From: Yasmin Cordeiro <67525293+yasmincsme@users.noreply.github.com>
Date: Sun, 18 Jun 2023 01:46:36 -0300
Subject: [PATCH] :books: docs: Atualizando arquivo
---
.idea/workspace.xml | 659 +++++++-----------
clients.dat | Bin 645 -> 554 bytes
orders.dat | Bin 987 -> 1023 bytes
.../controller/OrdersController.java | 24 +
.../controller/UpdateOrderController.java | 41 +-
.../UpdateOrderView.fxml | 17 +-
6 files changed, 326 insertions(+), 415 deletions(-)
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index b5ae98c..2462e3f 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,80 +7,17 @@
-
-
-
+
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
@@ -99,76 +36,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -360,352 +227,352 @@
-
+
-
- 1683432106063
-
-
+
+ 1687060759128
+
+
- 1683432106065
+ 1687060759128
-
- 1683432118330
-
-
+
+ 1687060783751
+
+
- 1683432118330
+ 1687060783751
-
- 1683432136385
-
-
+
+ 1687060794849
+
+
- 1683432136386
+ 1687060794849
-
- 1683432175366
-
-
+
+ 1687060835642
+
+
- 1683432175367
+ 1687060835642
-
- 1683432189816
-
-
+
+ 1687060976163
+
+
- 1683432189818
+ 1687060976163
-
- 1683595814075
-
-
+
+ 1687060986144
+
+
- 1683595814076
+ 1687060986144
-
- 1683595836571
-
-
+
+ 1687060999274
+
+
- 1683595836571
+ 1687060999274
-
- 1683595871652
-
-
+
+ 1687061012896
+
+
- 1683595871652
+ 1687061012896
-
- 1683595883084
-
-
+
+ 1687061038556
+
+
- 1683595883084
+ 1687061038556
-
- 1683595894694
-
-
+
+ 1687061049541
+
+
- 1683595894694
+ 1687061049541
-
- 1683595905527
-
-
+
+ 1687061061721
+
+
- 1683595905527
+ 1687061061721
-
- 1683595918072
-
-
+
+ 1687061073209
+
+
- 1683595918072
+ 1687061073209
-
- 1683595928943
-
-
+
+ 1687061086356
+
+
- 1683595928943
+ 1687061086356
-
- 1683595942158
-
-
+
+ 1687061098858
+
+
- 1683595942158
+ 1687061098859
-
- 1683595956435
-
-
+
+ 1687061156067
+
+
- 1683595956435
+ 1687061156067
-
- 1683595970116
-
-
+
+ 1687061168593
+
+
- 1683595970116
+ 1687061168593
-
- 1683595982123
-
-
+
+ 1687061183041
+
+
- 1683595982123
+ 1687061183041
-
- 1683595991709
-
-
+
+ 1687061194115
+
+
- 1683595991709
+ 1687061194115
-
- 1683596217081
-
-
+
+ 1687061206750
+
+
- 1683596217081
+ 1687061206750
-
- 1683596712736
-
-
+
+ 1687061217356
+
+
- 1683596712737
+ 1687061217356
-
- 1683596860953
-
-
+
+ 1687061229737
+
+
- 1683596860954
+ 1687061229737
-
- 1683596879701
-
-
+
+ 1687061242018
+
+
- 1683596879701
+ 1687061242018
-
- 1686544096837
-
-
+
+ 1687061252897
+
+
- 1686544096838
+ 1687061252897
-
- 1686544151831
-
-
+
+ 1687061263513
+
+
- 1686544151831
+ 1687061263514
-
- 1686544173972
-
-
+
+ 1687061277772
+
+
- 1686544173972
+ 1687061277773
-
- 1686544200107
-
-
+
+ 1687061296102
+
+
- 1686544200107
+ 1687061296102
-
- 1686544220049
-
-
+
+ 1687061310434
+
+
- 1686544220049
+ 1687061310434
-
- 1686544240287
-
-
+
+ 1687061326039
+
+
- 1686544240288
+ 1687061326040
-
- 1686544265606
-
-
+
+ 1687061338267
+
+
- 1686544265607
+ 1687061338267
-
- 1686544296257
-
-
+
+ 1687061348624
+
+
- 1686544296258
+ 1687061348624
-
- 1686544314854
-
-
+
+ 1687061361179
+
+
- 1686544314854
+ 1687061361179
-
- 1686544334059
-
-
+
+ 1687061373743
+
+
- 1686544334059
+ 1687061373743
-
- 1686544350306
-
-
+
+ 1687061385444
+
+
- 1686544350306
+ 1687061385444
-
- 1686544372074
-
-
+
+ 1687061395936
+
+
- 1686544372074
+ 1687061395936
-
- 1686544407776
-
-
+
+ 1687061403940
+
+
- 1686544407776
+ 1687061403941
-
- 1687046042194
-
-
+
+ 1687061416511
+
+
- 1687046042195
+ 1687061416511
-
- 1687046076815
-
-
+
+ 1687061436361
+
+
- 1687046076815
+ 1687061436361
-
- 1687046091437
-
-
+
+ 1687061448020
+
+
- 1687046091437
+ 1687061448020
-
- 1687046105316
-
-
+
+ 1687061458422
+
+
- 1687046105316
+ 1687061458422
-
- 1687046119098
-
-
+
+ 1687061469910
+
+
- 1687046119098
+ 1687061469910
-
- 1687046157958
-
-
+
+ 1687061481581
+
+
- 1687046157958
+ 1687061481581
-
- 1687046180909
-
-
+
+ 1687061492390
+
+
- 1687046180909
+ 1687061492390
-
- 1687046199264
-
-
+
+ 1687061530323
+
+
- 1687046199264
+ 1687061530323
-
- 1687046214561
-
-
+
+ 1687061543813
+
+
- 1687046214561
+ 1687061543813
-
- 1687046235626
-
-
+
+ 1687061589359
+
+
- 1687046235626
+ 1687061589359
-
- 1687046250155
-
-
+
+ 1687061614065
+
+
- 1687046250155
+ 1687061614065
-
- 1687046319164
-
-
+
+ 1687061626509
+
+
- 1687046319165
+ 1687061626509
-
- 1687046330311
-
-
+
+ 1687061641701
+
+
- 1687046330311
+ 1687061641701
-
- 1687046344115
-
-
+
+ 1687061676873
+
+
- 1687046344117
+ 1687061676873
-
+
@@ -723,14 +590,6 @@
-
-
-
-
-
-
-
-
@@ -748,7 +607,15 @@
-
+
+
+
+
+
+
+
+
+
diff --git a/clients.dat b/clients.dat
index 9710331d0d33fb2f1158a6ce4cd96b2ae9c87133..6d07e02eff7deb04ad14136746b95e264ee5620d 100644
GIT binary patch
delta 22
dcmZo=UBxoNh@H8dg@J*Ad7|Z#%@&Nli~v1N1uFmm
delta 111
zcmZ3*(#kr)h@GXJg@J*AWuoPhNRH&hlEk9Syu=a)*3{g@%$yPil{8ax)07lbQ(Z%o
zBtu;jV>4r23uDtnT|-NQGy^jOVR{E+FGR0)H)p@pu2nXZw6k+Fh-p_Pf5m4S(#iHYFg<^
R9B!U|p1~fjE+q^M6#!)!5e@(V
delta 29
lcmey*ew%&6113g>$uF3WF&0cd!K}r};veAZSHi$h0RXF83F80&
diff --git a/src/main/java/com/example/exa863_management_system_2023/controller/OrdersController.java b/src/main/java/com/example/exa863_management_system_2023/controller/OrdersController.java
index 974ef19..6cdc9a1 100644
--- a/src/main/java/com/example/exa863_management_system_2023/controller/OrdersController.java
+++ b/src/main/java/com/example/exa863_management_system_2023/controller/OrdersController.java
@@ -18,6 +18,7 @@
import java.io.IOException;
import java.util.List;
+import java.util.Objects;
public class OrdersController extends MenuController{
@@ -67,6 +68,7 @@ public class OrdersController extends MenuController{
private void initialize(){
selectedOrder = null;
initializeTable();
+ updateValues();
}
private void initializeTable(){
@@ -104,6 +106,28 @@ private void initializeTable(){
}
}
+ public void updateValues() {
+ int totalOrders = 0;
+ int canceledOrders = 0;
+ int pendignOrders = 0;
+ int openedOrders = 0;
+ List orderList = DAO.getWorkOrder().findMany();
+ for(WorkOrder workOrder : orderList) {
+ totalOrders += 1;
+ if (Objects.equals(workOrder.getStatus(), "OPEN")) {
+ openedOrders += 1;
+ } else if (Objects.equals(workOrder.getStatus(), "CANCELED")) {
+ canceledOrders += 1;
+ } else {
+ pendignOrders += 1;
+ }
+ }
+ this.numTotalLabel.setText(String.valueOf(totalOrders));
+ this.numCanceledLabel.setText(String.valueOf(canceledOrders));
+ this.numCompletedLabel.setText(String.valueOf(pendignOrders));
+ this.numOrdersLabel.setText(String.valueOf(openedOrders));
+ }
+
@FXML
void removeOrder(ActionEvent event) throws IOException {
try {
diff --git a/src/main/java/com/example/exa863_management_system_2023/controller/UpdateOrderController.java b/src/main/java/com/example/exa863_management_system_2023/controller/UpdateOrderController.java
index 802c496..ea4d03c 100644
--- a/src/main/java/com/example/exa863_management_system_2023/controller/UpdateOrderController.java
+++ b/src/main/java/com/example/exa863_management_system_2023/controller/UpdateOrderController.java
@@ -4,6 +4,7 @@
import com.example.exa863_management_system_2023.dao.DAO;
import com.example.exa863_management_system_2023.exceptions.InvalidSatisfactionScore;
import com.example.exa863_management_system_2023.exceptions.ObjectNotFoundException;
+import com.example.exa863_management_system_2023.exceptions.WorkOrderWithoutTechnician;
import com.example.exa863_management_system_2023.model.WorkOrder;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
@@ -16,35 +17,30 @@
public class UpdateOrderController {
- @FXML
- private TextField IDField;
-
+ //Button
@FXML
private Button cancelButton;
-
@FXML
- private TextField clientIDField;
+ private Button saveButton;
- @FXML
- private TextField costField;
+ //Field
@FXML
private TextField descriptionField;
-
@FXML
- private TextField paymentMethodField;
-
+ private TextField clientIDField;
+ @FXML
+ private TextField technicianID;
+ @FXML
+ private TextField statusField;
@FXML
private TextField priceField;
-
@FXML
- private TextField satisfactionScoreField;
-
+ private TextField costField;
@FXML
- private Button saveButton;
-
+ private TextField satisfactionScoreField;
@FXML
- private TextField technicianID;
+ private TextField paymentMethodField;
@FXML
void cancelOperation(ActionEvent event) throws IOException {
@@ -54,7 +50,7 @@ void cancelOperation(ActionEvent event) throws IOException {
}
@FXML
- void saveOrder(ActionEvent event) throws InvalidSatisfactionScore, ObjectNotFoundException, IOException {
+ void saveOrder(ActionEvent event) throws InvalidSatisfactionScore, ObjectNotFoundException, IOException, WorkOrderWithoutTechnician {
WorkOrder order = (WorkOrder) OrdersController.selectedOrder;
if (!descriptionField.getText().isEmpty()) {
@@ -66,6 +62,17 @@ void saveOrder(ActionEvent event) throws InvalidSatisfactionScore, ObjectNotFoun
if (!technicianID.getText().isEmpty()) {
order.setTechnicianID(technicianID.getText());
}
+ if (!statusField.getText().isEmpty()) {
+ if (statusField.getText().toLowerCase().charAt(0) == 'o') {
+ order.reopen();
+ }
+ if (statusField.getText().toLowerCase().charAt(0) == 'c') {
+ order.cancel();
+ }
+ if (statusField.getText().toLowerCase().charAt(0) == 'f') {
+ order.finish();
+ }
+ }
if (!priceField.getText().isEmpty()) {
order.setPrice(Double.parseDouble(priceField.getText()));
}
diff --git a/src/main/resources/com/example/exa863_management_system_2023/UpdateOrderView.fxml b/src/main/resources/com/example/exa863_management_system_2023/UpdateOrderView.fxml
index 64e69b1..3339e59 100644
--- a/src/main/resources/com/example/exa863_management_system_2023/UpdateOrderView.fxml
+++ b/src/main/resources/com/example/exa863_management_system_2023/UpdateOrderView.fxml
@@ -25,14 +25,14 @@
-
+
-
+
@@ -49,6 +49,11 @@
+
+
+
+
+
@@ -100,6 +105,14 @@
+