Просмотр исходного кода

브랜드카테고리 조회 추가

gagamel 5 лет назад
Родитель
Сommit
e6039bf1ea

+ 13 - 4
src/main/java/com/style24/front/biz/dao/TsfDisplayDao.java

@@ -13,10 +13,10 @@ import com.style24.persistence.domain.Cate4Srch;
 import com.style24.persistence.domain.Cate5;
 import com.style24.persistence.domain.Contents;
 import com.style24.persistence.domain.GnbTab;
+import com.style24.persistence.domain.Goods;
+import com.style24.persistence.domain.GoodsSearch;
 import com.style24.persistence.domain.MainLayout;
 import com.style24.persistence.domain.Popup;
-import com.style24.persistence.domain.GoodsSearch;
-import com.style24.persistence.domain.Goods;
 
 /**
  * 전시 Dao
@@ -125,7 +125,7 @@ public interface TsfDisplayDao {
 	 * @date 2021. 3. 16
 	 */
 	Cate4Srch getCate4srch(Cate4Srch cate4Srch);
-	
+
 	/**
 	 * 팝업 목록
 	 *
@@ -136,7 +136,6 @@ public interface TsfDisplayDao {
 	 */
 	Collection<Popup> getPopupList(Popup popup);
 
-
 	/**
 	 * 몰메인 브랜드픽 조회
 	 * @param
@@ -199,4 +198,14 @@ public interface TsfDisplayDao {
 	 * @since 2021. 4. 12
 	 */
 	Collection<BrandGroup> getAllBrandList(BrandGroup brandGroup);
+
+	/**
+	 * 브랜드그룹의 기본카테고리여부 조회
+	 * @param brandGroupNo - 브랜드그룹번호
+	 * @return
+	 * @author gagamel
+	 * @date 2021. 4. 12
+	 */
+	String getBrandGroupDefaultCategoryYn(Integer brandGroupNo);
+
 }

+ 35 - 20
src/main/java/com/style24/front/biz/web/TsfDisplayController.java

@@ -7,18 +7,6 @@ import java.util.HashMap;
 
 import javax.servlet.http.HttpServletResponse;
 
-import com.style24.persistence.domain.BrandGroup;
-import com.style24.persistence.domain.Cate4Srch;
-import com.style24.persistence.domain.Contents;
-import com.style24.persistence.domain.GnbTab;
-import com.style24.persistence.domain.Goods;
-import com.style24.persistence.domain.GoodsSearch;
-import com.style24.persistence.domain.Lookbook;
-import com.style24.persistence.domain.MainLayout;
-import com.style24.persistence.domain.Plan;
-import com.style24.persistence.domain.Popup;
-import com.style24.persistence.domain.Social;
-import com.style24.persistence.domain.Login;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.mobile.device.Device;
@@ -42,6 +30,19 @@ 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.Cate1;
+import com.style24.persistence.domain.Cate4Srch;
+import com.style24.persistence.domain.Contents;
+import com.style24.persistence.domain.GnbTab;
+import com.style24.persistence.domain.Goods;
+import com.style24.persistence.domain.GoodsSearch;
+import com.style24.persistence.domain.Login;
+import com.style24.persistence.domain.Lookbook;
+import com.style24.persistence.domain.MainLayout;
+import com.style24.persistence.domain.Plan;
+import com.style24.persistence.domain.Popup;
+import com.style24.persistence.domain.Social;
 
 import lombok.extern.slf4j.Slf4j;
 
