From c8d3ab3ff06fc88f6a733a0a0c9d679b699ae030 Mon Sep 17 00:00:00 2001 From: localhorst Date: Sat, 30 May 2020 16:16:14 +0200 Subject: [PATCH 01/20] list suppliers page --- .../hso/ecommerce/app/RequestController.java | 12 +- .../suppliers/SupplierIndexController.java | 56 ++++++++- .../repos/supplier/SupplierRepository.java | 8 ++ .../templates/intern/suppliers/index.html | 111 ++++++++---------- 4 files changed, 115 insertions(+), 72 deletions(-) diff --git a/prototype/src/main/java/org/hso/ecommerce/app/RequestController.java b/prototype/src/main/java/org/hso/ecommerce/app/RequestController.java index bb0b5d6..0f9c42e 100644 --- a/prototype/src/main/java/org/hso/ecommerce/app/RequestController.java +++ b/prototype/src/main/java/org/hso/ecommerce/app/RequestController.java @@ -100,11 +100,12 @@ public class RequestController { return "intern/customerOrders/id"; } + /* @GetMapping("/intern/suppliers/") public String internSuppliers() { return "intern/suppliers/index"; } - +*/ @GetMapping("/intern/suppliers/{id}") public String internSuppliersId() { return "intern/suppliers/id"; @@ -120,15 +121,6 @@ public class RequestController { return "intern/supplierOrders/id"; } - /* - - @GetMapping("/intern/suppliersOffers") - public String internSuppliersOffers() { - return "intern/offeredArticles/index"; - } - */ - - @GetMapping("/intern/accounting/") public String accounting() { return "intern/accounting/index"; diff --git a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java index d6cefc0..56ca421 100644 --- a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java +++ b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java @@ -1,8 +1,62 @@ package org.hso.ecommerce.controller.intern.suppliers; +import java.util.ArrayList; +import java.util.List; + +import org.hso.ecommerce.entities.supplier.Supplier; +import org.hso.ecommerce.repos.supplier.SupplierRepository; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; @Controller -//@RequestMapping("...") +@RequestMapping("/intern/") public class SupplierIndexController { + + @Autowired + private final SupplierRepository supplierRepository = null; + + @GetMapping("suppliers") + public String listSuppliers(Model model) { + + List totals = new ArrayList(); + + for (Supplier supplier : supplierRepository.findAll()) { + UImodelSuppliers tmp = new UImodelSuppliers(supplier.id, supplier.name); + totals.add(tmp); + } + + model.addAttribute("suppliers", totals); + return "intern/suppliers/index"; + } + + public class UImodelSuppliers { + long id; + String name; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public UImodelSuppliers(long id, String name) { + this.id = id; + this.name = name; + } + + } + } diff --git a/prototype/src/main/java/org/hso/ecommerce/repos/supplier/SupplierRepository.java b/prototype/src/main/java/org/hso/ecommerce/repos/supplier/SupplierRepository.java index 2b81659..f1023df 100644 --- a/prototype/src/main/java/org/hso/ecommerce/repos/supplier/SupplierRepository.java +++ b/prototype/src/main/java/org/hso/ecommerce/repos/supplier/SupplierRepository.java @@ -1,10 +1,18 @@ package org.hso.ecommerce.repos.supplier; +import java.util.List; + import org.hso.ecommerce.entities.supplier.Supplier; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; @Repository public interface SupplierRepository extends JpaRepository { + + @Query("SELECT a FROM Supplier a") + List findAll(); + + } diff --git a/prototype/src/main/resources/templates/intern/suppliers/index.html b/prototype/src/main/resources/templates/intern/suppliers/index.html index a735be8..4fdc843 100644 --- a/prototype/src/main/resources/templates/intern/suppliers/index.html +++ b/prototype/src/main/resources/templates/intern/suppliers/index.html @@ -1,63 +1,52 @@ - - - - - - Lieferanten - - - - - - - -
- -
-

- - - - - - - - - - - - - - - - - - - - - - - - -
- -
NrName
0015Cheap AGDetails
5012Not Cheap GmbH & Co. KGDetails
7400Hans MÜller GmbHDetails
-

-
-
-
- - - + + + + Lieferanten + + + + + + +
+ +
+

+ + + + + + + + + + + + + + + + + + +
+ +
NrName
Details
+

+
+
+
+ + \ No newline at end of file -- 2.47.1 From 5d7ecbdfb71db0263cb8dda6db199b1179044fa3 Mon Sep 17 00:00:00 2001 From: localhorst Date: Sat, 30 May 2020 16:43:07 +0200 Subject: [PATCH 02/20] basic detail page for supplier --- .../hso/ecommerce/app/RequestController.java | 5 +- .../suppliers/SupplierIndexController.java | 135 ++++++++++++++++++ .../repos/supplier/SupplierRepository.java | 4 +- .../templates/intern/suppliers/id.html | 3 +- 4 files changed, 142 insertions(+), 5 deletions(-) diff --git a/prototype/src/main/java/org/hso/ecommerce/app/RequestController.java b/prototype/src/main/java/org/hso/ecommerce/app/RequestController.java index 0f9c42e..b49241c 100644 --- a/prototype/src/main/java/org/hso/ecommerce/app/RequestController.java +++ b/prototype/src/main/java/org/hso/ecommerce/app/RequestController.java @@ -105,12 +105,13 @@ public class RequestController { public String internSuppliers() { return "intern/suppliers/index"; } -*/ + @GetMapping("/intern/suppliers/{id}") public String internSuppliersId() { return "intern/suppliers/id"; } - +*/ + @GetMapping("/intern/supplierOrders/") public String internSupplierOrders() { return "intern/supplierOrders/index"; diff --git a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java index 56ca421..d9d214a 100644 --- a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java +++ b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java @@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @Controller @@ -32,6 +33,24 @@ public class SupplierIndexController { return "intern/suppliers/index"; } + @GetMapping("/suppliers/{id}") + public String internListedArticlesId(Model model, @PathVariable String id) { + + System.out.println("hEre!"); + + int supplierId = Integer.parseInt(id); + + UImodelSupplierDetailOrders orders = new UImodelSupplierDetailOrders(supplierId, "01.01.1970", "orderd article", + "netto €", "42", "total €", "31.12.1970"); + + UImodelSupplierDetail total = new UImodelSupplierDetail(supplierRepository.findSupplierById(supplierId).name, + "42€", orders); + + model.addAttribute("SupplierDetail", total); + + return "intern/suppliers/id"; + } + public class UImodelSuppliers { long id; String name; @@ -59,4 +78,120 @@ public class SupplierIndexController { } + public class UImodelSupplierDetail { + + String name; + String balance; + UImodelSupplierDetailOrders orders; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getBalance() { + return balance; + } + + public void setBalance(String balance) { + this.balance = balance; + } + + public UImodelSupplierDetailOrders getOrders() { + return orders; + } + + public void setOrders(UImodelSupplierDetailOrders orders) { + this.orders = orders; + } + + public UImodelSupplierDetail(String name, String balance, UImodelSupplierDetailOrders orders) { + this.name = name; + this.balance = balance; + this.orders = orders; + } + + } + + public class UImodelSupplierDetailOrders { + long id; + String dateOrder; + String articleName; + String priceNetto; + String quantity; + String price_total; + String dateArrival; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getDateOrder() { + return dateOrder; + } + + public void setDateOrder(String dateOrder) { + this.dateOrder = dateOrder; + } + + public String getArticleName() { + return articleName; + } + + public void setArticleName(String articleName) { + this.articleName = articleName; + } + + public String getPriceNetto() { + return priceNetto; + } + + public void setPriceNetto(String priceNetto) { + this.priceNetto = priceNetto; + } + + public String getQuantity() { + return quantity; + } + + public void setQuantity(String quantity) { + this.quantity = quantity; + } + + public String getPrice_total() { + return price_total; + } + + public void setPrice_total(String price_total) { + this.price_total = price_total; + } + + public String getDateArrival() { + return dateArrival; + } + + public void setDateArrival(String dateArrival) { + this.dateArrival = dateArrival; + } + + public UImodelSupplierDetailOrders(long id, String dateOrder, String articleName, String priceNetto, + String quantity, String price_total, String dateArrival) { + this.id = id; + this.dateOrder = dateOrder; + this.articleName = articleName; + this.priceNetto = priceNetto; + this.quantity = quantity; + this.price_total = price_total; + this.dateArrival = dateArrival; + } + + } + } diff --git a/prototype/src/main/java/org/hso/ecommerce/repos/supplier/SupplierRepository.java b/prototype/src/main/java/org/hso/ecommerce/repos/supplier/SupplierRepository.java index f1023df..4437125 100644 --- a/prototype/src/main/java/org/hso/ecommerce/repos/supplier/SupplierRepository.java +++ b/prototype/src/main/java/org/hso/ecommerce/repos/supplier/SupplierRepository.java @@ -5,6 +5,7 @@ import java.util.List; import org.hso.ecommerce.entities.supplier.Supplier; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; @Repository @@ -13,6 +14,7 @@ public interface SupplierRepository extends JpaRepository { @Query("SELECT a FROM Supplier a") List findAll(); + @Query("SELECT a FROM Supplier a WHERE a.id = :supplierId") + Supplier findSupplierById(@Param("supplierId") long supplierId); - } diff --git a/prototype/src/main/resources/templates/intern/suppliers/id.html b/prototype/src/main/resources/templates/intern/suppliers/id.html index f4f6788..308d009 100644 --- a/prototype/src/main/resources/templates/intern/suppliers/id.html +++ b/prototype/src/main/resources/templates/intern/suppliers/id.html @@ -15,8 +15,7 @@ -- 2.47.1 From c1b95881896db4b8c214c24f030a0bb65f0ad802 Mon Sep 17 00:00:00 2001 From: localhorst Date: Fri, 5 Jun 2020 17:37:19 +0200 Subject: [PATCH 08/20] added post form for marking order as delivered --- .../warehouse/StoreSupplierOrderAction.java | 7 ++++++ .../suppliers/SupplierIndexController.java | 3 +++ .../suppliers/SupplierOrderController.java | 25 +++++++++++++++++-- .../intern/supplierOrders/index.html | 7 ++++-- .../templates/intern/suppliers/id.html | 7 ++++-- 5 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 prototype/src/main/java/org/hso/ecommerce/action/warehouse/StoreSupplierOrderAction.java diff --git a/prototype/src/main/java/org/hso/ecommerce/action/warehouse/StoreSupplierOrderAction.java b/prototype/src/main/java/org/hso/ecommerce/action/warehouse/StoreSupplierOrderAction.java new file mode 100644 index 0000000..9bc413d --- /dev/null +++ b/prototype/src/main/java/org/hso/ecommerce/action/warehouse/StoreSupplierOrderAction.java @@ -0,0 +1,7 @@ +package org.hso.ecommerce.action.warehouse; + +public class StoreSupplierOrderAction { + + //TODO add delivery date and warehouse booking + +} diff --git a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java index 84e6147..e71e2c2 100644 --- a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java +++ b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java @@ -19,7 +19,9 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.view.RedirectView; @Controller @RequestMapping("/intern/") @@ -83,6 +85,7 @@ public class SupplierIndexController { return "intern/suppliers/id"; } + public class UImodelSuppliers { long id; diff --git a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierOrderController.java b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierOrderController.java index b659666..e49c4db 100644 --- a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierOrderController.java +++ b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierOrderController.java @@ -4,6 +4,7 @@ import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Optional; import org.hso.ecommerce.entities.supplier.SupplierOrder; import org.hso.ecommerce.repos.supplier.SupplierOrderRepository; @@ -11,7 +12,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.view.RedirectView; @Controller @RequestMapping("/intern/") @@ -22,7 +26,7 @@ public class SupplierOrderController { @GetMapping("supplierOrders") public String listSuppliers(Model model) { - + List totals = new ArrayList(); for (SupplierOrder orders : supplierOrderRepository.findAll()) { @@ -34,6 +38,23 @@ public class SupplierOrderController { return "intern/supplierOrders/index"; } + @PostMapping("/supplierOrders/store/{id}") + public RedirectView storeOrder(@PathVariable(required = true) String id) { + + long supplierOrderID = Long.parseLong(id); + + Optional order = supplierOrderRepository.findById(supplierOrderID); + + if (order.isPresent()) { + //TODO call action + + System.out.println("Order is present\n"); + + } + + return new RedirectView("../../supplierOrders/"); + } + public class UImodelSupplierOrder { long id; String dateOrder; @@ -116,7 +137,7 @@ public class SupplierOrderController { public void setSupplierName(String supplierName) { this.supplierName = supplierName; } - + public UImodelSupplierOrder(SupplierOrder order) { this.id = order.id; this.supplierName = order.supplier.name; diff --git a/prototype/src/main/resources/templates/intern/supplierOrders/index.html b/prototype/src/main/resources/templates/intern/supplierOrders/index.html index 71db072..1f94a89 100644 --- a/prototype/src/main/resources/templates/intern/supplierOrders/index.html +++ b/prototype/src/main/resources/templates/intern/supplierOrders/index.html @@ -53,11 +53,14 @@
- Angekommen + Angekommen
- Unterwegs + Unterwegs
+
+ +
diff --git a/prototype/src/main/resources/templates/intern/suppliers/id.html b/prototype/src/main/resources/templates/intern/suppliers/id.html index 1cb4770..2be77e2 100644 --- a/prototype/src/main/resources/templates/intern/suppliers/id.html +++ b/prototype/src/main/resources/templates/intern/suppliers/id.html @@ -50,11 +50,14 @@
- Angekommen + Angekommen
- Unterwegs + Unterwegs
+
+ +
-- 2.47.1 From e138476d76a669506baddff531e6cff95df204da Mon Sep 17 00:00:00 2001 From: localhorst Date: Fri, 5 Jun 2020 18:05:10 +0200 Subject: [PATCH 09/20] code cleanup --- .../intern/InternArticleController.java | 119 +--------- .../suppliers/SupplierIndexController.java | 207 ++---------------- .../suppliers/SupplierOfferController.java | 94 +------- .../suppliers/SupplierOrderController.java | 98 ++------- .../templates/intern/listedArticles/id.html | 6 +- .../intern/listedArticles/index.html | 4 +- .../intern/offeredArticles/index.html | 4 +- .../intern/supplierOrders/index.html | 4 +- .../templates/intern/suppliers/id.html | 4 +- 9 files changed, 67 insertions(+), 473 deletions(-) diff --git a/prototype/src/main/java/org/hso/ecommerce/controller/intern/InternArticleController.java b/prototype/src/main/java/org/hso/ecommerce/controller/intern/InternArticleController.java index 35d76f8..82b9cd6 100644 --- a/prototype/src/main/java/org/hso/ecommerce/controller/intern/InternArticleController.java +++ b/prototype/src/main/java/org/hso/ecommerce/controller/intern/InternArticleController.java @@ -62,16 +62,12 @@ public class InternArticleController { @GetMapping("/{id}") public String internListedArticlesId(Model model, @PathVariable String id) { - int articleid = Integer.parseInt(id); - UImodelArticle total = new UImodelArticle(); - total.addArticle(articleRepository.findArticleById(articleid), warehouseEntryRepository.getArticleStock(articleid).orElse(0)); model.addAttribute("ArticleID", total); - return "intern/listedArticles/id"; } @@ -148,9 +144,9 @@ public class InternArticleController { File tmpFile = new File(defaultImagePath); // test if default img file exits if (!tmpFile.exists()) { - // fallback if the file not exists + // fallback if the file not exists // create new file - BufferedImage bufferedImage = new BufferedImage(422, 428, BufferedImage.TYPE_INT_RGB); + BufferedImage bufferedImage = new BufferedImage(422, 428, BufferedImage.TYPE_INT_RGB); try { ImageIO.write(bufferedImage, "jpg", new File(defaultImagePath)); // save new file on disk } catch (IOException e) { @@ -192,25 +188,18 @@ public class InternArticleController { public static class UImodelArticles { public String imgPath; - public String title; - public String price; - - public String price_netto; - + public String priceNet; public String categorie; - public int stock; - - public long offer_id; - + public long offerID; public long id; void addListedArticle(Article article, int stock) { this.imgPath = article.image.path; this.title = article.title; - this.price_netto = String.format("%.2f", ((float) article.shopPricePerUnitNetCent / 100)); + this.priceNet = String.format("%.2f", ((float) article.shopPricePerUnitNetCent / 100)); this.price = String.format("%.2f", ((float) article.getPriceGross() / 100)); StringBuilder result = new StringBuilder(); @@ -221,7 +210,7 @@ public class InternArticleController { this.categorie = result.toString(); this.stock = stock; - this.offer_id = article.related.id; + this.offerID = article.related.id; this.id = article.id; } } @@ -231,116 +220,28 @@ public class InternArticleController { public String imgPath; public String title; public String price; - public String price_netto; + public String priceNet; public String reorderMaxPrice; public String categorie; public int stock; - public long offer_id; + public long offerID; public long id; public boolean shouldReorder; public String warehouseUnitsPerSlot; public String description; - public String getImgPath() { - return imgPath; - } - - public void setImgPath(String imgPath) { - this.imgPath = imgPath; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getPrice() { - return price; - } - - public void setPrice(String price) { - this.price = price; - } - - public String getPrice_netto() { - return price_netto; - } - - public void setPrice_netto(String price_netto) { - this.price_netto = price_netto; - } - - public String getReorderMaxPrice() { - return reorderMaxPrice; - } - - public void setReorderMaxPrice(String reorderMaxPrice) { - this.reorderMaxPrice = reorderMaxPrice; - } - public String getCategorie() { return categorie; } - public void setCategorie(String categorie) { - this.categorie = categorie; - } - - public int getStock() { - return stock; - } - - public void setStock(int stock) { - this.stock = stock; - } - - public long getOffer_id() { - return offer_id; - } - - public void setOffer_id(long offer_id) { - this.offer_id = offer_id; - } - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public boolean isShouldReorder() { - return shouldReorder; - } - - public void setShouldReorder(boolean shouldReorder) { - this.shouldReorder = shouldReorder; - } - - public String getWarehouseUnitsPerSlot() { - return warehouseUnitsPerSlot; - } - - public void setWarehouseUnitsPerSlot(String warehouseUnitsPerSlot) { - this.warehouseUnitsPerSlot = warehouseUnitsPerSlot; - } - public String getDescription() { return description; } - public void setDescription(String description) { - this.description = description; - } - void addArticle(Article article, int stock) { this.imgPath = article.image.path; this.title = article.title; - this.price_netto = String.format("%.2f", ((float) article.shopPricePerUnitNetCent / 100)); + this.priceNet = String.format("%.2f", ((float) article.shopPricePerUnitNetCent / 100)); this.price = String.format("%.2f", ((float) article.getPriceGross() / 100)); StringBuilder result = new StringBuilder(); @@ -352,7 +253,7 @@ public class InternArticleController { this.categorie = result.toString(); this.stock = stock; - this.offer_id = article.related.id; + this.offerID = article.related.id; this.id = article.id; this.reorderMaxPrice = String.format("%.2f", ((float) article.reorderMaxPrice / 100)); this.shouldReorder = article.shouldReorder; diff --git a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java index e71e2c2..8f8c1fc 100644 --- a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java +++ b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java @@ -19,9 +19,7 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.view.RedirectView; @Controller @RequestMapping("/intern/") @@ -85,27 +83,10 @@ public class SupplierIndexController { return "intern/suppliers/id"; } - public class UImodelSuppliers { - long id; - String name; - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } + public long id; + public String name; public UImodelSuppliers(long id, String name) { this.id = id; @@ -116,42 +97,10 @@ public class SupplierIndexController { public class UImodelSupplierDetail { - String name; - String balance; - List orders; - List bookings; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getBalance() { - return balance; - } - - public void setBalance(String balance) { - this.balance = balance; - } - - public List getOrders() { - return orders; - } - - public void setOrders(List orders) { - this.orders = orders; - } - - public List getBookings() { - return bookings; - } - - public void setBookings(List bookings) { - this.bookings = bookings; - } + public String name; + public String balance; + public List orders; + public List bookings; public UImodelSupplierDetail(String name, String balance, List orders, List bookings) { @@ -164,86 +113,22 @@ public class SupplierIndexController { } public class UImodelSupplierDetailOrders { - long id; - String dateOrder; - String articleName; - long articleId; - String priceNetto; - String quantity; - String price_total; - boolean arrived; - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public String getDateOrder() { - return dateOrder; - } - - public void setDateOrder(String dateOrder) { - this.dateOrder = dateOrder; - } - - public String getArticleName() { - return articleName; - } - - public void setArticleName(String articleName) { - this.articleName = articleName; - } - - public String getPriceNetto() { - return priceNetto; - } - - public void setPriceNetto(String priceNetto) { - this.priceNetto = priceNetto; - } - - public String getQuantity() { - return quantity; - } - - public void setQuantity(String quantity) { - this.quantity = quantity; - } - - public String getPrice_total() { - return price_total; - } - - public void setPrice_total(String price_total) { - this.price_total = price_total; - } - - public long getArticleId() { - return articleId; - } - - public void setArticleId(long articleId) { - this.articleId = articleId; - } - - public boolean isArrived() { - return arrived; - } - - public void setArrived(boolean arrived) { - this.arrived = arrived; - } + public long id; + public String dateOrder; + public String articleName; + public long articleId; + public String priceNet; + public String quantity; + public String priceTotal; + public boolean arrived; public UImodelSupplierDetailOrders(SupplierOrder order) { this.id = order.id; this.articleName = order.ordered.title; this.articleId = order.ordered.id; - this.priceNetto = String.format("%.2f", ((float) order.pricePerUnitNetCent / 100)); + this.priceNet = String.format("%.2f", ((float) order.pricePerUnitNetCent / 100)); this.quantity = String.valueOf(order.numberOfUnits); - this.price_total = String.format("%.2f", ((float) order.totalPriceNet / 100)); + this.priceTotal = String.format("%.2f", ((float) order.totalPriceNet / 100)); Date date = new Date(); date.setTime(order.created.getTime()); @@ -259,60 +144,12 @@ public class SupplierIndexController { public class UImodelSupplierDetailBookings { - String dateBooking; - String price; - String srcName; - String balance; - String reason; - long orderID; - - public String getDateBooking() { - return dateBooking; - } - - public void setDateBooking(String dateBooking) { - this.dateBooking = dateBooking; - } - - public String getPrice() { - return price; - } - - public void setPrice(String price) { - this.price = price; - } - - public String getSrcName() { - return srcName; - } - - public void setSrcName(String srcName) { - this.srcName = srcName; - } - - public String getBalance() { - return balance; - } - - public void setBalance(String balance) { - this.balance = balance; - } - - public String getReason() { - return reason; - } - - public void setReason(String reason) { - this.reason = reason; - } - - public long getOrderID() { - return orderID; - } - - public void setOrderID(long orderID) { - this.orderID = orderID; - } + public String dateBooking; + public String price; + public String srcName; + public String balance; + public String reason; + public long orderID; public UImodelSupplierDetailBookings(Booking booking) { Date date = new Date(); diff --git a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierOfferController.java b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierOfferController.java index ca71682..3feac7c 100644 --- a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierOfferController.java +++ b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierOfferController.java @@ -40,94 +40,22 @@ public class SupplierOfferController { public class UImodelOfferedArticle { - long offer_id; - String title; - String manufacturer; - String articlenumber; - String supplierName; - String price; - String ads; - int listedArticleId; - boolean offerIsListed; // true --> offered article is listed - - public long getOffer_id() { - return offer_id; - } - - public void setOffer_id(long offer_id) { - this.offer_id = offer_id; - } - - public boolean isOfferIsListed() { - return offerIsListed; - } - - public void setOfferIsListed(boolean offerIsListed) { - this.offerIsListed = offerIsListed; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getManufacturer() { - return manufacturer; - } - - public void setManufacturer(String manufacturer) { - this.manufacturer = manufacturer; - } - - public String getArticlenumber() { - return articlenumber; - } - - public void setArticlenumber(String articlenumber) { - this.articlenumber = articlenumber; - } - - public String getSupplierName() { - return supplierName; - } - - public void setSupplierName(String supplierName) { - this.supplierName = supplierName; - } - - public String getPrice() { - return price; - } - - public void setPrice(String price) { - this.price = price; - } - - public String getAds() { - return ads; - } - - public void setAds(String ads) { - this.ads = ads; - } - - public int getListedArticleId() { - return listedArticleId; - } - - public void setListedArticleId(int listedArticleId) { - this.listedArticleId = listedArticleId; - } + public long offerId; + public String title; + public String manufacturer; + public String articleNumber; + public String supplierName; + public String price; + public String ads; + public int listedArticleId; + public boolean offerIsListed; // true --> offered article is listed public void addData(ArticleOffer article, Optional listedArticleId) { - this.offer_id = article.id; + this.offerId = article.id; this.title = article.title; this.manufacturer = article.manufacturer; - this.articlenumber = article.articleNumber; + this.articleNumber = article.articleNumber; this.supplierName = article.cheapestSupplier.name; this.price = String.format("%.2f", ((float) article.pricePerUnitNet / 100)); this.ads = (article.shouldBeAdvertised) ? "Ja" : "Nein"; diff --git a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierOrderController.java b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierOrderController.java index e49c4db..1485c92 100644 --- a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierOrderController.java +++ b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierOrderController.java @@ -46,8 +46,8 @@ public class SupplierOrderController { Optional order = supplierOrderRepository.findById(supplierOrderID); if (order.isPresent()) { - //TODO call action - + // TODO call action + System.out.println("Order is present\n"); } @@ -56,96 +56,24 @@ public class SupplierOrderController { } public class UImodelSupplierOrder { - long id; - String dateOrder; - String supplierName; - String articleName; - long articleId; - String priceNetto; - String quantity; - String price_total; - boolean arrived; - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public String getDateOrder() { - return dateOrder; - } - - public void setDateOrder(String dateOrder) { - this.dateOrder = dateOrder; - } - - public String getArticleName() { - return articleName; - } - - public void setArticleName(String articleName) { - this.articleName = articleName; - } - - public String getPriceNetto() { - return priceNetto; - } - - public void setPriceNetto(String priceNetto) { - this.priceNetto = priceNetto; - } - - public String getQuantity() { - return quantity; - } - - public void setQuantity(String quantity) { - this.quantity = quantity; - } - - public String getPrice_total() { - return price_total; - } - - public void setPrice_total(String price_total) { - this.price_total = price_total; - } - - public long getArticleId() { - return articleId; - } - - public void setArticleId(long articleId) { - this.articleId = articleId; - } - - public boolean isArrived() { - return arrived; - } - - public void setArrived(boolean arrived) { - this.arrived = arrived; - } - - public String getSupplierName() { - return supplierName; - } - - public void setSupplierName(String supplierName) { - this.supplierName = supplierName; - } + public long id; + public String dateOrder; + public String supplierName; + public String articleName; + public long articleId; + public String priceNet; + public String quantity; + public String priceTotal; + public boolean arrived; public UImodelSupplierOrder(SupplierOrder order) { this.id = order.id; this.supplierName = order.supplier.name; this.articleName = order.ordered.title; this.articleId = order.ordered.id; - this.priceNetto = String.format("%.2f", ((float) order.pricePerUnitNetCent / 100)); + this.priceNet = String.format("%.2f", ((float) order.pricePerUnitNetCent / 100)); this.quantity = String.valueOf(order.numberOfUnits); - this.price_total = String.format("%.2f", ((float) order.totalPriceNet / 100)); + this.priceTotal = String.format("%.2f", ((float) order.totalPriceNet / 100)); Date date = new Date(); date.setTime(order.created.getTime()); diff --git a/prototype/src/main/resources/templates/intern/listedArticles/id.html b/prototype/src/main/resources/templates/intern/listedArticles/id.html index 135147b..9158bb3 100644 --- a/prototype/src/main/resources/templates/intern/listedArticles/id.html +++ b/prototype/src/main/resources/templates/intern/listedArticles/id.html @@ -28,9 +28,9 @@

- + - + Details

@@ -47,7 +47,7 @@

-  EUR
+  EUR
(19% Mwst.)
=  EUR Brutto diff --git a/prototype/src/main/resources/templates/intern/listedArticles/index.html b/prototype/src/main/resources/templates/intern/listedArticles/index.html index 6986f0b..e066499 100644 --- a/prototype/src/main/resources/templates/intern/listedArticles/index.html +++ b/prototype/src/main/resources/templates/intern/listedArticles/index.html @@ -50,10 +50,10 @@ € - € + - +

diff --git a/prototype/src/main/resources/templates/intern/offeredArticles/index.html b/prototype/src/main/resources/templates/intern/offeredArticles/index.html index 04d9a12..df2814f 100644 --- a/prototype/src/main/resources/templates/intern/offeredArticles/index.html +++ b/prototype/src/main/resources/templates/intern/offeredArticles/index.html @@ -43,7 +43,7 @@ - + @@ -53,7 +53,7 @@
-
+
diff --git a/prototype/src/main/resources/templates/intern/supplierOrders/index.html b/prototype/src/main/resources/templates/intern/supplierOrders/index.html index 1f94a89..febaa36 100644 --- a/prototype/src/main/resources/templates/intern/supplierOrders/index.html +++ b/prototype/src/main/resources/templates/intern/supplierOrders/index.html @@ -48,9 +48,9 @@ - € + - € +
Angekommen diff --git a/prototype/src/main/resources/templates/intern/suppliers/id.html b/prototype/src/main/resources/templates/intern/suppliers/id.html index 2be77e2..1edfcf3 100644 --- a/prototype/src/main/resources/templates/intern/suppliers/id.html +++ b/prototype/src/main/resources/templates/intern/suppliers/id.html @@ -45,9 +45,9 @@ - € + - € +
Angekommen -- 2.47.1 From 4f5e1fe185d9cefeceeb1418e6f4259452658c32 Mon Sep 17 00:00:00 2001 From: localhorst Date: Sat, 30 May 2020 16:16:14 +0200 Subject: [PATCH 10/20] list suppliers page --- .../hso/ecommerce/app/RequestController.java | 12 +- .../suppliers/SupplierIndexController.java | 56 ++++++++- .../repos/supplier/SupplierRepository.java | 8 ++ .../templates/intern/suppliers/index.html | 111 ++++++++---------- 4 files changed, 115 insertions(+), 72 deletions(-) diff --git a/prototype/src/main/java/org/hso/ecommerce/app/RequestController.java b/prototype/src/main/java/org/hso/ecommerce/app/RequestController.java index bb0b5d6..0f9c42e 100644 --- a/prototype/src/main/java/org/hso/ecommerce/app/RequestController.java +++ b/prototype/src/main/java/org/hso/ecommerce/app/RequestController.java @@ -100,11 +100,12 @@ public class RequestController { return "intern/customerOrders/id"; } + /* @GetMapping("/intern/suppliers/") public String internSuppliers() { return "intern/suppliers/index"; } - +*/ @GetMapping("/intern/suppliers/{id}") public String internSuppliersId() { return "intern/suppliers/id"; @@ -120,15 +121,6 @@ public class RequestController { return "intern/supplierOrders/id"; } - /* - - @GetMapping("/intern/suppliersOffers") - public String internSuppliersOffers() { - return "intern/offeredArticles/index"; - } - */ - - @GetMapping("/intern/accounting/") public String accounting() { return "intern/accounting/index"; diff --git a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java index d6cefc0..56ca421 100644 --- a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java +++ b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java @@ -1,8 +1,62 @@ package org.hso.ecommerce.controller.intern.suppliers; +import java.util.ArrayList; +import java.util.List; + +import org.hso.ecommerce.entities.supplier.Supplier; +import org.hso.ecommerce.repos.supplier.SupplierRepository; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; @Controller -//@RequestMapping("...") +@RequestMapping("/intern/") public class SupplierIndexController { + + @Autowired + private final SupplierRepository supplierRepository = null; + + @GetMapping("suppliers") + public String listSuppliers(Model model) { + + List totals = new ArrayList(); + + for (Supplier supplier : supplierRepository.findAll()) { + UImodelSuppliers tmp = new UImodelSuppliers(supplier.id, supplier.name); + totals.add(tmp); + } + + model.addAttribute("suppliers", totals); + return "intern/suppliers/index"; + } + + public class UImodelSuppliers { + long id; + String name; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public UImodelSuppliers(long id, String name) { + this.id = id; + this.name = name; + } + + } + } diff --git a/prototype/src/main/java/org/hso/ecommerce/repos/supplier/SupplierRepository.java b/prototype/src/main/java/org/hso/ecommerce/repos/supplier/SupplierRepository.java index 2b81659..f1023df 100644 --- a/prototype/src/main/java/org/hso/ecommerce/repos/supplier/SupplierRepository.java +++ b/prototype/src/main/java/org/hso/ecommerce/repos/supplier/SupplierRepository.java @@ -1,10 +1,18 @@ package org.hso.ecommerce.repos.supplier; +import java.util.List; + import org.hso.ecommerce.entities.supplier.Supplier; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; @Repository public interface SupplierRepository extends JpaRepository { + + @Query("SELECT a FROM Supplier a") + List findAll(); + + } diff --git a/prototype/src/main/resources/templates/intern/suppliers/index.html b/prototype/src/main/resources/templates/intern/suppliers/index.html index a735be8..4fdc843 100644 --- a/prototype/src/main/resources/templates/intern/suppliers/index.html +++ b/prototype/src/main/resources/templates/intern/suppliers/index.html @@ -1,63 +1,52 @@ - - - - - - Lieferanten - - - - - - - -
- -
-

- - - - - - - - - - - - - - - - - - - - - - - - -
- -
NrName
0015Cheap AGDetails
5012Not Cheap GmbH & Co. KGDetails
7400Hans MÜller GmbHDetails
-

-
-
-
- - - + + + + Lieferanten + + + + + + +
+ +
+

+ + + + + + + + + + + + + + + + + + +
+ +
NrName
Details
+

+
+
+
+ + \ No newline at end of file -- 2.47.1 From b600040bf34ba7246ca5a090ddbd9996eefc6d9a Mon Sep 17 00:00:00 2001 From: localhorst Date: Sat, 30 May 2020 16:43:07 +0200 Subject: [PATCH 11/20] basic detail page for supplier --- .../hso/ecommerce/app/RequestController.java | 5 +- .../suppliers/SupplierIndexController.java | 135 ++++++++++++++++++ .../repos/supplier/SupplierRepository.java | 4 +- .../templates/intern/suppliers/id.html | 3 +- 4 files changed, 142 insertions(+), 5 deletions(-) diff --git a/prototype/src/main/java/org/hso/ecommerce/app/RequestController.java b/prototype/src/main/java/org/hso/ecommerce/app/RequestController.java index 0f9c42e..b49241c 100644 --- a/prototype/src/main/java/org/hso/ecommerce/app/RequestController.java +++ b/prototype/src/main/java/org/hso/ecommerce/app/RequestController.java @@ -105,12 +105,13 @@ public class RequestController { public String internSuppliers() { return "intern/suppliers/index"; } -*/ + @GetMapping("/intern/suppliers/{id}") public String internSuppliersId() { return "intern/suppliers/id"; } - +*/ + @GetMapping("/intern/supplierOrders/") public String internSupplierOrders() { return "intern/supplierOrders/index"; diff --git a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java index 56ca421..d9d214a 100644 --- a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java +++ b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java @@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @Controller @@ -32,6 +33,24 @@ public class SupplierIndexController { return "intern/suppliers/index"; } + @GetMapping("/suppliers/{id}") + public String internListedArticlesId(Model model, @PathVariable String id) { + + System.out.println("hEre!"); + + int supplierId = Integer.parseInt(id); + + UImodelSupplierDetailOrders orders = new UImodelSupplierDetailOrders(supplierId, "01.01.1970", "orderd article", + "netto €", "42", "total €", "31.12.1970"); + + UImodelSupplierDetail total = new UImodelSupplierDetail(supplierRepository.findSupplierById(supplierId).name, + "42€", orders); + + model.addAttribute("SupplierDetail", total); + + return "intern/suppliers/id"; + } + public class UImodelSuppliers { long id; String name; @@ -59,4 +78,120 @@ public class SupplierIndexController { } + public class UImodelSupplierDetail { + + String name; + String balance; + UImodelSupplierDetailOrders orders; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getBalance() { + return balance; + } + + public void setBalance(String balance) { + this.balance = balance; + } + + public UImodelSupplierDetailOrders getOrders() { + return orders; + } + + public void setOrders(UImodelSupplierDetailOrders orders) { + this.orders = orders; + } + + public UImodelSupplierDetail(String name, String balance, UImodelSupplierDetailOrders orders) { + this.name = name; + this.balance = balance; + this.orders = orders; + } + + } + + public class UImodelSupplierDetailOrders { + long id; + String dateOrder; + String articleName; + String priceNetto; + String quantity; + String price_total; + String dateArrival; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getDateOrder() { + return dateOrder; + } + + public void setDateOrder(String dateOrder) { + this.dateOrder = dateOrder; + } + + public String getArticleName() { + return articleName; + } + + public void setArticleName(String articleName) { + this.articleName = articleName; + } + + public String getPriceNetto() { + return priceNetto; + } + + public void setPriceNetto(String priceNetto) { + this.priceNetto = priceNetto; + } + + public String getQuantity() { + return quantity; + } + + public void setQuantity(String quantity) { + this.quantity = quantity; + } + + public String getPrice_total() { + return price_total; + } + + public void setPrice_total(String price_total) { + this.price_total = price_total; + } + + public String getDateArrival() { + return dateArrival; + } + + public void setDateArrival(String dateArrival) { + this.dateArrival = dateArrival; + } + + public UImodelSupplierDetailOrders(long id, String dateOrder, String articleName, String priceNetto, + String quantity, String price_total, String dateArrival) { + this.id = id; + this.dateOrder = dateOrder; + this.articleName = articleName; + this.priceNetto = priceNetto; + this.quantity = quantity; + this.price_total = price_total; + this.dateArrival = dateArrival; + } + + } + } diff --git a/prototype/src/main/java/org/hso/ecommerce/repos/supplier/SupplierRepository.java b/prototype/src/main/java/org/hso/ecommerce/repos/supplier/SupplierRepository.java index f1023df..4437125 100644 --- a/prototype/src/main/java/org/hso/ecommerce/repos/supplier/SupplierRepository.java +++ b/prototype/src/main/java/org/hso/ecommerce/repos/supplier/SupplierRepository.java @@ -5,6 +5,7 @@ import java.util.List; import org.hso.ecommerce.entities.supplier.Supplier; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; @Repository @@ -13,6 +14,7 @@ public interface SupplierRepository extends JpaRepository { @Query("SELECT a FROM Supplier a") List findAll(); + @Query("SELECT a FROM Supplier a WHERE a.id = :supplierId") + Supplier findSupplierById(@Param("supplierId") long supplierId); - } diff --git a/prototype/src/main/resources/templates/intern/suppliers/id.html b/prototype/src/main/resources/templates/intern/suppliers/id.html index f4f6788..308d009 100644 --- a/prototype/src/main/resources/templates/intern/suppliers/id.html +++ b/prototype/src/main/resources/templates/intern/suppliers/id.html @@ -15,8 +15,7 @@ -- 2.47.1 From bd8b3db7f36327443054b2181a48b0a67510266d Mon Sep 17 00:00:00 2001 From: localhorst Date: Fri, 5 Jun 2020 17:37:19 +0200 Subject: [PATCH 17/20] added post form for marking order as delivered --- .../warehouse/StoreSupplierOrderAction.java | 7 ++++++ .../suppliers/SupplierIndexController.java | 3 +++ .../suppliers/SupplierOrderController.java | 25 +++++++++++++++++-- .../intern/supplierOrders/index.html | 7 ++++-- .../templates/intern/suppliers/id.html | 7 ++++-- 5 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 prototype/src/main/java/org/hso/ecommerce/action/warehouse/StoreSupplierOrderAction.java diff --git a/prototype/src/main/java/org/hso/ecommerce/action/warehouse/StoreSupplierOrderAction.java b/prototype/src/main/java/org/hso/ecommerce/action/warehouse/StoreSupplierOrderAction.java new file mode 100644 index 0000000..9bc413d --- /dev/null +++ b/prototype/src/main/java/org/hso/ecommerce/action/warehouse/StoreSupplierOrderAction.java @@ -0,0 +1,7 @@ +package org.hso.ecommerce.action.warehouse; + +public class StoreSupplierOrderAction { + + //TODO add delivery date and warehouse booking + +} diff --git a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java index 84e6147..e71e2c2 100644 --- a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java +++ b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java @@ -19,7 +19,9 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.view.RedirectView; @Controller @RequestMapping("/intern/") @@ -83,6 +85,7 @@ public class SupplierIndexController { return "intern/suppliers/id"; } + public class UImodelSuppliers { long id; diff --git a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierOrderController.java b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierOrderController.java index b659666..e49c4db 100644 --- a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierOrderController.java +++ b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierOrderController.java @@ -4,6 +4,7 @@ import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Optional; import org.hso.ecommerce.entities.supplier.SupplierOrder; import org.hso.ecommerce.repos.supplier.SupplierOrderRepository; @@ -11,7 +12,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.view.RedirectView; @Controller @RequestMapping("/intern/") @@ -22,7 +26,7 @@ public class SupplierOrderController { @GetMapping("supplierOrders") public String listSuppliers(Model model) { - + List totals = new ArrayList(); for (SupplierOrder orders : supplierOrderRepository.findAll()) { @@ -34,6 +38,23 @@ public class SupplierOrderController { return "intern/supplierOrders/index"; } + @PostMapping("/supplierOrders/store/{id}") + public RedirectView storeOrder(@PathVariable(required = true) String id) { + + long supplierOrderID = Long.parseLong(id); + + Optional order = supplierOrderRepository.findById(supplierOrderID); + + if (order.isPresent()) { + //TODO call action + + System.out.println("Order is present\n"); + + } + + return new RedirectView("../../supplierOrders/"); + } + public class UImodelSupplierOrder { long id; String dateOrder; @@ -116,7 +137,7 @@ public class SupplierOrderController { public void setSupplierName(String supplierName) { this.supplierName = supplierName; } - + public UImodelSupplierOrder(SupplierOrder order) { this.id = order.id; this.supplierName = order.supplier.name; diff --git a/prototype/src/main/resources/templates/intern/supplierOrders/index.html b/prototype/src/main/resources/templates/intern/supplierOrders/index.html index 71db072..1f94a89 100644 --- a/prototype/src/main/resources/templates/intern/supplierOrders/index.html +++ b/prototype/src/main/resources/templates/intern/supplierOrders/index.html @@ -53,11 +53,14 @@
- Angekommen + Angekommen
- Unterwegs + Unterwegs
+
+ +
diff --git a/prototype/src/main/resources/templates/intern/suppliers/id.html b/prototype/src/main/resources/templates/intern/suppliers/id.html index 1cb4770..2be77e2 100644 --- a/prototype/src/main/resources/templates/intern/suppliers/id.html +++ b/prototype/src/main/resources/templates/intern/suppliers/id.html @@ -50,11 +50,14 @@
- Angekommen + Angekommen
- Unterwegs + Unterwegs
+
+ +
-- 2.47.1 From 445b504188f12f631cf2a62ed842932f14ed18b1 Mon Sep 17 00:00:00 2001 From: localhorst Date: Fri, 5 Jun 2020 18:05:10 +0200 Subject: [PATCH 18/20] code cleanup --- .../intern/InternArticleController.java | 121 +--------- .../suppliers/SupplierIndexController.java | 207 ++---------------- .../suppliers/SupplierOfferController.java | 94 +------- .../suppliers/SupplierOrderController.java | 98 ++------- .../templates/intern/listedArticles/id.html | 10 +- .../intern/listedArticles/index.html | 4 +- .../intern/offeredArticles/index.html | 4 +- .../intern/supplierOrders/index.html | 4 +- .../templates/intern/suppliers/id.html | 4 +- 9 files changed, 68 insertions(+), 478 deletions(-) diff --git a/prototype/src/main/java/org/hso/ecommerce/controller/intern/InternArticleController.java b/prototype/src/main/java/org/hso/ecommerce/controller/intern/InternArticleController.java index e011f71..e799210 100644 --- a/prototype/src/main/java/org/hso/ecommerce/controller/intern/InternArticleController.java +++ b/prototype/src/main/java/org/hso/ecommerce/controller/intern/InternArticleController.java @@ -62,16 +62,12 @@ public class InternArticleController { @GetMapping("/{id}") public String internListedArticlesId(Model model, @PathVariable String id) { - int articleid = Integer.parseInt(id); - UImodelArticle total = new UImodelArticle(); - total.addArticle(articleRepository.findArticleById(articleid), warehouseEntryRepository.getArticleStock(articleid).orElse(0)); model.addAttribute("ArticleID", total); - return "intern/listedArticles/id"; } @@ -80,7 +76,7 @@ public class InternArticleController { @RequestParam(value = "title", required = true) String title, @RequestParam(value = "description", required = true) String description, @RequestParam(value = "units-per-slot", required = true) String warehouseUnitsPerSlot, - @RequestParam(value = "price_netto", required = true) String pricenetto, + @RequestParam(value = "priceNet", required = true) String pricenetto, @RequestParam(value = "reorderMaxPrice", required = true) String reorderMaxPrice, @RequestParam(value = "autobuy", required = true) Boolean shouldReorder, @RequestParam(value = "categorie", required = true) String categories, @@ -192,19 +188,12 @@ public class InternArticleController { public static class UImodelArticles { public String imgPath; - public String title; - public String price; - - public String price_netto; - + public String priceNet; public String categorie; - public int stock; - - public long offer_id; - + public long offerID; public long id; void addListedArticle(Article article, int stock) { @@ -213,7 +202,7 @@ public class InternArticleController { this.imgPath = article.image.path; } this.title = article.title; - this.price_netto = String.format("%.2f", ((float) article.shopPricePerUnitNetCent / 100)); + this.priceNet = String.format("%.2f", ((float) article.shopPricePerUnitNetCent / 100)); this.price = String.format("%.2f", ((float) article.getPriceGross() / 100)); StringBuilder result = new StringBuilder(); @@ -224,7 +213,7 @@ public class InternArticleController { this.categorie = result.toString(); this.stock = stock; - this.offer_id = article.related.id; + this.offerID = article.related.id; this.id = article.id; } } @@ -234,123 +223,31 @@ public class InternArticleController { public String imgPath; public String title; public String price; - public String price_netto; + public String priceNet; public String reorderMaxPrice; public String categorie; public int stock; - public long offer_id; + public long offerID; public long id; public boolean shouldReorder; public String warehouseUnitsPerSlot; public String description; public int vatPercent; - public String getImgPath() { - return imgPath; - } - - public void setImgPath(String imgPath) { - this.imgPath = imgPath; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getPrice() { - return price; - } - - public void setPrice(String price) { - this.price = price; - } - - public int getVatPercent() { - return vatPercent; - } - - public String getPrice_netto() { - return price_netto; - } - - public void setPrice_netto(String price_netto) { - this.price_netto = price_netto; - } - - public String getReorderMaxPrice() { - return reorderMaxPrice; - } - - public void setReorderMaxPrice(String reorderMaxPrice) { - this.reorderMaxPrice = reorderMaxPrice; - } - public String getCategorie() { return categorie; } - public void setCategorie(String categorie) { - this.categorie = categorie; - } - - public int getStock() { - return stock; - } - - public void setStock(int stock) { - this.stock = stock; - } - - public long getOffer_id() { - return offer_id; - } - - public void setOffer_id(long offer_id) { - this.offer_id = offer_id; - } - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public boolean isShouldReorder() { - return shouldReorder; - } - - public void setShouldReorder(boolean shouldReorder) { - this.shouldReorder = shouldReorder; - } - - public String getWarehouseUnitsPerSlot() { - return warehouseUnitsPerSlot; - } - - public void setWarehouseUnitsPerSlot(String warehouseUnitsPerSlot) { - this.warehouseUnitsPerSlot = warehouseUnitsPerSlot; - } - public String getDescription() { return description; } - public void setDescription(String description) { - this.description = description; - } - void addArticle(Article article, int stock) { if (article.image != null) { this.imgPath = article.image.path; } this.title = article.title; - this.price_netto = String.format("%.2f", ((float) article.shopPricePerUnitNetCent / 100)); + this.priceNet = String.format("%.2f", ((float) article.shopPricePerUnitNetCent / 100)); this.price = String.format("%.2f", ((float) article.getPriceGross() / 100)); StringBuilder result = new StringBuilder(); @@ -362,7 +259,7 @@ public class InternArticleController { this.categorie = result.toString(); this.stock = stock; - this.offer_id = article.related.id; + this.offerID = article.related.id; this.id = article.id; this.reorderMaxPrice = String.format("%.2f", ((float) article.reorderMaxPrice / 100)); this.shouldReorder = article.shouldReorder; diff --git a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java index e71e2c2..8f8c1fc 100644 --- a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java +++ b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierIndexController.java @@ -19,9 +19,7 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.view.RedirectView; @Controller @RequestMapping("/intern/") @@ -85,27 +83,10 @@ public class SupplierIndexController { return "intern/suppliers/id"; } - public class UImodelSuppliers { - long id; - String name; - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } + public long id; + public String name; public UImodelSuppliers(long id, String name) { this.id = id; @@ -116,42 +97,10 @@ public class SupplierIndexController { public class UImodelSupplierDetail { - String name; - String balance; - List orders; - List bookings; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getBalance() { - return balance; - } - - public void setBalance(String balance) { - this.balance = balance; - } - - public List getOrders() { - return orders; - } - - public void setOrders(List orders) { - this.orders = orders; - } - - public List getBookings() { - return bookings; - } - - public void setBookings(List bookings) { - this.bookings = bookings; - } + public String name; + public String balance; + public List orders; + public List bookings; public UImodelSupplierDetail(String name, String balance, List orders, List bookings) { @@ -164,86 +113,22 @@ public class SupplierIndexController { } public class UImodelSupplierDetailOrders { - long id; - String dateOrder; - String articleName; - long articleId; - String priceNetto; - String quantity; - String price_total; - boolean arrived; - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public String getDateOrder() { - return dateOrder; - } - - public void setDateOrder(String dateOrder) { - this.dateOrder = dateOrder; - } - - public String getArticleName() { - return articleName; - } - - public void setArticleName(String articleName) { - this.articleName = articleName; - } - - public String getPriceNetto() { - return priceNetto; - } - - public void setPriceNetto(String priceNetto) { - this.priceNetto = priceNetto; - } - - public String getQuantity() { - return quantity; - } - - public void setQuantity(String quantity) { - this.quantity = quantity; - } - - public String getPrice_total() { - return price_total; - } - - public void setPrice_total(String price_total) { - this.price_total = price_total; - } - - public long getArticleId() { - return articleId; - } - - public void setArticleId(long articleId) { - this.articleId = articleId; - } - - public boolean isArrived() { - return arrived; - } - - public void setArrived(boolean arrived) { - this.arrived = arrived; - } + public long id; + public String dateOrder; + public String articleName; + public long articleId; + public String priceNet; + public String quantity; + public String priceTotal; + public boolean arrived; public UImodelSupplierDetailOrders(SupplierOrder order) { this.id = order.id; this.articleName = order.ordered.title; this.articleId = order.ordered.id; - this.priceNetto = String.format("%.2f", ((float) order.pricePerUnitNetCent / 100)); + this.priceNet = String.format("%.2f", ((float) order.pricePerUnitNetCent / 100)); this.quantity = String.valueOf(order.numberOfUnits); - this.price_total = String.format("%.2f", ((float) order.totalPriceNet / 100)); + this.priceTotal = String.format("%.2f", ((float) order.totalPriceNet / 100)); Date date = new Date(); date.setTime(order.created.getTime()); @@ -259,60 +144,12 @@ public class SupplierIndexController { public class UImodelSupplierDetailBookings { - String dateBooking; - String price; - String srcName; - String balance; - String reason; - long orderID; - - public String getDateBooking() { - return dateBooking; - } - - public void setDateBooking(String dateBooking) { - this.dateBooking = dateBooking; - } - - public String getPrice() { - return price; - } - - public void setPrice(String price) { - this.price = price; - } - - public String getSrcName() { - return srcName; - } - - public void setSrcName(String srcName) { - this.srcName = srcName; - } - - public String getBalance() { - return balance; - } - - public void setBalance(String balance) { - this.balance = balance; - } - - public String getReason() { - return reason; - } - - public void setReason(String reason) { - this.reason = reason; - } - - public long getOrderID() { - return orderID; - } - - public void setOrderID(long orderID) { - this.orderID = orderID; - } + public String dateBooking; + public String price; + public String srcName; + public String balance; + public String reason; + public long orderID; public UImodelSupplierDetailBookings(Booking booking) { Date date = new Date(); diff --git a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierOfferController.java b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierOfferController.java index edc7bc2..979f967 100644 --- a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierOfferController.java +++ b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierOfferController.java @@ -40,94 +40,22 @@ public class SupplierOfferController { public class UImodelOfferedArticle { - long offer_id; - String title; - String manufacturer; - String articlenumber; - String supplierName; - String price; - String ads; - int listedArticleId; - boolean offerIsListed; // true --> offered article is listed - - public long getOffer_id() { - return offer_id; - } - - public void setOffer_id(long offer_id) { - this.offer_id = offer_id; - } - - public boolean isOfferIsListed() { - return offerIsListed; - } - - public void setOfferIsListed(boolean offerIsListed) { - this.offerIsListed = offerIsListed; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getManufacturer() { - return manufacturer; - } - - public void setManufacturer(String manufacturer) { - this.manufacturer = manufacturer; - } - - public String getArticlenumber() { - return articlenumber; - } - - public void setArticlenumber(String articlenumber) { - this.articlenumber = articlenumber; - } - - public String getSupplierName() { - return supplierName; - } - - public void setSupplierName(String supplierName) { - this.supplierName = supplierName; - } - - public String getPrice() { - return price; - } - - public void setPrice(String price) { - this.price = price; - } - - public String getAds() { - return ads; - } - - public void setAds(String ads) { - this.ads = ads; - } - - public int getListedArticleId() { - return listedArticleId; - } - - public void setListedArticleId(int listedArticleId) { - this.listedArticleId = listedArticleId; - } + public long offerId; + public String title; + public String manufacturer; + public String articleNumber; + public String supplierName; + public String price; + public String ads; + public int listedArticleId; + public boolean offerIsListed; // true --> offered article is listed public void addData(ArticleOffer article, Optional listedArticleId) { - this.offer_id = article.id; + this.offerId = article.id; this.title = article.title; this.manufacturer = article.manufacturer; - this.articlenumber = article.articleNumber; + this.articleNumber = article.articleNumber; this.supplierName = article.cheapestSupplier.name; this.price = String.format("%.2f", ((float) article.pricePerUnitNet / 100)); this.ads = (article.shouldBeAdvertised) ? "Ja" : "Nein"; diff --git a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierOrderController.java b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierOrderController.java index e49c4db..1485c92 100644 --- a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierOrderController.java +++ b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierOrderController.java @@ -46,8 +46,8 @@ public class SupplierOrderController { Optional order = supplierOrderRepository.findById(supplierOrderID); if (order.isPresent()) { - //TODO call action - + // TODO call action + System.out.println("Order is present\n"); } @@ -56,96 +56,24 @@ public class SupplierOrderController { } public class UImodelSupplierOrder { - long id; - String dateOrder; - String supplierName; - String articleName; - long articleId; - String priceNetto; - String quantity; - String price_total; - boolean arrived; - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public String getDateOrder() { - return dateOrder; - } - - public void setDateOrder(String dateOrder) { - this.dateOrder = dateOrder; - } - - public String getArticleName() { - return articleName; - } - - public void setArticleName(String articleName) { - this.articleName = articleName; - } - - public String getPriceNetto() { - return priceNetto; - } - - public void setPriceNetto(String priceNetto) { - this.priceNetto = priceNetto; - } - - public String getQuantity() { - return quantity; - } - - public void setQuantity(String quantity) { - this.quantity = quantity; - } - - public String getPrice_total() { - return price_total; - } - - public void setPrice_total(String price_total) { - this.price_total = price_total; - } - - public long getArticleId() { - return articleId; - } - - public void setArticleId(long articleId) { - this.articleId = articleId; - } - - public boolean isArrived() { - return arrived; - } - - public void setArrived(boolean arrived) { - this.arrived = arrived; - } - - public String getSupplierName() { - return supplierName; - } - - public void setSupplierName(String supplierName) { - this.supplierName = supplierName; - } + public long id; + public String dateOrder; + public String supplierName; + public String articleName; + public long articleId; + public String priceNet; + public String quantity; + public String priceTotal; + public boolean arrived; public UImodelSupplierOrder(SupplierOrder order) { this.id = order.id; this.supplierName = order.supplier.name; this.articleName = order.ordered.title; this.articleId = order.ordered.id; - this.priceNetto = String.format("%.2f", ((float) order.pricePerUnitNetCent / 100)); + this.priceNet = String.format("%.2f", ((float) order.pricePerUnitNetCent / 100)); this.quantity = String.valueOf(order.numberOfUnits); - this.price_total = String.format("%.2f", ((float) order.totalPriceNet / 100)); + this.priceTotal = String.format("%.2f", ((float) order.totalPriceNet / 100)); Date date = new Date(); date.setTime(order.created.getTime()); diff --git a/prototype/src/main/resources/templates/intern/listedArticles/id.html b/prototype/src/main/resources/templates/intern/listedArticles/id.html index e1cd1a7..6461fc2 100644 --- a/prototype/src/main/resources/templates/intern/listedArticles/id.html +++ b/prototype/src/main/resources/templates/intern/listedArticles/id.html @@ -29,9 +29,9 @@

- + - + Details

@@ -48,8 +48,8 @@

-  EUR
+  EUR
(% Mwst.)
@@ -109,4 +109,4 @@

- + \ No newline at end of file diff --git a/prototype/src/main/resources/templates/intern/listedArticles/index.html b/prototype/src/main/resources/templates/intern/listedArticles/index.html index 6986f0b..e066499 100644 --- a/prototype/src/main/resources/templates/intern/listedArticles/index.html +++ b/prototype/src/main/resources/templates/intern/listedArticles/index.html @@ -50,10 +50,10 @@ € - € + - +
diff --git a/prototype/src/main/resources/templates/intern/offeredArticles/index.html b/prototype/src/main/resources/templates/intern/offeredArticles/index.html index 04d9a12..df2814f 100644 --- a/prototype/src/main/resources/templates/intern/offeredArticles/index.html +++ b/prototype/src/main/resources/templates/intern/offeredArticles/index.html @@ -43,7 +43,7 @@ - + @@ -53,7 +53,7 @@
-
+
diff --git a/prototype/src/main/resources/templates/intern/supplierOrders/index.html b/prototype/src/main/resources/templates/intern/supplierOrders/index.html index 1f94a89..febaa36 100644 --- a/prototype/src/main/resources/templates/intern/supplierOrders/index.html +++ b/prototype/src/main/resources/templates/intern/supplierOrders/index.html @@ -48,9 +48,9 @@ - € + - € +
Angekommen diff --git a/prototype/src/main/resources/templates/intern/suppliers/id.html b/prototype/src/main/resources/templates/intern/suppliers/id.html index 2be77e2..1edfcf3 100644 --- a/prototype/src/main/resources/templates/intern/suppliers/id.html +++ b/prototype/src/main/resources/templates/intern/suppliers/id.html @@ -45,9 +45,9 @@ - € + - € +
Angekommen -- 2.47.1 From 99612165f5a7b48d17d65ed8ae709e45cf48163c Mon Sep 17 00:00:00 2001 From: localhorst Date: Sun, 7 Jun 2020 11:44:50 +0200 Subject: [PATCH 19/20] fixed review requests --- .../hso/ecommerce/repos/supplier/SupplierRepository.java | 3 +-- .../resources/templates/intern/supplierOrders/index.html | 2 +- .../src/main/resources/templates/intern/suppliers/id.html | 6 +++--- .../main/resources/templates/intern/suppliers/index.html | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/prototype/src/main/java/org/hso/ecommerce/repos/supplier/SupplierRepository.java b/prototype/src/main/java/org/hso/ecommerce/repos/supplier/SupplierRepository.java index 4437125..14b3a75 100644 --- a/prototype/src/main/java/org/hso/ecommerce/repos/supplier/SupplierRepository.java +++ b/prototype/src/main/java/org/hso/ecommerce/repos/supplier/SupplierRepository.java @@ -16,5 +16,4 @@ public interface SupplierRepository extends JpaRepository { @Query("SELECT a FROM Supplier a WHERE a.id = :supplierId") Supplier findSupplierById(@Param("supplierId") long supplierId); - -} +} \ No newline at end of file diff --git a/prototype/src/main/resources/templates/intern/supplierOrders/index.html b/prototype/src/main/resources/templates/intern/supplierOrders/index.html index febaa36..84b58ec 100644 --- a/prototype/src/main/resources/templates/intern/supplierOrders/index.html +++ b/prototype/src/main/resources/templates/intern/supplierOrders/index.html @@ -26,7 +26,7 @@ + data-target-id="main-table"> diff --git a/prototype/src/main/resources/templates/intern/suppliers/id.html b/prototype/src/main/resources/templates/intern/suppliers/id.html index 1edfcf3..9577868 100644 --- a/prototype/src/main/resources/templates/intern/suppliers/id.html +++ b/prototype/src/main/resources/templates/intern/suppliers/id.html @@ -22,11 +22,11 @@

Bestellungen

- +
@@ -70,7 +70,7 @@

-

+ data-target-id="main-table">
+
diff --git a/prototype/src/main/resources/templates/intern/suppliers/index.html b/prototype/src/main/resources/templates/intern/suppliers/index.html index 4fdc843..4f26685 100644 --- a/prototype/src/main/resources/templates/intern/suppliers/index.html +++ b/prototype/src/main/resources/templates/intern/suppliers/index.html @@ -26,7 +26,7 @@ -- 2.47.1 From bd6be54149abaa0b6fafb991c97b35e768cd8dca Mon Sep 17 00:00:00 2001 From: localhorst Date: Sun, 7 Jun 2020 11:45:53 +0200 Subject: [PATCH 20/20] removed space in SupplierOrderRepo --- .../hso/ecommerce/repos/supplier/SupplierOrderRepository.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/prototype/src/main/java/org/hso/ecommerce/repos/supplier/SupplierOrderRepository.java b/prototype/src/main/java/org/hso/ecommerce/repos/supplier/SupplierOrderRepository.java index 31c05cf..06ad249 100644 --- a/prototype/src/main/java/org/hso/ecommerce/repos/supplier/SupplierOrderRepository.java +++ b/prototype/src/main/java/org/hso/ecommerce/repos/supplier/SupplierOrderRepository.java @@ -14,12 +14,9 @@ public interface SupplierOrderRepository extends JpaRepository findOrderBySupplierID(@Param("supplierId") long supplierId); - @Query("SELECT a FROM SupplierOrder a") List findAll(); - } -- 2.47.1
Zeitpunkt
+ data-target-id="main-table">