From 880449d5e9d2fcc1796b25dfd62e72a0c6322fbe Mon Sep 17 00:00:00 2001 From: ahah525 Date: Wed, 26 Oct 2022 10:03:50 +0900 Subject: [PATCH] =?UTF-8?q?#18=20-=20Fix:=20Boolean=20->=20boolean=20?= =?UTF-8?q?=ED=83=80=EC=9E=85=EC=9C=BC=EB=A1=9C=20=EA=B5=90=EC=B2=B4?= =?UTF-8?q?=ED=95=98=EC=97=AC=20default=20=EB=A1=9C=20false=20=EA=B0=92=20?= =?UTF-8?q?=EB=93=A4=EC=96=B4=EA=B0=80=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mutbooks/app/order/entity/Order.java | 18 +++++++++--------- .../mutbooks/app/order/entity/OrderItem.java | 5 ++++- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/2Week_Mission/mutbooks/src/main/java/com/example/mutbooks/app/order/entity/Order.java b/2Week_Mission/mutbooks/src/main/java/com/example/mutbooks/app/order/entity/Order.java index 20f1de0..ba2d554 100644 --- a/2Week_Mission/mutbooks/src/main/java/com/example/mutbooks/app/order/entity/Order.java +++ b/2Week_Mission/mutbooks/src/main/java/com/example/mutbooks/app/order/entity/Order.java @@ -23,10 +23,10 @@ public class Order extends BaseEntity { private String name; // 주문명 private LocalDateTime payDate; // 결제 일시 - private Boolean readyStatus; // 주문완료 여부 - private Boolean isPaid; // 결제완료 여부 - private Boolean isCanceled; // 주문취소 여부 - private Boolean isRefunded; // 환불 여부 + private boolean readyStatus; // 주문완료 여부 + private boolean isPaid; // 결제완료 여부 + private boolean isCanceled; // 주문취소 여부 + private boolean isRefunded; // 환불 여부 @Builder.Default @OneToMany(mappedBy = "order", cascade = CascadeType.ALL, orphanRemoval = true) @@ -44,7 +44,7 @@ public void makeName() { String name = orderItems.get(0).getProduct().getSubject(); // 2건 이상일 경우 1번 주문 품목 제목 외 ?건 형식으로 if(orderItems.size() > 1) { - name += " 외 %d건".formatted(orderItems.size() - 1); + name += " 외 %d개".formatted(orderItems.size() - 1); } this.name = name; } @@ -55,12 +55,12 @@ public void setOrderDone() { } // 총 주문(상품) 금액 - public long getTotalPayPrice() { + public long getPayPrice() { // 상품들의 실제 판매가의 총합 - long totalPayPrice = 0; + long payPrice = 0; for(OrderItem orderItem : orderItems) { - totalPayPrice += orderItem.getSalePrice(); + payPrice += orderItem.getSalePrice(); } - return totalPayPrice; + return payPrice; } } diff --git a/2Week_Mission/mutbooks/src/main/java/com/example/mutbooks/app/order/entity/OrderItem.java b/2Week_Mission/mutbooks/src/main/java/com/example/mutbooks/app/order/entity/OrderItem.java index f23fc50..cadb3d7 100644 --- a/2Week_Mission/mutbooks/src/main/java/com/example/mutbooks/app/order/entity/OrderItem.java +++ b/2Week_Mission/mutbooks/src/main/java/com/example/mutbooks/app/order/entity/OrderItem.java @@ -33,10 +33,13 @@ public class OrderItem extends BaseEntity { private int pgFee; // 결제대행사 수수료 private int payPrice; // 결제 금액 private int refundPrice; // 환불 금액 - private Boolean isPaid; // 결제 여부 + private boolean isPaid; // 결제 여부 public OrderItem(Product product) { + // product 로 부터 가져온 값 this.product = product; this.price = product.getPrice(); + this.salePrice = product.getSalePrice(); + this.wholesalePrice = product.getWholesalePrice(); } }