Selaa lähdekoodia

Merge branch 'card007' into order

card007 5 vuotta sitten
vanhempi
commit
736e1e1fe4

+ 7 - 7
src/main/java/com/style24/front/biz/dao/TsfOrderDao.java

@@ -25,24 +25,24 @@ public interface TsfOrderDao {
 	Collection<Order> getOrderListForMypage(Order order);
 
 	/**
-	 * 마이페이지 주문상태 별 주문수량 조회
+	 * 주문 상태 별 수량 조회
 	 *
 	 * @param Order
-	 * @return int
+	 * @return Order
 	 * @author card007
 	 * @since 2021. 02. 08
 	 */
-	int getOrderStatCount(Order order);
+	Order getOrderStatCount(Order order);
 
 	/**
-	 * 마이페이지 주문변경상태 별 주문수량 조회
+	 * 마이페이지 주문목록 페이징 처리 주문번호 조회
 	 *
 	 * @param Order
-	 * @return int
+	 * @return Collection<Order>
 	 * @author card007
-	 * @since 2021. 02. 08
+	 * @since 2021. 02. 18
 	 */
-	int getOrderChangeStatCount(Order order);
+	Collection<Order> getPagingOrdNoList(Order order);
 
 	/**
 	 * 마이페이지 주문상세 금액정보 조회

+ 85 - 28
src/main/java/com/style24/front/biz/service/TsfOrderService.java

@@ -61,6 +61,7 @@ public class TsfOrderService {
 	 */
 	public Collection<GagaMap> getOrderListForMypage(Order order) {
 		Collection<GagaMap> mapList = new ArrayList<>();
+		Collection<GagaMap> ordDtlStatList = new ArrayList<>();
 		List<Order> orderList = new ArrayList<>();
 		int ordNo = 0;
 		String ordDt = "";
@@ -77,21 +78,42 @@ public class TsfOrderService {
 		int rowspan = 0;
 
 		for (Order tmpOrder : orderDao.getOrderListForMypage(order)) {
-			// 주문번호, 배송구분(총알배송, 일반배송, 업체직배송), 배송정책 변경
-			if (ordNo != tmpOrder.getOrdNo() || !selfGoodsYn.equals(tmpOrder.getSelfGoodsYn()) || ("N".equals(tmpOrder.getSelfGoodsYn()) && !delvFeeCd.equals(tmpOrder.getDelvFeeCd())) || !shotDelvYn.equals(tmpOrder.getShotDelvYn())) {
+			// 주문번호, 배송구분(총알배송, 일반배송, 업체직배송), 배송정책, 선물하기 변경
+			if (ordNo != tmpOrder.getOrdNo()
+				|| !selfGoodsYn.equals(tmpOrder.getSelfGoodsYn())
+				|| ("N".equals(tmpOrder.getSelfGoodsYn()) && !delvFeeCd.equals(tmpOrder.getDelvFeeCd()))
+				|| !shotDelvYn.equals(tmpOrder.getShotDelvYn())
+				|| !giftPackYn.equals(tmpOrder.getGiftPackYn())) {
 				// 데이터 설정
 				if (index > 0) {
+					// 주문내역 목록 설정
+					GagaMap ordDtlStatMap = new GagaMap();
+					ordDtlStatMap.set("orderList", orderList);
+					ordDtlStatMap.set("ordDtlStat", orderList.iterator().next().getOrdDtlStat());
+					ordDtlStatMap.set("shipCompNm", shipCompNm);
+					ordDtlStatMap.set("invoiceNo", invoiceNo);
+					ordDtlStatMap.set("reviewSq", reviewSq);
+					ordDtlStatMap.set("recipBaseAddr", orderList.iterator().next().getRecipBaseAddr());
+					ordDtlStatMap.set("giftLimitDay", orderList.iterator().next().getGiftLimitDay());
+					ordDtlStatMap.set("recipNm", orderList.iterator().next().getRecipNm());
+					ordDtlStatMap.set("giftLimitDt", orderList.iterator().next().getGiftLimitDt());
+					ordDtlStatMap.set("purchaseConfirmDay", orderList.iterator().next().getPurchaseConfirmDay());
+					ordDtlStatMap.set("ordDtlStatLastBanner", "Y");
+					ordDtlStatMap.set("ordDtlStatBanner", "Y");
+					ordDtlStatList.add(ordDtlStatMap);
+					
 					GagaMap map = new GagaMap();
 					map.set("ordNo", ordNo);					// 주문번호
 					map.set("ordDt", ordDt);					// 주문일시
 					map.set("shotDelvYn", shotDelvYn);			// 총알배송여부
 					map.set("selfGoodsYn", selfGoodsYn);		// 자사여부
-					map.set("ordDtlStat", ordDtlStat);			// 주문상태코드
-					map.set("shipCompNm", shipCompNm);			// 배송업체명
-					map.set("invoiceNo", invoiceNo);			// 송장번호
+					// map.set("ordDtlStat", ordDtlStat);			// 주문상태코드
+					// map.set("shipCompNm", shipCompNm);			// 배송업체명
+					// map.set("invoiceNo", invoiceNo);			// 송장번호
 					map.set("giftPackYn", giftPackYn);			// 선물하기여부
-					map.set("reviewSq", reviewSq);				// 리뷰일련번호
-					map.set("orderList", setOrderListParameter(orderList, rowspan, ordDtlStatCnt, "Y"));			// 주문내역
+					// map.set("reviewSq", reviewSq);				// 리뷰일련번호
+					map.set("ordDtlStatList", ordDtlStatList);	// 주문내역
+					// map.set("orderList", setOrderListParameter(orderList, rowspan, ordDtlStatCnt, "Y"));			// 주문내역
 					mapList.add(map);
 				}
 
@@ -107,13 +129,30 @@ public class TsfOrderService {
 				reviewSq = tmpOrder.getReviewSq();
 				giftPackYn = tmpOrder.getGiftPackYn();
 				orderList = new ArrayList<>();
+				ordDtlStatList = new ArrayList<>();
 				ordDtlStatCnt = 0;
 				rowspan = 0;
 			} else if (index > 0 && !ordDtlStat.equals(tmpOrder.getOrdDtlStat())) {
 				// 주문내역 데이터 추가
 				orderList = setOrderListParameter(orderList, rowspan, ordDtlStatCnt, "N");
 
+				// 주문내역 목록 설정
+				GagaMap ordDtlStatMap = new GagaMap();
+				ordDtlStatMap.set("orderList", orderList);
+				ordDtlStatMap.set("ordDtlStat", orderList.iterator().next().getOrdDtlStat());
+				ordDtlStatMap.set("shipCompNm", shipCompNm);
+				ordDtlStatMap.set("invoiceNo", invoiceNo);
+				ordDtlStatMap.set("reviewSq", reviewSq);
+				ordDtlStatMap.set("purchaseConfirmDay", orderList.iterator().next().getPurchaseConfirmDay());
+				ordDtlStatMap.set("recipBaseAddr", orderList.iterator().next().getRecipBaseAddr());
+				ordDtlStatMap.set("giftLimitDay", orderList.iterator().next().getGiftLimitDay());
+				ordDtlStatMap.set("recipNm", orderList.iterator().next().getRecipNm());
+				ordDtlStatMap.set("giftLimitDt", orderList.iterator().next().getGiftLimitDt());
+				ordDtlStatMap.set("ordDtlStatBanner", "Y");
+				ordDtlStatList.add(ordDtlStatMap);
+
 				// 상태 별 배너 설정 후 초기화 진행
+				orderList = new ArrayList<>();
 				ordDtlStat = tmpOrder.getOrdDtlStat();
 				rowspan = 0;
 			}
@@ -129,17 +168,34 @@ public class TsfOrderService {
 
 		// 마지막 데이터 설정
 		if (ordNo > 0) {
+			// 주문내역 목록 설정
+			GagaMap ordDtlStatMap = new GagaMap();
+			ordDtlStatMap.set("orderList", orderList);
+			ordDtlStatMap.set("ordDtlStat", orderList.iterator().next().getOrdDtlStat());
+			ordDtlStatMap.set("shipCompNm", shipCompNm);
+			ordDtlStatMap.set("invoiceNo", invoiceNo);
+			ordDtlStatMap.set("reviewSq", reviewSq);
+			ordDtlStatMap.set("purchaseConfirmDay", orderList.iterator().next().getPurchaseConfirmDay());
+			ordDtlStatMap.set("recipBaseAddr", orderList.iterator().next().getRecipBaseAddr());
+			ordDtlStatMap.set("giftLimitDay", orderList.iterator().next().getGiftLimitDay());
+			ordDtlStatMap.set("recipNm", orderList.iterator().next().getRecipNm());
+			ordDtlStatMap.set("giftLimitDt", orderList.iterator().next().getGiftLimitDt());
+			ordDtlStatMap.set("ordDtlStatLastBanner", "Y");
+			ordDtlStatMap.set("ordDtlStatBanner", "Y");
+			ordDtlStatList.add(ordDtlStatMap);
+			
 			GagaMap map = new GagaMap();
 			map.set("ordNo", ordNo);
 			map.set("ordDt", ordDt);
 			map.set("shotDelvYn", shotDelvYn);
 			map.set("selfGoodsYn", selfGoodsYn);
-			map.set("ordDtlStat", ordDtlStat);
-			map.set("shipCompNm", shipCompNm);
-			map.set("invoiceNo", invoiceNo);
+			// map.set("ordDtlStat", ordDtlStat);
+			// map.set("shipCompNm", shipCompNm);
+			// map.set("invoiceNo", invoiceNo);
 			map.set("giftPackYn", giftPackYn);
-			map.set("reviewSq", reviewSq);
-			map.set("orderList", setOrderListParameter(orderList, rowspan, ordDtlStatCnt, "Y"));
+			// map.set("reviewSq", reviewSq);
+			map.set("ordDtlStatList", ordDtlStatList);	// 주문내역
+			// map.set("orderList", setOrderListParameter(orderList, rowspan, ordDtlStatCnt, "Y"));
 			mapList.add(map);
 		}
 
@@ -156,18 +212,19 @@ public class TsfOrderService {
 	 */
 	private List<Order> setOrderListParameter(List<Order> orderList, int rowspan, int ordDtlStatCnt, String setLastBanner) {
 		// rowspan 설정
-		for (int i = 0;i <= rowspan;i++) {
-			if (i == rowspan) {
-				orderList.get(ordDtlStatCnt - rowspan).setRowspan(rowspan);
-			} else if (rowspan == 1){
-				orderList.get(ordDtlStatCnt - rowspan).setRowspan(1);
-			} else {
-				orderList.get(ordDtlStatCnt - rowspan).setRowspan(0);
-			}
-		}
+		// for (int i = 0;i <= rowspan;i++) {
+		// 	if (i == rowspan) {
+		// 		orderList.get(ordDtlStatCnt - rowspan).setRowspan(rowspan);
+		// 	} else if (rowspan == 1){
+		// 		orderList.get(ordDtlStatCnt - rowspan).setRowspan(1);
+		// 	} else {
+		// 		orderList.get(ordDtlStatCnt - rowspan).setRowspan(0);
+		// 	}
+		// }
 
 		// 주문상세상태값 별 배너 설정
 		if ("Y".equals(setLastBanner)) {
+			orderList.get(orderList.size() - 1).setOrdDtlStatLastBanner("Y");
 			orderList.get(orderList.size() - 1).setOrdDtlStatBanner("Y");
 		} else {
 			orderList.get(ordDtlStatCnt - 1).setOrdDtlStatBanner("Y");
@@ -177,24 +234,24 @@ public class TsfOrderService {
 	}
 
 	/**
-	 * 마이페이지 주문상태 별 주문수량 조회
+	 * 주문 상태 별 수량 조회
 	 *
 	 * @param Order
-	 * @return int
+	 * @return Order
 	 * @author card007
 	 * @since 2021. 02. 08
 	 */
-	public int getOrderStatCount(Order order) { return orderDao.getOrderStatCount(order); }
+	public Order getOrderStatCount(Order order) { return orderDao.getOrderStatCount(order); }
 
 	/**
-	 * 마이페이지 주문변경상태 별 주문수량 조회
+	 * 마이페이지 주문목록 페이징 처리 주문번호 조회
 	 *
 	 * @param Order
-	 * @return int
+	 * @return Collection<Order>
 	 * @author card007
-	 * @since 2021. 02. 08
+	 * @since 2021. 02. 18
 	 */
-	public int getOrderChangeStatCount(Order order) { return orderDao.getOrderChangeStatCount(order); }
+	public Collection<Order> getPagingOrdNoList(Order order) { return orderDao.getPagingOrdNoList(order); }
 
 	/**
 	 * 마이페이지 주문상세 금액정보 조회

+ 50 - 38
src/main/java/com/style24/front/biz/web/TsfMypageController.java

@@ -1,14 +1,19 @@
 package com.style24.front.biz.web;
 
+import java.util.ArrayList;
 import java.util.Collection;
+import java.util.List;
 
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.lang.Nullable;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.ModelAndView;
 
@@ -27,6 +32,7 @@ import com.style24.front.biz.service.TsfReviewService;
 import com.style24.front.biz.service.TsfWishlistService;
 import com.style24.front.support.controller.TsfBaseController;
 import com.style24.front.support.security.session.TsfSession;
+import com.style24.persistence.TscPageRequest;
 import com.style24.persistence.domain.Customer;
 import com.style24.persistence.domain.Order;
 
@@ -81,8 +87,12 @@ public class TsfMypageController extends TsfBaseController {
 	 * @since 2021. 02. 04
 	 */
 	@GetMapping({"/main/form", "/order/list/form"})
-	public ModelAndView mypageOrderListForm() {
+	public ModelAndView mypageOrderListForm(@RequestBody(required = false) Order order) {
 		ModelAndView mav = new ModelAndView();
+
+		if (order == null) {
+			order = new Order();
+		}
 		
 		// int custNo = TsfSession.getInfo().getCustNo();
 		int custNo = 1000007;
@@ -95,9 +105,9 @@ public class TsfMypageController extends TsfBaseController {
 		mav.addObject("customerInfo", coreCustomerService.getCustomerInfo(customer));
 
 		// 주문정보 조회
-		Order order = new Order();
+		// Order order = new Order();
+		
 		order.setCustNo(custNo);
-		mav.addObject("orderInfo", orderService.getOrderListForMypage(order));
 
 		// 쿠폰정보 조회
 		mav.addObject("couponCnt", coreOrderService.getCouponInfo(order));
@@ -111,42 +121,9 @@ public class TsfMypageController extends TsfBaseController {
 		// 상품권 정보 조회
 		mav.addObject("rmGfcdAmt", coreOrderService.getGiftcardInfo(order));
 
-		// 주문접수
-		order.setOrdDtlStat(TscConstants.OrderDetailStat.ORDER_RECEIPT.value());
-		mav.addObject("orderReceiptCount", orderService.getOrderStatCount(order));
-
-		// 결제완료
-		order.setOrdDtlStat(TscConstants.OrderDetailStat.PAYMENT_COMPLETE.value());
-		mav.addObject("paymentCompleteCount", orderService.getOrderStatCount(order));
-
-		// 상품준비중
-		order.setOrdDtlStat(TscConstants.OrderDetailStat.GOODS_PREPARE.value());
-		mav.addObject("goodsPrepareCount", orderService.getOrderStatCount(order));
-
-		// 배송중
-		order.setOrdDtlStat(TscConstants.OrderDetailStat.DELIVERY_PREPARE.value());
-		mav.addObject("shipPrepareCount", orderService.getOrderStatCount(order));
-
-		// 배송중
-		order.setOrdDtlStat(TscConstants.OrderDetailStat.SHIPPING.value());
-		mav.addObject("shippingCount", orderService.getOrderStatCount(order));
+		// 주문 상태 별 수량 조회
+		mav.addObject("orderCount", orderService.getOrderStatCount(order));
 
-		// 배송완료
-		order.setOrdDtlStat(TscConstants.OrderDetailStat.DELIVERY_COMPLETE.value());
-		mav.addObject("shipCompleteCount", orderService.getOrderStatCount(order));
-
-		// 취소내역
-		order.setChgStat(TscConstants.OrderChangeStat.CANCEL.value());
-		mav.addObject("cancelCount", orderService.getOrderChangeStatCount(order));
-
-		// 반품내역
-		order.setChgStat(TscConstants.OrderChangeStat.RETURN.value());
-		mav.addObject("returnCount", orderService.getOrderChangeStatCount(order));
-
-		// 교환내역
-		order.setChgStat(TscConstants.OrderChangeStat.EXCHANGE.value());
-		mav.addObject("exchangeCount", orderService.getOrderChangeStatCount(order));
-		
 		// 검색기간 설정
 		mav.addObject("searchPeriod", orderService.getSearchPeriod());
 
@@ -212,6 +189,41 @@ public class TsfMypageController extends TsfBaseController {
 		return mav;
 	}
 
+	/**
+	 * 마이페이지 주문목록 조회
+	 * 
+	 * @param Order
+	 * @return ModelAndView
+	 * @author card007
+	 * @since 2021. 02. 18
+	 */
+	@PostMapping("/order/list")
+	@ResponseBody
+	public ModelAndView getOrderList(@RequestBody Order order) {
+		ModelAndView mav = new ModelAndView();
+
+		// 페이징 처리 설정
+		order.setPageable(new TscPageRequest(order.getPageNo() - 1, 5));
+
+		// 페이징 처리 및 주문정보 조회
+		List<Integer> ordNoList = new ArrayList<>();
+
+		for (Order tmpOrder : orderService.getPagingOrdNoList(order)) {
+			ordNoList.add(tmpOrder.getOrdNo());
+		}
+
+		if (ordNoList.size() > 0) {
+			order.setOrdNoList(ordNoList.stream().mapToInt(Integer::intValue).toArray());
+		}
+
+		mav.addObject("orderList", orderService.getOrderListForMypage(order));
+		mav.addObject("orderInfo", order);
+		
+		mav.setViewName(super.getDeviceViewName("mypage/MypageOrderList"));
+		
+		return mav;
+	}
+
 	/**
 	 * 마이페이지 주문상세 주문내역 삭제
 	 *

+ 49 - 56
src/main/java/com/style24/persistence/mybatis/shop/TsfOrder.xml

@@ -92,17 +92,9 @@
 			<if test="ordNo != null and ordNo != ''">
 		   AND O.ORD_NO = #{ordNo}
 			</if>
-			<choose>
-				<when test="stDate != null and stDate != '' and edDate != null and edDate != ''">
-		   AND O.ORD_DT BETWEEN DATE_FORMAT(CONCAT(#{stDate}, ' 000000'), '%Y-%m-%d %H%i%S') AND DATE_FORMAT(CONCAT(#{edDate}, ' 235959'), '%Y-%m-%d %H%i%S')
-				</when>
-				<otherwise>
-		   AND O.ORD_DT >= DATE_FORMAT(LAST_DAY(NOW() - INTERVAL 3 MONTH) + INTERVAL 1 DAY, '%Y-%m-%d')
-				</otherwise>
-			</choose>
-			<if test="ordDtlNoArr != null">
-		   AND OD.ORD_DTL_NO IN
-				<foreach collection="ordDtlNoArr" item="item" index="index"  open="(" close=")" separator=",">
+			<if test="ordNoList != null">
+		   AND O.ORD_NO IN
+				<foreach collection="ordNoList" item="item" index="index"  open="(" close=")" separator=",">
 					#{item}
 				</foreach>
 			</if>
@@ -111,65 +103,63 @@
 		 ORDER BY OD.SUPPLY_COMP_CD
 				, OD.DELV_FEE_CD
 				, OD.ORD_NO DESC
+		        , OD.GIFT_PACK_YN DESC
 				, G.SELF_GOODS_YN DESC
 				, OD.SHOT_DELV_YN DESC
 				, OD.ORD_DTL_STAT
 	</select>
 
-	<!-- 마이페이지 주문상태 별 주문수량 조회 -->
-	<select id="getOrderStatCount" parameterType="Order" resultType="int">
+	<!-- 마이페이지 주문 상태 별 수량 조회 -->
+	<select id="getOrderStatCount" parameterType="Order" resultType="Order">
 		/* TscOrder.getOrderStatCount */
-		SELECT COUNT(*) CNT
-		  FROM TB_ORDER O
-		 INNER JOIN TB_ORDER_DETAIL OD
-		    ON O.ORD_NO = OD.ORD_NO
-		<where>
-			<choose>
-				<when test='custNo != null and custNo != ""'>
-		   AND O.CUST_NO  =  #{custNo}
-				</when>
-				<otherwise>
-		   AND O.ORD_NO = #{ordNo}
-		   AND O.ORD_NM = #{orderNm}
-				</otherwise>
-			</choose>
-		</where>
-		<if test="ordDtlStat == 'G013_60'">
-		   AND O.ORD_DT >= DATE_FORMAT(CURRENT_DATE - INTERVAL 1 WEEK, '%Y-%m-%d')
-		</if>
-		   AND OD.ORD_DTL_STAT = #{ordDtlStat}
-		   AND O.DISP_YN = 'Y'
-	</select>
-
-	<!-- 마이페이지 주문변경상태 별 주문수량 조회 -->
-	<select id="getOrderChangeStatCount" parameterType="Order" resultType="int">
-		/* TscOrder.getOrderChangeStatCount */
-		SELECT COUNT(*) CNT
-		  FROM TB_ORDER_CHANGE_DETAIL OCD
-		 INNER JOIN TB_ORDER_DETAIL OD
-		    ON OCD.ORD_DTL_NO = OD.ORD_DTL_NO
-		 INNER JOIN TB_ORDER O
-		    ON O.ORD_NO = OD.ORD_NO
+		SELECT SUM(Z.ORDER_RECEIPT)                          AS ORDER_RECEIPT_COUNT
+		     , SUM(Z.PAYMENT_COMPLETE)                       AS PAYMENT_COMPLETE_COUNT
+		     , SUM(Z.GOODS_PREPARE)                          AS GOODS_PREPARE_COUNT
+		     , SUM(Z.SHIP_PREPARE)                           AS SHIP_PREPARE_COUNT
+		     , SUM(Z.SHIPPING)                               AS SHIPPING_COUNT
+		     , SUM(Z.SHIP_COMPLETE)                          AS SHIP_COMPLETE_COUNT
+		     , SUM(Z.CANCEL_COUNT)                           AS CANCEL_COUNT
+		     , SUM(Z.EXCHANGE_COUNT + Z.EXCHANGE_WAIT_COUNT) AS EXCHANGE_COUNT
+		     , SUM(Z.RETURN_COUNT)                           AS RETURN_COUNT
+		  FROM (SELECT IFNULL(CASE OD.ORD_DTL_STAT WHEN 'G013_00' THEN 1
+							   END, 0) AS ORDER_RECEIPT
+					 , IFNULL(CASE OD.ORD_DTL_STAT WHEN 'G013_20' THEN 1
+							   END, 0) AS PAYMENT_COMPLETE
+					 , IFNULL(CASE OD.ORD_DTL_STAT WHEN 'G013_30' THEN 1
+							   END, 0) AS GOODS_PREPARE
+					 , IFNULL(CASE OD.ORD_DTL_STAT WHEN 'G013_40' THEN 1
+							   END, 0) AS SHIP_PREPARE
+					 , IFNULL(CASE OD.ORD_DTL_STAT WHEN 'G013_50' THEN 1
+							   END, 0) AS SHIPPING
+					 , IFNULL(CASE WHEN OD.ORD_DTL_STAT = 'G013_60'
+								    AND O.ORD_DT >= DATE_FORMAT(CURRENT_DATE - INTERVAL 1 WEEK, '%Y-%m-%d') THEN 1
+							   END, 0) AS SHIP_COMPLETE
+					 , IFNULL(CASE OCD.CHG_STAT WHEN 'G685_20' THEN 1
+							   END, 0) AS CANCEL_COUNT
+					 , IFNULL(CASE OCD.CHG_STAT WHEN 'G685_30' THEN 1
+							   END, 0) AS EXCHANGE_COUNT
+					 , IFNULL(CASE OCD.CHG_STAT WHEN 'G685_33' THEN 1
+							   END, 0) AS EXCHANGE_WAIT_COUNT
+					 , IFNULL(CASE OCD.CHG_STAT WHEN 'G685_40' THEN 1
+							   END, 0) AS RETURN_COUNT
+				  FROM TB_ORDER O
+				 INNER JOIN TB_ORDER_DETAIL OD
+					ON O.ORD_NO = OD.ORD_NO
+				  LEFT OUTER JOIN TB_ORDER_CHANGE_DETAIL OCD
+					ON OD.ORD_DTL_NO = OCD.ORD_DTL_NO
 		<where>
 			<choose>
 				<when test='custNo != null and custNo != ""'>
-		   AND O.CUST_NO  =  #{custNo}
+				   AND O.CUST_NO  =  #{custNo}
 				</when>
 				<otherwise>
-		   AND O.ORD_NO = #{ordNo}
-		   AND O.ORD_NM = #{orderNm}
+				   AND O.ORD_NO = #{ordNo}
+				   AND O.ORD_NM = #{orderNm}
 				</otherwise>
 			</choose>
 		</where>
-		<choose>
-			<when test="chgStat == 'G685_30'">
-		   AND OCD.CHG_STAT IN (#{chgStat}, 'G685_33')
-			</when>
-			<otherwise>
-		   AND OCD.CHG_STAT = #{chgStat}
-			</otherwise>
-		</choose>
-		   AND O.DISP_YN = 'Y'
+				   AND O.DISP_YN = 'Y'
+		) AS Z
 	</select>
 
 	<!-- 마이페이지 주문목록 페이징 처리 주문번호 조회 -->
@@ -181,6 +171,9 @@
 		  FROM TB_ORDER
 		 WHERE CUST_NO = #{custNo}
 		   AND DISP_YN = 'Y'
+		<if test="stDate != null and stDate != '' and edDate != null and edDate != ''">
+		   AND ORD_DT BETWEEN CONCAT(#{stDate}, ' 00:00:00') AND CONCAT(#{edDate}, ' 23:59:59')
+		</if>
 		<include refid="selectForPagingFooter"/>
 	</select>
 

+ 11 - 8
src/main/webapp/WEB-INF/views/web/common/layout/MypageLayoutWeb.html

@@ -45,14 +45,17 @@
 					</div>
 					<div class="lnb_list">
 						<ul id="mypageLnbList">
-							<li><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_ORDER_LIST);">주문확인/배송조회</a></li>
-							<li><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_CRS_LIST);">취소/반품/환불내역</a></li>
-							<li><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_RESTOCK);">재입고 알림 내역</a></li>
-							<li><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_REVIEW);">리뷰</a></li>
-							<li><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_DELIVERY_ADDR);">배송지 관리</a></li>
-							<li><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_WISHLIST);">위시리스트</a></li>
-							<li><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_CUSTOMER);">내정보 관리</a></li>
-							<li><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_SECEDE);">회원 탈퇴</a></li>
+							<li><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_MYPAGE_ORDER_LIST);">주문확인/배송조회</a></li>
+							<li><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_MYPAGE_CRS_LIST);">취소/반품/환불내역</a></li>
+							<li><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_MYPAGE_RESTOCK);">재입고 알림 내역</a></li>
+							<li><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_MYPAGE_COUPON);">쿠폰</a></li>
+							<li><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_MYPAGE_POINT);">STYLE24 포인트</a></li>
+							<li><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_MYPAGE_GIFTCARD);">상품권</a></li>
+							<li><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_MYPAGE_REVIEW);">리뷰</a></li>
+							<li><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_MYPAGE_DELIVERY_ADDR);">배송지 관리</a></li>
+							<li><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_MYPAGE_WISHLIST);">위시리스트</a></li>
+							<li><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_MYPAGE_CUSTOMER);">내정보 관리</a></li>
+							<li><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_MYPAGE_SECEDE);">회원 탈퇴</a></li>
 						</ul>
 					</div>
 				</div>

