Skip to content

Commit

Permalink
[1103] 주문 내역
Browse files Browse the repository at this point in the history
- 주문 내역 조회 api 구현 완료
- #9 이슈
  • Loading branch information
DESKTOP-4OK39MV\user committed Nov 3, 2022
1 parent 99a4db1 commit 943bb1b
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public String mainBestsellerView(
@RequestParam(value = "year", required = false) String year
, @RequestParam(value = "month", required = false) String month
, @RequestParam(value = "week", required = false) String week
,Model model) {
, Model model) {

JSONArray bookBestsellerList;
JSONArray foreignBestsellerList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public String setOrderNumber() {
// 주문 정보 저장 - 회원
public boolean addOrderMember(int userId, List<String> shippingList, List<String> bookDetail) {

// 여러 query 동시 수행 시 트랜잭션

int orderCount = addOrder(shippingList, userId, null);

int orderId = getOrderByUserId(userId).getId();
Expand Down Expand Up @@ -181,8 +183,10 @@ public List<OrderInfo> getOrderInfoByNonMember(int nonMemberId) {

BookDetail bookDetail = bookBO.getBookDetailObject(detail.getIsbn());

orderBookDetail.setOrderDetailList(detail);
orderBookDetail.setBookDetailList(bookDetail);
orderBookDetail.setOrderDetail(detail);
orderBookDetail.setBookDetail(bookDetail);

orderBookDetailList.add(orderBookDetail);
}

orderInfo.setOrder(order);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@

public class OrderBookDetail {

private OrderDetail orderDetailList;
private BookDetail bookDetailList;
private OrderDetail orderDetail;
private BookDetail bookDetail;

public OrderDetail getOrderDetailList() {
return orderDetailList;
public OrderDetail getOrderDetail() {
return orderDetail;
}
public void setOrderDetailList(OrderDetail orderDetailList) {
this.orderDetailList = orderDetailList;
public void setOrderDetail(OrderDetail orderDetail) {
this.orderDetail = orderDetail;
}
public BookDetail getBookDetailList() {
return bookDetailList;
public BookDetail getBookDetail() {
return bookDetail;
}
public void setBookDetailList(BookDetail bookDetailList) {
this.bookDetailList = bookDetailList;
public void setBookDetail(BookDetail bookDetail) {
this.bookDetail = bookDetail;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public User selectUser(
@Param("loginId") String loginId
, @Param("password") String password);

public User selectUserByUserId(@Param("userId") int userId);

public User selectUserLoginId(
@Param("name") String name
, @Param("email") String email);
Expand Down
16 changes: 16 additions & 0 deletions src/main/resources/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,22 @@ header .header-user-nav {
}


/* orderInfo */

.orderInfo-text {
width: 440px;
height: 35px;

}

.orderInfo-title {
height: 50px;
font-size: 18px;
font-weight: bold;
}



/* a tag */

a {
Expand Down
45 changes: 23 additions & 22 deletions src/main/webapp/WEB-INF/jsp/store/order/orderInfo.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -52,34 +52,35 @@
<th class=" w-25">주문 번호</th>
<td>${orderInfo.order.orderNumber }</td>
</tr>

<!-- 책 정보 -->
<c:forEach var="details" items="${orderInfo.orderBookDetailList }">
<tr>
<th></th>
<td>${orderInfo.orderBookDetailList[0].bookDetail.title }</td> <!-- 안됨 -->
<th><img src="${details.bookDetail.cover }" width="100px"></th>
<td>
<div class="d-flex flex-column justify-content-around align-items-around text-left ml-3">
<div class="orderInfo-text orderInfo-title my-3">${details.bookDetail.title }</div>
<div class="orderInfo-text pb-2">${details.bookDetail.author }</div>
<div class="orderInfo-text">${details.bookDetail.publisher }</div>
</div>
</td>
<tr>
</table>

<c:forEach var="details" items="${orderInfo.orderBookDetailList }">

<div class="bg-danger">책 정보</div>

<!-- 책 정보 -->
<div class="border d-flex w-75 my-4 px-5 bookDetail-div" data-isbn=${details.orderDetail.isbn }>
<div class=" m-4 p-2"><img src="${detail.bookDetail.cover }" width="160px"></div>
<div class="book-detail-text mt-5 ml-3">
<div><h2>${detail.bookDetail.title }</h2></div>
<div>${detail.bookDetail.author } ${detail.bookDetail.publisher }</div>
<div class="mt-2">수량 : ${detail.orderDetail.count }</div>
</div>
</div>
</c:forEach>

</div>
<div class="d-flex justify-content-center">
<table class="table m-3 w-75 text-center">

<tr>
<th>수량</th>
<td>${details.orderDetail.count } 권</td>
</tr>
<tr>
<th class="w-25">결제 금액</th>
<td><fmt:formatNumber value="${orderInfo.order.totalPrice }" pattern="#,###"/> 원 </td>
</tr>

</c:forEach>
</table>
</div>

<div class="d-flex justify-content-center">
<table class="table m-3 w-75 text-center">
</table>
</div>
</div>
Expand Down

0 comments on commit 943bb1b

Please sign in to comment.