Ver Fonte

몰메인 수정

bin2107 há 5 anos atrás
pai
commit
28fb83d77a

+ 18 - 0
src/main/java/com/style24/front/biz/dao/TsfDisplayDao.java

@@ -153,4 +153,22 @@ public interface TsfDisplayDao {
 	 * @date 2021. 4. 5
 	 */
 	Collection<GoodsSearch> getCategoryFilter(Cate4Srch cate4Srch);
+
+	/**
+	 * 상품카테고리 필터 혜택 목록
+	 * @param
+	 * @return
+	 * @author bin2107
+	 * @date 2021. 4. 7
+	 */
+	Collection<GoodsSearch> getCategoryFilterBenefit(Cate4Srch cate4Srch);
+
+	/**
+	 * 카테고리 별 상품 수
+	 * @param
+	 * @return
+	 * @author bin2107
+	 * @date 2021. 4. 7
+	 */
+	int getCategoryGoodsCount(GoodsSearch goodsSearch);
 }

+ 22 - 0
src/main/java/com/style24/front/biz/service/TsfDisplayService.java

@@ -336,4 +336,26 @@ public class TsfDisplayService {
 		return displayDao.getCategoryFilter(cate4Srch);
 	}
 
+	/**
+	 * 상품카테고리 필터 혜택 목록
+	 * @param
+	 * @return
+	 * @author bin2107
+	 * @date 2021. 4. 7
+	 */
+	public Collection<GoodsSearch> getCategoryFilterBenefit(Cate4Srch cate4Srch){
+		return displayDao.getCategoryFilterBenefit(cate4Srch);
+	}
+
+	/**
+	 * 카테고리 별 상품 수
+	 * @param
+	 * @return
+	 * @author bin2107
+	 * @date 2021. 4. 7
+	 */
+	public int getCategoryGoodsCount(GoodsSearch goodsSearch){
+	return displayDao.getCategoryGoodsCount(goodsSearch);
+	}
+
 }

+ 40 - 1
src/main/java/com/style24/front/biz/web/TsfDisplayController.java

@@ -7,6 +7,7 @@ import java.util.HashMap;
 
 import javax.servlet.http.HttpServletResponse;
 
+import com.gagaframework.web.parameter.GagaMap;
 import com.style24.core.support.env.TscConstants;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -27,6 +28,7 @@ import com.style24.front.biz.service.TsfPlanningService;
 import com.style24.front.biz.service.TsfSocialService;
 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.BrandGroup;
 import com.style24.persistence.domain.Cate4Srch;
 import com.style24.persistence.domain.Contents;
@@ -472,9 +474,46 @@ public class TsfDisplayController extends TsfBaseController {
 		mav.addObject("filterAgeList", displayService.getCategoryFilter(cate4Srch, "AGE"));
 		mav.addObject("filterSeasonList", displayService.getCategoryFilter(cate4Srch, "SEASON"));
 		mav.addObject("filterColorList", displayService.getCategoryFilter(cate4Srch, "COLOR"));
-		mav.addObject("filterBenefitList", displayService.getCategoryFilter(cate4Srch, "BENEFIT"));
+		mav.addObject("filterColorList", displayService.getCategoryFilter(cate4Srch, "BENEFIT"));
+		//mav.addObject("filterBenefitList", displayService.getCategoryFilterBenefit(cate4Srch));
 		mav.addObject("cateInfo", cate4Srch);
 
 		return mav;
 	}
+
+	/**
+	 * 카테고리 상품 리스트 조회
+	 * @param
+	 * @return
+	 * @author bin2107
+	 * @since 2021. 4. 7
+	 */
+	@PostMapping("/category/goods/list")
+	@ResponseBody
+	public GagaMap getGoodsList(GoodsSearch goodsSearch){
+		GagaMap result = new GagaMap();
+		TscPageRequest pageable = new TscPageRequest((goodsSearch.getPageNo() > 0 ? goodsSearch.getPageNo() - 1 : 0), goodsSearch.getPageSize(), goodsSearch.getPageUnit());
+
+		goodsSearch.setSiteCd(TscConstants.Site.STYLE24.value());
+		goodsSearch.setFormalGb("G009_10");
+		goodsSearch.setFrontGb(TsfSession.getFrontGb());
+		goodsSearch.setCustGb(TsfSession.getCustGb());
+		if(goodsSearch.getBrandGroupNo()==null || goodsSearch.getBrandGroupNo().equals("")){
+			goodsSearch.setBrandGroupNo(0);
+		}
+		if(goodsSearch.getCate4No()!=null && !goodsSearch.getCate4No().equals("")){
+			goodsSearch.setCateNo(goodsSearch.getCate4No());
+		} else if(goodsSearch.getCate3No()!=null && !goodsSearch.getCate3No().equals("")){
+			goodsSearch.setCateNo(goodsSearch.getCate3No());
+		} else if(goodsSearch.getCate2No()!=null && !goodsSearch.getCate2No().equals("")){
+			goodsSearch.setCateNo(goodsSearch.getCate2No());
+		} else if(goodsSearch.getCate1No()!=null && !goodsSearch.getCate1No().equals("")){
+			goodsSearch.setCateNo(goodsSearch.getCate1No());
+		}
+
+		int totalCnt = displayService.getCategoryGoodsCount(goodsSearch);
+		log.info("totalCnt::::::::::{}",totalCnt);
+		pageable.setTotalCount(0);
+		return result;
+	}
 }