+ 82 - 25
src/main/webapp/WEB-INF/views/web/mypage/MypageOrderDetailFormWeb.html

@@ -28,25 +28,26 @@
 			<button type="button" class="btn btn_default od_del_btn" onclick="fnDeleteOrder()"><span>주문 내역 삭제</span></button>
 		</div>
 		<div class="sec_body">
-			<div class="order_list">
+			<div class="order_list" id="orderList">
 				<section class="order_row">
 					<th:block th:if="${orderList}" th:each="oneData, status : ${orderList}">
 						<div class="part_deliver">
-							
 							<div class="tbl_tit">
 								<!-- 주문일/선물일 설정 -->
 								<span class="start_t" th:unless="${oneData.giftPackYn == 'Y'}">주문일</span>
 								<span class="gift_t" th:if="${oneData.giftPackYn == 'Y'}">선물일</span>
 								<!-- //주문일/선물일 설정 -->
+
 								<span class="order_date" th:text="${oneData.ordDt}"></span>
-								<span class="order_label01" th:if="${oneData.selfGoodsYn == 'N'}">업체직배송</span>
-								<span class="order_label01" th:if="${oneData.shotDelvYn == 'N' and oneData.selfGoodsYn == 'Y'}">STYLE24 일반배송</span>
+
+								<!-- 배송구분 설정 -->
 								<span class="order_label02" th:if="${oneData.shotDelvYn == 'Y'}">총알배송</span>
