Sfoglia il codice sorgente

프론트 단위테스트 관련 수정

bin2107 5 anni fa
parent
commit
37a205e636

+ 23 - 6
src/main/java/com/style24/front/biz/web/TsfDisplayController.java

@@ -381,14 +381,31 @@ public class TsfDisplayController extends TsfBaseController {
 				mav.addObject("planningList", displayService.getContentsList(contents));
 			} else if ("SCM002".equals(cateMain.getContentsLoc())) {
 				// 신상품
-				cate.setContentsLoc("SCM002");
-				cate.setMaxRow(20);
-				mav.addObject("newGoodsList", goodsService.getContentsCategoryGoodsList(cate));
+				Contents contents = new Contents();
+				contents.setContentsLoc("SCM002");
+				contents.setCateNo(cate.getCate1No());
+				contents.setMaxRow(1);
+				Collection<Contents> conList = displayService.getContentsList(contents);
+				mav.addObject("newGoodsList", null);
+
+				for(Contents contentsData : conList){
+					cate.setContentsLoc("SCM002");
+					cate.setMaxRow(20);
+					mav.addObject("newGoodsList", goodsService.getContentsCategoryGoodsList(cate));
+				}
 			} else if ("SCM003".equals(cateMain.getContentsLoc())) {
 				// 베스트품
-				cate.setContentsLoc("SCM003");
-				cate.setMaxRow(20);
-				mav.addObject("bestGoodsList", goodsService.getContentsCategoryGoodsList(cate));
+				Contents contents = new Contents();
+				contents.setContentsLoc("SCM003");
+				contents.setCateNo(cate.getCate1No());
+				contents.setMaxRow(1);
+				Collection<Contents> conList = displayService.getContentsList(contents);
+				mav.addObject("bestGoodsList", null);
+				for(Contents contentsData : conList){
+					cate.setContentsLoc("SCM003");
+					cate.setMaxRow(Integer.parseInt(contentsData.getStrVar1()));
+					mav.addObject("bestGoodsList", goodsService.getContentsCategoryGoodsList(cate));
+				}
 			}
 
 			cateMainLayoutList.add(cateMain);

+ 8 - 5
src/main/java/com/style24/persistence/mybatis/shop/TsfGoods.xml

@@ -1129,11 +1129,14 @@
 		                 , ROW_NUMBER() OVER(ORDER BY GS.SELL_WEEK_QTY DESC
 		                                            , G.GOODS_CD) AS NUMB
 		                     </when>
-							 <when test="contentsLoc == 'SMM009' or contentsLoc == 'SMM007'"> <!-- md추천 -->
-						 , ROW_NUMBER() OVER(ORDER BY CTG.DISP_ORD
-								 , G.REG_DT DESC
-								 , G.GOODS_CD) AS NUMB
-							 </when>
+		                     <when test="contentsLoc == 'SMM009' or contentsLoc == 'SMM007'"> <!-- md추천 -->
+		                 , ROW_NUMBER() OVER(ORDER BY CTG.DISP_ORD
+		                 , G.REG_DT DESC
+		                 , G.GOODS_CD) AS NUMB
+		                     </when>
+		                     <when test="contentsLoc == 'SCM002' or contentsLoc == 'SCM003'"> <!-- md추천 -->
+		                  , ROW_NUMBER() OVER(ORDER BY CG.DISP_ORD ,G.UPD_DT DESC, G.CURR_PRICE DESC, G.GOODS_CD ASC) AS NUMB
+		                     </when>
 		                     <otherwise>
 		                 , ROW_NUMBER() OVER(ORDER BY CG.DISP_ORD
 		                                            , G.REG_DT DESC

+ 7 - 7
src/main/webapp/WEB-INF/views/web/common/fragments/GnbWeb.html

@@ -705,14 +705,14 @@
 								tag += '	<p>' + item.title + '</p>\n';
 								tag += '	<div class="brand_list swiper-container">\n';
 								tag += '		<ul class="clear swiper-wrapper">\n';
-							} else {
-								tag += '			<li class="swiper-slide">\n';
-								tag += '				<a href="javascript:void(0);" onclick="cfnGoToBrandMain(' + item.brandGroupNo + ');">\n';
-								tag += '					<img src="' + _uploadDefaultUrl + item.logoFileNm + '" alt=""/>\n';
-								tag += '					<span><em>' + item.brandGroupNm + '</em></span>\n';
-								tag += '				</a>\n';
-								tag += '			</li>\n';
 							}