+ 7 - 0
src/main/java/com/style24/persistence/domain/GoodsSearch.java

@@ -1,6 +1,7 @@
 package com.style24.persistence.domain;
 
 import com.style24.persistence.TscBaseDomain;
+import com.style24.persistence.TscPageRequest;
 import lombok.Data;
 
 /**
@@ -57,4 +58,10 @@ public class GoodsSearch extends TscBaseDomain {
     private String  filterCd;
     private String  filterNm;
 
+    private TscPageRequest pageable;				// 페이징
+    private int pageNo;
+    private int pageSize;
+    private int pageUnit = 10;
+    private String sortGb;
+
 }

+ 45 - 11
src/main/java/com/style24/persistence/mybatis/shop/TsfDisplay.xml

@@ -594,21 +594,55 @@
 		SELECT
 		<choose>
 			<when test="filterGb != null and filterGb =='SIZE'">
-		       SUBSTRING_INDEX(FILTER_CD,'|',1) AS FILTER_CD
+		SUBSTRING_INDEX(FILTER_CD,'|',1) AS FILTER_CD
 			</when>
 			<otherwise>
-		       FILTER_CD
+		FILTER_CD
 			</otherwise>
 		</choose>
-			 , FILTER_NM
-		FROM	TB_CATE_FILTER
-		WHERE	1=1
-		  AND	SITE_CD = #{siteCd}
-		  AND 	CATE_GB = #{cateGb}
-		  AND 	FORMAL_GB = #{formalGb}
-		  AND 	BRAND_GROUP_NO = #{brandGroupNo}
-		  AND 	CATE_NO = #{cateNo}
-		  AND 	FILTER_GB = #{filterGb}
+		, FILTER_NM
+		FROM TB_CATE_FILTER
+		WHERE 1=1
+		AND SITE_CD = #{siteCd}
+		AND CATE_GB = #{cateGb}
+		AND FORMAL_GB = #{formalGb}
+		AND BRAND_GROUP_NO = #{brandGroupNo}
+		AND CATE_NO = #{cateNo}
+		AND FILTER_GB = #{filterGb}
 		ORDER BY DISP_ORD
 	</select>
+
+	<!-- 카테고리별 상품 총 수 -->
+	<select id="getCategoryGoodsCount" parameterType="GoodsSearch" resultType="int">
+		/* TsfDisplay.getCategoryGoodsCount */
+		SELECT COUNT(1) AS TOTCNT
+		FROM (SELECT A.GOODS_CD
+		           , A.CATE_NO
+		           , A.DISP_ORD
+		           , A.REG_NO
+		           , A.REG_DT
+		      FROM TB_CATE_GOODS A
+		      WHERE 1 = 1
+		        AND EXISTS(SELECT 1
+		                    FROM TB_CATE_4SRCH
+		                    WHERE 1 = 1
+		                      AND LEAF_CATE_NO = A.CATE_NO
+		                      AND CATE1_NO = #{cate1No}
+		                    <if test="cate2No != null and cate2No != ''">
+		                     AND CATE2_NO = #{cate2No}
+							</if>
+		                    <if test="cate3No != null and cate3No != ''">
+		                    AND CATE3_NO = #{cate3No}
+							</if>
+		                    <if test="cate4No != null and cate4No != ''">
+		                    AND CATE4_NO = #{cate4No}
+							</if>
+		                    <if test="cate5No != null and cate5No != ''">
+		                    AND CATE5_NO = #{cate5No}
+		                    </if>
+				  )
+		) A
+		   , TB_GOODS C
+		WHERE A.GOODS_CD = C.GOODS_CD
+	</select>
 </mapper>

+ 19 - 3
src/main/webapp/WEB-INF/views/web/display/CategoryGoodsListFormWeb.html

@@ -455,12 +455,12 @@
 			if(!gagajf.isNull(filterPriceList)){
 				var custom_values = [];
 				$.each(filterPriceList, function (priceIdx, priceItem){
-					custom_values[0] = priceItem.price1;
-					custom_values[1] = priceItem.price2;
+					custom_values[priceIdx] = priceItem.FILTER_NM;
+					/*custom_values[1] = priceItem.price2;
 					custom_values[2] = priceItem.price3;
 					custom_values[3] = priceItem.price4;
 					custom_values[4] = priceItem.price5;
-					custom_values[5] = priceItem.price6;
+					custom_values[5] = priceItem.price6;*/
 				});
 
 				var my_from = custom_values.indexOf(custom_values[0]); //custom_values.indexOf('9,000원');
@@ -500,8 +500,24 @@
 			});
 
 			fnCreateCategoryList();
+
+			fnGoodsListSearch();
 		});
 
+		var fnGoodsListSearch = function (){
+			gagaInfiniteScroll.getHistory();
+		}
+
+		// 상품 검색
+		var fnGetInfiniteScrollDataList = function (pageNum){
+			$("#searchForm input[name=pageNo]").val(pageNum+1);
+			gagajf.ajaxFormSubmit("/display/category/goods/list", document.searchForm,  gagaInfiniteScroll.jsonToHtml);
+		}
+
+		var fnDrawInfiniteScrollData = function (result){
+			console.log('nn');
+		}
+
 		var fnCreateCategoryList = function (){
 			$.getJSON('/display/gnb/tab/list'
 					, function(result, status) {