-								<a href="" class="detail_btn">주문상세보기</a>
+								<span class="order_label01" th:if="${oneData.shotDelvYn == 'N' and oneData.selfGoodsYn == 'Y'}">STYLE24 일반배송</span>
+								<span class="order_label01" th:if="${oneData.selfGoodsYn == 'N'}">업체직배송</span>
+								<!-- //배송구분 설정 -->
+								<a href="javascript:void(0)" class="detail_btn" th:attr="ordNo=${oneData.ordNo}" onclick="fnGoToOrderDetail(this)">주문상세보기</a>
 							</div>
-							<th:block th:if="${oneData.orderList}" th:each="order, status : ${oneData.orderList}" th:with="imageUrl=${@environment.getProperty('upload.goods.view')}">
-								<input type="hidden" name="ordDtlNo" th:value="${order.ordDtlNo}"/>
-								<input type="hidden" name="ordDtlStat" th:value="${order.ordDtlStat}"/>
+							<th:block th:if="${oneData.ordDtlStatList}" th:each="ordDtlStat, status : ${oneData.ordDtlStatList}">
 								<div class="tbl type2">
 									<table>
 										<colgroup>
@@ -54,6 +55,7 @@
 											<col width="180">
 										</colgroup>
 										<tbody>
+										<th:block th:if="${ordDtlStat.orderList}" th:each="order, status : ${ordDtlStat.orderList}" th:with="imageUrl=${@environment.getProperty('upload.goods.view')}">
 											<tr class="bundle_row">
 												<td>
 													<div class="info_item">