+							tag += '			<li class="swiper-slide">\n';
+							tag += '				<a href="javascript:void(0);" onclick="cfnGoToBrandMain(' + item.brandGroupNo + ');">\n';
+							tag += '					<img src="' + _uploadDefaultUrl + item.logoFileNm + '" alt=""/>\n';
+							tag += '					<span><em>' + item.brandGroupNm + '</em></span>\n';
+							tag += '				</a>\n';
+							tag += '			</li>\n';
+
 							prevTitle = item.title;
 						});
 						tag += '		</ul>\n';

+ 4 - 4
src/main/webapp/WEB-INF/views/web/display/CategoryMainFormWeb.html

@@ -29,7 +29,7 @@
 	</div>
 
 	<div class="wrap">
-		<th:block th:if="${cateMainLayoutList}" th:each="mainLayoutData, mainStat : ${cateMainLayoutList}" th:with="contentsLoc=${#strings.replace(mainLayoutData.contentsLoc,'SCM','')},contentsTitle=${brandMainLayoutData.contentsTitle}">
+		<th:block th:if="${cateMainLayoutList}" th:each="mainLayoutData, mainStat : ${cateMainLayoutList}" th:with="contentsLoc=${#strings.replace(mainLayoutData.contentsLoc,'SCM','')},contentsTitle=${mainLayoutData.contentsTitle}">
 			<th:block th:if="${contentsLoc=='001'}">
 				<div class="content dp_submain" > <!-- 페이지특정 클래스 = dp_list -->
 					<div class="cont_head">
@@ -89,9 +89,9 @@
 						<div class="swiper-container post-trendy">
 							<div class="swiper-wrapper">
 								<div class="swiper-slide" th:each="item, status : ${newGoodsList}">
-									<div class="item_prod">
+									<div class="item_prod" th:if="${status.count<21}">
 										<div class="item_state">
-											<button type="button" class="itemLike" th:classappend="${item.likeIt}">관심상품 추가</button>
+											<button type="button" class="itemLike" th:classappend="${item.likeIt == 'likeit'}? 'likeit' : ''"  onclick="cfnPutWishList(this);" th:attr="goodsCd=${item.goodsCd}, ithrCd='', contentsLoc='SCM001', planDtlSq=''">관심상품 추가</button>
 											<a href="javascript:void(0);" class="itemLink" th:onclick="cfnGoToGoodsDetail([[${item.goodsCd}]], '', '', 'SCM001');">
 												<div class=" itemPic">
 													<img class="vLHTC pd_img" th:src="${@environment.getProperty('upload.goods.view') + '/' + item.sysImgNm}" th:alt="${item.goodsCd}"/>
@@ -123,7 +123,7 @@
 							<div class="itemsGrp"> <!-- itemsGrp rank hot deal -->
 								<div class="item_prod" th:each="item, status : ${bestGoodsList}">
 									<div class="item_state" >
-										<button type="button" class="itemLike" th:classappend="${item.likeIt}">관심상품 추가</button>
+										<button type="button" class="itemLike" th:classappend="${item.likeIt == 'likeit'}? 'likeit' : ''"  onclick="cfnPutWishList(this);" th:attr="goodsCd=${item.goodsCd}, ithrCd='', contentsLoc='SCM002', planDtlSq=''">관심상품 추가</button>
 										<a href="javascript:void(0);" class="itemLink" th:onclick="cfnGoToGoodsDetail([[${item.goodsCd}]], '', '', 'SCM002');">
 											<div class="rank ranker"><span th:text="${status.index+1}">1</span></div>
 											<div class="itemPic">