@@ -91,7 +92,7 @@ public class TsfDisplayController extends TsfBaseController {
 		MainLayout mallMainLayout = new MainLayout();
 		// 로그인 유무 확인 (로그인이 되어 있지 않으면 regNo 를 0으로 장바구니에 저장한다.)
 		Login login = new Login();
-		if(TsfSession.isLogin()) {
+		if (TsfSession.isLogin()) {
 			login = TsfSession.getInfo();
 		} else {
 			login.setCustNo(0);
@@ -144,7 +145,7 @@ public class TsfDisplayController extends TsfBaseController {
 				}
 			}
 
-			if(contentsLoc.equals("SMM004")){
+			if (contentsLoc.equals("SMM004")) {
 				mainLayout.setBestItemList(displayService.getBestItemForGoods(contents));
 			}
 
@@ -370,19 +371,19 @@ public class TsfDisplayController extends TsfBaseController {
 		Collection<MainLayout> mainLayoutCollection = displayService.getMainLayout(mainLayout);
 		Collection<MainLayout> cateMainLayoutList = new ArrayList<MainLayout>();
 
-		for(MainLayout cateMain : mainLayoutCollection){
-			if("SCM001".equals(cateMain.getContentsLoc())){
+		for (MainLayout cateMain : mainLayoutCollection) {
+			if ("SCM001".equals(cateMain.getContentsLoc())) {
 				// 기획전
 				Contents contents = new Contents();
 				contents.setContentsLoc("SCM001");
 				contents.setCateNo(cate.getCate1No());
 				mav.addObject("planningList", displayService.getContentsList(contents));
-			} else if("SCM002".equals(cateMain.getContentsLoc())){
+			} else if ("SCM002".equals(cateMain.getContentsLoc())) {
 				// 신상품
 				cate.setContentsLoc("SCM002");
 				cate.setMaxRow(20);
 				mav.addObject("newGoodsList", goodsService.getContentsCategoryGoodsList(cate));
-			} else if("SCM003".equals(cateMain.getContentsLoc())){
+			} else if ("SCM003".equals(cateMain.getContentsLoc())) {
 				// 베스트품
 				cate.setContentsLoc("SCM003");
 				cate.setMaxRow(20);
@@ -522,7 +523,7 @@ public class TsfDisplayController extends TsfBaseController {
 		mav.addObject("filterSeasonList", displayService.getCategoryFilter(cate4Srch, "SEASON"));
 		mav.addObject("filterColorList", displayService.getCategoryFilter(cate4Srch, "COLOR"));
 		mav.addObject("filterBenefitList", displayService.getCategoryFilterBenefit(cate4Srch));
-		mav.addObject("sortGb" , "new");
+		mav.addObject("sortGb", "new");
 		mav.addObject("cateInfo", cate4Srch);
 
 		return mav;
@@ -565,7 +566,7 @@ public class TsfDisplayController extends TsfBaseController {
 		log.info("totalCnt::::::::::{}", totalCnt);
 		pageable.setTotalCount(totalCnt);
 		goodsSearch.setPageable(pageable);
-		log.info("getEndRow:::::{}",pageable.getEndRow());
+		log.info("getEndRow:::::{}", pageable.getEndRow());
 		result.set("paging", goodsSearch);
 		result.set("totalCnt", totalCnt);
 		result.set("endRow", pageable.getEndRow());
@@ -602,4 +603,18 @@ public class TsfDisplayController extends TsfBaseController {
 	public Collection<BrandGroup> getAllBrandList(BrandGroup brandGroup) {
 		return displayService.getAllBrandList(brandGroup);
 	}
+
+	/**
+	 * 브랜드 카테고리 목록
+	 * @param brandGroupNo - 브랜드그룹번호
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 4. 12
+	 */
+	@GetMapping("/brand/cate/list")
+	@ResponseBody
+	public Collection<Cate1> getBrandCategoryList(Integer brandGroupNo) {
+		return displayService.getBrandCategoryList(brandGroupNo);
+	}
+
 }

+ 16 - 1
src/main/java/com/style24/persistence/mybatis/shop/TsfDisplay.xml

@@ -276,6 +276,12 @@
 		<if test="cate1No != null and cate1No != ''">
 		AND    CATE1_NO = #{cate1No}
 		</if>
+		<if test='defaultCateYn != null and defaultCateYn != "" and defaultCateYn == "N"'> <!-- 별도카테고리이면 -->
+		AND    CATE1_NO = (SELECT BRAND_CATE_NO
+		                   FROM   TB_BRAND_GROUP
+		                   WHERE  BRAND_GROUP_NO = #{brandGroupNo}
+		                  )
+		</if>
 		AND    DISP_YN = 'Y'
 		AND    USE_YN = 'Y'
 		AND    EXISTS (SELECT 1
@@ -289,7 +295,7 @@
 		               AND    FORMAL_GB = #{formalGb}
 		               </if>
 		               <if test='soldoutGoodsDispYn != null and soldoutGoodsDispYn =="N"'>
-		               AND    STOCK_QTY > 0 /*품절상품전시여부:N일 때 재고가 있는 카테고리만*/
+		               AND    STOCK_QTY > 0 /*품절상품전시여부N일 때 재고가 있는 카테고리만*/
 		               </if>
 		              )
 		ORDER  BY DISP_ORD
@@ -909,4 +915,13 @@
 		ORDER BY (CASE  WHEN ASCII(SUBSTRING(Z.BRAND_GROUP_NM,1)) BETWEEN 48 AND 57 THEN 3
 		                WHEN ASCII(SUBSTRING(Z.BRAND_GROUP_NM,1)) <![CDATA[<]]> 128 THEN 2 ELSE 1 END), Z.BRAND_GROUP_NM
 	</select>
+	
+	<!-- 브랜드그룹의 기본카테고리여부 조회 -->
+	<select id="getBrandGroupDefaultCategoryYn" parameterType="Integer" resultType="String">
+		/* TsfDisplay.getBrandGroupDefaultCategoryYn */
+		SELECT DEFAULT_CATE_YN
+		FROM   TB_BRAND_GROUP
+		WHERE  BRAND_GROUP_NO = #{brandGroupNo}
+	</select>
+	
 </mapper>