@@ -83,7 +85,8 @@
 														</div>
 													</div>
 												</td>
-												<td class="merge_row"> <!-- 같은 데이터 노출시 동일 영역끼리 병합 : 클래스명 merge_row 추가 -->
+												<!-- 주문 -->
+												<td class="merge_row" th:unless="${oneData.giftPackYn == 'Y'}">
 													<div class="delivery">
 														<p class="dlvr_staus" th:text="${order.ordDtlStatNm}"></p>
 														<p class="dlvr_desc" th:if="${order.delvEddt}" th:text="|${order.delvEddt}일 도착|"></p>
@@ -91,29 +94,83 @@
 													<div class="tbl_btn_wrap case02">
 														<button type="button" class="btn btn_default btn_sm"><span>교환</span></button>
 														<button type="button" class="btn btn_default btn_sm"><span>반품/취소</span></button>
-														<button type="button" class="btn btn_default btn_sm" th:if="${order.reviewSq == 0}"><span>리뷰작성</span></button>
+														<button type="button" class="btn btn_default btn_sm"><span>리뷰작성</span></button>
+													</div>
+												</td>
+												<td class="merge_row" th:if="${oneData.giftPackYn == 'Y' and #strings.isEmpty(order.recipBaseAddr)}">
+													<div class="delivery">
+														<p class="dlvr_staus c_primary">주소 입력 대기</p>
+														<p class="dlvr_desc" th:text="|남은 기간 ${order.giftLimitDay}일|"></p>
+														<p class="dlvr_desc" th:text="|(${order.giftLimitDt}까지)|"></p>
+													</div>
+													<div class="tbl_btn_wrap case02">
+														<button type="button" class="btn btn_dark btn_sm"><span>SMS 재전송</span></button>
+													</div>
+												</td>
+												<td class="merge_row" th:if="${oneData.giftPackYn == 'Y' and !#strings.isEmpty(order.recipBaseAddr)}">
+													<div class="delivery">
+														<p class="dlvr_staus c_primary">선물 완료</p>
+														<p class="dlvr_desc" th:text="|(${order.giftCompleteDt})|"></p>
+													</div>
+													<div class="tbl_btn_wrap case02">
 													</div>
 												</td>
 											</tr>
+										</th:block>
 										</tbody>
 									</table>
 								</div>
