From d652956ae9cb4a573189679453f68776ebbece61 Mon Sep 17 00:00:00 2001 From: abazov73 <92822431+abazov73@users.noreply.github.com> Date: Tue, 25 Apr 2023 14:55:16 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A7=D0=B5=D1=82=D0=B2=D1=91=D1=80=D1=82?= =?UTF-8?q?=D0=B0=D1=8F=20=D0=BB=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82=D0=BE?= =?UTF-8?q?=D1=80=D0=BD=D0=B0=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0?= =?UTF-8?q?.=20Frontend.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/ipLab/data.mv.db | Bin 86016 -> 90112 bytes .../Controllers/ProductController.java | 15 +++ .../Controllers/StoreController.java | 6 +- .../ipLab/StoreDataBase/DTO/OrderedDTO.java | 8 +- .../ipLab/StoreDataBase/DTO/ProductDTO.java | 8 +- .../ipLab/StoreDataBase/Model/Product.java | 6 +- .../ipLab/StoreDataBase/Model/Store.java | 7 +- frontend/src/App.jsx | 15 ++- frontend/src/components/common/Header.jsx | 2 +- .../src/components/common/ToolbarOrder.jsx | 15 +++ frontend/src/components/common/orderTable.jsx | 116 ++++++++++++++++++ .../src/components/common/productTable.jsx | 113 +++++++++++++++++ frontend/src/components/common/storeTable.jsx | 113 +++++++++++++++++ .../src/components/pages/addToStorePage.jsx | 87 +++++++++++++ frontend/src/components/pages/orderPage.jsx | 108 ++++++++++++++++ frontend/src/components/pages/productPage.jsx | 44 +++++++ frontend/src/components/pages/storePage.jsx | 43 +++++++ frontend/src/models/order.js | 8 ++ frontend/src/models/product.js | 7 ++ frontend/src/models/store.js | 7 ++ 20 files changed, 708 insertions(+), 20 deletions(-) create mode 100644 frontend/src/components/common/ToolbarOrder.jsx create mode 100644 frontend/src/components/common/orderTable.jsx create mode 100644 frontend/src/components/common/productTable.jsx create mode 100644 frontend/src/components/common/storeTable.jsx create mode 100644 frontend/src/components/pages/addToStorePage.jsx create mode 100644 frontend/src/components/pages/orderPage.jsx create mode 100644 frontend/src/components/pages/productPage.jsx create mode 100644 frontend/src/components/pages/storePage.jsx create mode 100644 frontend/src/models/order.js create mode 100644 frontend/src/models/product.js create mode 100644 frontend/src/models/store.js diff --git a/backend/ipLab/data.mv.db b/backend/ipLab/data.mv.db index 11dee237cd3172aef22f426bf7116dfb75291213..fd1fd435077a223ae2b28a901e2e86c2ef328ff3 100644 GIT binary patch literal 90112 zcmeHw3z!{MooC(duJkn|L3xId;H3kEIH9fg<7OS{bl)VMbm!51J0$b%x3Qj>HR%t7fLSQgpM8+@90OO!Cz~`VcEQ1Y#g0IinMaN~7!EezW`54{bsZ*!w z+*d!6&InpJ>8f+8PM!MK|NQIJ`M=i}l~wNU5$^*9Uzis|W3l=Uq`IJ*nJN=9^7cV(`>9TX)SvXfXw{XGs!BV-h0?(D6-U1=vcTvM~@bU21^5l-nE5Io6CjL_TItrV4-8MtD`X3)mJX8aP&|OB-_>X zP}dz*Ur|`!HMqX8Leq6c^1{GZe1)8reA)IaHLz6Mk}Tg-1KXDa4@mJ`GYCAz*BxE+ zebtu@&o#6ag|43d-c8F3g@unWNV>ba*Oz(<<*qe-r9#J+p*4NI-5s4B-9v-r&Hbf; zjtl1#G|*FFj(HXsjI)#QRrUZHPF>v#Szwm>=Jm7AM2cWK}(7k!nV0oa6V1Ywba**7I1Lnf0^Fr^Yp3-)% zeKlYg;6Zl94^rE5?Zyp#YkPZ!divybmuxNdOKbZE`Zo7(>+9~@8MWOh*F4ykfz3Tb z-Q|u8J1~3$rJZEh$XE>)qG4LO0#EusbB!OBUEBOgr+}xUuon00UAKvh0(bY7b&o$q zC+R~Cl-8C8N}IY%crOx~j2;P(MurSj2)gawxDvF?(AR{NkD#Wpu|@dLzgkO=&8Si*I~_$f-YTzz6YE4y?LOgG%#Jqs#@P~C;Hvi zyx*8`r|VfZbg2&Hccbfa^R6jTOot1r0nBZufHLoyW|o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ab/src/main/java/com/example/ipLab/StoreDataBase/Controllers/ProductController.java b/backend/ipLab/src/main/java/com/example/ipLab/StoreDataBase/Controllers/ProductController.java index 624a5c7..593ae0a 100644 --- a/backend/ipLab/src/main/java/com/example/ipLab/StoreDataBase/Controllers/ProductController.java +++ b/backend/ipLab/src/main/java/com/example/ipLab/StoreDataBase/Controllers/ProductController.java @@ -28,6 +28,21 @@ public class ProductController { .toList(); } + //сделать запрос + пагинация + @GetMapping("/getWithStores") + public List getProductsWithStores(){ + return productService.getAllProducts().stream().filter(prod -> prod.getStore() != null) + .map(ProductDTO::new) + .toList(); + } + + @GetMapping("/getWithoutStores") + public List getProductsWithoutStores(){ + return productService.getAllProducts().stream().filter(prod -> prod.getStore() == null) + .map(ProductDTO::new) + .toList(); + } + @PostMapping public ProductDTO createProduct(@RequestParam("productName") String productName){ final Product product = productService.addProduct(productName); diff --git a/backend/ipLab/src/main/java/com/example/ipLab/StoreDataBase/Controllers/StoreController.java b/backend/ipLab/src/main/java/com/example/ipLab/StoreDataBase/Controllers/StoreController.java index 2d3373a..f918377 100644 --- a/backend/ipLab/src/main/java/com/example/ipLab/StoreDataBase/Controllers/StoreController.java +++ b/backend/ipLab/src/main/java/com/example/ipLab/StoreDataBase/Controllers/StoreController.java @@ -44,9 +44,9 @@ public class StoreController { return new StoreDTO(storeService.updateStore(id, storeName)); } - @PutMapping("/{storeId}-{productId}") - public ProductDTO addProduct(@PathVariable Long storeId, - @PathVariable Long productId){ + @PutMapping("/add") + public ProductDTO addProduct(@RequestParam("storeId") Long storeId, + @RequestParam("productId") Long productId){ return new ProductDTO(storeService.addProduct(storeId, productId)); } diff --git a/backend/ipLab/src/main/java/com/example/ipLab/StoreDataBase/DTO/OrderedDTO.java b/backend/ipLab/src/main/java/com/example/ipLab/StoreDataBase/DTO/OrderedDTO.java index d54164c..2eabeec 100644 --- a/backend/ipLab/src/main/java/com/example/ipLab/StoreDataBase/DTO/OrderedDTO.java +++ b/backend/ipLab/src/main/java/com/example/ipLab/StoreDataBase/DTO/OrderedDTO.java @@ -7,12 +7,14 @@ public class OrderedDTO { public final int quantity; public final String productName; public final String customerFIO; + public final String storeName; public OrderedDTO(Ordered ordered){ this.id = ordered.getId(); this.quantity = ordered.getQuantity(); this.productName = ordered.getProduct().getName(); - this.customerFIO = ordered.getCustomer().getLastName() + ordered.getCustomer().getFirstName() + ordered.getCustomer().getMiddleName(); + this.storeName = ordered.getProduct().getStore().getStoreName(); + this.customerFIO = ordered.getCustomer().getLastName() + " " + ordered.getCustomer().getFirstName() + " " + ordered.getCustomer().getMiddleName(); } public Long getId() { @@ -30,4 +32,8 @@ public class OrderedDTO { public String getCustomerFIO() { return customerFIO; } + + public String getStoreName() { + return storeName; + } } diff --git a/backend/ipLab/src/main/java/com/example/ipLab/StoreDataBase/DTO/ProductDTO.java b/backend/ipLab/src/main/java/com/example/ipLab/StoreDataBase/DTO/ProductDTO.java index 6672276..826b2b8 100644 --- a/backend/ipLab/src/main/java/com/example/ipLab/StoreDataBase/DTO/ProductDTO.java +++ b/backend/ipLab/src/main/java/com/example/ipLab/StoreDataBase/DTO/ProductDTO.java @@ -6,13 +6,13 @@ import java.util.List; public class ProductDTO { public final Long id; - public final String name; + public final String productName; public final String storeName; public ProductDTO(Product product){ this.id = product.getId(); - this.name = product.getName(); - this.storeName = product.getStore().getStoreName(); + this.productName = product.getName(); + this.storeName = product.getStore() == null ? null : product.getStore().getStoreName(); } public Long getId() { @@ -20,7 +20,7 @@ public class ProductDTO { } public String getName() { - return name; + return productName; } public String getStoreName() { diff --git a/backend/ipLab/src/main/java/com/example/ipLab/StoreDataBase/Model/Product.java b/backend/ipLab/src/main/java/com/example/ipLab/StoreDataBase/Model/Product.java index 5f1beb2..f884f69 100644 --- a/backend/ipLab/src/main/java/com/example/ipLab/StoreDataBase/Model/Product.java +++ b/backend/ipLab/src/main/java/com/example/ipLab/StoreDataBase/Model/Product.java @@ -38,8 +38,10 @@ public class Product { } @PreRemove public void removeStore(){ - this.store.getProducts().remove(this); - this.store = null; + if (this.store != null) { + this.store.getProducts().remove(this); + this.store = null; + } removeOrders(); } diff --git a/backend/ipLab/src/main/java/com/example/ipLab/StoreDataBase/Model/Store.java b/backend/ipLab/src/main/java/com/example/ipLab/StoreDataBase/Model/Store.java index 0a0ec07..b1b7f1c 100644 --- a/backend/ipLab/src/main/java/com/example/ipLab/StoreDataBase/Model/Store.java +++ b/backend/ipLab/src/main/java/com/example/ipLab/StoreDataBase/Model/Store.java @@ -1,6 +1,5 @@ package com.example.ipLab.StoreDataBase.Model; -import com.example.ipLab.StoreDataBase.Service.ProductService; import jakarta.persistence.*; import jakarta.validation.constraints.NotBlank; @@ -18,7 +17,9 @@ public class Store { private String storeName; @OneToMany(fetch = FetchType.EAGER, mappedBy = "store", cascade = CascadeType.ALL, orphanRemoval = true) private List products; - public Store(){} + public Store(){ + this.products = new ArrayList<>(); + } public Store(String storeName){ this.storeName = storeName; this.products = new ArrayList<>(); @@ -47,7 +48,7 @@ public class Store { products) { product.removeStore(); } - products = null; + products = new ArrayList<>(); } public void setStoreName(String storeName) { diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 2ab1336..869a6bc 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -1,7 +1,10 @@ import { useRoutes, Outlet, BrowserRouter } from 'react-router-dom'; import Header from './components/common/Header'; -import Footer from './components/common/Footer'; -import CustomerPage from './components/pages/customerPage' +import CustomerPage from './components/pages/customerPage'; +import StorePage from './components/pages/storePage'; +import ProductPage from './components/pages/productPage'; +import OrderPage from './components/pages/orderPage'; +import AddToStorePage from './components/pages/addToStorePage' import './styleSite.css'; function Router(props) { @@ -12,9 +15,10 @@ export default function App() { const routes = [ { index: true, element: }, { path: 'customer', element: , label:'Покупатели'}, - // { path: 'shop', element: , label: 'Магазины' }, - // { path: 'product', element: , label: 'Товары'}, - // { path: 'order', element: , label: 'Заказы'} + { path: 'store', element: , label: 'Магазины' }, + { path: 'product', element: , label: 'Товары' }, + { path: 'order', element: , label: 'Заказы'}, + { path: 'addToStore', element: , label: 'Доставка'} ]; const links = routes.filter(route => route.hasOwnProperty('label')); const rootRoute = [ @@ -29,7 +33,6 @@ export default function App() {
-