From 98dabce14f61a262fede287c7568e619c7edb77b Mon Sep 17 00:00:00 2001 From: Le Deng Date: Sat, 11 Mar 2017 09:36:22 -0500 Subject: [PATCH] latest --- bookstore-api/.idea/workspace.xml | 93 ++++++++---- .../java/com/bookstore/domain/CartItem.java | 1 + .../main/java/com/bookstore/domain/Order.java | 20 +++ .../bookstore/resource/CheckoutResource.java | 11 +- .../com/bookstore/domain/CartItem.class | Bin 3043 -> 3047 bytes .../classes/com/bookstore/domain/Order.class | Bin 4187 -> 4849 bytes .../bookstore/resource/CheckoutResource.class | Bin 5003 -> 5408 bytes .../order-summary/order-summary.component.ts | 39 +++++- .../app/components/order/order.component.ts | 132 ++++++++++-------- store-front/src/app/models/order.ts | 3 + .../src/app/services/checkout.service.ts | 9 ++ 11 files changed, 210 insertions(+), 98 deletions(-) diff --git a/bookstore-api/.idea/workspace.xml b/bookstore-api/.idea/workspace.xml index 7edefab..a005c12 100644 --- a/bookstore-api/.idea/workspace.xml +++ b/bookstore-api/.idea/workspace.xml @@ -19,8 +19,8 @@ - - + + @@ -28,6 +28,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -122,12 +152,12 @@ @@ -954,12 +984,12 @@ - + - @@ -1015,13 +1045,6 @@ - - - - - - - @@ -1377,14 +1400,6 @@ - - - - - - - - @@ -1437,14 +1452,6 @@ - - - - - - - - @@ -1477,10 +1484,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + - - + + diff --git a/bookstore-api/src/main/java/com/bookstore/domain/CartItem.java b/bookstore-api/src/main/java/com/bookstore/domain/CartItem.java index b207f5d..f69f7e9 100644 --- a/bookstore-api/src/main/java/com/bookstore/domain/CartItem.java +++ b/bookstore-api/src/main/java/com/bookstore/domain/CartItem.java @@ -36,6 +36,7 @@ public class CartItem implements Serializable { @ManyToOne @JoinColumn(name = "order_id") + @JsonIgnore private Order order; public Long getId() { diff --git a/bookstore-api/src/main/java/com/bookstore/domain/Order.java b/bookstore-api/src/main/java/com/bookstore/domain/Order.java index a8ede11..43a4b98 100644 --- a/bookstore-api/src/main/java/com/bookstore/domain/Order.java +++ b/bookstore-api/src/main/java/com/bookstore/domain/Order.java @@ -31,12 +31,15 @@ public class Order implements Serializable { private List cartItemList; @OneToOne(cascade=CascadeType.ALL) + @JsonIgnore private ShippingAddress shippingAddress; @OneToOne(cascade=CascadeType.ALL) + @JsonIgnore private BillingAddress billingAddress; @OneToOne(cascade=CascadeType.ALL) + @JsonIgnore private Payment payment; @ManyToOne @@ -130,4 +133,21 @@ public class Order implements Serializable { public void setUser(User user) { this.user = user; } + + @Override + public String toString() { + return "Order{" + + "id=" + id + + ", orderDate=" + orderDate + + ", shippingDate=" + shippingDate + + ", shippingMethod='" + shippingMethod + '\'' + + ", orderStatus='" + orderStatus + '\'' + + ", orderTotal=" + orderTotal + + ", cartItemList=" + cartItemList + + ", shippingAddress=" + shippingAddress + + ", billingAddress=" + billingAddress + + ", payment=" + payment + + ", user=" + user + + '}'; + } } diff --git a/bookstore-api/src/main/java/com/bookstore/resource/CheckoutResource.java b/bookstore-api/src/main/java/com/bookstore/resource/CheckoutResource.java index 21e3569..e9efd74 100644 --- a/bookstore-api/src/main/java/com/bookstore/resource/CheckoutResource.java +++ b/bookstore-api/src/main/java/com/bookstore/resource/CheckoutResource.java @@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.*; import java.security.Principal; import java.time.LocalDate; import java.util.*; +import java.util.concurrent.TimeUnit; /** * Created by z00382545 on 3/10/17. @@ -24,6 +25,8 @@ import java.util.*; @RequestMapping("/checkout") public class CheckoutResource { + private Order order = new Order(); + @Autowired private JavaMailSender mailSender; @@ -43,7 +46,7 @@ public class CheckoutResource { private MailConstructor mailConstructor; @RequestMapping(value = "/checkout", method = RequestMethod.POST) - public ResponseEntity checkoutPost( + public Order checkoutPost( @RequestBody HashMap mapper, Principal principal ) { @@ -78,7 +81,11 @@ public class CheckoutResource { estimatedDeliveryDate = today.plusDays(3); } - return new ResponseEntity("Order Checkout Successful!", HttpStatus.OK); + this.order = order; + + return order; } + + } diff --git a/bookstore-api/target/classes/com/bookstore/domain/CartItem.class b/bookstore-api/target/classes/com/bookstore/domain/CartItem.class index 7b26ef7ed62c2f0c737cc21e2b79a0a017dea1f4..448fde30a08fe3ae285527e244523f353faa4bb4 100644 GIT binary patch delta 188 zcmaDX{#<;+Ty_y*24)5=1_lOg21W**Vg>^Sbq0pXYuPgywI}Cui%!=^Y0KAec AqyPW_ delta 188 zcmaDZ{#bm&Ty_C|1||kA1_lOg21W**Vg`fB8`(1%wI(NWiB2})&|uYLU}eysJdsm; zatVh%qY+SCc=C1*BUUq@xH(vymD7{a3ambbQ-jqGC~glFcVlz{i@gPkxdFx8!D2NaJ7i=W|^1_0j7 BER_HN diff --git a/bookstore-api/target/classes/com/bookstore/domain/Order.class b/bookstore-api/target/classes/com/bookstore/domain/Order.class index 56fafe325f11b77a147b07a947b01b0ef707dff3..f82667b3cc1dfe87a43903ccb299dde3819b63ea 100644 GIT binary patch literal 4849 zcmb7`*>@CG5QnRiOr|sGtc0*bK!p$jBZ~`!1e34@13|JNAYf;vnRJ-x9;bVdfVd!n ziu=Ceg3GI(qi~L%*v?n0%bP^Tw;K3!xZj%!#MBR!JEp*50?eTHR}bl1pwmLa4%F3)pw|0xek6LUoa z@^yog6JrWB*rlvd+KrPH-m+`v)4T#H&6zQaMbpX&iRNH>&~RsLT(Q0CisNnxf;iOZ z=^V$!%D7g_n@!-J`QVP}g6__whs@k=BV!iyJR8dBC3nO%3ZuAs7=>3L(J*f2ET}Aj zbh9w)k@EJ=(TrV4Puuoc$F)mFI%^kn(@GEfI{OB2eucz~W0o;tAJnZm?5hR6STwRj zaA3kiRw$X#os6D^!BvvO!(!9-XYJtVs6s7)g9fwNlHuU`YvpL;zF&Pg*k3L&;qjrt z_C`<786AO9I$y}AXZ6fk$F|aXC4|xkFdxZTZ~)|+r_FpG-=hL@pB!W;B!+{@qCQtJ zEPRBO@)L)}K1A!vNDGCQ$>k=o2_c!^+2s?qx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f#lO5_W<%m21r=mg6`6%8jyiB$bBuy zXY{!aWFQSv1xPIeBROO5=_?(`U>al-AdL)=uxSapuT9oM8pPFt ze63H`LK?&eNRR=-&6{(?qBZoGbk*!ggFMoJgdM&LBQ=tdk=uB78ru#A>Qy~8Y-~>f z^eh92Zw)~Ypb_@meq4S+qdwQ53fiE}NI6m9MmlCc0P)8R#PCk( W!N=up-&9xI2;LmbU084V^v!?T&R9eM diff --git a/bookstore-api/target/classes/com/bookstore/resource/CheckoutResource.class b/bookstore-api/target/classes/com/bookstore/resource/CheckoutResource.class index 7423619ee4c641d9e130cc38bf4f2929459d4f6b..0d0b0ea737361a502c4196d6e989bec84ea85a6d 100644 GIT binary patch delta 2010 zcmZ{kd2~}n6vlrqO)|;LYbk*uVMmVGrqH6YnTmoy6|58}tt@V#JVUTeYnrmS#RYLe zL5&OG0=R&?tbu|ct|*H8f(wc(?#rK^;}P$?pnx26PG;tQbLY;z-*@LNJbpzuz3Z$+v9_IU)XmSHLDsIyDLLZY9H~Xkl+~Q-hVv%-V9N<=N z3vfFblRLOmV|N9(n0?;k-cW~XXf?4%Rjpht0u&Z2KF3j=fX+mzkD7G8qmmlt**`TI-M{v49m(1||E*^^$I589Q4e)NZc$OWRYF~->Ii5G@Bl|^} zn7bge(l@YS2ty@xix+rN@sh>M?39!(Ug1@XlZhyHS-i&U78RVL*lqC!Z(5whK#S8D zu6WDhZQfD5Yw;fMD?YIJkUbW|I92hH#m9Ui)mwbZ-pmMphhd-bxy3%dP<(0e6<;g9 zvG|t#7T@u`;s=W#`N`sEelZBliN;g$M66d?S($eFHM7RQeNcy4(b>`RRJ_qHuWG7~ zHjIj_;mR+B!D5;Z15^cuJFbEcx9Oh78 z)s%=y)b7q@t*LlJd3{r&zBQS&6RGk^Qc-OpF4?G>(IczJjjA!|nLGV|t`f`B(qP-o z2JYgq`r@KYbD(3oj^6S>2FOcL((uv=vT|wBFc>6jugrrTO!Pkr6WNc#ME#>Mk@zS~ zdIBST#3gy+B%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(); + + if (this.order.shippingMethod=="groundShipping") { + deliveryDate.setDate(deliveryDate.getDate()+5); + } else { + deliveryDate.setDate(deliveryDate.getDate()+3); + } + + let days = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; + + this.estimatedDeliveryDate = days[deliveryDate.getDay()]+', '+deliveryDate.getFullYear()+'/'+deliveryDate.getMonth()+'/'+deliveryDate.getDate(); + + this.cartItemList = this.order.cartItemList; + + }); + } + ngOnInit() { + } } diff --git a/store-front/src/app/components/order/order.component.ts b/store-front/src/app/components/order/order.component.ts index 0717bed..676d63d 100644 --- a/store-front/src/app/components/order/order.component.ts +++ b/store-front/src/app/components/order/order.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from '@angular/core'; import {AppConst} from '../../constants/app-const'; import {Book} from '../../models/book'; -import {Router} from "@angular/router"; +import {Router, NavigationExtras} from "@angular/router"; import {CartService} from '../../services/cart.service'; import {ShippingService} from '../../services/shipping.service'; import {PaymentService} from '../../services/payment.service'; @@ -14,7 +14,7 @@ import {UserPayment} from '../../models/user-payment'; import {UserBilling} from '../../models/user-billing'; import {UserShipping} from '../../models/user-shipping'; import {Payment} from '../../models/payment'; - +import {Order} from '../../models/order'; @Component({ selector: 'app-order', @@ -41,6 +41,7 @@ export class OrderComponent implements OnInit { private emptyPaymentList: boolean = true; private stateList: string[] = []; private shippingMethod:string; + private order:Order = new Order(); constructor( private router:Router, @@ -69,13 +70,13 @@ export class OrderComponent implements OnInit { getCartItemList(){ this.cartService.getCartItemList().subscribe( - res=>{ - this.cartItemList = res.json(); - this.cartItemNumber = this.cartItemList.length; - }, - error=>{ - console.log(error.text()); - } + res=>{ + this.cartItemList = res.json(); + this.cartItemNumber = this.cartItemList.length; + }, + error=>{ + console.log(error.text()); + } ); } @@ -110,58 +111,65 @@ export class OrderComponent implements OnInit { console.log("same as shipping") if(checked) { - this.billingAddress.billingAddressName = this.shippingAddress.shippingAddressName; - this.billingAddress.billingAddressStreet1 = this.shippingAddress.shippingAddressStreet1; - this.billingAddress.billingAddressStreet2 = this.shippingAddress.shippingAddressStreet2; - this.billingAddress.billingAddressCity = this.shippingAddress.shippingAddressCity; - this.billingAddress.billingAddressState = this.shippingAddress.shippingAddressState; - this.billingAddress.billingAddressCountry = this.shippingAddress.shippingAddressCountry; - this.billingAddress.billingAddressZipcode = this.shippingAddress.shippingAddressZipcode; - } else { - this.billingAddress.billingAddressName = ""; - this.billingAddress.billingAddressStreet1 = ""; - this.billingAddress.billingAddressStreet2 = ""; - this.billingAddress.billingAddressCity = ""; - this.billingAddress.billingAddressState = ""; - this.billingAddress.billingAddressCountry = ""; - this.billingAddress.billingAddressZipcode = ""; - } + this.billingAddress.billingAddressName = this.shippingAddress.shippingAddressName; + this.billingAddress.billingAddressStreet1 = this.shippingAddress.shippingAddressStreet1; + this.billingAddress.billingAddressStreet2 = this.shippingAddress.shippingAddressStreet2; + this.billingAddress.billingAddressCity = this.shippingAddress.shippingAddressCity; + this.billingAddress.billingAddressState = this.shippingAddress.shippingAddressState; + this.billingAddress.billingAddressCountry = this.shippingAddress.shippingAddressCountry; + this.billingAddress.billingAddressZipcode = this.shippingAddress.shippingAddressZipcode; + } else { + this.billingAddress.billingAddressName = ""; + this.billingAddress.billingAddressStreet1 = ""; + this.billingAddress.billingAddressStreet2 = ""; + this.billingAddress.billingAddressCity = ""; + this.billingAddress.billingAddressState = ""; + this.billingAddress.billingAddressCountry = ""; + this.billingAddress.billingAddressZipcode = ""; + } } onSubmit(){ this.checkoutService.checkout( - this.shippingAddress, - this.billingAddress, - this.payment, - this.shippingMethod - ).subscribe( + this.shippingAddress, + this.billingAddress, + this.payment, + this.shippingMethod + ).subscribe( res=>{ - console.log(res.text()); - }, - error=>{ - console.log(error.text()); - } - ); + this.order=res.json(); + console.log(this.order); - this.router.navigate(['/orderSummary']); - } + let navigationExtras: NavigationExtras = { + queryParams: { + "order": JSON.stringify(this.order) + } + }; - ngOnInit() { - this.getCartItemList(); - + this.router.navigate(['/orderSummary'], navigationExtras); + }, + error=>{ + console.log(error.text()); + } + ); + } - this.cartService.getShoppingCart().subscribe( - res=>{ + ngOnInit() { + this.getCartItemList(); + + + this.cartService.getShoppingCart().subscribe( + res=>{ console.log(res.json()); this.shoppingCart=res.json(); }, error=>{ console.log(error.text()); } - ); + ); - this.shippingService.getUserShippingList().subscribe( - res=>{ + this.shippingService.getUserShippingList().subscribe( + res=>{ console.log(res.json()); this.userShippingList=res.json(); this.emptyShippingList = false; @@ -169,10 +177,10 @@ export class OrderComponent implements OnInit { error=>{ console.log(error.text()); } - ); + ); - this.paymentService.getUserPaymentList().subscribe( - res=>{ + this.paymentService.getUserPaymentList().subscribe( + res=>{ console.log(res.json()); this.userPaymentList=res.json(); this.emptyPaymentList = false; @@ -180,20 +188,20 @@ export class OrderComponent implements OnInit { error=>{ console.log(error.text()); } - ); + ); - for (let s in AppConst.usStates) { - this.stateList.push(s); + for (let s in AppConst.usStates) { + this.stateList.push(s); + } + + this.payment.type=""; + this.payment.expiryMonth=""; + this.payment.expiryYear=""; + this.billingAddress.billingAddressState=""; + this.shippingAddress.shippingAddressState=""; + this.shippingMethod="groundShipping"; } - this.payment.type=""; - this.payment.expiryMonth=""; - this.payment.expiryYear=""; - this.billingAddress.billingAddressState=""; - this.shippingAddress.shippingAddressState=""; - this.shippingMethod="groundShipping"; + + } - - - -} diff --git a/store-front/src/app/models/order.ts b/store-front/src/app/models/order.ts index b9eceee..8ac9f03 100644 --- a/store-front/src/app/models/order.ts +++ b/store-front/src/app/models/order.ts @@ -1,3 +1,5 @@ +import {CartItem} from "./cart-item"; + export class Order { public id:number; public orderDate: string; @@ -5,4 +7,5 @@ export class Order { public shippingMethod: string; public orderStatus: string; public orderTotal: number; + public cartItemList: CartItem[]; } diff --git a/store-front/src/app/services/checkout.service.ts b/store-front/src/app/services/checkout.service.ts index c5d241f..d3ae4b3 100644 --- a/store-front/src/app/services/checkout.service.ts +++ b/store-front/src/app/services/checkout.service.ts @@ -29,4 +29,13 @@ export class CheckoutService { return this.http.post(url, order, {headers : tokenHeader}); } + getUserOrder() { + let url = AppConst.serverPath+"/checkout/getUserOrder"; + + let tokenHeader = new Headers ({ + 'x-auth-token' : localStorage.getItem("xAuthToken") + }); + return this.http.get(url, {headers : tokenHeader}); + } + }