-								<div class="order_confirm" th:if="${order.ordDtlStatBanner == 'Y'}">
-									<p class="cf_txt cf_desc c_primary" th:if="${order.ordDtlStat == 'G013_00' or order.ordDtlStat == 'G013_10' or order.ordDtlStat == 'G013_11'}">주문 완료 / 결제를 기다리고 있습니다.</p> <!-- button 없이 텍스트만 있을 경우 cf_desc c_primary class 추가 -->
-									<p class="cf_txt cf_desc c_primary" th:if="${order.ordDtlStat == 'G013_20' or order.ordDtlStat == 'G013_30' or order.ordDtlStat == 'G013_35'}">배송할 상품을 준비 중입니다.</p>
-									<p class="cf_txt cf_desc c_primary" th:if="${order.ordDtlStat == 'G013_40'}">상품준비가 완료되어 곧 배송될 예정입니다.</p>
-									<p class="cf_txt cf_desc c_primary" th:if="${order.ordDtlStat == 'G013_50' or order.ordDtlStat == 'G013_55'}" th:text="|${order.shipCompNm} / ${order.invoiceNo}|"></p>
-									<button type="button" class="btn btn_primary" th:if="${order.ordDtlStat == 'G013_50' or order.ordDtlStat == 'G013_55'}">배송조회</button>
-									<p class="cf_txt cf_desc c_primary" th:if="${order.ordDtlStat == 'G013_60'}" th:text="|${order.purchaseConfirmDay}일 후 자동으로 구매확정|"></p>
-									<button type="button" class="btn btn_primary" th:if="${order.ordDtlStat == 'G013_60'}" onclick="fnDecideOrder(this);">구매확정 하기</button>
-									<p class="cf_txt cf_desc c_primary" th:if="${order.ordDtlStat == 'G013_70' and order.reviewSq == 0}">리뷰를 작성하면 다른 구매자에게 도움이 될 수 있습니다.</p>
-									<button type="button" class="btn btn_primary" th:if="${order.ordDtlStat == 'G013_70' and order.reviewSq == 0}">리뷰작성</button>
-									<p class="cf_txt cf_desc c_primary" th:if="${order.ordDtlStat == 'G013_70' and order.reviewSq > 0}">주문내역 다시 구매하기 위해</p>
-									<button type="button" class="btn btn_primary" th:if="${order.ordDtlStat == 'G013_70' and order.reviewSq > 0}">장바구니 담기</button>
-								</div>
+								<th:block th:if="${ordDtlStat.ordDtlStatBanner == 'Y'}">
+									<!-- 주문 -->
+									<th:block th:unless="${oneData.giftPackYn == 'Y'}">
+										<div class="order_confirm" th:if="${ordDtlStat.ordDtlStat == 'G013_00' or ordDtlStat.ordDtlStat == 'G013_10' or ordDtlStat.ordDtlStat == 'G013_11'}">
+											<span class="cf_txt">주문 완료 / 결제를 기다리고 있습니다.</span>
+										</div>
+										<div class="order_confirm" th:if="${ordDtlStat.ordDtlStat == 'G013_20' or ordDtlStat.ordDtlStat == 'G013_30' or ordDtlStat.ordDtlStat == 'G013_35'}">
+											<span class="cf_txt">배송할 상품을 준비 중입니다.</span>
+										</div>
+										<div class="order_confirm" th:if="${ordDtlStat.ordDtlStat == 'G013_40'}">
+											<span class="cf_txt">상품준비가 완료되어 곧 배송될 예정입니다.</span>
+										</div>
+										<div class="order_confirm" th:if="${ordDtlStat.ordDtlStat == 'G013_50' or ordDtlStat.ordDtlStat == 'G013_55'}">
+											<span class="cf_txt" th:text="|${ordDtlStat.shipCompNm} / ${ordDtlStat.invoiceNo}|"></span>
+											<button type="button" class="btn btn_primary">배송조회</button>
+										</div>
+										<div class="order_confirm" th:if="${ordDtlStat.ordDtlStat == 'G013_60'}">
+											<span class="cf_txt" th:text="|${ordDtlStat.purchaseConfirmDay}일 후 자동으로 구매확정|"></span>
+											<button type="button" class="btn btn_primary">구매확정 하기</button>
+										</div>
+										<div class="order_confirm" th:if="${ordDtlStat.ordDtlStat == 'G013_70' and ordDtlStat.reviewSq == 0}">
+											<span class="cf_txt">리뷰를 작성하면 다른 구매자에게 도움이 될 수 있습니다.</span>
+											<button type="button" class="btn btn_primary">리뷰작성</button>
+										</div>
+										<div class="order_confirm" th:if="${ordDtlStat.ordDtlStat == 'G013_70' and ordDtlStat.reviewSq > 0}">
+											<span class="cf_txt">주문내역 다시 구매하기 위해</span>
+											<button type="button" class="btn btn_primary">장바구니 담기</button>
+										</div>
+									</th:block>
+
+									<!-- 선물 -->
+									<th:block th:if="${oneData.giftPackYn == 'Y'}">
+										<div class="order_confirm" th:if="${#strings.isEmpty(ordDtlStat.recipBaseAddr) and ordDtlStat.giftLimitDay >= 0}">
+											<span class="cf_txt" th:text="|${ordDtlStat.recipNm}님이 주소를 입력하기 전입니다. (입력기한 ${ordDtlStat.giftLimitDt})|"></span>
+										</div>
+										<div class="order_confirm" th:unless="${#strings.isEmpty(ordDtlStat.recipBaseAddr)}">
+											<span class="cf_txt" th:text="|${ordDtlStat.recipNm}님께 선물이 발송되었습니다.|"></span>
+										</div>
+										<div class="order_confirm" th:if="${#strings.isEmpty(ordDtlStat.recipBaseAddr) and ordDtlStat.giftLimitDay < 0}">
+											<span class="cf_txt">주소입력 기한이 경과되어 선물이 취소 되었습니다.</span>
+										</div>
+									</th:block>
+								</th:block>
 							</th:block>
 						</div>
 					</th:block>
+
+					<!-- 주문 없을 때 -->
+					<th:block th:unless="${orderList}" th:each="oneData, status : ${orderList}">
+
+					</th:block>
 				</section>
 				<section class="order_row" th:if="${paymentInfo.payMeans == 'G014_20'}">
 					<div class="order_tit">
@@ -376,7 +433,7 @@
 				gagajf.ajaxJsonSubmit('/mypage/order/decision'
 					, jsonData
 					, function() {
-						cfnGoToPage(_PAGE_ORDER_DETAIL + ordNo);
+						cfnGoToPage(_PAGE_MYPAGE_ORDER_DETAIL + ordNo);
 					});
 			}
 		});
@@ -387,7 +444,7 @@
 		fnSetMypageLnbList(1);
 		
 		// 마이페이지 location 설정
-		fnSetMypageLocation('주문확인/배송조회', '_PAGE_ORDER_LIST', '주문상세');
+		fnSetMypageLocation('주문확인/배송조회', '_PAGE_MYPAGE_ORDER_LIST', '주문상세');
 	});
 	
 </script>

+ 74 - 176
src/main/webapp/WEB-INF/views/web/mypage/MypageOrderListFormWeb.html

@@ -53,32 +53,32 @@
 				<ul class="clear">
 					<li>
 						<p class="or_p">주문접수</p>
-						<p class="count"><span th:text="${orderReceiptCount}">0</span></p>
+						<p class="count"><span th:text="${orderCount.orderReceiptCount}">0</span></p>
 					</li>
 					<li>
 						<p class="or_p">결제완료</p>
-						<p class="count"><span th:text="${paymentCompleteCount}">0</span></p>
+						<p class="count"><span th:text="${orderCount.paymentCompleteCount}">0</span></p>
 					</li>
 					<li>
 						<p class="or_p">상품 준비 중</p>
-						<p class="count"><span th:text="${goodsPrepareCount}">0</span></p>
+						<p class="count"><span th:text="${orderCount.goodsPrepareCount}">0</span></p>
 					</li>
 					<li>
 						<p class="or_p">배송 준비 중</p>
-						<p class="count"><span th:text="${shipPrepareCount}">0</span></p>
+						<p class="count"><span th:text="${orderCount.shipPrepareCount}">0</span></p>
 					</li>
 					<li>
 						<p class="or_p">배송 중</p>
-						<p class="count"><span th:text="${shippingCount}">0</span></p>
+						<p class="count"><span th:text="${orderCount.shippingCount}">0</span></p>
 					</li>
 					<li>
 						<p class="or_p">배송 완료</p>
-						<p class="count"><span th:text="${shipCompleteCount}">0</span></p>
+						<p class="count"><span th:text="${orderCount.shipCompleteCount}">0</span></p>
 					</li>
 				</ul>
 				<div class="order_right">
 					<p class="or_p">취소/교환/반품</p>
-					<p class="count"><span th:text="${cancelCount + returnCount + exchangeCount}">0</span></p>
+					<p class="count"><span th:text="${orderCount.cancelCount + orderCount.returnCount + orderCount.exchangeCount}">0</span></p>
 				</div>
 			</div>
 			<!-- //주문 경로 -->
@@ -89,189 +89,28 @@
 					<input type="checkbox" name="month" value="최근 1개월" id="chk01" onclick="fnSetSearchPeriod(1);">
 					<label for="chk01">최근 1개월</label>
 					<input type="checkbox" name="month" value="최근 3개월" id="chk02" onclick="fnSetSearchPeriod(3);">
-					<label for="chk02">최근 2개월</label>
+					<label for="chk02">최근 3개월</label>
 					<input type="checkbox" name="month" value="최근 6개월" id="chk03" onclick="fnSetSearchPeriod(6);">
-					<label for="chk03">최근 3개월</label>
+					<label for="chk03">최근 6개월</label>
 				</div>
 				<div class="sch_right">
 					<div class="sch_datepicker sb">
-						<input type="text" class="n_input my_datepicker" name="stDate" value="" th:placeholder="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}" id="stDate">
+						<input type="text" class="n_input my_datepicker" name="stDate" value="" id="stDate">
 					</div>
 					<div class="sch_datepicker">
