diff --git a/VamPa/src/main/java/com/vam/model/OrderPageItemDTO.java b/VamPa/src/main/java/com/vam/model/OrderPageItemDTO.java index a3d9c4a..80135ad 100644 --- a/VamPa/src/main/java/com/vam/model/OrderPageItemDTO.java +++ b/VamPa/src/main/java/com/vam/model/OrderPageItemDTO.java @@ -1,5 +1,7 @@ package com.vam.model; +import java.util.List; + public class OrderPageItemDTO { /* 뷰로부터 전달받을 값 */ @@ -22,6 +24,9 @@ public class OrderPageItemDTO { private int point; private int totalPoint; + + /* 상품 이미지 */ + private List imageList; public int getBookId() { return bookId; @@ -103,13 +108,22 @@ public class OrderPageItemDTO { } + public List getImageList() { + return imageList; + } + + public void setImageList(List imageList) { + this.imageList = imageList; + } + @Override public String toString() { return "OrderPageItemDTO [bookId=" + bookId + ", bookCount=" + bookCount + ", bookName=" + bookName + ", bookPrice=" + bookPrice + ", bookDiscount=" + bookDiscount + ", salePrice=" + salePrice - + ", totalPrice=" + totalPrice + ", point=" + point + ", totalPoint=" + totalPoint + "]"; - } - + + ", totalPrice=" + totalPrice + ", point=" + point + ", totalPoint=" + totalPoint + ", imageList=" + + imageList + "]"; + } + } diff --git a/VamPa/src/main/java/com/vam/service/OrderServiceImpl.java b/VamPa/src/main/java/com/vam/service/OrderServiceImpl.java index 84626e4..3fd709e 100644 --- a/VamPa/src/main/java/com/vam/service/OrderServiceImpl.java +++ b/VamPa/src/main/java/com/vam/service/OrderServiceImpl.java @@ -6,7 +6,10 @@ import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import com.vam.mapper.AttachMapper; import com.vam.mapper.OrderMapper; +import com.vam.model.AttachImageVO; +import com.vam.model.AttachImageVO; import com.vam.model.OrderPageItemDTO; @Service @@ -14,7 +17,11 @@ public class OrderServiceImpl implements OrderService{ @Autowired private OrderMapper orderMapper; - + + @Autowired + private AttachMapper attachMapper; + + @Override public List getGoodsInfo(List orders) { @@ -26,7 +33,11 @@ public class OrderServiceImpl implements OrderService{ goodsInfo.setBookCount(ord.getBookCount()); - goodsInfo.initSaleTotal(); + goodsInfo.initSaleTotal(); + + List imageList = attachMapper.getAttachList(goodsInfo.getBookId()); + + goodsInfo.setImageList(imageList); result.add(goodsInfo); } diff --git a/VamPa/src/main/webapp/WEB-INF/views/order.jsp b/VamPa/src/main/webapp/WEB-INF/views/order.jsp index 80d68fa..8ecb7c6 100644 --- a/VamPa/src/main/webapp/WEB-INF/views/order.jsp +++ b/VamPa/src/main/webapp/WEB-INF/views/order.jsp @@ -192,7 +192,9 @@ - +
+ +
${ol.bookName} @@ -324,6 +326,26 @@ $(document).ready(function(){ /* 주문 조합정보란 최신화 */ setTotalInfo(); + /* 이미지 삽입 */ + $(".image_wrap").each(function(i, obj){ + + const bobj = $(obj); + + if(bobj.data("bookid")){ + const uploadPath = bobj.data("path"); + const uuid = bobj.data("uuid"); + const fileName = bobj.data("filename"); + + const fileCallPath = encodeURIComponent(uploadPath + "/s_" + uuid + "_" + fileName); + + $(this).find("img").attr('src', '/display?fileName=' + fileCallPath); + } else { + $(this).find("img").attr('src', '/resources/img/goodsNoImage.png'); + } + + }); + + }); diff --git a/VamPa/src/main/webapp/resources/css/order.css b/VamPa/src/main/webapp/resources/css/order.css index 9dfa279..9e81b06 100644 --- a/VamPa/src/main/webapp/resources/css/order.css +++ b/VamPa/src/main/webapp/resources/css/order.css @@ -389,6 +389,17 @@ height: 110px; font-weight: bold; } +/* 이미지 */ +.image_wrap{ + width: 100%; + height: 100%; +} +.image_wrap img{ + max-width: 85%; + height: auto; + display: block; +} + diff --git a/VamPa_MySQL/src/main/java/com/vam/model/OrderPageItemDTO.java b/VamPa_MySQL/src/main/java/com/vam/model/OrderPageItemDTO.java index 5a1b927..85e5e28 100644 --- a/VamPa_MySQL/src/main/java/com/vam/model/OrderPageItemDTO.java +++ b/VamPa_MySQL/src/main/java/com/vam/model/OrderPageItemDTO.java @@ -1,5 +1,7 @@ package com.vam.model; +import java.util.List; + public class OrderPageItemDTO { /* 뷰로부터 전달받을 값 */ @@ -22,6 +24,9 @@ public class OrderPageItemDTO { private int point; private int totalPoint; + + /* 상품 이미지 */ + private List imageList; public int getBookId() { return bookId; @@ -103,11 +108,20 @@ public class OrderPageItemDTO { } + public List getImageList() { + return imageList; + } + + public void setImageList(List imageList) { + this.imageList = imageList; + } + @Override public String toString() { return "OrderPageItemDTO [bookId=" + bookId + ", bookCount=" + bookCount + ", bookName=" + bookName + ", bookPrice=" + bookPrice + ", bookDiscount=" + bookDiscount + ", salePrice=" + salePrice - + ", totalPrice=" + totalPrice + ", point=" + point + ", totalPoint=" + totalPoint + "]"; - } + + ", totalPrice=" + totalPrice + ", point=" + point + ", totalPoint=" + totalPoint + ", imageList=" + + imageList + "]"; + } } diff --git a/VamPa_MySQL/src/main/java/com/vam/service/OrderServiceImpl.java b/VamPa_MySQL/src/main/java/com/vam/service/OrderServiceImpl.java index 84626e4..e6ab9b5 100644 --- a/VamPa_MySQL/src/main/java/com/vam/service/OrderServiceImpl.java +++ b/VamPa_MySQL/src/main/java/com/vam/service/OrderServiceImpl.java @@ -6,7 +6,9 @@ import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import com.vam.mapper.AttachMapper; import com.vam.mapper.OrderMapper; +import com.vam.model.AttachImageVO; import com.vam.model.OrderPageItemDTO; @Service @@ -14,6 +16,9 @@ public class OrderServiceImpl implements OrderService{ @Autowired private OrderMapper orderMapper; + + @Autowired + private AttachMapper attachMapper; @Override public List getGoodsInfo(List orders) { @@ -26,7 +31,11 @@ public class OrderServiceImpl implements OrderService{ goodsInfo.setBookCount(ord.getBookCount()); - goodsInfo.initSaleTotal(); + goodsInfo.initSaleTotal(); + + List imageList = attachMapper.getAttachList(goodsInfo.getBookId()); + + goodsInfo.setImageList(imageList); result.add(goodsInfo); } diff --git a/VamPa_MySQL/src/main/webapp/WEB-INF/views/order.jsp b/VamPa_MySQL/src/main/webapp/WEB-INF/views/order.jsp index 80d68fa..8ecb7c6 100644 --- a/VamPa_MySQL/src/main/webapp/WEB-INF/views/order.jsp +++ b/VamPa_MySQL/src/main/webapp/WEB-INF/views/order.jsp @@ -192,7 +192,9 @@ - +
+ +
${ol.bookName} @@ -324,6 +326,26 @@ $(document).ready(function(){ /* 주문 조합정보란 최신화 */ setTotalInfo(); + /* 이미지 삽입 */ + $(".image_wrap").each(function(i, obj){ + + const bobj = $(obj); + + if(bobj.data("bookid")){ + const uploadPath = bobj.data("path"); + const uuid = bobj.data("uuid"); + const fileName = bobj.data("filename"); + + const fileCallPath = encodeURIComponent(uploadPath + "/s_" + uuid + "_" + fileName); + + $(this).find("img").attr('src', '/display?fileName=' + fileCallPath); + } else { + $(this).find("img").attr('src', '/resources/img/goodsNoImage.png'); + } + + }); + + }); diff --git a/VamPa_MySQL/src/main/webapp/resources/css/order.css b/VamPa_MySQL/src/main/webapp/resources/css/order.css index 9dfa279..9e81b06 100644 --- a/VamPa_MySQL/src/main/webapp/resources/css/order.css +++ b/VamPa_MySQL/src/main/webapp/resources/css/order.css @@ -389,6 +389,17 @@ height: 110px; font-weight: bold; } +/* 이미지 */ +.image_wrap{ + width: 100%; + height: 100%; +} +.image_wrap img{ + max-width: 85%; + height: auto; + display: block; +} +