Bladeren bron

Merge branch 'develop' of http://112.172.147.34:4936/style24/style24.front into develop

sowon4187 5 jaren geleden
bovenliggende
commit
572cc462c8

+ 92 - 94
src/main/java/com/style24/front/biz/service/TsfDisplayService.java

@@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
 
+import com.style24.core.biz.service.TscEnvsetService;
 import com.style24.core.support.env.TscConstants;
 import com.style24.front.biz.dao.TsfDisplayDao;
 import com.style24.front.support.env.TsfConstants;
@@ -33,6 +34,9 @@ public class TsfDisplayService {
 	@Autowired
 	private TsfDisplayDao displayDao;
 
+	@Autowired
+	private TscEnvsetService envsetService;
+
 	/**
 	 * GNB 브랜드그룹 목록
 	 * @param contents - 컨텐츠 정보
@@ -66,107 +70,105 @@ public class TsfDisplayService {
 		return displayDao.getContentsList(contents);
 	}
 
-	/**
-	 * FULL 카테고리1 정보
-	 * @param cateGb - 카테고리구분
-	 * @param cate1No - 카테고리1번호
-	 * @return
-	 * @author gagamel
-	 * @since 2021. 3. 11
-	 */
-	@Cacheable(value = "cate", key = "'cateList-'.concat(#cateGb).concat(#cate1No)")
-	public Cate1 getFullCategory1(String cateGb, Integer cate1No) {
-		Cate4Srch cate = new Cate4Srch();
-		cate.setSiteCd(TscConstants.Site.STYLE24.value()); // 사이트코드
-		cate.setCateGb(cateGb); // 카테고리구분
-		cate.setCateType(TsfConstants.CateType.GOODS.value()); // 상품분류카테고리
-		cate.setCate1No(cate1No);
-		return this.getFullCategory1(cate);
-	}
-
-	/**
-	 * FULL 카테고리1 정보
-	 * @param cate - 카테고리 정보
-	 * @return
-	 * @author gagamel
-	 * @since 2021. 3. 11
-	 */
-	public Cate1 getFullCategory1(Cate4Srch cate) {
-		// 카테고리1 정보
-		Cate1 cate1 = displayDao.getCategory1List(cate).get(0);
-
-		if (cate1 != null) {
-			if (cate1.getLeafYn().equals("N")) {
-				cate.setCate1No(cate1.getCate1No());
-
-				// 카테고리2 목록
-				Collection<Cate2> cate2List = displayDao.getCategory2List(cate);
-
-				if (cate2List != null && !cate2List.isEmpty()) {
-					for (Cate2 cate2 : cate2List) {
-						if (cate2.getLeafYn().equals("N")) {
-							cate.setCate2No(cate2.getCate2No());
-
-							// 카테고리3 목록
-							Collection<Cate3> cate3List = displayDao.getCategory3List(cate);
-
-							if (cate3List != null && !cate3List.isEmpty()) {
-								for (Cate3 cate3 : cate3List) {
-									if (cate3.getLeafYn().equals("N")) {
-										cate.setCate3No(cate3.getCate3No());
-
-										// 카테고리4 목록
-										Collection<Cate4> cate4List = displayDao.getCategory4List(cate);
-
-										if (cate4List != null && !cate4List.isEmpty()) {
-											for (Cate4 cate4 : cate4List) {
-												if (cate4.getLeafYn().equals("N")) {
-													cate.setCate4No(cate4.getCate4No());
-
-													// 카테고리5 목록 담기
-													cate4.setCate5List(displayDao.getCategory5List(cate));
-												}
-											}
-
-											log.info("cate4List: {}", cate4List);
-
-											// 카테고리4 목록 담기
-											cate3.setCate4List(cate4List);
-										}
-									}
-								}
-
-								// 카테고리3 목록 담기
-								cate2.setCate3List(cate3List);
-							}
-						}
-					}
-
-					// 카테고리2 목록 담기
-					cate1.setCate2List(cate2List);
-				}
-			}
-		}
-
-		return cate1;
-	}
+//	/**
+//	 * FULL 카테고리1 정보
+//	 * @param cateGb - 카테고리구분
+//	 * @param cate1No - 카테고리1번호
+//	 * @return
+//	 * @author gagamel
+//	 * @since 2021. 3. 11
+//	 */
+//	@Cacheable(value = "cate", key = "'cateList-'.concat(#cateGb).concat(#cate1No)")
+//	public Cate1 getFullCategory1(String cateGb, Integer cate1No) {
+//		Cate4Srch cate = new Cate4Srch();
+//		cate.setSiteCd(TscConstants.Site.STYLE24.value()); // 사이트코드
+//		cate.setCateGb(cateGb); // 카테고리구분
+//		cate.setCateType(TsfConstants.CateType.GOODS.value()); // 상품분류카테고리
+//		cate.setCate1No(cate1No);
+//		return this.getFullCategory1(cate);
+//	}
+//
+//	/**
+//	 * FULL 카테고리1 정보
+//	 * @param cate - 카테고리 정보
+//	 * @return
+//	 * @author gagamel
+//	 * @since 2021. 3. 11
+//	 */
+//	public Cate1 getFullCategory1(Cate4Srch cate) {
+//		// 카테고리1 정보
+//		Cate1 cate1 = displayDao.getCategory1List(cate).get(0);
+//
+//		if (cate1 != null) {
+//			if (cate1.getLeafYn().equals("N")) {
+//				cate.setCate1No(cate1.getCate1No());
+//
+//				// 카테고리2 목록
+//				Collection<Cate2> cate2List = displayDao.getCategory2List(cate);
+//
+//				if (cate2List != null && !cate2List.isEmpty()) {
+//					for (Cate2 cate2 : cate2List) {
+//						if (cate2.getLeafYn().equals("N")) {
+//							cate.setCate2No(cate2.getCate2No());
+//
+//							// 카테고리3 목록
+//							Collection<Cate3> cate3List = displayDao.getCategory3List(cate);
+//
+//							if (cate3List != null && !cate3List.isEmpty()) {
+//								for (Cate3 cate3 : cate3List) {
+//									if (cate3.getLeafYn().equals("N")) {
+//										cate.setCate3No(cate3.getCate3No());
+//
+//										// 카테고리4 목록
+//										Collection<Cate4> cate4List = displayDao.getCategory4List(cate);
+//
+//										if (cate4List != null && !cate4List.isEmpty()) {
+//											for (Cate4 cate4 : cate4List) {
+//												if (cate4.getLeafYn().equals("N")) {
+//													cate.setCate4No(cate4.getCate4No());
+//
+//													// 카테고리5 목록 담기
+//													cate4.setCate5List(displayDao.getCategory5List(cate));
+//												}
+//											}
+//
+//											log.info("cate4List: {}", cate4List);
+//
+//											// 카테고리4 목록 담기
+//											cate3.setCate4List(cate4List);
+//										}
+//									}
+//								}
+//
+//								// 카테고리3 목록 담기
+//								cate2.setCate3List(cate3List);
+//							}
+//						}
+//					}
+//
+//					// 카테고리2 목록 담기
+//					cate1.setCate2List(cate2List);
+//				}
+//			}
+//		}
+//
+//		return cate1;
+//	}
 
 	/**
-	 * 카테고리 목록
+	 * 전체 카테고리 목록
 	 * @param cateGb - 카테고리구분
-	 * @param cate1No - 카테고리1번호
 	 * @return
 	 * @author gagamel
 	 * @since 2021. 3. 11
 	 */
-//	@Cacheable(value = "cate", key = "'cateList-'.concat(#cateGb).concat(#cate1No)")
-	public Collection<Cate1> getCategoryList(String cateGb, Integer cate1No) {
+	@Cacheable(value = "cate", key = "'allCate-'.concat(#cateGb)")
+	public Collection<Cate1> getAllCategoryList(String cateGb) {
 		Cate4Srch cate = new Cate4Srch();
 		cate.setSiteCd(TscConstants.Site.STYLE24.value()); // 사이트코드
 		cate.setCateGb(cateGb); // 카테고리구분
 		cate.setCateType(TsfConstants.CateType.GOODS.value()); // 상품분류카테고리
-		cate.setCate1No(cate1No);
-
+		cate.setSoldoutGoodsDispYn(envsetService.getSoldoutGoodsDisplayYn(TscConstants.Site.STYLE24.value()));
 		return this.getAllCategoryList(cate);
 	}
 
@@ -178,8 +180,6 @@ public class TsfDisplayService {
 	 * @since 2021. 3. 11
 	 */
 	public Collection<Cate1> getAllCategoryList(Cate4Srch cate) {
-//		Collection<Cate1> fullCateList = new ArrayList<>();
-
 		// 카테고리1 목록
 		Collection<Cate1> cate1List = displayDao.getCategory1List(cate);
 
@@ -238,8 +238,6 @@ public class TsfDisplayService {
 			}
 		}
 
-		log.info("cate1List: {}", cate1List);
-
 		return cate1List;
 	}
 

+ 16 - 19
src/main/java/com/style24/front/biz/web/TsfDisplayController.java

@@ -12,14 +12,13 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.ModelAndView;
 
-import com.style24.core.support.env.TscConstants;
+import com.style24.core.biz.service.TscEnvsetService;
 import com.style24.core.support.message.TscMessageByLocale;
 import com.style24.front.biz.service.TsfDisplayService;
 import com.style24.front.support.controller.TsfBaseController;
 import com.style24.front.support.env.TsfConstants;
 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;
 
@@ -42,6 +41,9 @@ public class TsfDisplayController extends TsfBaseController {
 	@Autowired
 	private TsfDisplayService displayService;
 
+	@Autowired
+	private TscEnvsetService envsetService;
+
 	/**
 	 * 몰 메인
 	 * @return
@@ -72,6 +74,18 @@ public class TsfDisplayController extends TsfBaseController {
 		return displayService.getGnbBrandGroupList(contents);
 	}
 
+	/**
+	 * 전체 카테고리 목록
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 3. 15
+	 */
+	@GetMapping("/all/cate/list")
+	@ResponseBody
+	public Collection<Cate1> getAllCategoryList() {
+		return displayService.getAllCategoryList(TsfConstants.CateGb.BYITEM.value());
+	}
+
 	/**
 	 * GNB 탭 목록
 	 * @param gnbTab - GNB탭 정보
@@ -87,21 +101,4 @@ public class TsfDisplayController extends TsfBaseController {
 		return displayService.getGnbTabList(gnbTab);
 	}
 
-	/**
-	 * 전체 카테고리 목록
-	 * @return
-	 * @author gagamel
-	 * @since 2021. 3. 15
-	 */
-	@GetMapping("/all/cate/list")
-	@ResponseBody
-	public Collection<Cate1> getAllCategoryList() {
-//		String soldoutGoodsDisplayYn = policyService.getSoldoutGoodsDisplayYn(WfoConstants.SITE_CD);
-		Cate4Srch cate = new Cate4Srch();
-		cate.setSiteCd(TscConstants.Site.STYLE24.value()); // 사이트코드
-		cate.setCateGb(TsfConstants.CateGb.BYITEM.value()); // 카테고리구분
-		cate.setCateType(TsfConstants.CateType.GOODS.value()); // 상품분류카테고리
-		return displayService.getAllCategoryList(cate);
-	}
-
 }

+ 0 - 3
src/main/java/com/style24/persistence/domain/GnbTab.java

@@ -29,7 +29,4 @@ public class GnbTab extends TscBaseDomain {
 	private String viewDt;			// 미리보기일시
 	private String preview;			// 미리보기여부
 
-	private Cate1 fullCate1;		// FULL카테고리1
-//	private Collection<Cate1> cateList;	// 카테고리목록
-
 }