-						<input type="text" class="n_input my_datepicker" name="edDate" value="" th:placeholder="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}" id="edDate">
+						<input type="text" class="n_input my_datepicker" name="edDate" value="" id="edDate">
 					</div>
-					<button type="button" class="btn btn_dark">조회</button>
+					<button type="button" class="btn btn_dark" onclick="fnSearchOrderList();">조회</button>
 				</div>
 			</div>
 			<!-- //주문조회 검색 -->
-			<div class="order_list">
-				<th:block th:if="${orderInfo}" th:each="oneData, status : ${orderInfo}">
-					<div class="part_deliver">
-						<div class="tbl_tit">
-							<!-- 주문일/선물일 설정 -->
-							<span class="start_t" th:unless="${oneData.giftPackYn == 'Y'}">주문일</span>
-							<span class="gift_t" th:if="${oneData.giftPackYn == 'Y'}">선물일</span>
-							<!-- //주문일/선물일 설정 -->
-
-							<span class="order_date" th:text="${oneData.ordDt}"></span>
-
-							<!-- 배송구분 설정 -->
-							<span class="order_method" th:if="${oneData.shotDelvYn == 'Y'}">총알배송</span>
-							<span class="order_method" th:if="${oneData.shotDelvYn == 'N' and oneData.selfGoodsYn == 'Y'}">일반배송</span>
-							<span class="order_method" th:if="${oneData.selfGoodsYn == 'N'}">업체직배송</span>
-							<!-- //배송구분 설정 -->
-							<a href="javascript:void(0)" class="detail_btn" th:attr="ordNo=${oneData.ordNo}" onclick="fnGoToOrderDetail(this)">주문상세보기</a>
-						</div>
-						<div class="tbl type2">
-							<table>
-								<colgroup>
-									<col width="840">
-									<col width="180">
-									<col width="*">
-								</colgroup>
-								<tbody>
-									<th:block th:if="${oneData.orderList}" th:each="order, status : ${oneData.orderList}" th:with="imageUrl=${@environment.getProperty('upload.goods.view')}">
-										<tr>
-											<td class="">
-												<div class="info_item">
-													<div class="thumb_box">
-														<a href="">
-															<img th:src="${imageUrl + '/' + order.sysImgNm}" width="100%" alt="">
-														</a>
-													</div>
-													<div class="info_box">
-														<p class="od_name">
-															<a href="">
-																<span class="brand" th:text="${order.brandNm}"></span>
-																<span class="name" th:text="${order.goodsNm}"></span>
-															</a>
-														</p>
-														<p class="od_opt">
-															<span class="option">옵션:<em th:text="${order.optCd}"></em></span>
-															<span class="count">수량:<em th:text="${order.ordQty}"></em>개</span>
-														</p>
-													</div>
-													<div class="info_calc">
-														<p class="price">
-															<span class="selling_price" th:text="|${#numbers.formatInteger(order.ordAmt, 1, 'COMMA')}원|"></span>
-														</p>
-														<p class="point"><span th:text="${#numbers.formatInteger(order.savePntAmt, 1, 'COMMA')}"></span>p</p>
-													</div>
-												</div>
-											</td>
-											<td class="" th:if="${order.rowspan > 0}" th:rowspan="${order.rowspan}">
-												<div class="delivery">
-													<!-- 주문 -->
-													<th:block th:unless="${oneData.giftPackYn == 'Y'}">
-														<p class="dlvr_staus" th:text="${order.ordDtlStatNm}"></p>
-														<p class="dlvr_desc" th:if="${order.delvEddt}" th:text="|${order.delvEddt}일 도착|"></p>
-													</th:block>
-													<!-- //주문 -->
-
-													<!-- 선물 -->
-													<th:block th:if="${oneData.giftPackYn == 'Y'}">
-														<!-- 주소 입력 전 -->
-														<th:block th:if="${#strings.isEmpty(order.recipBaseAddr)}">
-															<p class="dlvr_staus c_primary">주소 입력 대기</p>
-															<p class="dlvr_desc" th:text="|남은 기간 ${order.giftLimitDay}일|"></p>
-															<p class="dlvr_desc" th:text="|(${order.giftLimitDt}까지)|"></p>
-														</th:block>
-														<!-- 주소 입력 후 -->
-														<th:block th:unless="${#strings.isEmpty(order.recipBaseAddr)}">
-															<p class="dlvr_staus c_primary">선물 완료</p>
-															<p class="dlvr_desc" th:text="|(${order.giftCompleteDt})|"></p>
-														</th:block>
-													</th:block>
-													<!-- //선물 -->
-												</div>
-											</td>
-											<td class="" th:if="${order.rowspan > 0}" th:rowspan="${order.rowspan}">
-												<div class="tbl_btn_wrap case02">
-													<ul>
-														<!-- 주문 -->
-														<th:block th:unless="${oneData.giftPackYn == 'Y'}">
-															<li><button type="button" class="btn btn_default btn_sm"><span>교환</span></button></li>
-															<li><button type="button" class="btn btn_default btn_sm"><span>반품/취소</span></button></li>
-															<li th:if="${order.reviewSq == 0}"><button type="button" class="btn btn_dark btn_sm"><span>리뷰작성</span></button></li>
-														</th:block>
-														<!-- //주문 -->
-														
-														<!-- 선물 -->
-														<th:block th:if="${oneData.giftPackYn == 'Y'}">
-															<li><button type="button" class="btn btn_dark btn_sm" th:if="${#strings.isEmpty(order.recipBaseAddr)}"><span>SMS 재전송</span></button></li>
-														</th:block>
-														<!-- //선물 -->
-													</ul>
-												</div>
-											</td>
-										</tr>
-										<th:block th:if="${order.ordDtlStatBanner == 'Y'}">
-											<!-- 주문 -->
-											<th:block th:unless="${oneData.giftPackYn == 'Y'}">
-												<tr>
-													<td colspan="4">
-														<div class="order_confirm" th:if="${order.ordDtlStat == 'G013_00' or order.ordDtlStat == 'G013_10' or order.ordDtlStat == 'G013_11'}">
-															<span class="cf_txt">주문 완료 / 결제를 기다리고 있습니다.</span>
-														</div>
-														<div class="order_confirm" th:if="${order.ordDtlStat == 'G013_20' or order.ordDtlStat == 'G013_30' or order.ordDtlStat == 'G013_35'}">
-															<span class="cf_txt">배송할 상품을 준비 중입니다.</span>
-														</div>
-														<div class="order_confirm" th:if="${order.ordDtlStat == 'G013_40'}">
-															<span class="cf_txt">상품준비가 완료되어 곧 배송될 예정입니다.</span>
-														</div>
-														<div class="order_confirm" th:if="${order.ordDtlStat == 'G013_50' or order.ordDtlStat == 'G013_55'}">
-															<span class="cf_txt" th:text="|${order.shipCompNm} / ${order.invoiceNo}|"></span>
-															<button type="button" class="btn btn_primary">배송조회</button>
-														</div>
-														<div class="order_confirm" th:if="${order.ordDtlStat == 'G013_60'}">
-															<span class="cf_txt" th:text="|${order.purchaseConfirmDay}일 후 자동으로 구매확정|"></span>
-															<button type="button" class="btn btn_primary">구매확정 하기</button>
-														</div>
-														<div class="order_confirm" th:if="${order.ordDtlStat == 'G013_70' and order.reviewSq == 0}">
-															<span class="cf_txt">리뷰를 작성하면 다른 구매자에게 도움이 될 수 있습니다.</span>
-															<button type="button" class="btn btn_primary">리뷰작성</button>
-														</div>
-														<div class="order_confirm" th:if="${order.ordDtlStat == 'G013_70' and order.reviewSq > 0}">
-															<span class="cf_txt">주문내역 다시 구매하기 위해</span>
-															<button type="button" class="btn btn_primary">장바구니 담기</button>
-														</div>
-													</td>
-												</tr>
-											</th:block>
-
-											<!-- 선물 -->
-											<th:block th:if="${oneData.giftPackYn == 'Y'}">
-												<tr>
-													<td colspan="4">
-														<div class="order_confirm" th:if="${#strings.isEmpty(order.recipBaseAddr) and order.giftLimitDay >= 0}">
-															<span class="cf_txt" th:text="|${order.recipNm}님이 주소를 입력하기 전입니다. (입력기한 ${order.giftLimitDt})|"></span>
-														</div>
-														<div class="order_confirm" th:unless="${#strings.isEmpty(order.recipBaseAddr)}">
-															<span class="cf_txt" th:text="|${order.recipNm}님께 선물이 발송되었습니다.|"></span>
-														</div>
-														<div class="order_confirm" th:if="${#strings.isEmpty(order.recipBaseAddr) and order.giftLimitDay < 0}">
-															<span class="cf_txt">주소입력 기한이 경과되어 선물이 취소 되었습니다.</span>
-														</div>
-													</td>
-												</tr>
-											</th:block>
-										</th:block>
-									</th:block>
-								</tbody>
-							</table>
-						</div>
-					</div>
-				</th:block>
-
-				<!-- 주문 없을 때 -->
-				<th:block th:unless="${orderInfo}" th:each="oneData, status : ${orderInfo}">
-
-				</th:block>
+			<div class="order_list" id="orderList">
 			</div>
 		</div>
 	</div>
 <script src="/ux/plugins/gaga/gaga.paging.js"></script>
 <script th:inline="javascript">
