From da71ada2b81346a422ccc49e1d820fc5d6d2e48e Mon Sep 17 00:00:00 2001 From: Ethanell Date: Wed, 29 Jun 2022 21:44:24 +0200 Subject: [PATCH] Add purchase to detail --- .../WEB-INF/classes/DAO/MagasinHelper.class | Bin 8959 -> 10786 bytes .../classes/controller/BddController.class | Bin 7417 -> 7562 bytes build/web/WEB-INF/classes/jsp/detail.jsp | 57 +++++++++- build/web/WEB-INF/jsp/detail.jsp | 56 +++++++++- nbproject/private/private.xml | 3 +- src/java/DAO/MagasinHelper.java | 103 ++++++++++++++++-- src/java/controller/BddController.java | 15 +-- web/WEB-INF/jsp/detail.jsp | 56 +++++++++- 8 files changed, 264 insertions(+), 26 deletions(-) diff --git a/build/web/WEB-INF/classes/DAO/MagasinHelper.class b/build/web/WEB-INF/classes/DAO/MagasinHelper.class index 9e73c1a1439f1f2b6754ac53c48e1085f15ab66f..e3f950b2ded65dfb143c767e403db252ccae4fa3 100644 GIT binary patch literal 10786 zcmd5>d303O8UNkMBr{0{!LS(!I&7LiNEDGu5-1piM6$7ifbnJWNFJHY46{HY7OE7= z;)VtVL$%6Qmnv8lBUWs+w%Tg#X0^4gUG$vxv_0)Pp2O*)_IK}lGkFsxvKVdtnfKnk z_q+GIzwi5g_xtX=`q8t`1GpUTXW}w!&%$KvkZ(I(xFrit?8w5cxGfvESp?ynrjBM%b}_px4A&soo;3!OxbQs-REvFVVt={I(jM(Po2s4z8L#tG2jW zYtkY{phEYD^e|Vu_>}p3Q7fa&2pG{B0%`dLO9alRmUZD^W6T$gP}^85R}gC@8p)8& zkLlrdt|O?Og_PRx)ongK6eY^+bBFav%pcXF0)uQoS(|l4+XP1Tn08TE3q&-ZHNmjt zZMTQwTfeBsbY%(yOK*ktfQ3=b*HW#86j&~taNz|yq6^LXJu}C!7O6y5)kt9Fvfn zZA5&*Sb)JHo&P+}RBiae!D=nsqSJL!Ph=ayi5TK0WY-!YYZ@aE(ZkU=LX7$R%JLKd z(dC84Rh8Z1qltfZz0Wd7B~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YfQ**pn4yA5-vhWw<`3 z;=;nCGCrzbISRoTR>=_(>Kyr(fUyfu#N;ar_f= z?Vp)z|3W+dl||0q=tO^Ko;^rMgDgv}x2*kka+bM5g{yH2_z*pz zd2qN&FbAv8Az~TZv#u^L`E>H}$v-eS^0630yvM>V0w@#XaFHnEe`qG4UQEOsF$F6{ z5Ua!_+{FG)aY+W_GylMF8kME>*(gbVC+K1p*dOb4s{Dju=aY;yr~Nu5Dv5m+v9BTa zwZ#5XVm}QH;xb$-E=QZFLs(458gV6J?C%pZ9g*f#uT$wS31|5_W!YjKZLyv;f|UZg zY~mjf&90f5RC&rotv;ibPIVIB8D%P-M`d=mbM~dJ>?wwDH$S3uGpxvV8=btHiB-1S z7LN$9Ig2(e)&1jg^m9M5eJl} diff --git a/build/web/WEB-INF/classes/controller/BddController.class b/build/web/WEB-INF/classes/controller/BddController.class index d2974448f4d396f9f55c12bae36894de5aba1a01..f1b11c08862179824c7771a7b8350be77da30b44 100644 GIT binary patch delta 3673 zcmaJ@d3aRS75|-?$-JA%n@sYuF;N1fZGssh#2}U+YlsR$APn0O2qcpMB1tC9B4Klc zLYK5I_)1XKQcuq>s%jE?RUc^fZ&I{b-K{3wC<$`pv;$?wX z1a#^4Re_6A_d^e=@FRgA%l#(;KNa|yz|R%D=0ODphTYOe+s-O@GpT&^7Ow2 zF3bHt0uKtjFYti}R|u>k66BD(Q;#GnFDU<4M%zs9ntQ%LR0iQR~@~kCtdfh+lT!sc40Rk zSE-t=RcNY8)2K$pUfe-YIA)!Loh+!{_KW06=~r55Qx?TJO( zli@@?`()ilYE)?xwGy&30kgKvh^Qx4W*lWjSSp;|(JuL}T_FxWunrkE zx!jD()W!*hE*T4NZH-5alW~2%cPJw5myXVg;2W_va$<<2#HfBm-G;V2`yk`HW}g8t+~Zn5evdil3(PPP}JT z4T1((aNq#1ZbLZ%2U%9l1NbyPW4vc(vPK#|YFq~_tvUn!kG^GeK))fca+)+MW=H(O zGLljsKF?-fU~Lwh#YGeN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fASh&C)OX^GZ%(y0vBA0BV}K%Jb#=AhP(>096KKTuK#uQ2t2<2Kcv=f4}8&FS3FQX^V|Rr%<255`BVyMm2vO z3f;(sHA_b(a}Wd9GqOzI=&zpHa=p*XO_Z<8lAA1+{BKrp^!4!TbH@*RBx zw$NC_P)`XCwCTCAZfo z!yM+!Y`({2TgV$`Yq}sTS&hV!S&#-yw)SPClg~fNdC5lNd+1|!qF`Tc@)`=@9@bIZ zPWyPvaKb*7CM=e*OX<`%)I4`{W>#nL2aiG2{hZ0u!)_{{9iz{V(PzdO8sTZb?ddF= zkZsyJf zID8We_yJgt!$#0%W4GEtx7tCs8bK!=e5}E$?C?T8oerOg?J_WpTAghYr9PysGlH&U z8r)+_?vS?LlrlnEizz7~t<{u-m5<%MVb^;8Z_b&*hJZ*RVvwtiA<){ijZC8g?#tE!L%1C&P8LORe)J`~>ZY{LntHza_kH#dv#-fYO zEymYbaZak@wGU;N zWc1AEb%1@JK@ew$ku7AW5wg<=S!oOh>-lsfRL(Ja*k+#vmPs83%Ywu1*-8eB0Zj5G zUCC%!2r^n0g2Kiv^BA(y3nr!oAHSfRQ}}eiW#H!yWCWCe2xO+vF+9`Gp-efbTj1sK z94GoZC;bNF_-2wT{}$K$ZLaotuJZ*f#6>jWUA`nP8I@==^RX+@XIG-n26USZXpfEO tCL7OnHl8bNJQrGcmMmna2N+u8k!2#tH`c*TB%i5+=;qnOx*DGO@4raQl7avL diff --git a/build/web/WEB-INF/classes/jsp/detail.jsp b/build/web/WEB-INF/classes/jsp/detail.jsp index 398d510..25094f9 100644 --- a/build/web/WEB-INF/classes/jsp/detail.jsp +++ b/build/web/WEB-INF/classes/jsp/detail.jsp @@ -56,11 +56,19 @@

- +

- +

@@ -76,13 +84,56 @@

- + checked id="available" />

+ +

result: ${result}

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+
diff --git a/build/web/WEB-INF/jsp/detail.jsp b/build/web/WEB-INF/jsp/detail.jsp index 398d510..17956f9 100644 --- a/build/web/WEB-INF/jsp/detail.jsp +++ b/build/web/WEB-INF/jsp/detail.jsp @@ -56,11 +56,19 @@

- +

- +

@@ -76,13 +84,55 @@

- + checked id="available" />

+ +

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+
diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml index e9dbd15..eb512d4 100644 --- a/nbproject/private/private.xml +++ b/nbproject/private/private.xml @@ -3,8 +3,7 @@ - file:/C:/Users/flifloo/Nextcloud/IUT/JEE/JEE%20Project/Code/src/java/DAO/Product.hbm.xml - file:/C:/Users/flifloo/Nextcloud/IUT/JEE/JEE%20Project/Code/web/WEB-INF/jsp/menu.jsp + file:/C:/Users/flifloo/Nextcloud/IUT/JEE/JEE%20Project/Code/web/WEB-INF/jsp/detail.jsp file:/C:/Users/flifloo/Nextcloud/IUT/JEE/JEE%20Project/Code/web/WEB-INF/jsp/resultat.jsp file:/C:/Users/flifloo/Nextcloud/IUT/JEE/JEE%20Project/Code/src/java/controller/BddController.java file:/C:/Users/flifloo/Nextcloud/IUT/JEE/JEE%20Project/Code/src/java/DAO/MagasinHelper.java diff --git a/src/java/DAO/MagasinHelper.java b/src/java/DAO/MagasinHelper.java index a0066e0..c766991 100644 --- a/src/java/DAO/MagasinHelper.java +++ b/src/java/DAO/MagasinHelper.java @@ -25,7 +25,7 @@ public class MagasinHelper { this.session = HibernateUtil.getSessionFactory().openSession(); } - public List getProducts(){ + public List getProductsColums(){ List resultat=null; Transaction tx=null; try{ @@ -46,6 +46,27 @@ public class MagasinHelper { return resultat; } + public List getProducts(){ + List resultat=null; + Transaction tx=null; + try{ + if(!session.isOpen())session=HibernateUtil.getSessionFactory().openSession(); + session.flush(); + + tx=session.beginTransaction(); + Query q=session.createQuery("from Product p"); + resultat=q.list(); + + + } catch (Exception e) { + e.printStackTrace(); + } finally{ + if (session.isOpen())session.close(); + } + + return resultat; + } + public Product getProduct(int id){ Product resultat=null; Transaction tx=null; @@ -68,7 +89,7 @@ public class MagasinHelper { return resultat; } - public List getClients(){ + public List getClientsColums(){ List resultat=null; Transaction tx=null; try{ @@ -91,6 +112,30 @@ public class MagasinHelper { return resultat; } + + public List getClients(){ + List resultat=null; + Transaction tx=null; + try{ + if(!session.isOpen())session=HibernateUtil.getSessionFactory().openSession(); + session.flush(); + + tx=session.beginTransaction(); + Query q=session.createQuery("from Customer c"); + resultat=q.list(); + + + } + catch (Exception e) { + e.printStackTrace(); + } + finally{ + if (session.isOpen())session.close(); + } + + return resultat; +} + public List getClients(String name){ List resultat=null; Transaction tx=null; @@ -113,6 +158,48 @@ public class MagasinHelper { return resultat; } + + public List getManufacturers(){ + List resultat=null; + Transaction tx=null; + try{ + if(!session.isOpen())session=HibernateUtil.getSessionFactory().openSession(); + session.flush(); + + tx=session.beginTransaction(); + Query q=session.createQuery("from Manufacturer m"); + resultat=q.list(); + + + } catch (Exception e) { + e.printStackTrace(); + } finally{ + if (session.isOpen())session.close(); + } + + return resultat; + } + + public List getProductCodes(){ + List resultat=null; + Transaction tx=null; + try{ + if(!session.isOpen())session=HibernateUtil.getSessionFactory().openSession(); + session.flush(); + + tx=session.beginTransaction(); + Query q=session.createQuery("from ProductCode p"); + resultat=q.list(); + + + } catch (Exception e) { + e.printStackTrace(); + } finally{ + if (session.isOpen())session.close(); + } + + return resultat; + } public List getDiscountCode(){ List resultat=null; @@ -274,7 +361,7 @@ public void deleteCustomer (int _id) { } - public List getPurchase(){ + public List getPurchaseColums(){ List resultat=null; Transaction tx=null; try{ @@ -282,7 +369,7 @@ public void deleteCustomer (int _id) { session.flush(); tx=session.beginTransaction(); - Query q=session.createQuery("select po.customerId, po.productId, po.quantity, po.shippingCost, po.salesDate, po.shippingDate, po.freightCompany from PurchaseOrder po"); + Query q=session.createQuery("select po.orderNum, po.customerId, po.productId, po.quantity, po.shippingCost, po.salesDate, po.shippingDate, po.freightCompany from PurchaseOrder po"); resultat=(List)q.list(); } catch (Exception e) { @@ -295,17 +382,17 @@ public void deleteCustomer (int _id) { return resultat; } - public List getPurchase(int id){ - List resultat=null; + public PurchaseOrder getPurchase(int id){ + PurchaseOrder resultat=null; Transaction tx=null; try{ if(!session.isOpen())session=HibernateUtil.getSessionFactory().openSession(); session.flush(); tx=session.beginTransaction(); - Query q=session.createQuery(" from PurchaseOrder a where a.customerId=:_id"); + Query q=session.createQuery(" from PurchaseOrder p where p.orderNum = :_id"); q.setInteger("_id", id); - resultat=(List)q.list(); + resultat=(PurchaseOrder)q.list().iterator().next(); } catch (Exception e) { e.printStackTrace(); diff --git a/src/java/controller/BddController.java b/src/java/controller/BddController.java index 1ead67a..56fc3fe 100644 --- a/src/java/controller/BddController.java +++ b/src/java/controller/BddController.java @@ -69,16 +69,16 @@ public class BddController extends MultiActionController { switch (type) { case "customer": - mv.addObject("results", new MagasinHelper().getClients()); + mv.addObject("results", new MagasinHelper().getClientsColums()); mv.addObject("colonnes", Arrays.asList("customerId", "name", "addressline1", "addressline2", "zip", "rate")); break; case "product": - mv.addObject("results", new MagasinHelper().getProducts()); + mv.addObject("results", new MagasinHelper().getProductsColums()); mv.addObject("colonnes", Arrays.asList("productId", "manufacturerId", "productCode", "purchaseCost", "quantityOnHand", "markup", "available", "description")); break; case "purchase": - mv.addObject("results", new MagasinHelper().getPurchase()); - mv.addObject("colonnes", Arrays.asList("customerId", "productId", "quantity", "shippingCost", "salesDate", "shippingDate", "freightCompany")); + mv.addObject("results", new MagasinHelper().getPurchaseColums()); + mv.addObject("colonnes", Arrays.asList("orderNum", "customerId", "productId", "quantity", "shippingCost", "salesDate", "shippingDate", "freightCompany")); mv.addObject("relation", new HashMap() {{ put("customerId", "customer"); put("productId", "product"); @@ -112,17 +112,18 @@ public class BddController extends MultiActionController { switch (type) { case "customer": mv.addObject("result", new MagasinHelper().getClient(Integer.parseInt(request.getParameter("num")))); - mv.addObject("colonnes", Arrays.asList("customerId", "name", "addressline1", "addressline2", "zip", "rate")); mv.addObject("code",new MagasinHelper().getDiscountCode()); mv.addObject("cpostaux",new MagasinHelper().getZipCode()); break; case "product": mv.addObject("result", new MagasinHelper().getProduct(Integer.parseInt(request.getParameter("num")))); - mv.addObject("colonnes", Arrays.asList("productId", "manufacturerId", "productCode", "purchaseCost", "quantityOnHand", "markup", "available", "description")); + mv.addObject("manufacturers", new MagasinHelper().getManufacturers()); + mv.addObject("productCodes", new MagasinHelper().getProductCodes()); break; case "purchase": mv.addObject("result", new MagasinHelper().getPurchase(Integer.parseInt(request.getParameter("num")))); - mv.addObject("colonnes", Arrays.asList("customerId", "productId", "quantity", "shippingCost", "salesDate", "shippingDate", "freightCompany")); + mv.addObject("customers", new MagasinHelper().getClients()); + mv.addObject("products", new MagasinHelper().getProducts()); break; default: mv.addObject("error", "Type not found"); diff --git a/web/WEB-INF/jsp/detail.jsp b/web/WEB-INF/jsp/detail.jsp index 398d510..17956f9 100644 --- a/web/WEB-INF/jsp/detail.jsp +++ b/web/WEB-INF/jsp/detail.jsp @@ -56,11 +56,19 @@

- +

- +

@@ -76,13 +84,55 @@

- + checked id="available" />

+ +

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+