+	let customerInfo = [[${customerInfo}]];
 /*<![CDATA[*/
 	$(document).ready(function() {
 		// 마이페이지 LNB 설정
@@ -282,13 +121,18 @@
 		
 		// datepicker 설정
 		$(".my_datepicker").datepicker();
+		
+		// 주문 리스트 조회
+		fnSearchOrderList(1);
 	});
 	
+	// 주문상세보기 버튼 클릭 이벤트 처리
 	var fnGoToOrderDetail = function(param) {
 		let ordNo = $(param).attr('ordNo');
-		cfnGoToPage(_PAGE_ORDER_DETAIL + ordNo);
+		cfnGoToPage(_PAGE_MYPAGE_ORDER_DETAIL + ordNo);
 	}
 	
+	// 검색기간 버튼 클릭 이벤트 처리
 	var fnSetSearchPeriod = function(period) {
 		let date = new Date();
 		$('#edDate').val(date.getFullYear() + '-' + ('0' + (date.getMonth() + 1)).slice(-2) + '-' + ('0' + (date.getDate() + 1)).slice(-2));
@@ -296,6 +140,60 @@
 		$('#stDate').val(date.getFullYear() + '-' + ('0' + (date.getMonth() + 1)).slice(-2) + '-' + ('0' + (date.getDate() + 1)).slice(-2));
 	}
 	
+	// 주문 목록 조회
+	var fnSearchOrderList = function(pageNo) {
+		if (pageNo == null) {
+			pageNo = $('#pageNo').val();
+		}
+		let stDate = $('#stDate').val();
+		let edDate = $('#edDate').val();
+		//let ordDtlStat = $('#ordDtlStat').val();
+		
+		let data = {};
+		data.pageNo = pageNo;
+		data.stDate = stDate;
+		data.edDate = edDate;
+		data.custNo = customerInfo.custNo;
+		//data.ordDtlStat = ordDtlStat;
+		
+		let jsonData = JSON.stringify(data)
+		
+		$.ajax( {
+			type		: "POST",
+			url 		: '/mypage/order/list',
+			data		: jsonData,
+			dataType 	: 'html',
+			beforeSend : function(xhr, settings) {
+				// AJAX call
+				xhr.setRequestHeader("AJAX", "true");
+				
+				// dataType: "json"일 때
+				xhr.setRequestHeader('Accept', 'application/json');
+				xhr.setRequestHeader('Content-Type', 'application/json');
+				
+				// Button disabled & progressBar creation
+				gagajf.showProgressbar(true);
+			},
+			success 	: function(result) {
+				$('#orderList').html(result);
+				fnMergeRow();
+			}
+		});
+	}
+	
+	// rowspan 처리
+	var fnMergeRow = function() {
+		$(".merge_row").each(function() {
+			var txt = $(this).text();
+			var rows = $(this).parents("table").find(".merge_row:contains('" + txt + "')");
+			//console.log(txt);
+			//console.log(rows);
+			if (rows.length > 1) {
+				rows.eq(0).attr("rowspan", rows.length);
+				rows.not(":eq(0)").remove();
+			}
+		});
+	}
 /*]]>*/
 </script>
 

+ 176 - 0
src/main/webapp/WEB-INF/views/web/mypage/MypageOrderListWeb.html

@@ -0,0 +1,176 @@
+<!DOCTYPE html>
+<html lang="ko" xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : MypageOrderListWeb.html
+ * @desc    : 마이페이지 > 주문확인/배송조회 주문리스트 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2021 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.02.18   card007     최초 작성
+ *******************************************************************************
+ -->
+<th:block th:if="${orderList}" th:each="oneData, status : ${orderList}">
+	<input type="hidden" th:value="${orderInfo.pageNo}" id="pageNo"/>
+	<div class="part_deliver">
+		<div class="tbl_tit">
+			<!-- 주문일/선물일 설정 -->
+			<span class="start_t" th:unless="${oneData.giftPackYn == 'Y'}">주문일</span>
+			<span class="gift_t" th:if="${oneData.giftPackYn == 'Y'}">선물일</span>
+			<!-- //주문일/선물일 설정 -->
+
+			<span class="order_date" th:text="${oneData.ordDt}"></span>
+
+			<!-- 배송구분 설정 -->
+			<span class="order_label02" th:if="${oneData.shotDelvYn == 'Y'}">총알배송</span>
+			<span class="order_label01" th:if="${oneData.shotDelvYn == 'N' and oneData.selfGoodsYn == 'Y'}">STYLE24 일반배송</span>
+			<span class="order_label01" th:if="${oneData.selfGoodsYn == 'N'}">업체직배송</span>
+			<!-- //배송구분 설정 -->
+			<a href="javascript:void(0)" class="detail_btn" th:attr="ordNo=${oneData.ordNo}" onclick="fnGoToOrderDetail(this)">주문상세보기</a>
+		</div>
+		<th:block th:if="${oneData.ordDtlStatList}" th:each="ordDtlStat, status : ${oneData.ordDtlStatList}">
+			<div class="tbl type2">
+				<table>
+					<colgroup>
+						<col width="1020">
+						<col width="180">
+					</colgroup>
+					<tbody>
+						<th:block th:if="${ordDtlStat.orderList}" th:each="order, status : ${ordDtlStat.orderList}" th:with="imageUrl=${@environment.getProperty('upload.goods.view')}">
+						<tr class="bundle_row">
+							<td>
+								<div class="info_item">
+									<div class="thumb_box">
+										<a href="">
+											<img th:src="${imageUrl + '/' + order.sysImgNm}" width="100%" alt="">
+										</a>
+									</div>
+									<div class="info_box">
+										<p class="od_name">
+											<a href="">
+												<span class="brand" th:text="${order.brandNm}"></span>
+												<span class="name" th:text="${order.goodsNm}"></span>
+											</a>
+										</p>
+										<p class="od_opt">
+											<span class="option"><em th:text="${order.optCd1}"></em><em th:text="${order.optCd2}"></em></span>
+											<span class="count">수량 <em th:text="${order.ordQty}"></em>개</span>
+										</p>
+									</div>
+									<div class="info_calc">
+										<p class="price">
+											<span class="selling_price" th:text="|${#numbers.formatInteger(order.ordAmt, 1, 'COMMA')}원|"></span>
+										</p>
+										<p class="point"><span th:text="${#numbers.formatInteger(order.savePntAmt, 1, 'COMMA')}"></span>p</p>
+									</div>
+								</div>
+							</td>
+							<!--  <td class="" th:if="${order.rowspan > 0}" th:rowspan="${order.rowspan}">  -->
+							<!-- 주문 -->
+							<td class="merge_row" th:unless="${oneData.giftPackYn == 'Y'}">
+								<div class="delivery">
+									<p class="dlvr_staus" th:text="${order.ordDtlStatNm}"></p>
+									<p class="dlvr_desc" th:if="${order.delvEddt}" th:text="|${order.delvEddt}일 도착|"></p>
+								</div>
+								<div class="tbl_btn_wrap case02">
+									<button type="button" class="btn btn_default btn_sm"><span>교환</span></button>
+									<button type="button" class="btn btn_default btn_sm"><span>반품/취소</span></button>
+									<button type="button" class="btn btn_default btn_sm"><span>리뷰작성</span></button>
+								</div>
+							</td>
+							<td class="merge_row" th:if="${oneData.giftPackYn == 'Y' and #strings.isEmpty(order.recipBaseAddr)}">
+								<div class="delivery">
+									<p class="dlvr_staus c_primary">주소 입력 대기</p>
+									<p class="dlvr_desc" th:text="|남은 기간 ${order.giftLimitDay}일|"></p>
+									<p class="dlvr_desc" th:text="|(${order.giftLimitDt}까지)|"></p>
+								</div>
+								<div class="tbl_btn_wrap case02">
+									<button type="button" class="btn btn_dark btn_sm"><span>SMS 재전송</span></button>
+								</div>
+							</td>
+							<td class="merge_row" th:if="${oneData.giftPackYn == 'Y' and !#strings.isEmpty(order.recipBaseAddr)}">
+								<div class="delivery">
+									<p class="dlvr_staus c_primary">선물 완료</p>
+									<p class="dlvr_desc" th:text="|(${order.giftCompleteDt})|"></p>
+								</div>
+								<div class="tbl_btn_wrap case02">
+								</div>
+							</td>
+						</tr>
+						</th:block>
+					</tbody>
+				</table>
+			</div>
+			<th:block th:if="${ordDtlStat.ordDtlStatBanner == 'Y'}">
+				<!-- 주문 -->
+				<th:block th:unless="${oneData.giftPackYn == 'Y'}">
+					<div class="order_confirm" th:if="${ordDtlStat.ordDtlStat == 'G013_00' or ordDtlStat.ordDtlStat == 'G013_10' or ordDtlStat.ordDtlStat == 'G013_11'}">
+						<span class="cf_txt">주문 완료 / 결제를 기다리고 있습니다.</span>
+					</div>
+					<div class="order_confirm" th:if="${ordDtlStat.ordDtlStat == 'G013_20' or ordDtlStat.ordDtlStat == 'G013_30' or ordDtlStat.ordDtlStat == 'G013_35'}">
+						<span class="cf_txt">배송할 상품을 준비 중입니다.</span>
+					</div>
+					<div class="order_confirm" th:if="${ordDtlStat.ordDtlStat == 'G013_40'}">
+						<span class="cf_txt">상품준비가 완료되어 곧 배송될 예정입니다.</span>
+					</div>
+					<div class="order_confirm" th:if="${ordDtlStat.ordDtlStat == 'G013_50' or ordDtlStat.ordDtlStat == 'G013_55'}">
+						<span class="cf_txt" th:text="|${ordDtlStat.shipCompNm} / ${ordDtlStat.invoiceNo}|"></span>
+						<button type="button" class="btn btn_primary">배송조회</button>
+					</div>
+					<div class="order_confirm" th:if="${ordDtlStat.ordDtlStat == 'G013_60'}">
+						<span class="cf_txt" th:text="|${ordDtlStat.purchaseConfirmDay}일 후 자동으로 구매확정|"></span>
+						<button type="button" class="btn btn_primary">구매확정 하기</button>
+					</div>
+					<div class="order_confirm" th:if="${ordDtlStat.ordDtlStat == 'G013_70' and ordDtlStat.reviewSq == 0}">
+						<span class="cf_txt">리뷰를 작성하면 다른 구매자에게 도움이 될 수 있습니다.</span>
+						<button type="button" class="btn btn_primary">리뷰작성</button>
+					</div>
+					<div class="order_confirm" th:if="${ordDtlStat.ordDtlStat == 'G013_70' and ordDtlStat.reviewSq > 0}">
+						<span class="cf_txt">주문내역 다시 구매하기 위해</span>
+						<button type="button" class="btn btn_primary">장바구니 담기</button>
+					</div>
+				</th:block>
+	
+				<!-- 선물 -->
+				<th:block th:if="${oneData.giftPackYn == 'Y'}">
+					<div class="order_confirm" th:if="${#strings.isEmpty(ordDtlStat.recipBaseAddr) and ordDtlStat.giftLimitDay >= 0}">
+						<span class="cf_txt" th:text="|${ordDtlStat.recipNm}님이 주소를 입력하기 전입니다. (입력기한 ${ordDtlStat.giftLimitDt})|"></span>
+					</div>
+					<div class="order_confirm" th:unless="${#strings.isEmpty(ordDtlStat.recipBaseAddr)}">
+						<span class="cf_txt" th:text="|${ordDtlStat.recipNm}님께 선물이 발송되었습니다.|"></span>
+					</div>
+					<div class="order_confirm" th:if="${#strings.isEmpty(ordDtlStat.recipBaseAddr) and ordDtlStat.giftLimitDay < 0}">
+						<span class="cf_txt">주소입력 기한이 경과되어 선물이 취소 되었습니다.</span>
+					</div>
+				</th:block>
+			</th:block>
+		</th:block>
+	</div>
+</th:block>
+
+<!-- 주문 없을 때 -->
+<th:block th:unless="${orderList}" th:each="oneData, status : ${orderList}">
+
+</th:block>
+
+<script th:inline="javascript">
+/*<![CDATA[*/
+	$(document).ready(function() {
+		$(".merge_row").each(function() {
+			var txt = $(this).text();
+			var rows = $(this).parents(".merge").find(".merge_row:contains('" + txt + "')");
+			console.log(txt);
+			console.log(rows.length);
+			if (rows.length > 1) {
+				rows.eq(0).attr("rowspan", rows.length);
+				rows.not(":eq(0)").remove();
+			}
+		});
+	});
+/*]]>*/
+</script>
+
+</html>

+ 2 - 0
src/main/webapp/ux/pc/js/common-ui.js

@@ -272,6 +272,8 @@ $(document).ready( function() {
 	$(".merge_row").each(function() {
 		var txt = $(this).text();
 		var rows = $(this).parents("table").find(".merge_row:contains('" + txt + "')");
+		console.log(txt);
+		console.log(rows.length);
 		if (rows.length > 1) {
 			rows.eq(0).attr("rowspan", rows.length);
 			rows.not(":eq(0)").remove();

+ 12 - 9
src/main/webapp/ux/style24_link.js

@@ -25,15 +25,18 @@ const _PAGE_CUSTOMER_DORMANT = _frontUrl + "/customer/dormant/certify/form";
 
 //== 마이페이지 ==/
 const _PAGE_MYPAGE = _frontUrl + "/mypage/main/form";							// 마이페이지 > 메인
-const _PAGE_ORDER_LIST = _frontUrl + "/mypage/order/list/form";					// 마이페이지 > 주문확인/배송조회
-const _PAGE_ORDER_DETAIL = _frontUrl + "/mypage/order/detail/form/";			// 마이페이지 > 주문/배송 상세
-const _PAGE_CRS_LIST = _frontUrl + "/mypage/crs/list/form";						// 마이페이지 > 취소/교환/반품 목록
-const _PAGE_RESTOCK = _frontUrl + "/mypage/restock/form";						// 마이페이지 > 재입고 알림 내역
-const _PAGE_REVIEW = _frontUrl + "/mypage/review/form";							// 마이페이지 > 리뷰
-const _PAGE_DELIVERY_ADDR = _frontUrl + "/mypage/delivery/addr/form";			// 마이페이지 > 배송지 관리
-const _PAGE_WISHLIST = _frontUrl + "/mypage/wish/list/form";					// 마이페이지 > 위시리스트
-const _PAGE_CUSTOMER = _frontUrl + "/mypage/customer/form";						// 마이페이지 > 내정보 관리
-const _PAGE_SECEDE = _frontUrl + "/mypage/customer/secede/form";				// 마이페이지 > 회원탈퇴
+const _PAGE_MYPAGE_ORDER_LIST = _frontUrl + "/mypage/order/list/form";			// 마이페이지 > 주문확인/배송조회
+const _PAGE_MYPAGE_ORDER_DETAIL = _frontUrl + "/mypage/order/detail/form/";		// 마이페이지 > 주문/배송 상세
+const _PAGE_MYPAGE_CRS_LIST = _frontUrl + "/mypage/crs/list/form";				// 마이페이지 > 취소/교환/반품 목록
+const _PAGE_MYPAGE_RESTOCK = _frontUrl + "/mypage/restock/form";				// 마이페이지 > 재입고 알림 내역
+const _PAGE_MYPAGE_COUPON = _frontUrl + "/mypage/coupon/form";					// 마이페이지 > 재입고 알림 내역
+const _PAGE_MYPAGE_POINT = _frontUrl + "/mypage/point/form";					// 마이페이지 > 재입고 알림 내역
+const _PAGE_MYPAGE_GIFTCARD = _frontUrl + "/mypage/gift/card/form";				// 마이페이지 > 재입고 알림 내역
+const _PAGE_MYPAGE_REVIEW = _frontUrl + "/mypage/review/form";					// 마이페이지 > 리뷰
+const _PAGE_MYPAGE_DELIVERY_ADDR = _frontUrl + "/mypage/delivery/addr/form";	// 마이페이지 > 배송지 관리
+const _PAGE_MYPAGE_WISHLIST = _frontUrl + "/mypage/wish/list/form";				// 마이페이지 > 위시리스트
+const _PAGE_MYPAGE_CUSTOMER = _frontUrl + "/mypage/customer/form";				// 마이페이지 > 내정보 관리
+const _PAGE_MYPAGE_SECEDE = _frontUrl + "/mypage/customer/secede/form";			// 마이페이지 > 회원탈퇴
 
 //== 검색 ==/