Procházet zdrojové kódy

[ST24PRJ-439] [결함][FRONT] 추천 영역 호출 코드 확인

jmh před 4 roky
rodič
revize
61f0e07507

+ 1243 - 1150
src/main/java/com/style24/front/biz/service/TsfDisplayService.java

@@ -1,1150 +1,1243 @@
-package com.style24.front.biz.service;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-
-import com.style24.front.biz.thirdparty.EigeneaiApi;
-import com.style24.persistence.domain.eigene.Eigeneai;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.cache.annotation.Cacheable;
-import org.springframework.core.env.Environment;
-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.biz.dao.TsfGoodsDao;
-import com.style24.front.support.env.TsfConstants;
-import com.style24.front.support.security.session.TsfSession;
-import com.style24.persistence.domain.BrandGroup;
-import com.style24.persistence.domain.Cate1;
-import com.style24.persistence.domain.Cate2;
-import com.style24.persistence.domain.Cate3;
-import com.style24.persistence.domain.Cate4;
-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.Login;
-import com.style24.persistence.domain.MainLayout;
-import com.style24.persistence.domain.Popup;
-import com.style24.persistence.domain.SearchKeyword;
-import com.style24.persistence.domain.searchengine.Filter;
-import com.style24.persistence.domain.searchengine.SearchEngine;
-
-import lombok.extern.slf4j.Slf4j;
-
-import com.gagaframework.web.parameter.GagaMap;
-import com.gagaframework.web.util.GagaFileUtil;
-
-/**
- * 전시 Service
- *
- * @author gagamel
- * @since 2020. 12. 29
- */
-@Service
-@Slf4j
-public class TsfDisplayService {
-
-	@Autowired
-	private TsfDisplayDao displayDao;
-
-	@Autowired
-	private TscEnvsetService envsetService;
-
-	@Autowired
-	private TsfGoodsDao goodsDao;
-
-	@Autowired
-	private Environment env;
-
-	@Autowired
-	private EigeneaiApi eigeneaiApi;
-
-	/**
-	 * GNB 브랜드그룹 목록
-	 * @param contents - 컨텐츠 정보
-	 * @return
-	 * @author gagamel
-	 * @since 2021. 3. 11
-	 */
-	@Cacheable(value = "commonGnb", key = "'brandGroup'")
-	public Collection<BrandGroup> getGnbBrandGroupList(Contents contents) {
-		return displayDao.getGnbBrandGroupList(contents);
-	}
-
-	/**
-	 * 브랜드메인의 GNB브랜드그룹 정보 조회
-	 * @param brandGroupNo - 브랜드그룹번호
-	 * @return
-	 * @author gagamel
-	 * @since 2021. 3. 16
-	 */
-	public BrandGroup getGnbBrandGroup(Integer brandGroupNo) {
-		return displayDao.getGnbBrandGroup(brandGroupNo);
-	}
-
-	/**
-	 * GNB 탭 목록
-	 * @param gnbTab - GNB탭 정보
-	 * @return
-	 * @author gagamel
-	 * @date 2021. 3. 11
-	 */
-//	@Cacheable(value = "commonGnb", key = "'gnbTab-'.concat(#gnbTab.gtabGb)")
-	public Collection<GnbTab> getGnbTabList(GnbTab gnbTab) {
-		return displayDao.getGnbTabList(gnbTab);
-	}
-
-	/**
-	 * 컨텐츠 목록
-	 * @param contents - 컨텐츠 정보
-	 * @return
-	 * @author gagamel
-	 * @date 2021. 3. 11
-	 */
-	public Collection<Contents> getContentsList(Contents contents) {
-		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;
-//	}
-
-	/**
-	 * 전체 카테고리 목록
-	 * @param cateGb - 카테고리구분
-	 * @return
-	 * @author gagamel
-	 * @since 2021. 3. 11
-	 */
-	@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.setSoldoutGoodsDispYn(envsetService.getSoldoutGoodsDisplayYn(TscConstants.Site.STYLE24.value()));
-		return this.getAllCategoryList(cate);
-	}
-
-	/**
-	 * 전체 카테고리 목록
-	 * @param cate - 카테고리 정보
-	 * @return
-	 * @author gagamel
-	 * @since 2021. 3. 11
-	 */
-	public Collection<Cate1> getAllCategoryList(Cate4Srch cate) {
-//		// 카테고리1 목록
-//		Collection<Cate1> cate1List = displayDao.getCategory1List(cate);
-//
-//		if (cate1List != null && !cate1List.isEmpty()) {
-//			for (Cate1 cate1 : cate1List) {
-//				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);
-//					}
-//				}
-//			}
-//		}
-
-		Collection<Cate1> cate1List = new ArrayList<Cate1>();
-
-		// 전체 카테고리 목록
-		Collection<Cate4Srch> cateList = displayDao.getAllCategoryList(cate);
-
-		if (cateList != null && !cateList.isEmpty()) {
-			Integer prevCate1No = 0;
-			Integer prevCate2No = 0;
-			Integer prevCate3No = 0;
-			Integer prevCate4No = 0;
-			Integer prevCate5No = 0;
-
-			for (Cate4Srch cate4srch1 : cateList) {
-				if (cate4srch1.getCate1No() != null && !cate4srch1.getCate1No().equals(prevCate1No)) {
-					Cate1 cate1 = new Cate1();
-					cate1.setSiteCd(cate4srch1.getSiteCd());
-					cate1.setCateGb(cate4srch1.getCateGb());
-					cate1.setCateType(cate4srch1.getCateType());
-					cate1.setCate1No(cate4srch1.getCate1No());
-					cate1.setCate1Nm(cate4srch1.getCate1Nm());
-					cate1.setFormalGb(cate4srch1.getFormalGb());
-					cate1.setDispOrd(cate4srch1.getDispOrd());
-
-					Collection<Cate2> cate2List = new ArrayList<Cate2>();
-					for (Cate4Srch cate4srch2 : cateList) {
-						if (cate4srch2.getCate1No() != null && cate4srch1.getCate1No().equals(cate4srch2.getCate1No())) {
-							if (cate4srch2.getCate2No() != null && !cate4srch2.getCate2No().equals(prevCate2No)) {
-								Cate2 cate2 = new Cate2();
-								cate2.setSiteCd(cate4srch2.getSiteCd());
-								cate2.setCateGb(cate4srch2.getCateGb());
-								cate2.setCateType(cate4srch2.getCateType());
-								cate2.setCate2No(cate4srch2.getCate2No());
-								cate2.setCate2Nm(cate4srch2.getCate2Nm());
-								cate2.setCate1No(cate4srch2.getCate1No());
-								cate2.setFormalGb(cate4srch2.getFormalGb());
-								cate2.setDispOrd(cate4srch2.getDispOrd());
-
-								Collection<Cate3> cate3List = new ArrayList<Cate3>();
-								for (Cate4Srch cate4srch3 : cateList) {
-									if (cate4srch3.getCate2No() != null && cate4srch2.getCate2No().equals(cate4srch3.getCate2No())) {
-										if (cate4srch3.getCate3No() != null && !cate4srch3.getCate3No().equals(prevCate3No)) {
-											Cate3 cate3 = new Cate3();
-											cate3.setSiteCd(cate4srch3.getSiteCd());
-											cate3.setCateGb(cate4srch3.getCateGb());
-											cate3.setCateType(cate4srch3.getCateType());
-											cate3.setCate3No(cate4srch3.getCate3No());
-											cate3.setCate3Nm(cate4srch3.getCate3Nm());
-											cate3.setCate1No(cate4srch3.getCate1No());
-											cate3.setCate2No(cate4srch3.getCate2No());
-											cate3.setFormalGb(cate4srch3.getFormalGb());
-											cate3.setDispOrd(cate4srch3.getDispOrd());
-
-											Collection<Cate4> cate4List = new ArrayList<Cate4>();
-											for (Cate4Srch cate4srch4 : cateList) {
-												if (cate4srch4.getCate3No() != null && cate4srch3.getCate3No().equals(cate4srch4.getCate3No())) {
-													if (cate4srch4.getCate4No() != null && !cate4srch4.getCate4No().equals(prevCate4No)) {
-														Cate4 cate4 = new Cate4();
-														cate4.setSiteCd(cate4srch4.getSiteCd());
-														cate4.setCateGb(cate4srch4.getCateGb());
-														cate4.setCateType(cate4srch4.getCateType());
-														cate4.setCate4No(cate4srch4.getCate4No());
-														cate4.setCate4Nm(cate4srch4.getCate4Nm());
-														cate4.setCate1No(cate4srch4.getCate1No());
-														cate4.setCate2No(cate4srch4.getCate2No());
-														cate4.setCate3No(cate4srch4.getCate3No());
-														cate4.setFormalGb(cate4srch4.getFormalGb());
-														cate4.setDispOrd(cate4srch4.getDispOrd());
-
-														Collection<Cate5> cate5List = new ArrayList<Cate5>();
-														for (Cate4Srch cate4srch5 : cateList) {
-															if (cate4srch5.getCate4No() != null && cate4srch4.getCate4No().equals(cate4srch5.getCate4No())) {
-																if (cate4srch5.getCate5No() != null && !cate4srch5.getCate5No().equals(prevCate5No)) {
-																	Cate5 cate5 = new Cate5();
-																	cate5.setSiteCd(cate4srch5.getSiteCd());
-																	cate5.setCateGb(cate4srch5.getCateGb());
-																	cate5.setCateType(cate4srch5.getCateType());
-																	cate5.setCate5No(cate4srch5.getCate5No());
-																	cate5.setCate5Nm(cate4srch5.getCate5Nm());
-																	cate5.setCate1No(cate4srch5.getCate1No());
-																	cate5.setCate2No(cate4srch5.getCate2No());
-																	cate5.setCate3No(cate4srch5.getCate3No());
-																	cate5.setCate4No(cate4srch5.getCate4No());
-																	cate5.setFormalGb(cate4srch5.getFormalGb());
-																	cate5.setDispOrd(cate4srch5.getDispOrd());
-																	cate5.setLeafYn("Y");
-																	cate5List.add(cate5);
-																}
-															}
-
-															prevCate5No = cate4srch5.getCate5No();
-														}
-
-														cate4.setLeafYn(cate5List.size() > 0 ? "N" : "Y");
-														cate4.setCate5List(cate5List);
-														cate4List.add(cate4);
-													}
-												}
-
-												prevCate4No = cate4srch4.getCate4No();
-											}
-
-											cate3.setLeafYn(cate4List.size() > 0 ? "N" : "Y");
-											cate3.setCate4List(cate4List);
-											cate3List.add(cate3);
-										}
-									}
-
-									prevCate3No = cate4srch3.getCate3No();
-								}
-
-								cate2.setLeafYn(cate3List.size() > 0 ? "N" : "Y");
-								cate2.setCate3List(cate3List);
-								cate2List.add(cate2);
-							}
-						}
-
-						prevCate2No = cate4srch2.getCate2No();
-					}
-
-					cate1.setLeafYn(cate2List.size() > 0 ? "N" : "Y");
-					cate1.setCate2List(cate2List);
-					cate1List.add(cate1);
-				}
-
-				prevCate1No = cate4srch1.getCate1No();
-			}
-		}
-
-//				Map<Integer, List<Cate4Srch>> cate4srch1 = cateList.stream().collect(Collectors.groupingBy(Cate4Srch::getCate1No, LinkedHashMap::new, Collectors.toList()));
-//				cate4srch1.forEach((key1, value1) -> {
-//					log.info("{}:{}", key1, value1);
-//					Cate1 cate1 = new Cate1();
-//					cate1.setCate1No(key1);
-//					Iterator<Cate4Srch> aaa = value1.iterator();
-//					while (aaa.hasNext()) {
-//						aaa.next();
-//					}
-//
-//					Map<Integer, List<Cate4Srch>> cate4srch2 = value1.stream().collect(Collectors.groupingBy(Cate4Srch::getCate2No, LinkedHashMap::new, Collectors.toList()));
-//					cate4srch2.forEach((key2, value2) -> {
-//						log.info("{}:{}", key2, value2);
-//					});
-//				});
-
-		return cate1List;
-	}
-
-	/**
-	 * 브랜드 카테고리 목록
-	 * @param brandGroupNo - 브랜드그룹번호
-	 * @return
-	 * @author gagamel
-	 * @since 2021. 4. 12
-	 */
-	@Cacheable(value = "cate", key = "'brandCate-'.concat(#brandGroupNo)")
-	public Collection<Cate1> getBrandCategoryList(Integer brandGroupNo) {
-		// 브랜드그룹의 기본카테고리여부 조회
-		String defaultCateYn = displayDao.getBrandGroupDefaultCategoryYn(brandGroupNo);
-
-		Cate4Srch cate = new Cate4Srch();
-		cate.setSiteCd(TscConstants.Site.STYLE24.value()); // 사이트코드
-
-		if (defaultCateYn.equals("Y")) { // 기본카테고리이면
-			cate.setCateGb(TsfConstants.CateGb.BYITEM.value());
-		} else { // 별도카테고리이면
-			cate.setCateGb(TsfConstants.CateGb.BYBRAND.value());
-		}
-
-		cate.setCateType(TsfConstants.CateType.GOODS.value()); // 상품분류카테고리
-		cate.setBrandGroupNo(brandGroupNo);
-		cate.setSoldoutGoodsDispYn(envsetService.getSoldoutGoodsDisplayYn(TscConstants.Site.STYLE24.value()));
-		cate.setDefaultCateYn(defaultCateYn);
-
-		return this.getAllCategoryList(cate);
-	}
-
-	/**
-	 * 아울렛 카테고리 목록
-	 * @param brandGroupNo - 브랜드그룹번호
-	 * @return
-	 * @author gagamel
-	 * @since 2021. 4. 12
-	 */
-	@Cacheable(value = "cate", key = "'outletCate-'.concat(#formalGb)")
-	public Collection<Cate1> getOutletCategoryList(String formalGb) {
-		Cate4Srch cate = new Cate4Srch();
-		cate.setSiteCd(TscConstants.Site.STYLE24.value()); // 사이트코드
-
-		cate.setFormalGb(formalGb);
-		cate.setCateGb(TsfConstants.CateGb.BYITEM.value());
-		cate.setCateType(TsfConstants.CateType.GOODS.value()); // 상품분류카테고리
-		cate.setSoldoutGoodsDispYn(envsetService.getSoldoutGoodsDisplayYn(TscConstants.Site.STYLE24.value()));
-
-		return this.getAllCategoryList(cate);
-	}
-
-	/**
-	 * 카테고리 목록
-	 * @param brandGroupNo - 브랜드그룹번호
-	 * @return
-	 * @author gagamel
-	 * @since 2021. 4. 12
-	 */
-	@Cacheable(value = "cate", key = "'reloadCate-'.concat(#cateGb)")
-	public Collection<Cate1> getCategoryReloadList(String cateGb) {
-		Cate4Srch cate = new Cate4Srch();
-		cate.setSiteCd(TscConstants.Site.STYLE24.value()); // 사이트코드
-
-		cate.setCateGb(TsfConstants.CateGb.BYITEM.value());
-		cate.setCateType(TsfConstants.CateType.GOODS.value()); // 상품분류카테고리
-		cate.setSoldoutGoodsDispYn(envsetService.getSoldoutGoodsDisplayYn(TscConstants.Site.STYLE24.value()));
-
-		return this.getAllCategoryList(cate);
-	}
-
-	/**
-	 * 메인 레이아웃 목록
-	 * @param cateNo - 카테고리No
-	 * @return
-	 * @author bin2107
-	 * @date 2021. 3. 16
-	 */
-	public Collection<MainLayout> getMainLayout(MainLayout mainLayout) {
-		return displayDao.getMainLayout(mainLayout);
-	}
-
-	/**
-	 * 카테고리 4srch 조회
-	 * @param
-	 * @return
-	 * @author bin2107
-	 * @date 2021. 3. 16
-	 */
-	public Cate4Srch getCate4srch(Cate4Srch cate4Srch) {
-		return displayDao.getCate4srch(cate4Srch);
-	}
-
-	/**
-	 * 팝업 목록
-	 *
-	 * @param popup
-	 * @return
-	 * @author eskim
-	 * @date 2021. 3. 30
-	 */
-	public GagaMap getPopupList(Popup popup) {
-		GagaMap result = new GagaMap();
-		Collection<Popup> popupList = new ArrayList<Popup>();
-		popup.setSiteCd(TscConstants.Site.STYLE24.value());
-
-		if ("P".equals(popup.getFrontGb())) {
-			result.set("dataList", displayDao.getPopupList(popup));
-		} else {
-			//우선순위 full 팝
-			popup.setPopupGb("F");
-			popupList = displayDao.getPopupList(popup);
-			result.set("popupGb", "F");
-			result.set("dataList", popupList);
-			if (popupList != null && popupList.size() > 0) {
-				return result;
-			}
-			popup.setPopupGb("H");
-			popupList = displayDao.getPopupList(popup);
-			result.set("popupGb", "H");
-			result.set("dataList", popupList);
-		}
-
-		// Collection<Popup>
-
-		return result;
-	}
-
-	/**
-	 * 몰메인 MD PICK 목록(메인용)
-	 * @param
-	 * @return
-	 * @author bin2107
-	 * @date 2021. 3. 30
-	 */
-	public Collection<Contents> getContentsForGoodsMain(Contents contents) {
-		Collection<Contents> contentsList = new ArrayList<>();
-		if(contents.getContentsLoc().equals("SMM007")){
-			contentsList = displayDao.getBrandpickTitleBrandList(contents);
-		}else{
-			contentsList = displayDao.getContentsList(contents);
-		}
-
-		Collection<Goods> goodsList = new ArrayList<>();
-		Cate4Srch tempContents = new Cate4Srch();
-		for (Contents data : contentsList) {
-			tempContents.setContentsLoc(data.getContentsLoc());
-			tempContents.setDispOrd(data.getDispOrd());
-			tempContents.setMaxRow(20);
-			tempContents.setCustNo(TsfSession.isLogin() ? TsfSession.getInfo().getCustNo() : 0);
-			
-			// 2021.08.31 FN_GET_BENEFIT_PRICE() 쿼리 null 처리
-			tempContents.setFrontGb(TsfSession.getFrontGb());
-			tempContents.setCustGb(TsfSession.getCustGb());
-			
-			if ("SMM007".equals(data.getContentsLoc())) {
-				if(!"".equals(data.getBrandGroupNo()) && !"null".equals(data.getBrandGroupNo()) && !data.getBrandGroupNo().equals(null)){
-					tempContents.setBrandGroupNo(Integer.parseInt(data.getBrandGroupNo()));
-				}
-				data.setFrontGb(TsfSession.getFrontGb());
-				data.setBannerList(displayDao.getContentsBannerList(data));
-			}
-			goodsList = (goodsDao.getContentsCategoryGoodsListMain(tempContents));
-			if ("SMM007".equals(data.getContentsLoc())) {
-				int maxrow = 3;
-				if (goodsList == null || goodsList.size() < 3) {
-					Cate4Srch cate = new Cate4Srch();
-					cate.setSiteCd(TscConstants.Site.STYLE24.value());
-					cate.setCateGb(TsfConstants.CateGb.BYITEM.value());
-					cate.setFrontGb(data.getFrontGb());
-					cate.setBrandGroupNo(Integer.parseInt(data.getBrandGroupNo()));
-					cate.setMaxRow(maxrow - goodsList.size());
-					
-					// 2021.09.29 신상품조회시 frontGb, custGb 누락 추가
-					cate.setCustGb(TsfSession.getCustGb());
-					
-					goodsList.addAll(goodsDao.getContentsCategoryNewGoodsList(cate));
-				}
-			}
-			data.setGoodsList(goodsList);
-		}
-
-		log.info("getContentsForGoods contentsList.size()::{}", contentsList.size());
-
-		return contentsList;
-	}
-	
-	/**
-	 * 몰메인 MD PICK 목록
-	 * @param
-	 * @return
-	 * @author jmh
-	 * @date 2021. 8. 13
-	 */
-	public Collection<Contents> getContentsForGoods(Contents contents) {
-		Collection<Contents> contentsList = new ArrayList<>();
-		if(contents.getContentsLoc().equals("SMM007")){
-			contentsList = displayDao.getBrandpickTitleBrandList(contents);
-		}else{
-			contentsList = displayDao.getContentsList(contents);
-		}
-
-		Collection<Goods> goodsList = new ArrayList<>();
-		Cate4Srch tempContents = new Cate4Srch();
-		for (Contents data : contentsList) {
-			tempContents.setContentsLoc(data.getContentsLoc());
-			tempContents.setDispOrd(data.getDispOrd());
-			tempContents.setMaxRow(20);
-			tempContents.setCustNo(TsfSession.isLogin() ? TsfSession.getInfo().getCustNo() : 0);
-			if ("SMM007".equals(data.getContentsLoc())) {
-				if(!"".equals(data.getBrandGroupNo()) && !"null".equals(data.getBrandGroupNo()) && !data.getBrandGroupNo().equals(null)){
-					tempContents.setBrandGroupNo(Integer.parseInt(data.getBrandGroupNo()));
-				}
-				data.setFrontGb(TsfSession.getFrontGb());
-				data.setBannerList(displayDao.getContentsBannerList(data));
-			}
-			goodsList = (goodsDao.getContentsCategoryGoodsList(tempContents));
-			if ("SMM007".equals(data.getContentsLoc())) {
-				int maxrow = 3;
-				if (goodsList == null || goodsList.size() < 3) {
-					Cate4Srch cate = new Cate4Srch();
-					cate.setSiteCd(TscConstants.Site.STYLE24.value());
-					cate.setCateGb(TsfConstants.CateGb.BYITEM.value());
-					cate.setFrontGb(data.getFrontGb());
-					cate.setBrandGroupNo(Integer.parseInt(data.getBrandGroupNo()));
-					cate.setMaxRow(maxrow - goodsList.size());
-					
-					// 2021.09.29 신상품조회시 frontGb, custGb 누락 추가
-					cate.setFrontGb(TsfSession.getFrontGb());
-					cate.setCustGb(TsfSession.getCustGb());
-					goodsList.addAll(goodsDao.getContentsCategoryNewGoodsList(cate));
-				}
-			}
-			data.setGoodsList(goodsList);
-		}
-
-		log.info("getContentsForGoods contentsList.size()::{}", contentsList.size());
-
-		return contentsList;
-	}
-
-	/**
-	 * 몰메인 BESTITEM 목록(메인용)
-	 * @param
-	 * @return
-	 * @author bin2107
-	 * @date 2021. 4. 9
-	 */
-	public Collection<Contents> getBestItemForGoodsMain(Contents contents) {
-		contents.setContentsLoc("SCM003");
-		contents.setCateNo(null);
-		Collection<Contents> contentsList = displayDao.getBestItemCategoryList(contents);
-		Cate4Srch tempCate = new Cate4Srch();
-
-		for (Contents data : contentsList) {
-			tempCate.setContentsLoc(data.getContentsLoc());
-			tempCate.setMaxRow(10);
-			tempCate.setCustNo(TsfSession.isLogin() ? TsfSession.getInfo().getCustNo() : 0);
-			tempCate.setCateNo(data.getCateNo());
-			tempCate.setSiteCd(data.getSiteCd());
-			tempCate.setCateGb(data.getCateGb());
-			
-			// 2021.08.31 FN_GET_BENEFIT_PRICE() 쿼리 null 처리
-			tempCate.setFrontGb(TsfSession.getFrontGb());
-			tempCate.setCustGb(TsfSession.getCustGb());
-			
-			Collection<Goods> cateGoodsList = goodsDao.getContentsCategoryGoodsListMain(tempCate);
-			if(10 > cateGoodsList.size()){
-				//TODO : 추천솔루션
-				int cnt = 0;
-				cnt = 10 - cateGoodsList.size();
-
-				Collection<Eigeneai.Result> itemList = eigeneaiApi.getCategoryWeeklySellBestGoodsList(cnt, data.getCateNo(), TsfSession.getFrontGb());
-				for(Eigeneai.Result tempData : itemList){
-					Goods tempBest = new Goods();
-					tempBest.setBrandGroupNm(tempData.getProduct().getBrandName());
-					tempBest.setGoodsCd(tempData.getProduct().getItemId());
-					tempBest.setGoodsFullNm(tempData.getProduct().getItemName());
-					tempBest.setListPrice((int) tempData.getProduct().getOriginalPrice());
-					tempBest.setCurrPrice((int) tempData.getProduct().getSalePrice());
-					tempBest.setSysImgNm(tempData.getProduct().getItemImage());
-					tempBest.setItemUrl(tempData.getProduct().getItemUrl());
-					cateGoodsList.add(tempBest);
-				}
-			}
-
-			data.setGoodsList(cateGoodsList);
-		}
-
-		return contentsList;
-	}
-	
-	/**
-	 * 몰메인 BESTITEM 목록
-	 * @param
-	 * @return
-	 * @author jmh
-	 * @date 2021. 8. 13
-	 */
-	public Collection<Contents> getBestItemForGoods(Contents contents) {
-		contents.setContentsLoc("SCM003");
-		contents.setCateNo(null);
-		Collection<Contents> contentsList = displayDao.getBestItemCategoryList(contents);
-		Cate4Srch tempCate = new Cate4Srch();
-
-		for (Contents data : contentsList) {
-			tempCate.setContentsLoc(data.getContentsLoc());
-			tempCate.setMaxRow(10);
-			tempCate.setCustNo(TsfSession.isLogin() ? TsfSession.getInfo().getCustNo() : 0);
-			tempCate.setCateNo(data.getCateNo());
-			tempCate.setSiteCd(data.getSiteCd());
-			tempCate.setCateGb(data.getCateGb());
-			Collection<Goods> cateGoodsList = goodsDao.getContentsCategoryGoodsList(tempCate);
-			if(10 > cateGoodsList.size()){
-				//TODO : 추천솔루션
-				int cnt = 0;
-				cnt = 10 - cateGoodsList.size();
-
-				Collection<Eigeneai.Result> itemList = eigeneaiApi.getCategoryWeeklySellBestGoodsList(cnt, data.getCateNo(), TsfSession.getFrontGb());
-				for(Eigeneai.Result tempData : itemList){
-					Goods tempBest = new Goods();
-					tempBest.setBrandGroupNm(tempData.getProduct().getBrandName());
-					tempBest.setGoodsCd(tempData.getProduct().getItemId());
-					tempBest.setGoodsFullNm(tempData.getProduct().getItemName());
-					tempBest.setListPrice((int) tempData.getProduct().getOriginalPrice());
-					tempBest.setCurrPrice((int) tempData.getProduct().getSalePrice());
-					tempBest.setSysImgNm(tempData.getProduct().getItemImage());
-					tempBest.setItemUrl(tempData.getProduct().getItemUrl());
-					cateGoodsList.add(tempBest);
-				}
-			}
-
-			data.setGoodsList(cateGoodsList);
-		}
-
-		return contentsList;
-	}
-
-	/**
-	 * BEST ITEM 카테고리 목록
-	 * @param
-	 * @return
-	 * @author bin2107
-	 * @date 2021. 4. 13
-	 */
-	public Collection<Contents> getBestItemCategoryList(Contents contents) {
-		return displayDao.getBestItemCategoryList(contents);
-	}
-
-	/**
-	 * BEST ITEM 카테고리별 상품 리스트
-	 * @param
-	 * @return
-	 * @author bin2107
-	 * @date 2021. 4. 13
-	 */
-	public Collection<Goods> getBestItemCategoryGoodsList(Contents contents) {
-		Cate4Srch cate4Srch = new Cate4Srch();
-		// 로그인 유무 확인 (로그인이 되어 있지 않으면 regNo 를 0으로 장바구니에 저장한다.)
-		Login login = new Login();
-		if (TsfSession.isLogin()) {
-			login = TsfSession.getInfo();
-		} else {
-			login.setCustNo(0);
-		}
-
-		String cateNo = String.valueOf(contents.getCateNo());
-		Collection<Goods> goodsList = new ArrayList<>();
-		if(!"".equals(cateNo) && !"null".equals(cateNo) && !cateNo.equals(null)){
-			cate4Srch.setCustNo(login.getCustNo());
-			cate4Srch.setPageGb(contents.getPageGb());
-			cate4Srch.setContentsLoc(contents.getContentsLoc());
-			cate4Srch.setPageable(contents.getPageable());
-			cate4Srch.setPageNo(contents.getPageNo());
-			cate4Srch.setPageSize(contents.getPageSize());
-			cate4Srch.setPageUnit(contents.getPageUnit());
-			cate4Srch.setCustNo(TsfSession.isLogin() ? TsfSession.getInfo().getCustNo() : 0);
-			cate4Srch.setCate1No(contents.getCateNo());
-			cate4Srch.setSiteCd(TscConstants.Site.STYLE24.value());
-			cate4Srch.setCateGb("G032_101");
-
-			log.info("getBestItemCategoryGoodsList cate4Srch:::::::::{}", cate4Srch);
-
-			goodsList = goodsDao.getContentsCategoryGoodsList(cate4Srch);
-			log.info("goodsList 1::::::{}",goodsList);
-		}
-/*
-		if (goodsList.size() < 100) {
-			// TODO 추천솔루션
-			log.info("goodsList.size()::::::{}",goodsList.size());
-			int cnt = 100 - goodsList.size();
-			log.info("itemList cnt::::::{}",cnt);
-			Collection<Eigeneai.Result> itemList = new ArrayList<>();
-			if(!"".equals(cateNo) && !"null".equals(cateNo) && !cateNo.equals(null)){
-				itemList = eigeneaiApi.getCategoryWeeklySellBestGoodsList(cnt, contents.getCateNo());
-			}else{
-				itemList = eigeneaiApi.getWeeklySellBestGoodsList(cnt);
-			}
-
-			log.info("itemList::::::{}",itemList);
-			for(Eigeneai.Result tempData: itemList){
-				Goods tempBest = new Goods();
-				tempBest.setBrandGroupNm(tempData.getProduct().getBrandName());
-				tempBest.setGoodsCd(tempData.getProduct().getItemId());
-				tempBest.setMainColorCd("");
-				tempBest.setGoodsNm(tempData.getProduct().getItemName());
-				tempBest.setGoodsFullNm(tempData.getProduct().getItemName());
-				tempBest.setListPrice((int) tempData.getProduct().getOriginalPrice());
-				tempBest.setCurrPrice((int) tempData.getProduct().getSalePrice());
-				
-				// 2021.08.30 검색엔진데이타 https: 붙여서 넘어옴 처리 
-				if (tempData.getProduct().getItemImage().indexOf("https:") > -1) {
-					tempBest.setSysImgNm(tempData.getProduct().getItemImage().replaceAll("https://image.istyle24.com/Upload/ProductImage/",""));
-				} else {
-					tempBest.setSysImgNm(tempData.getProduct().getItemImage().replaceAll("//image.istyle24.com/Upload/ProductImage/",""));
-				}
-				
-				tempBest.setItemUrl(tempData.getProduct().getItemUrl());
-				goodsList.add(tempBest);
-			}
-			log.info("goodsList 2::::::{}",goodsList);
-		}
-*/
-		return goodsList;
-	}
-
-	/**
-	 * 상품리스트 카테고리별 필터 목록
-	 * @param params - 검색엔진 정보
-	 * @return
-	 * @author gagamel
-	 * @date 2021. 5. 3
-	 */
-	public Collection<Filter> getGoodsListCategoryFilterList(SearchEngine params) {
-		params.setSiteCd(TscConstants.Site.STYLE24.value());
-		if (StringUtils.isBlank(params.getFormalGb())) {
-			params.setFormalGb("G009_10");
-		}
-		return displayDao.getGoodsListCategoryFilterList(params);
-	}
-
-	/**
-	 * 검색키워드를 통한 검색상품리스트 카테고리별 필터 목록
-	 * @param params - 검색엔진 정보
-	 * @return
-	 * @author gagamel
-	 * @date 2021. 5. 3
-	 */
-	public Collection<Filter> getSearchGoodsListCategoryFilterList(SearchEngine params) {
-		params.setSiteCd(TscConstants.Site.STYLE24.value());
-		params.setCateGb(TsfConstants.CateGb.BYITEM.value());
-		params.setFormalGb("G009_10");
-		return displayDao.getSearchGoodsListCategoryFilterList(params);
-	}
-
-	/**
-	 * 카테고리별 필터 목록
-	 * @param filterList - 필터 목록
-	 * @param filterGb - 필터 구분
-	 * @return
-	 * @author gagamel
-	 * @date 2021. 5. 3
-	 */
-	public Collection<Filter> getCategoryFilterList(Collection<Filter> filterList, String filterGb) {
-		Collection<Filter> resultList = new ArrayList<Filter>();
-		int idx = 0;
-		String maxPrice = "0";
-		String minPrice = "0";
-		String lastStr = "";
-		ArrayList<String> seasonSortArr = new ArrayList<>();
-		Collection<Filter> seasonArr = new ArrayList<Filter>();
-		for (Filter filter : filterList) {
-			if (!"".equals(filter.getFilterCd()) && !filter.getFilterCd().equals(null)) {
-				if (filter.getFilterGb().equals("PRICE")) {
-					if (idx == 0) {
-						minPrice = filter.getFilterCd();
-					} else {
-						maxPrice = filter.getFilterCd();
-					}
-					idx++;
-				} else {
-					if (filter.getFilterGb().equals(filterGb)) {
-						if ("BENEFIT".equals(filterGb)) {
-							if (!filter.getFilterCd().equals("40")) {
-								resultList.add(filter);
-							}
-						}else if ("SIZE".equals(filterGb)) {
-							// 자사 사이즈만 표시 
-							if(null != filter.getFilterCd()) {
-								lastStr = filter.getFilterCd().substring(filter.getFilterCd().length()-1, filter.getFilterCd().length()); 
-								if("Y".equals(lastStr)) {
-									resultList.add(filter);
-								}
-							}
-						}else if ("SEASON".equals(filterGb)) {
-							// 시즌정보 정렬 
-							seasonSortArr.add(filter.getFilterCd());
-							seasonArr.add(filter);
-						} else {
-							resultList.add(filter);
-						}
-					}
-				}
-			}
-		}
-
-		if (filterGb.equals("PRICE")) {
-			int sliceVal = (Integer.parseInt(maxPrice) - Integer.parseInt(minPrice)) / 5;
-			int tempPrice = 0;
-			Filter temp = new Filter();
-			Collection<Filter> priceList = new ArrayList<Filter>();
-			for (int i = 0; i < 6; i++) {
-				tempPrice = 0;
-				temp = new Filter();
-				temp.setFilterGb("PRICE");
-				if (i == 0) {
-//					tempPrice = (int)Math.floor((Integer.parseInt(minPrice)) / 1000) * 1000 ;
-					tempPrice = (int)Math.floor((Integer.parseInt(minPrice)));
-					temp.setFilterCd(String.valueOf(tempPrice));
-					temp.setFilterNm(String.valueOf(tempPrice));
-				} else if (i == 5) {
-					tempPrice = (int)Math.floor((Integer.parseInt(maxPrice)));
-					temp.setFilterCd(String.valueOf(tempPrice));
-					temp.setFilterNm(String.valueOf(tempPrice));
-				} else {
-					tempPrice = (int)Math.floor((Integer.parseInt(minPrice) + sliceVal * i) / 1000) * 1000;
-					temp.setFilterCd(String.valueOf(tempPrice));
-					temp.setFilterNm(String.valueOf(tempPrice));
-				}
-				priceList.add(temp);
-			}
-			resultList.addAll(priceList);
-		}
-		
-		// 시즌정렬
-		if (filterGb.equals("SEASON")) {
-			Collections.sort(seasonSortArr);
-			for (String filterCd : seasonSortArr) {
-				for (Filter item : seasonArr) {
-					if( filterCd.equals(item.getFilterCd())){
-						resultList.add(item);
-						break;
-					}
-				}
-			}
-		}
-		
-		return resultList;
-	}
-
-	/**
-	 * 상품카테고리 필터 목록
-	 * @param
-	 * @return
-	 * @author bin2107
-	 * @date 2021. 4. 5
-	 */
-	public Collection<GoodsSearch> getCategoryFilter(Cate4Srch cate4Srch, String filterGb) {
-		cate4Srch.setFilterGb(filterGb);
-		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
-	 * @since 2021. 4. 28
-	 */
-	public Collection<BrandGroup> getBrandImgList(BrandGroup brandGroup) {
-		return displayDao.getBrandImgList(brandGroup);
-	}
-
-	/**
-	 * 전체 브랜드
-	 * @param
-	 * @return
-	 * @author bin2107
-	 * @since 2021. 4. 12
-	 */
-	public Collection<BrandGroup> getAllBrandList(BrandGroup brandGroup) {
-		return displayDao.getAllBrandList(brandGroup);
-	}
-
-	/**
-	 * GNB TAB 기획전배너 리스트
-	 * @param Contents
-	 * @return
-	 * @author bin2107
-	 * @since 2021. 4. 14
-	 */
-	public Collection<Contents> getGnbTabBannerlist(Contents contenst) {
-		Collection<Contents> contentsList = displayDao.getGnbTabBannerList(contenst);
-		return contentsList;
-	}
-
-	/**
-	 * 키워드를 이용한 전체 카테고리 목록
-	 * @param keyword - 상품검색키워드
-	 * @return
-	 * @author gagamel
-	 * @since 2021. 5. 6
-	 */
-	public Collection<Cate1> getKeywordCategoryList(String keyword) {
-		Cate4Srch cate = new Cate4Srch();
-		cate.setSiteCd(TscConstants.Site.STYLE24.value()); // 사이트코드
-		cate.setCateGb(TsfConstants.CateGb.BYITEM.value()); // 카테고리구분
-		cate.setCateType(TsfConstants.CateType.GOODS.value()); // 상품분류카테고리
-		cate.setSoldoutGoodsDispYn(envsetService.getSoldoutGoodsDisplayYn(TscConstants.Site.STYLE24.value()));
-		cate.setKeyword(keyword);
-		return this.getAllCategoryList(cate);
-	}
-
-	public int getContentsCategoryGoodsCount(Contents contents) {
-		Cate4Srch cate4Srch = new Cate4Srch();
-		// 로그인 유무 확인 (로그인이 되어 있지 않으면 regNo 를 0으로 장바구니에 저장한다.)
-		Login login = new Login();
-		if (TsfSession.isLogin()) {
-			login = TsfSession.getInfo();
-		} else {
-			login.setCustNo(0);
-		}
-
-		cate4Srch.setCustNo(login.getCustNo());
-		cate4Srch.setPageGb(contents.getPageGb());
-		cate4Srch.setContentsLoc(contents.getContentsLoc());
-		cate4Srch.setMaxRow(100);
-		cate4Srch.setCustNo(TsfSession.isLogin() ? TsfSession.getInfo().getCustNo() : 0);
-		cate4Srch.setCate1No(contents.getCateNo());
-		cate4Srch.setSiteCd(TscConstants.Site.STYLE24.value());
-		cate4Srch.setCateGb("G032_101");
-		return goodsDao.getContentsCategoryGoodsCount(cate4Srch);
-	}
-
-	/**
-	 * 검색키워드 조회
-	 * @param
-	 * @return
-	 * @throws Exception
-	 * @author bin2107
-	 * @since 2021. 7. 2
-	 */
-	public Collection<SearchKeyword> getSearchKeywordList(SearchKeyword searchKeyword) {
-		return displayDao.getSearchKeywordList(searchKeyword);
-	}
-
-	/**
-	 * 스플래시 이미지 가져오기
-	 * @param siteCd - 사이트코드
-	 * @return
-	 * @author gagamel
-	 * @since 2021. 7. 5
-	 */
-	@Cacheable(value = "splashimg")
-	public String getSplashImageUrl() {
-		String splashImg = displayDao.getSplashImage();
-		if (StringUtils.isBlank(splashImg)) {
-			return "";
-		}
-		return "http:" + GagaFileUtil.getConcatenationPath(env.getProperty("upload.image.view"), "splashimg", splashImg);
-	}
-
-	/**
-	 * 몰메인 신상풍 목록
-	 * @param
-	 * @return
-	 * @author bin2107
-	 * @date 2021. 7. 13
-	 */
-	public Collection<Contents> getMainNewGoodsList(Contents contents) {
-		Collection<Contents> contentsList = displayDao.getBestItemCategoryList(contents);
-		Cate4Srch tempCate = new Cate4Srch();
-
-		for (Contents data : contentsList) {
-			tempCate.setContentsLoc(data.getContentsLoc());
-			tempCate.setMaxRow(20);
-			tempCate.setCustNo(TsfSession.isLogin() ? TsfSession.getInfo().getCustNo() : 0);
-			tempCate.setSiteCd(data.getSiteCd());
-			tempCate.setCateGb(data.getCateGb());
-			
-			// 2021.09.29 신상품조회시 frontGb, custGb 누락 추가
-			tempCate.setFrontGb(TsfSession.getFrontGb());
-			tempCate.setCustGb(TsfSession.getCustGb());
-			
-			data.setGoodsList(goodsDao.getContentsCategoryNewGoodsList(tempCate));
-		}
-
-		return contentsList;
-	}
-
-	/**
-	 * 몰메인 신상품 목록
-	 * @param
-	 * @return
-	 * @author bin2107
-	 * @date 2021. 7. 13
-	 */
-	public Collection<Goods> getContentsCategoryNewGoodsList(Cate4Srch cate4Srch){
-		return goodsDao.getContentsCategoryNewGoodsList(cate4Srch);
-	}
-
-	/**
-	 * 몰메인 브랜드픽 타이틀 브랜드 목록
-	 * @param contents - 컨텐츠 정보
-	 * @return
-	 * @author bin2107
-	 * @date 2021. 7. 23
-	 */
-	public Collection<Contents> getBrandpickTitleBrandList(Contents contents) {
-		return displayDao.getBrandpickTitleBrandList(contents);
-	}
-	
-}
+package com.style24.front.biz.service;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.lang3.StringUtils;
+import org.json.simple.JSONArray;
+import org.json.simple.JSONObject;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Service;
+
+import com.gagaframework.web.parameter.GagaMap;
+import com.gagaframework.web.util.GagaFileUtil;
+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.biz.dao.TsfGoodsDao;
+import com.style24.front.biz.thirdparty.EigeneaiApi;
+import com.style24.front.support.env.TsfConstants;
+import com.style24.front.support.security.session.TsfSession;
+import com.style24.persistence.domain.BrandGroup;
+import com.style24.persistence.domain.Cate1;
+import com.style24.persistence.domain.Cate2;
+import com.style24.persistence.domain.Cate3;
+import com.style24.persistence.domain.Cate4;
+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.Login;
+import com.style24.persistence.domain.MainLayout;
+import com.style24.persistence.domain.Popup;
+import com.style24.persistence.domain.SearchKeyword;
+import com.style24.persistence.domain.eigene.Eigeneai;
+import com.style24.persistence.domain.searchengine.Filter;
+import com.style24.persistence.domain.searchengine.SearchEngine;
+
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * 전시 Service
+ *
+ * @author gagamel
+ * @since 2020. 12. 29
+ */
+@Service
+@Slf4j
+public class TsfDisplayService {
+
+	@Autowired
+	private TsfDisplayDao displayDao;
+
+	@Autowired
+	private TscEnvsetService envsetService;
+
+	@Autowired
+	private TsfGoodsDao goodsDao;
+
+	@Autowired
+	private Environment env;
+
+	@Autowired
+	private EigeneaiApi eigeneaiApi;
+	
+	/**
+	 * GNB 브랜드그룹 목록
+	 * @param contents - 컨텐츠 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 3. 11
+	 */
+	@Cacheable(value = "commonGnb", key = "'brandGroup'")
+	public Collection<BrandGroup> getGnbBrandGroupList(Contents contents) {
+		return displayDao.getGnbBrandGroupList(contents);
+	}
+
+	/**
+	 * 브랜드메인의 GNB브랜드그룹 정보 조회
+	 * @param brandGroupNo - 브랜드그룹번호
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 3. 16
+	 */
+	public BrandGroup getGnbBrandGroup(Integer brandGroupNo) {
+		return displayDao.getGnbBrandGroup(brandGroupNo);
+	}
+
+	/**
+	 * GNB 탭 목록
+	 * @param gnbTab - GNB탭 정보
+	 * @return
+	 * @author gagamel
+	 * @date 2021. 3. 11
+	 */
+//	@Cacheable(value = "commonGnb", key = "'gnbTab-'.concat(#gnbTab.gtabGb)")
+	public Collection<GnbTab> getGnbTabList(GnbTab gnbTab) {
+		return displayDao.getGnbTabList(gnbTab);
+	}
+
+	/**
+	 * 컨텐츠 목록
+	 * @param contents - 컨텐츠 정보
+	 * @return
+	 * @author gagamel
+	 * @date 2021. 3. 11
+	 */
+	public Collection<Contents> getContentsList(Contents contents) {
+		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;
+//	}
+
+	/**
+	 * 전체 카테고리 목록
+	 * @param cateGb - 카테고리구분
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 3. 11
+	 */
+	@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.setSoldoutGoodsDispYn(envsetService.getSoldoutGoodsDisplayYn(TscConstants.Site.STYLE24.value()));
+		return this.getAllCategoryList(cate);
+	}
+
+	/**
+	 * 전체 카테고리 목록
+	 * @param cate - 카테고리 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 3. 11
+	 */
+	public Collection<Cate1> getAllCategoryList(Cate4Srch cate) {
+//		// 카테고리1 목록
+//		Collection<Cate1> cate1List = displayDao.getCategory1List(cate);
+//
+//		if (cate1List != null && !cate1List.isEmpty()) {
+//			for (Cate1 cate1 : cate1List) {
+//				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);
+//					}
+//				}
+//			}
+//		}
+
+		Collection<Cate1> cate1List = new ArrayList<Cate1>();
+
+		// 전체 카테고리 목록
+		Collection<Cate4Srch> cateList = displayDao.getAllCategoryList(cate);
+
+		if (cateList != null && !cateList.isEmpty()) {
+			Integer prevCate1No = 0;
+			Integer prevCate2No = 0;
+			Integer prevCate3No = 0;
+			Integer prevCate4No = 0;
+			Integer prevCate5No = 0;
+
+			for (Cate4Srch cate4srch1 : cateList) {
+				if (cate4srch1.getCate1No() != null && !cate4srch1.getCate1No().equals(prevCate1No)) {
+					Cate1 cate1 = new Cate1();
+					cate1.setSiteCd(cate4srch1.getSiteCd());
+					cate1.setCateGb(cate4srch1.getCateGb());
+					cate1.setCateType(cate4srch1.getCateType());
+					cate1.setCate1No(cate4srch1.getCate1No());
+					cate1.setCate1Nm(cate4srch1.getCate1Nm());
+					cate1.setFormalGb(cate4srch1.getFormalGb());
+					cate1.setDispOrd(cate4srch1.getDispOrd());
+
+					Collection<Cate2> cate2List = new ArrayList<Cate2>();
+					for (Cate4Srch cate4srch2 : cateList) {
+						if (cate4srch2.getCate1No() != null && cate4srch1.getCate1No().equals(cate4srch2.getCate1No())) {
+							if (cate4srch2.getCate2No() != null && !cate4srch2.getCate2No().equals(prevCate2No)) {
+								Cate2 cate2 = new Cate2();
+								cate2.setSiteCd(cate4srch2.getSiteCd());
+								cate2.setCateGb(cate4srch2.getCateGb());
+								cate2.setCateType(cate4srch2.getCateType());
+								cate2.setCate2No(cate4srch2.getCate2No());
+								cate2.setCate2Nm(cate4srch2.getCate2Nm());
+								cate2.setCate1No(cate4srch2.getCate1No());
+								cate2.setFormalGb(cate4srch2.getFormalGb());
+								cate2.setDispOrd(cate4srch2.getDispOrd());
+
+								Collection<Cate3> cate3List = new ArrayList<Cate3>();
+								for (Cate4Srch cate4srch3 : cateList) {
+									if (cate4srch3.getCate2No() != null && cate4srch2.getCate2No().equals(cate4srch3.getCate2No())) {
+										if (cate4srch3.getCate3No() != null && !cate4srch3.getCate3No().equals(prevCate3No)) {
+											Cate3 cate3 = new Cate3();
+											cate3.setSiteCd(cate4srch3.getSiteCd());
+											cate3.setCateGb(cate4srch3.getCateGb());
+											cate3.setCateType(cate4srch3.getCateType());
+											cate3.setCate3No(cate4srch3.getCate3No());
+											cate3.setCate3Nm(cate4srch3.getCate3Nm());
+											cate3.setCate1No(cate4srch3.getCate1No());
+											cate3.setCate2No(cate4srch3.getCate2No());
+											cate3.setFormalGb(cate4srch3.getFormalGb());
+											cate3.setDispOrd(cate4srch3.getDispOrd());
+
+											Collection<Cate4> cate4List = new ArrayList<Cate4>();
+											for (Cate4Srch cate4srch4 : cateList) {
+												if (cate4srch4.getCate3No() != null && cate4srch3.getCate3No().equals(cate4srch4.getCate3No())) {
+													if (cate4srch4.getCate4No() != null && !cate4srch4.getCate4No().equals(prevCate4No)) {
+														Cate4 cate4 = new Cate4();
+														cate4.setSiteCd(cate4srch4.getSiteCd());
+														cate4.setCateGb(cate4srch4.getCateGb());
+														cate4.setCateType(cate4srch4.getCateType());
+														cate4.setCate4No(cate4srch4.getCate4No());
+														cate4.setCate4Nm(cate4srch4.getCate4Nm());
+														cate4.setCate1No(cate4srch4.getCate1No());
+														cate4.setCate2No(cate4srch4.getCate2No());
+														cate4.setCate3No(cate4srch4.getCate3No());
+														cate4.setFormalGb(cate4srch4.getFormalGb());
+														cate4.setDispOrd(cate4srch4.getDispOrd());
+
+														Collection<Cate5> cate5List = new ArrayList<Cate5>();
+														for (Cate4Srch cate4srch5 : cateList) {
+															if (cate4srch5.getCate4No() != null && cate4srch4.getCate4No().equals(cate4srch5.getCate4No())) {
+																if (cate4srch5.getCate5No() != null && !cate4srch5.getCate5No().equals(prevCate5No)) {
+																	Cate5 cate5 = new Cate5();
+																	cate5.setSiteCd(cate4srch5.getSiteCd());
+																	cate5.setCateGb(cate4srch5.getCateGb());
+																	cate5.setCateType(cate4srch5.getCateType());
+																	cate5.setCate5No(cate4srch5.getCate5No());
+																	cate5.setCate5Nm(cate4srch5.getCate5Nm());
+																	cate5.setCate1No(cate4srch5.getCate1No());
+																	cate5.setCate2No(cate4srch5.getCate2No());
+																	cate5.setCate3No(cate4srch5.getCate3No());
+																	cate5.setCate4No(cate4srch5.getCate4No());
+																	cate5.setFormalGb(cate4srch5.getFormalGb());
+																	cate5.setDispOrd(cate4srch5.getDispOrd());
+																	cate5.setLeafYn("Y");
+																	cate5List.add(cate5);
+																}
+															}
+
+															prevCate5No = cate4srch5.getCate5No();
+														}
+
+														cate4.setLeafYn(cate5List.size() > 0 ? "N" : "Y");
+														cate4.setCate5List(cate5List);
+														cate4List.add(cate4);
+													}
+												}
+
+												prevCate4No = cate4srch4.getCate4No();
+											}
+
+											cate3.setLeafYn(cate4List.size() > 0 ? "N" : "Y");
+											cate3.setCate4List(cate4List);
+											cate3List.add(cate3);
+										}
+									}
+
+									prevCate3No = cate4srch3.getCate3No();
+								}
+
+								cate2.setLeafYn(cate3List.size() > 0 ? "N" : "Y");
+								cate2.setCate3List(cate3List);
+								cate2List.add(cate2);
+							}
+						}
+
+						prevCate2No = cate4srch2.getCate2No();
+					}
+
+					cate1.setLeafYn(cate2List.size() > 0 ? "N" : "Y");
+					cate1.setCate2List(cate2List);
+					cate1List.add(cate1);
+				}
+
+				prevCate1No = cate4srch1.getCate1No();
+			}
+		}
+
+//				Map<Integer, List<Cate4Srch>> cate4srch1 = cateList.stream().collect(Collectors.groupingBy(Cate4Srch::getCate1No, LinkedHashMap::new, Collectors.toList()));
+//				cate4srch1.forEach((key1, value1) -> {
+//					log.info("{}:{}", key1, value1);
+//					Cate1 cate1 = new Cate1();
+//					cate1.setCate1No(key1);
+//					Iterator<Cate4Srch> aaa = value1.iterator();
+//					while (aaa.hasNext()) {
+//						aaa.next();
+//					}
+//
+//					Map<Integer, List<Cate4Srch>> cate4srch2 = value1.stream().collect(Collectors.groupingBy(Cate4Srch::getCate2No, LinkedHashMap::new, Collectors.toList()));
+//					cate4srch2.forEach((key2, value2) -> {
+//						log.info("{}:{}", key2, value2);
+//					});
+//				});
+
+		return cate1List;
+	}
+
+	/**
+	 * 브랜드 카테고리 목록
+	 * @param brandGroupNo - 브랜드그룹번호
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 4. 12
+	 */
+	@Cacheable(value = "cate", key = "'brandCate-'.concat(#brandGroupNo)")
+	public Collection<Cate1> getBrandCategoryList(Integer brandGroupNo) {
+		// 브랜드그룹의 기본카테고리여부 조회
+		String defaultCateYn = displayDao.getBrandGroupDefaultCategoryYn(brandGroupNo);
+
+		Cate4Srch cate = new Cate4Srch();
+		cate.setSiteCd(TscConstants.Site.STYLE24.value()); // 사이트코드
+
+		if (defaultCateYn.equals("Y")) { // 기본카테고리이면
+			cate.setCateGb(TsfConstants.CateGb.BYITEM.value());
+		} else { // 별도카테고리이면
+			cate.setCateGb(TsfConstants.CateGb.BYBRAND.value());
+		}
+
+		cate.setCateType(TsfConstants.CateType.GOODS.value()); // 상품분류카테고리
+		cate.setBrandGroupNo(brandGroupNo);
+		cate.setSoldoutGoodsDispYn(envsetService.getSoldoutGoodsDisplayYn(TscConstants.Site.STYLE24.value()));
+		cate.setDefaultCateYn(defaultCateYn);
+
+		return this.getAllCategoryList(cate);
+	}
+
+	/**
+	 * 아울렛 카테고리 목록
+	 * @param brandGroupNo - 브랜드그룹번호
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 4. 12
+	 */
+	@Cacheable(value = "cate", key = "'outletCate-'.concat(#formalGb)")
+	public Collection<Cate1> getOutletCategoryList(String formalGb) {
+		Cate4Srch cate = new Cate4Srch();
+		cate.setSiteCd(TscConstants.Site.STYLE24.value()); // 사이트코드
+
+		cate.setFormalGb(formalGb);
+		cate.setCateGb(TsfConstants.CateGb.BYITEM.value());
+		cate.setCateType(TsfConstants.CateType.GOODS.value()); // 상품분류카테고리
+		cate.setSoldoutGoodsDispYn(envsetService.getSoldoutGoodsDisplayYn(TscConstants.Site.STYLE24.value()));
+
+		return this.getAllCategoryList(cate);
+	}
+
+	/**
+	 * 카테고리 목록
+	 * @param brandGroupNo - 브랜드그룹번호
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 4. 12
+	 */
+	@Cacheable(value = "cate", key = "'reloadCate-'.concat(#cateGb)")
+	public Collection<Cate1> getCategoryReloadList(String cateGb) {
+		Cate4Srch cate = new Cate4Srch();
+		cate.setSiteCd(TscConstants.Site.STYLE24.value()); // 사이트코드
+
+		cate.setCateGb(TsfConstants.CateGb.BYITEM.value());
+		cate.setCateType(TsfConstants.CateType.GOODS.value()); // 상품분류카테고리
+		cate.setSoldoutGoodsDispYn(envsetService.getSoldoutGoodsDisplayYn(TscConstants.Site.STYLE24.value()));
+
+		return this.getAllCategoryList(cate);
+	}
+
+	/**
+	 * 메인 레이아웃 목록
+	 * @param cateNo - 카테고리No
+	 * @return
+	 * @author bin2107
+	 * @date 2021. 3. 16
+	 */
+	public Collection<MainLayout> getMainLayout(MainLayout mainLayout) {
+		return displayDao.getMainLayout(mainLayout);
+	}
+
+	/**
+	 * 카테고리 4srch 조회
+	 * @param
+	 * @return
+	 * @author bin2107
+	 * @date 2021. 3. 16
+	 */
+	public Cate4Srch getCate4srch(Cate4Srch cate4Srch) {
+		return displayDao.getCate4srch(cate4Srch);
+	}
+
+	/**
+	 * 팝업 목록
+	 *
+	 * @param popup
+	 * @return
+	 * @author eskim
+	 * @date 2021. 3. 30
+	 */
+	public GagaMap getPopupList(Popup popup) {
+		GagaMap result = new GagaMap();
+		Collection<Popup> popupList = new ArrayList<Popup>();
+		popup.setSiteCd(TscConstants.Site.STYLE24.value());
+
+		if ("P".equals(popup.getFrontGb())) {
+			result.set("dataList", displayDao.getPopupList(popup));
+		} else {
+			//우선순위 full 팝
+			popup.setPopupGb("F");
+			popupList = displayDao.getPopupList(popup);
+			result.set("popupGb", "F");
+			result.set("dataList", popupList);
+			if (popupList != null && popupList.size() > 0) {
+				return result;
+			}
+			popup.setPopupGb("H");
+			popupList = displayDao.getPopupList(popup);
+			result.set("popupGb", "H");
+			result.set("dataList", popupList);
+		}
+
+		// Collection<Popup>
+
+		return result;
+	}
+
+	/**
+	 * 몰메인 MD PICK 목록(메인용)
+	 * @param
+	 * @return
+	 * @author bin2107
+	 * @date 2021. 3. 30
+	 */
+	public Collection<Contents> getContentsForGoodsMain(Contents contents) {
+		Collection<Contents> contentsList = new ArrayList<>();
+		if(contents.getContentsLoc().equals("SMM007")){
+			contentsList = displayDao.getBrandpickTitleBrandList(contents);
+		}else{
+			contentsList = displayDao.getContentsList(contents);
+		}
+
+		Collection<Goods> goodsList = new ArrayList<>();
+		Cate4Srch tempContents = new Cate4Srch();
+		for (Contents data : contentsList) {
+			tempContents.setContentsLoc(data.getContentsLoc());
+			tempContents.setDispOrd(data.getDispOrd());
+			tempContents.setMaxRow(20);
+			tempContents.setCustNo(TsfSession.isLogin() ? TsfSession.getInfo().getCustNo() : 0);
+			
+			// 2021.08.31 FN_GET_BENEFIT_PRICE() 쿼리 null 처리
+			tempContents.setFrontGb(TsfSession.getFrontGb());
+			tempContents.setCustGb(TsfSession.getCustGb());
+			
+			if ("SMM007".equals(data.getContentsLoc())) {
+				if(!"".equals(data.getBrandGroupNo()) && !"null".equals(data.getBrandGroupNo()) && !data.getBrandGroupNo().equals(null)){
+					tempContents.setBrandGroupNo(Integer.parseInt(data.getBrandGroupNo()));
+				}
+				data.setFrontGb(TsfSession.getFrontGb());
+				data.setBannerList(displayDao.getContentsBannerList(data));
+			}
+			goodsList = (goodsDao.getContentsCategoryGoodsListMain(tempContents));
+			if ("SMM007".equals(data.getContentsLoc())) {
+				int maxrow = 3;
+				if (goodsList == null || goodsList.size() < 3) {
+					Cate4Srch cate = new Cate4Srch();
+					cate.setSiteCd(TscConstants.Site.STYLE24.value());
+					cate.setCateGb(TsfConstants.CateGb.BYITEM.value());
+					cate.setFrontGb(data.getFrontGb());
+					cate.setBrandGroupNo(Integer.parseInt(data.getBrandGroupNo()));
+					cate.setMaxRow(maxrow - goodsList.size());
+					
+					// 2021.09.29 신상품조회시 frontGb, custGb 누락 추가
+					cate.setCustGb(TsfSession.getCustGb());
+					
+					goodsList.addAll(goodsDao.getContentsCategoryNewGoodsList(cate));
+				}
+			}
+			data.setGoodsList(goodsList);
+		}
+
+		log.info("getContentsForGoods contentsList.size()::{}", contentsList.size());
+
+		return contentsList;
+	}
+	
+	/**
+	 * 몰메인 MD PICK 목록
+	 * @param
+	 * @return
+	 * @author jmh
+	 * @date 2021. 8. 13
+	 */
+	public Collection<Contents> getContentsForGoods(Contents contents) {
+		Collection<Contents> contentsList = new ArrayList<>();
+		if(contents.getContentsLoc().equals("SMM007")){
+			contentsList = displayDao.getBrandpickTitleBrandList(contents);
+		}else{
+			contentsList = displayDao.getContentsList(contents);
+		}
+
+		Collection<Goods> goodsList = new ArrayList<>();
+		Cate4Srch tempContents = new Cate4Srch();
+		for (Contents data : contentsList) {
+			tempContents.setContentsLoc(data.getContentsLoc());
+			tempContents.setDispOrd(data.getDispOrd());
+			tempContents.setMaxRow(20);
+			tempContents.setCustNo(TsfSession.isLogin() ? TsfSession.getInfo().getCustNo() : 0);
+			if ("SMM007".equals(data.getContentsLoc())) {
+				if(!"".equals(data.getBrandGroupNo()) && !"null".equals(data.getBrandGroupNo()) && !data.getBrandGroupNo().equals(null)){
+					tempContents.setBrandGroupNo(Integer.parseInt(data.getBrandGroupNo()));
+				}
+				data.setFrontGb(TsfSession.getFrontGb());
+				data.setBannerList(displayDao.getContentsBannerList(data));
+			}
+			goodsList = (goodsDao.getContentsCategoryGoodsList(tempContents));
+			if ("SMM007".equals(data.getContentsLoc())) {
+				int maxrow = 3;
+				if (goodsList == null || goodsList.size() < 3) {
+					Cate4Srch cate = new Cate4Srch();
+					cate.setSiteCd(TscConstants.Site.STYLE24.value());
+					cate.setCateGb(TsfConstants.CateGb.BYITEM.value());
+					cate.setFrontGb(data.getFrontGb());
+					cate.setBrandGroupNo(Integer.parseInt(data.getBrandGroupNo()));
+					cate.setMaxRow(maxrow - goodsList.size());
+					
+					// 2021.09.29 신상품조회시 frontGb, custGb 누락 추가
+					cate.setFrontGb(TsfSession.getFrontGb());
+					cate.setCustGb(TsfSession.getCustGb());
+					goodsList.addAll(goodsDao.getContentsCategoryNewGoodsList(cate));
+				}
+			}
+			data.setGoodsList(goodsList);
+		}
+
+		log.info("getContentsForGoods contentsList.size()::{}", contentsList.size());
+
+		return contentsList;
+	}
+
+	/**
+	 * 몰메인 BESTITEM 목록(메인용)
+	 * @param
+	 * @return
+	 * @author bin2107
+	 * @date 2021. 4. 9
+	 */
+	public Collection<Contents> getBestItemForGoodsMain(Contents contents) {
+		contents.setContentsLoc("SCM003");
+		contents.setCateNo(null);
+		Collection<Contents> contentsList = displayDao.getBestItemCategoryList(contents);
+		Cate4Srch tempCate = new Cate4Srch();
+
+		for (Contents data : contentsList) {
+			tempCate.setContentsLoc(data.getContentsLoc());
+			tempCate.setMaxRow(10);
+			tempCate.setCustNo(TsfSession.isLogin() ? TsfSession.getInfo().getCustNo() : 0);
+			tempCate.setCateNo(data.getCateNo());
+			tempCate.setSiteCd(data.getSiteCd());
+			tempCate.setCateGb(data.getCateGb());
+			
+			// 2021.08.31 FN_GET_BENEFIT_PRICE() 쿼리 null 처리
+			tempCate.setFrontGb(TsfSession.getFrontGb());
+			tempCate.setCustGb(TsfSession.getCustGb());
+			
+			Collection<Goods> cateGoodsList = goodsDao.getContentsCategoryGoodsListMain(tempCate);
+			if(10 > cateGoodsList.size()){
+				//TODO : 추천솔루션
+				int cnt = 0;
+				cnt = 10 - cateGoodsList.size();
+
+				Collection<Eigeneai.Result> itemList = eigeneaiApi.getCategoryWeeklySellBestGoodsList(cnt, data.getCateNo(), TsfSession.getFrontGb());
+				for(Eigeneai.Result tempData : itemList){
+					Goods tempBest = new Goods();
+					tempBest.setBrandGroupNm(tempData.getProduct().getBrandName());
+					tempBest.setGoodsCd(tempData.getProduct().getItemId());
+					tempBest.setGoodsFullNm(tempData.getProduct().getItemName());
+					tempBest.setListPrice((int) tempData.getProduct().getOriginalPrice());
+					tempBest.setCurrPrice((int) tempData.getProduct().getSalePrice());
+					tempBest.setSysImgNm(tempData.getProduct().getItemImage());
+					tempBest.setItemUrl(tempData.getProduct().getItemUrl());
+					cateGoodsList.add(tempBest);
+				}
+			}
+
+			data.setGoodsList(cateGoodsList);
+		}
+
+		return contentsList;
+	}
+	
+	/**
+	 * 몰메인 BESTITEM 목록
+	 * @param
+	 * @return
+	 * @author jmh
+	 * @date 2021. 8. 13
+	 */
+	public Collection<Contents> getBestItemForGoods(Contents contents) {
+		contents.setContentsLoc("SCM003");
+		contents.setCateNo(null);
+		Collection<Contents> contentsList = displayDao.getBestItemCategoryList(contents);
+		Cate4Srch tempCate = new Cate4Srch();
+
+		for (Contents data : contentsList) {
+			tempCate.setContentsLoc(data.getContentsLoc());
+			tempCate.setMaxRow(10);
+			tempCate.setCustNo(TsfSession.isLogin() ? TsfSession.getInfo().getCustNo() : 0);
+			tempCate.setCateNo(data.getCateNo());
+			tempCate.setSiteCd(data.getSiteCd());
+			tempCate.setCateGb(data.getCateGb());
+			Collection<Goods> cateGoodsList = goodsDao.getContentsCategoryGoodsList(tempCate);
+			if(10 > cateGoodsList.size()){
+				//TODO : 추천솔루션
+				int cnt = 0;
+				cnt = 10 - cateGoodsList.size();
+
+				Collection<Eigeneai.Result> itemList = eigeneaiApi.getCategoryWeeklySellBestGoodsList(cnt, data.getCateNo(), TsfSession.getFrontGb());
+				for(Eigeneai.Result tempData : itemList){
+					Goods tempBest = new Goods();
+					tempBest.setBrandGroupNm(tempData.getProduct().getBrandName());
+					tempBest.setGoodsCd(tempData.getProduct().getItemId());
+					tempBest.setGoodsFullNm(tempData.getProduct().getItemName());
+					tempBest.setListPrice((int) tempData.getProduct().getOriginalPrice());
+					tempBest.setCurrPrice((int) tempData.getProduct().getSalePrice());
+					tempBest.setSysImgNm(tempData.getProduct().getItemImage());
+					tempBest.setItemUrl(tempData.getProduct().getItemUrl());
+					cateGoodsList.add(tempBest);
+				}
+			}
+
+			data.setGoodsList(cateGoodsList);
+		}
+
+		return contentsList;
+	}
+
+	/**
+	 * BEST ITEM 카테고리 목록
+	 * @param
+	 * @return
+	 * @author bin2107
+	 * @date 2021. 4. 13
+	 */
+	public Collection<Contents> getBestItemCategoryList(Contents contents) {
+		return displayDao.getBestItemCategoryList(contents);
+	}
+
+	/**
+	 * BEST ITEM 카테고리별 상품 리스트
+	 * @param
+	 * @return
+	 * @author bin2107
+	 * @date 2021. 4. 13
+	 */
+	public Collection<Goods> getBestItemCategoryGoodsList(Contents contents) {
+		Cate4Srch cate4Srch = new Cate4Srch();
+		// 로그인 유무 확인 (로그인이 되어 있지 않으면 regNo 를 0으로 장바구니에 저장한다.)
+		Login login = new Login();
+		if (TsfSession.isLogin()) {
+			login = TsfSession.getInfo();
+		} else {
+			login.setCustNo(0);
+		}
+
+		String cateNo = String.valueOf(contents.getCateNo());
+		Collection<Goods> goodsList = new ArrayList<>();
+		if(!"".equals(cateNo) && !"null".equals(cateNo) && !cateNo.equals(null)){
+			cate4Srch.setCustNo(login.getCustNo());
+			cate4Srch.setPageGb(contents.getPageGb());
+			cate4Srch.setContentsLoc(contents.getContentsLoc());
+			cate4Srch.setPageable(contents.getPageable());
+			cate4Srch.setPageNo(contents.getPageNo());
+			cate4Srch.setPageSize(contents.getPageSize());
+			cate4Srch.setPageUnit(contents.getPageUnit());
+			cate4Srch.setCustNo(TsfSession.isLogin() ? TsfSession.getInfo().getCustNo() : 0);
+			cate4Srch.setCate1No(contents.getCateNo());
+			cate4Srch.setSiteCd(TscConstants.Site.STYLE24.value());
+			cate4Srch.setCateGb("G032_101");
+
+			log.info("getBestItemCategoryGoodsList cate4Srch:::::::::{}", cate4Srch);
+
+			goodsList = goodsDao.getContentsCategoryGoodsList(cate4Srch);
+			log.info("goodsList 1::::::{}",goodsList);
+		}
+/*
+		if (goodsList.size() < 100) {
+			// TODO 추천솔루션
+			log.info("goodsList.size()::::::{}",goodsList.size());
+			int cnt = 100 - goodsList.size();
+			log.info("itemList cnt::::::{}",cnt);
+			Collection<Eigeneai.Result> itemList = new ArrayList<>();
+			if(!"".equals(cateNo) && !"null".equals(cateNo) && !cateNo.equals(null)){
+				itemList = eigeneaiApi.getCategoryWeeklySellBestGoodsList(cnt, contents.getCateNo());
+			}else{
+				itemList = eigeneaiApi.getWeeklySellBestGoodsList(cnt);
+			}
+
+			log.info("itemList::::::{}",itemList);
+			for(Eigeneai.Result tempData: itemList){
+				Goods tempBest = new Goods();
+				tempBest.setBrandGroupNm(tempData.getProduct().getBrandName());
+				tempBest.setGoodsCd(tempData.getProduct().getItemId());
+				tempBest.setMainColorCd("");
+				tempBest.setGoodsNm(tempData.getProduct().getItemName());
+				tempBest.setGoodsFullNm(tempData.getProduct().getItemName());
+				tempBest.setListPrice((int) tempData.getProduct().getOriginalPrice());
+				tempBest.setCurrPrice((int) tempData.getProduct().getSalePrice());
+				
+				// 2021.08.30 검색엔진데이타 https: 붙여서 넘어옴 처리 
+				if (tempData.getProduct().getItemImage().indexOf("https:") > -1) {
+					tempBest.setSysImgNm(tempData.getProduct().getItemImage().replaceAll("https://image.istyle24.com/Upload/ProductImage/",""));
+				} else {
+					tempBest.setSysImgNm(tempData.getProduct().getItemImage().replaceAll("//image.istyle24.com/Upload/ProductImage/",""));
+				}
+				
+				tempBest.setItemUrl(tempData.getProduct().getItemUrl());
+				goodsList.add(tempBest);
+			}
+			log.info("goodsList 2::::::{}",goodsList);
+		}
+*/
+		return goodsList;
+	}
+
+	/**
+	 * 상품리스트 카테고리별 필터 목록
+	 * @param params - 검색엔진 정보
+	 * @return
+	 * @author gagamel
+	 * @date 2021. 5. 3
+	 */
+	public Collection<Filter> getGoodsListCategoryFilterList(SearchEngine params) {
+		params.setSiteCd(TscConstants.Site.STYLE24.value());
+		if (StringUtils.isBlank(params.getFormalGb())) {
+			params.setFormalGb("G009_10");
+		}
+		return displayDao.getGoodsListCategoryFilterList(params);
+	}
+
+	/**
+	 * 검색키워드를 통한 검색상품리스트 카테고리별 필터 목록
+	 * @param params - 검색엔진 정보
+	 * @return
+	 * @author gagamel
+	 * @date 2021. 5. 3
+	 */
+	public Collection<Filter> getSearchGoodsListCategoryFilterList(SearchEngine params) {
+		params.setSiteCd(TscConstants.Site.STYLE24.value());
+		params.setCateGb(TsfConstants.CateGb.BYITEM.value());
+		params.setFormalGb("G009_10");
+		return displayDao.getSearchGoodsListCategoryFilterList(params);
+	}
+
+	/**
+	 * 카테고리별 필터 목록
+	 * @param filterList - 필터 목록
+	 * @param filterGb - 필터 구분
+	 * @return
+	 * @author gagamel
+	 * @date 2021. 5. 3
+	 */
+	public Collection<Filter> getCategoryFilterList(Collection<Filter> filterList, String filterGb) {
+		Collection<Filter> resultList = new ArrayList<Filter>();
+		int idx = 0;
+		String maxPrice = "0";
+		String minPrice = "0";
+		String lastStr = "";
+		ArrayList<String> seasonSortArr = new ArrayList<>();
+		Collection<Filter> seasonArr = new ArrayList<Filter>();
+		for (Filter filter : filterList) {
+			if (!"".equals(filter.getFilterCd()) && !filter.getFilterCd().equals(null)) {
+				if (filter.getFilterGb().equals("PRICE")) {
+					if (idx == 0) {
+						minPrice = filter.getFilterCd();
+					} else {
+						maxPrice = filter.getFilterCd();
+					}
+					idx++;
+				} else {
+					if (filter.getFilterGb().equals(filterGb)) {
+						if ("BENEFIT".equals(filterGb)) {
+							if (!filter.getFilterCd().equals("40")) {
+								resultList.add(filter);
+							}
+						}else if ("SIZE".equals(filterGb)) {
+							// 자사 사이즈만 표시 
+							if(null != filter.getFilterCd()) {
+								lastStr = filter.getFilterCd().substring(filter.getFilterCd().length()-1, filter.getFilterCd().length()); 
+								if("Y".equals(lastStr)) {
+									resultList.add(filter);
+								}
+							}
+						}else if ("SEASON".equals(filterGb)) {
+							// 시즌정보 정렬 
+							seasonSortArr.add(filter.getFilterCd());
+							seasonArr.add(filter);
+						} else {
+							resultList.add(filter);
+						}
+					}
+				}
+			}
+		}
+
+		if (filterGb.equals("PRICE")) {
+			int sliceVal = (Integer.parseInt(maxPrice) - Integer.parseInt(minPrice)) / 5;
+			int tempPrice = 0;
+			Filter temp = new Filter();
+			Collection<Filter> priceList = new ArrayList<Filter>();
+			for (int i = 0; i < 6; i++) {
+				tempPrice = 0;
+				temp = new Filter();
+				temp.setFilterGb("PRICE");
+				if (i == 0) {
+//					tempPrice = (int)Math.floor((Integer.parseInt(minPrice)) / 1000) * 1000 ;
+					tempPrice = (int)Math.floor((Integer.parseInt(minPrice)));
+					temp.setFilterCd(String.valueOf(tempPrice));
+					temp.setFilterNm(String.valueOf(tempPrice));
+				} else if (i == 5) {
+					tempPrice = (int)Math.floor((Integer.parseInt(maxPrice)));
+					temp.setFilterCd(String.valueOf(tempPrice));
+					temp.setFilterNm(String.valueOf(tempPrice));
+				} else {
+					tempPrice = (int)Math.floor((Integer.parseInt(minPrice) + sliceVal * i) / 1000) * 1000;
+					temp.setFilterCd(String.valueOf(tempPrice));
+					temp.setFilterNm(String.valueOf(tempPrice));
+				}
+				priceList.add(temp);
+			}
+			resultList.addAll(priceList);
+		}
+		
+		// 시즌정렬
+		if (filterGb.equals("SEASON")) {
+			Collections.sort(seasonSortArr);
+			for (String filterCd : seasonSortArr) {
+				for (Filter item : seasonArr) {
+					if( filterCd.equals(item.getFilterCd())){
+						resultList.add(item);
+						break;
+					}
+				}
+			}
+		}
+		
+		return resultList;
+	}
+
+	/**
+	 * 상품카테고리 필터 목록
+	 * @param
+	 * @return
+	 * @author bin2107
+	 * @date 2021. 4. 5
+	 */
+	public Collection<GoodsSearch> getCategoryFilter(Cate4Srch cate4Srch, String filterGb) {
+		cate4Srch.setFilterGb(filterGb);
+		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
+	 * @since 2021. 4. 28
+	 */
+	public Collection<BrandGroup> getBrandImgList(BrandGroup brandGroup) {
+		return displayDao.getBrandImgList(brandGroup);
+	}
+
+	/**
+	 * 전체 브랜드
+	 * @param
+	 * @return
+	 * @author bin2107
+	 * @since 2021. 4. 12
+	 */
+	public Collection<BrandGroup> getAllBrandList(BrandGroup brandGroup) {
+		return displayDao.getAllBrandList(brandGroup);
+	}
+
+	/**
+	 * GNB TAB 기획전배너 리스트
+	 * @param Contents
+	 * @return
+	 * @author bin2107
+	 * @since 2021. 4. 14
+	 */
+	public Collection<Contents> getGnbTabBannerlist(Contents contenst) {
+		Collection<Contents> contentsList = displayDao.getGnbTabBannerList(contenst);
+		return contentsList;
+	}
+
+	/**
+	 * 키워드를 이용한 전체 카테고리 목록
+	 * @param keyword - 상품검색키워드
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 5. 6
+	 */
+	public Collection<Cate1> getKeywordCategoryList(String keyword) {
+		Cate4Srch cate = new Cate4Srch();
+		cate.setSiteCd(TscConstants.Site.STYLE24.value()); // 사이트코드
+		cate.setCateGb(TsfConstants.CateGb.BYITEM.value()); // 카테고리구분
+		cate.setCateType(TsfConstants.CateType.GOODS.value()); // 상품분류카테고리
+		cate.setSoldoutGoodsDispYn(envsetService.getSoldoutGoodsDisplayYn(TscConstants.Site.STYLE24.value()));
+		cate.setKeyword(keyword);
+		return this.getAllCategoryList(cate);
+	}
+
+	public int getContentsCategoryGoodsCount(Contents contents) {
+		Cate4Srch cate4Srch = new Cate4Srch();
+		// 로그인 유무 확인 (로그인이 되어 있지 않으면 regNo 를 0으로 장바구니에 저장한다.)
+		Login login = new Login();
+		if (TsfSession.isLogin()) {
+			login = TsfSession.getInfo();
+		} else {
+			login.setCustNo(0);
+		}
+
+		cate4Srch.setCustNo(login.getCustNo());
+		cate4Srch.setPageGb(contents.getPageGb());
+		cate4Srch.setContentsLoc(contents.getContentsLoc());
+		cate4Srch.setMaxRow(100);
+		cate4Srch.setCustNo(TsfSession.isLogin() ? TsfSession.getInfo().getCustNo() : 0);
+		cate4Srch.setCate1No(contents.getCateNo());
+		cate4Srch.setSiteCd(TscConstants.Site.STYLE24.value());
+		cate4Srch.setCateGb("G032_101");
+		return goodsDao.getContentsCategoryGoodsCount(cate4Srch);
+	}
+
+	/**
+	 * 검색키워드 조회
+	 * @param
+	 * @return
+	 * @throws Exception
+	 * @author bin2107
+	 * @since 2021. 7. 2
+	 */
+	public Collection<SearchKeyword> getSearchKeywordList(SearchKeyword searchKeyword) {
+		return displayDao.getSearchKeywordList(searchKeyword);
+	}
+
+	/**
+	 * 스플래시 이미지 가져오기
+	 * @param siteCd - 사이트코드
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 7. 5
+	 */
+	@Cacheable(value = "splashimg")
+	public String getSplashImageUrl() {
+		String splashImg = displayDao.getSplashImage();
+		if (StringUtils.isBlank(splashImg)) {
+			return "";
+		}
+		return "http:" + GagaFileUtil.getConcatenationPath(env.getProperty("upload.image.view"), "splashimg", splashImg);
+	}
+
+	/**
+	 * 몰메인 신상풍 목록
+	 * @param
+	 * @return
+	 * @author bin2107
+	 * @date 2021. 7. 13
+	 */
+	public Collection<Contents> getMainNewGoodsList(Contents contents) {
+		Collection<Contents> contentsList = displayDao.getBestItemCategoryList(contents);
+		Cate4Srch tempCate = new Cate4Srch();
+
+		for (Contents data : contentsList) {
+			tempCate.setContentsLoc(data.getContentsLoc());
+			tempCate.setMaxRow(20);
+			tempCate.setCustNo(TsfSession.isLogin() ? TsfSession.getInfo().getCustNo() : 0);
+			tempCate.setSiteCd(data.getSiteCd());
+			tempCate.setCateGb(data.getCateGb());
+			
+			// 2021.09.29 신상품조회시 frontGb, custGb 누락 추가
+			tempCate.setFrontGb(TsfSession.getFrontGb());
+			tempCate.setCustGb(TsfSession.getCustGb());
+			
+			data.setGoodsList(goodsDao.getContentsCategoryNewGoodsList(tempCate));
+		}
+
+		return contentsList;
+	}
+
+	/**
+	 * 몰메인 신상품 목록
+	 * @param
+	 * @return
+	 * @author bin2107
+	 * @date 2021. 7. 13
+	 */
+	public Collection<Goods> getContentsCategoryNewGoodsList(Cate4Srch cate4Srch){
+		return goodsDao.getContentsCategoryNewGoodsList(cate4Srch);
+	}
+
+	/**
+	 * 몰메인 브랜드픽 타이틀 브랜드 목록
+	 * @param contents - 컨텐츠 정보
+	 * @return
+	 * @author bin2107
+	 * @date 2021. 7. 23
+	 */
+	public Collection<Contents> getBrandpickTitleBrandList(Contents contents) {
+		return displayDao.getBrandpickTitleBrandList(contents);
+	}
+	
+	/**
+	 * 몰메인 MD PICK 목록(메인용)
+	 * @param
+	 * @return
+	 * @author bin2107
+	 * @date 2021. 3. 30
+	 */
+	@SuppressWarnings("unchecked")
+	public Collection<Contents> getContentsForGoodsMainMdPick(Contents contents) {
+		Collection<Contents> contentsList = new ArrayList<>();
+		contentsList = displayDao.getContentsList(contents);
+		
+		Collection<Goods> goodsList = new ArrayList<>();
+		Cate4Srch tempContents = new Cate4Srch();
+		for (Contents data : contentsList) {
+			tempContents.setContentsLoc(data.getContentsLoc());
+			tempContents.setDispOrd(data.getDispOrd());
+			tempContents.setMaxRow(20);
+			tempContents.setCustNo(TsfSession.isLogin() ? TsfSession.getInfo().getCustNo() : 0);
+			
+			// 2021.08.31 FN_GET_BENEFIT_PRICE() 쿼리 null 처리
+			tempContents.setFrontGb(TsfSession.getFrontGb());
+			tempContents.setCustGb(TsfSession.getCustGb());
+			
+			goodsList = (goodsDao.getContentsCategoryGoodsListMain(tempContents));
+			data.setGoodsList(goodsList);
+		}
+		
+		// md pick 5개 미만일 때, 추천솔루션 추가 세팅 
+		if(contents.getContentsLoc().equals("SMM009")){
+			if( contentsList.size() < 5) {
+				int cnt = 0;
+				int len = 0;
+				len = 5 - contentsList.size();
+				
+				JSONObject groupedResults = eigeneaiApi.getSoaringSalesCategoryList(TsfSession.getFrontGb());
+				
+				if(null != groupedResults) {
+					Contents apiContents;
+					Collection<Goods> apiGoodsList = new ArrayList<>();
+					Goods goods;
+					
+					JSONArray groupArr;
+					JSONObject subObj;
+					JSONObject subPrjObj;
+					Set<Map.Entry<String, JSONArray>> entries = groupedResults.entrySet();
+					for (Map.Entry<String, JSONArray> entry: entries) {
+						if( cnt < len) {
+							groupArr = entry.getValue();
+							if( null != groupArr) {
+								apiGoodsList = new ArrayList<Goods>();
+								apiContents = new Contents();
+								apiContents.setContentsLoc(contents.getContentsLoc());
+															
+								for( int i=0; i< groupArr.size(); i++) {
+									subObj = (JSONObject) groupArr.get(i);
+									subPrjObj = (JSONObject) subObj.get("product"); 
+									
+									if( null != subPrjObj) {
+										apiContents.setMdTitle("#"+subPrjObj.get("category2Name").toString());
+										
+										goods = new Goods();							
+										goods.setGoodsCd(subPrjObj.get("itemId").toString());
+										goods.setGoodsFullNm(subPrjObj.get("itemName").toString());
+										goods.setBrandGroupNm(subPrjObj.get("brandName").toString());
+										goods.setSysImgNm(subPrjObj.get("itemImage").toString().replace("https:", "").replace(env.getProperty("upload.goods.view")+"/", "").replace(env.getProperty("upload.goods.view"), ""));
+										goods.setListPrice((int) Double.parseDouble(subPrjObj.get("originalPrice").toString()));
+										goods.setCurrPrice((int) Double.parseDouble(subPrjObj.get("salePrice").toString()));
+										
+										apiGoodsList.add(goods);
+									}
+								}
+								
+								if( 0 < apiGoodsList.size()) {
+									apiContents.setGoodsList(apiGoodsList);
+									contentsList.add(apiContents);
+									cnt ++;
+								}
+							}
+						}else {
+							break;
+						}
+					}
+				}
+			}
+		}
+		//log.info("getContentsForGoods contentsList.size()::{}", contentsList.size());
+
+		return contentsList;
+	}
+}

+ 1331 - 1332
src/main/java/com/style24/front/biz/service/TsfGoodsService.java

@@ -1,1332 +1,1331 @@
-package com.style24.front.biz.service;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.style24.core.support.env.TscConstants;
-import com.style24.front.biz.dao.TsfDisplayDao;
-import com.style24.front.biz.dao.TsfGoodsDao;
-import com.style24.front.biz.thirdparty.EigeneaiApi;
-import com.style24.front.support.security.session.TsfSession;
-import com.style24.persistence.domain.CardPromotion;
-import com.style24.persistence.domain.Cate4Srch;
-import com.style24.persistence.domain.Delivery;
-import com.style24.persistence.domain.Freegift;
-import com.style24.persistence.domain.Goods;
-import com.style24.persistence.domain.GoodsCompose;
-import com.style24.persistence.domain.GoodsContents;
-import com.style24.persistence.domain.GoodsDesc;
-import com.style24.persistence.domain.GoodsImg;
-import com.style24.persistence.domain.GoodsNotiInfo;
-import com.style24.persistence.domain.GoodsSafeNo;
-import com.style24.persistence.domain.GoodsSearch;
-import com.style24.persistence.domain.GoodsStock;
-import com.style24.persistence.domain.GoodsVideo;
-import com.style24.persistence.domain.GoodsViewHst;
-import com.style24.persistence.domain.Measurement;
-import com.style24.persistence.domain.MeasurementStyle;
-import com.style24.persistence.domain.Notice;
-import com.style24.persistence.domain.ReinboundInform;
-import com.style24.persistence.domain.SizeInfo;
-import com.style24.persistence.domain.Tmtb;
-import com.style24.persistence.domain.eigene.Eigeneai;
-import com.style24.persistence.domain.searchengine.SearchEngine;
-
-import lombok.extern.slf4j.Slf4j;
-
-import com.gagaframework.web.parameter.GagaMap;
-
-/**
- * 상품 Service
- *
- * @author gagamel
- * @since 2020. 12. 29
- */
-@Service
-@Slf4j
-public class TsfGoodsService {
-
-	@Autowired
-	private TsfGoodsDao goodsDao;
-
-	@Autowired
-	private TsfCouponService couponService;
-
-	@Autowired
-	private TsfDisplayDao displayDao;
-
-	@Autowired
-	private ObjectMapper mapper;
-
-	@Autowired
-	private EigeneaiApi eigeneaiApi;
-
-	/**
-	 * 상품뷰이력 생성
-	 *
-	 * @param goodsCd - 상품코드
-	 * @param ithrCd - 유입코드
-	 * @return
-	 * @author eskim
-	 * @since 2021. 2. 09
-	 */
-	@Transactional("shopTxnManager")
-	public void createGoodsViewHst(String goodsCd, String ithrCd) {
-		// 상품뷰이력 생성
-		GoodsViewHst goodsViewHst = new GoodsViewHst();
-		goodsViewHst.setGoodsCd(goodsCd);
-		goodsViewHst.setJsessionId(TsfSession.getSessionId());
-		goodsViewHst.setSiteCd(TscConstants.Site.STYLE24.value());
-		goodsViewHst.setFrontGb(TsfSession.getFrontGb());
-		goodsViewHst.setAfLinkCd(ithrCd);
-		String referer = TsfSession.getHttpServletRequest().getHeader("Referer");
-		if (StringUtils.isNotBlank(referer)) {
-			byte[] referBytes = referer.getBytes();
-			if (referBytes.length > 1000) {
-				goodsViewHst.setReferer(new String(referBytes, 0, 1000));
-			} else {
-				goodsViewHst.setReferer(referer);
-			}
-		}
-
-		if (TsfSession.getInfo() != null) {
-			goodsViewHst.setCustNo(TsfSession.getInfo().getCustNo());
-		}
-
-		goodsDao.createGoodsViewHst(goodsViewHst);
-	}
-
-	/**
-	 * 상품 네비게이션 조회
-	 * @param goods
-	 * @return
-	 * @author eskim
-	 * @since 2021. 02. 09
-	 */
-	public Cate4Srch getGoodsNavigation(Goods goods) {
-		return goodsDao.getGoodsNavigation(goods);
-	}
-
-	/**
-	 * 상품 정보 조회
-	 * @param goods
-	 * @return
-	 * @author eskim
-	 * @since 2021. 01. 28
-	 */
-	public Goods getGoodsInfo(Goods goods) {
-		return goodsDao.getGoodsInfo(goods);
-	}
-
-	/**
-	 * 상품 DESC 조회
-	 *
-	 * @param resultGoods
-	 * @return
-	 * @author eskim
-	 * @since 2021. 2. 17
-	 */
-	public Goods getGoodsDesc(Goods resultGoods) {
-
-		GoodsDesc goods = new GoodsDesc();
-		goods.setGoodsCd(resultGoods.getGoodsCd());
-
-		//상품상세 구분(10:상품타이틀,20:상품타이틀내용,30:상품특징,40:상위컨텐츠,50:하위컨텐츠,60:상위컨텐츠-모바일,70:하위컨텐츠-모바일,80:상품상세(as-is,입점))
-
-		// 상품타이틀
-		goods.setDescGb("10");
-		String goodsTitle = this.getGoodsDescList(goods);
-		resultGoods.setGoodsTitle(goodsTitle);
-		// 상품타이틀내용
-		goods.setDescGb("20");
-		String goodsTitleDesc = this.getGoodsDescList(goods);
-		resultGoods.setGoodsTitleDesc(goodsTitleDesc);
-		// 상품특징
-		goods.setDescGb("30");
-		String goodsSpecialDesc = this.getGoodsDescList(goods);
-		resultGoods.setGoodsSpecialDesc(goodsSpecialDesc);
-
-		if ("P".equals(TsfSession.getFrontGb())) {
-			// 상품 상세 pc 상단
-			goods.setDescGb("40");
-			String goodsPcTopDesc = this.getGoodsDescList(goods);
-			resultGoods.setGoodsTopDesc(goodsPcTopDesc);
-
-			// 상품 상세 pc 하단
-			goods.setDescGb("50");
-			String goodsPcDownDesc = this.getGoodsDescList(goods);
-			resultGoods.setGoodsDownDesc(goodsPcDownDesc);
-
-		} else {
-			// 상품 상세 mobile 상단
-			goods.setDescGb("60");
-			String goodsMobileTopDesc = this.getGoodsDescList(goods);
-			resultGoods.setGoodsTopDesc(goodsMobileTopDesc);
-
-			// 상품 상세 mpbile 하단
-			goods.setDescGb("70");
-			String goodsMobileDownDesc = this.getGoodsDescList(goods);
-			resultGoods.setGoodsDownDesc(goodsMobileDownDesc);
-		}
-
-		// 상품특징
-		goods.setDescGb("80");
-		String goodsDesc = this.getGoodsDescList(goods);
-		resultGoods.setGoodsDesc(goodsDesc);
-
-		return resultGoods;
-	}
-
-	/**
-	 * 상품 상세 정보 조회
-	 *
-	 * @param goods
-	 * @return
-	 * @author eskim
-	 * @since 2021. 2. 17
-	 */
-	private String getGoodsDescList(GoodsDesc goods) {
-		Collection<GoodsDesc> goodsDescList = goodsDao.getGoodsDescList(goods);
-		StringBuilder goodsDesc = new StringBuilder();
-		if (goodsDescList != null && !goodsDescList.isEmpty()) {
-			for (GoodsDesc tmpGoodsDesc : goodsDescList) {
-				goodsDesc.append(tmpGoodsDesc.getGoodsDesc());
-			}
-		}
-		return goodsDesc.toString();
-	}
-
-	/**
-	 * 상품 이미지 정보
-	 *
-	 * @param goodsCd
-	 * @return
-	 * @author eskim
-	 * @since 2021. 2. 9
-	 */
-	public Collection<GoodsImg> getGoodsImgList(Goods goods) {
-		return goodsDao.getGoodsImgList(goods);
-	}
-
-	/**
-	 * 상품 동영상정보
-	 *
-	 * @param goodsCd
-	 * @return
-	 * @author eskim
-	 * @since 2021. 2. 9
-	 */
-	public Collection<GoodsVideo> getVideoList(GoodsVideo goodsVideo) {
-		return goodsDao.getVideoList(goodsVideo);
-	}
-
-	/**
-	 * 구성 상품 정보 조회
-	 * @param goods
-	 * @return
-	 * @author xodud1202
-	 * @since 2021. 01. 28
-	 */
-	public Goods getGoodsCompsInfo(Goods goods) {
-		return goodsDao.getGoodsCompsInfo(goods);
-	}
-
-	/**
-	 * 상품 재고 정보
-	 * @param goodsStock
-	 * @return
-	 * @author xodud1202
-	 * @since 2021. 01. 28
-	 */
-	public GoodsStock getGoodsStockInfo(GoodsStock goodsStock) {
-		return goodsDao.getGoodsStockInfo(goodsStock);
-	}
-
-	/**
-	 * 상품 재고 체크
-	 * @param param
-	 * goodsCd   (원상품코드) 필수
-	 * goodsType (상품타입) 필수
-	 * optCd     (옵션코드) 필수
-	 * goodsQty  (확인 재고 수량) 필수
-	 * itemCd    (세트 구성 상품코드) 세트
-	 * @return String
-	 * @author xodud1202
-	 * @since 2021. 01. 28
-	 */
-	public String getCheckStock(GoodsStock param) {
-		// 상품 마스터 정보 확인
-		Goods goodsInfo = new Goods();
-		goodsInfo.setGoodsCd(param.getGoodsCd());
-		goodsInfo.setSiteCd(TscConstants.Site.STYLE24.value());
-		goodsInfo = getGoodsInfo(goodsInfo);
-
-		if (TscConstants.GoodsStat.SOLDOUT.value().equals(goodsInfo.getGoodsStat())) {
-			return param.getGoodsCd() + "는 품절 상품입니다.";
-		}
-
-		if (param.getGoodsType().equals(TscConstants.GoodsType.SET.value())) {		// 세트상품이면 구성 상품코드로 조회
-			Goods compsInfo = new Goods();
-			compsInfo.setGoodsCd(param.getGoodsCd());
-			compsInfo.setCompsGoodsCd(param.getItemCd());
-			compsInfo.setGoodsType(param.getGoodsType());
-
-			compsInfo = goodsDao.getGoodsCompsInfo(compsInfo);						// 구성상품 정보 조회
-
-			if (TscConstants.GoodsStat.SOLDOUT.value().equals(compsInfo.getGoodsStat())) {
-				return compsInfo.getGoodsNm() + " 상품은 품절입니다.";
-			} else if (!TscConstants.GoodsStat.APPR.value().equals(compsInfo.getGoodsStat())) {
-				return compsInfo.getGoodsNm() + " 상품은 구매할 수 없습니다.";
-			}
-
-			GoodsStock stockCheck = new GoodsStock();								// 재고 조회 결과
-			stockCheck.setGoodsCd(param.getItemCd());
-			stockCheck.setOptCd(param.getOptCd());
-
-			stockCheck = goodsDao.getGoodsStockInfo(stockCheck);					// 구성 상품 재고 조회
-
-			if (stockCheck == null) {
-				return "재고체크 실패했습니다. 새로고침 후 다시 시도해주세요.";
-			}
-
-			if ("Y".equals(stockCheck.getSoldoutYn())) {
-				return stockCheck.getOptCd2() + " 옵션은 품절입니다.";
-			}
-
-			if (param.getGoodsQty() * compsInfo.getQty() > stockCheck.getCurrStockQty()) {
-				return compsInfo.getGoodsNm() + " 옵션의 재고가 충분하지 않습니다.";
-			}
-		} else {
-			GoodsStock stockCheck = new GoodsStock();								// 재고 조회 결과
-			stockCheck.setGoodsCd(param.getGoodsCd());
-			stockCheck.setOptCd(param.getOptCd());
-
-			stockCheck = goodsDao.getGoodsStockInfo(stockCheck);					// 구성 상품 재고 조회
-
-			if (stockCheck == null) {
-				return "재고체크 실패했습니다. 새로고침 후 다시 시도해주세요.";
-			}
-
-			if ("Y".equals(stockCheck.getSoldoutYn())) {
-				return stockCheck.getOptCd2() + " 옵션은 품절입니다.";
-			}
-
-			if (param.getGoodsQty() > stockCheck.getCurrStockQty()) {
-				return "옵션의 재고가 충분하지 않습니다.";
-			}
-		}
-
-		return "SUCCESS";
-	}
-
-	/**
-	 * 딜상품 구성상품정보 조회
-	 *
-	 * @param goods
-	 * @return
-	 * @author eskim
-	 * @since 2021. 2. 9
-	 */
-	public Collection<Goods> getGoodsDealComposeList(Goods goods) {
-		return goodsDao.getGoodsDealComposeList(goods);
-	}
-
-	/**
-	 * 상품 옵션1 목록
-	 *
-	 * @param goods
-	 * @return
-	 * @author eskim
-	 * @since 2021. 2. 9
-	 */
-	public Collection<GoodsStock> getGoodsOption1List(Goods goods) {
-		return goodsDao.getGoodsOption1List(goods);
-	}
-
-	/**
-	 * 상품 옵션2 목록
-	 *
-	 * @param goods
-	 * @return
-	 * @author eskim
-	 * @since 2021. 2. 9
-	 */
-	public Collection<GoodsStock> getGoodsOption2List(Goods goods) {
-		return goodsDao.getGoodsOption2List(goods);
-	}
-
-	/**
-	 * 상품 옵션 목록 - 입점용
-	 *
-	 * @param goods
-	 * @return
-	 * @author eskim
-	 * @since 2021. 3. 18
-	 */
-	public Collection<GoodsStock> getGoodsOptionList(Goods goods) {
-		return goodsDao.getGoodsOptionList(goods);
-	}
-
-	/**
-	 * 상품 고시정보
-	 *
-	 * @param goods
-	 * @return
-	 * @author eskim
-	 * @since 2021. 2. 17
-	 */
-	public Collection<GoodsNotiInfo> getGoodsNotiList(Goods goods) {
-		return goodsDao.getGoodsNotiList(goods);
-	}
-
-	/**
-	 * 카드 혜택
-	 *
-	 * @param cardPromotion
-	 * @return
-	 * @author eskim
-	 * @since 2021. 2. 17
-	 */
-	public Collection<CardPromotion> getCardPromotionList(CardPromotion cardPromotion) {
-		return goodsDao.getCardPromotionList(cardPromotion);
-	}
-
-	/**
-	 * 핫딜 상품 조회
-	 *
-	 * @param goods
-	 * @return
-	 * @author eskim
-	 * @since 2021. 2. 17
-	 */
-	public Goods getSocialGoods(Goods goods) {
-		return goodsDao.getSocialGoods(goods);
-	}
-
-	/**
-	 * 상품예약판매정보 조회
-	 *
-	 * @param goods
-	 * @return
-	 * @author eskim
-	 * @since 2021. 2. 17
-	 */
-	public Goods getGoodsResSell(Goods resultGoods) {
-
-		Goods goods = goodsDao.getGoodsResSell(resultGoods);
-		if (goods != null) {
-			resultGoods.setDelvResDt(goods.getDelvResDt());
-		}
-
-		return resultGoods;
-	}
-
-	/**
-	 * 상품 사이즈 선택 시 재고수량 가져오기
-	 *
-	 * @param goods
-	 * @return
-	 * @author eskim
-	 * @since 2020. 7. 9
-	 */
-	public int getGoodsStockQty(GoodsStock goodsStock) {
-		int result = 0;
-		// 예약상품 여부 확인
-		//int goodsResSellCount = goodsDao.getGoodsResSellCount(goodsStock.getGoodsCd());
-
-		//if ("N".equals(goodsStock.getSelfGoodsYn()) || goodsResSellCount > 0) {
-			result = goodsDao.getGoodsStockQty(goodsStock);
-		//} else {
-		//	result = goodsDao.getGoodsStoreStockQty(goodsStock);
-		//}
-		return result;
-	}
-
-	/**
-	 * 세트 상품 사이즈 선택 시 재고수량 가져오기
-	 *
-	 * @param goods
-	 * @return
-	 * @author eskim
-	 * @since 2021. 3. 22
-	 */
-	public int getGoodsSetStockQty(GoodsStock goodsStock) {
-
-//		input param
-//		arrGoodsOption : goodsOption // [{goodsCd|optCd|qty},{goodsCd|optCd|qty}]
-//		,minOrdQty : minOrdQty
-//		,maxOrdQty : maxOrdQty
-//		,goodsCd : mGoodsCd
-//		,selfGoodsYn : selfGoodsYn
-
-		int result = 0;
-		int index = 0;	// 상품순서
-		//int masterStoreCnt = 0;
-		//boolean stockCheck = false;
-		boolean returnFlag = false;
-		//String[][] arrGoodsStoreList = null;	// 상품코드, 매장코드, 상품별 주문수량
-
-		//log.info("[getGoodsSetStockQty] goodsStock = {}", goodsStock);
-
-		// 예약상품 여부 확인
-		//int goodsResSellCount = goodsDao.getGoodsResSellCount(goodsStock.getGoodsCd());
-
-		int ableOrderCnt = 0;
-		for (String arrGoodsCd : goodsStock.getArrGoodsOption()) {	// [{goodsCd|optCd|qty},{goodsCd|optCd|qty}]
-
-			String[] goodsSizeInfo = arrGoodsCd.split("\\|");
-			//log.info("[getGoodsSetStockQty] goodsSizeInfo = {}", goodsSizeInfo);
-			if (goodsSizeInfo.length == 3) {
-
-				GoodsStock tmpStock = new GoodsStock();
-				tmpStock.setGoodsCd(goodsSizeInfo[0]);
-				tmpStock.setOptCd(goodsSizeInfo[1]);
-				int qty = Integer.parseInt(goodsSizeInfo[2]);	// 한번에 주문해야하는 상품수량
-//				int stockByGoodsSize = goodsDao.getGoodsStockQty(tmpStock);
-				int stockByGoodsSize = 0;
-				//if ("N".equals(goodsStock.getSelfGoodsYn()) || goodsResSellCount > 0) {
-					stockByGoodsSize = goodsDao.getGoodsStockQty(tmpStock);
-				//} else {
-				//	stockByGoodsSize = goodsDao.getGoodsStoreStockQty(tmpStock);
-				//}
-
-				//log.info("[getGoodsSetStockQty] stockByGoodsSize = {}", stockByGoodsSize);
-				if (stockByGoodsSize <= 0) {
-					returnFlag = true;
-					break;
-				} else {
-					if (index == 0) {	//첫번째 상품 기준 생성
-						ableOrderCnt = stockByGoodsSize / qty;	// 주문가능 횟수
-					} else {
-						int orderCnt = stockByGoodsSize / qty;	// 주문가능 횟수
-
-						if (ableOrderCnt >= orderCnt) {
-							ableOrderCnt = orderCnt;
-						}
-					}
-				}
-				//log.info("[getGoodsSetStockQty] ableOrderCnt = {}", ableOrderCnt);
-			} else {
-				returnFlag = true;
-				break;
-			}
-			index++;
-		}
-		result = ableOrderCnt;	//주문 가능 수량
-
-		if (returnFlag) {
-			return 0;
-		}
-
-		if (goodsStock.getMinOrdQty() > result) {
-			result = 0;
-		}
-
-		if (goodsStock.getMaxOrdQty() < result) {
-			result = goodsStock.getMaxOrdQty();
-		}
-
-		return result;
-	}
-
-	/**
-	 * 상품  공지 목록
-	 * @param goods
-	 * @return
-	 * @author eskim
-	 * @since 2021. 03. 07
-	 */
-	public Collection<Notice> getGoodsNoticeList(Goods goods) {
-		return goodsDao.getGoodsNoticeList(goods);
-	}
-	
-	/**
-	 * 상세용 컨텐츠 목록
-	 * @param goodsContents
-	 * @return
-	 * @author eskim
-	 * @since 2021. 07. 14
-	 */
-	public Collection<GoodsContents> getGoodsContentsList(GoodsContents goodsContents) {
-		return goodsDao.getGoodsContentsList(goodsContents);
-	}
-	
-	
-
-	/**
-	 * 상품  안전인증 정보
-	 * @param goods
-	 * @return
-	 * @author eskim
-	 * @since 2021. 03. 07
-	 */
-	public GoodsSafeNo getGoodsSafeNo(Goods goods) {
-		return goodsDao.getGoodsSafeNo(goods);
-	}
-
-	/**
-	 * 상품  배송안내정보
-	 * @param goodsCd
-	 * @return
-	 * @author eskim
-	 * @since 2021. 03. 08
-	 */
-	public Delivery getGoodsDeliveryInfo(String goodsCd) {
-		return goodsDao.getGoodsDeliveryInfo(goodsCd);
-	}
-
-	/**
-	 * 상품 다다익선 목록
-	 * @param goods
-	 * @return
-	 * @author eskim
-	 * @date 2021. 3. 8
-	 */
-	public Collection<Goods> getTmtbGoodsList(Goods goods) {
-		Integer[] arrTmtbSq = goods.getArrTmtbSq();		// 장바구니 다다익선 추천상품 적용을 위해 백업.
-		goods.setArrTmtbSq(null);		// 배열 사용하여 진행시에 IN절에 걸려 query timeout 걸려 null처리
-		Collection<Goods> result = new ArrayList<Goods>();
-
-		Collection<Tmtb> tmtbSqList = goodsDao.getTmtbSqList(goods);
-		if (tmtbSqList == null || tmtbSqList.isEmpty()) {
-			return result;
-		}
-		//log.info("[tmtbSqList]={}",tmtbSqList);
-		//log.info("[goods]={}",goods);
-		int rCount = 0;	//다다익선 조회수
-		int tCount = goods.getMaxRownum();	//리턴 잔여수
-		if (tCount == 0) {
-			tCount = 20;
-		}
-
-		// 상품상세 다다익선 조회 쿼리
-		if(arrTmtbSq == null || arrTmtbSq.length < 1) {
-			for (Tmtb tmtb : tmtbSqList) {
-				goods.setTmtbSq(tmtb.getTmtbSq());
-				Collection<Goods> tmtbGoodsList = goodsDao.getTmtbGoodsList(goods);
-				if (tmtbGoodsList == null || tmtbGoodsList.isEmpty()) {
-					continue;
-				}
-
-				if (tCount <= 0) { //잔여수가 없으면 종료
-					break;
-				}
-
-				//다다익선 조회 상품 수
-				rCount = tmtbGoodsList.size();
-
-				if (tCount > rCount) { 	//조회수보다 잔여수가 클경우
-					result.addAll(tmtbGoodsList);
-					tCount = tCount - rCount; //남은 잔여수 계산
-				} else {
-					if (tCount == rCount) {	//잔여 수량과 조회수가 같은면 종료
-						result.addAll(tmtbGoodsList);
-						break;
-					} else {
-
-						for (int i = 0; i < tCount; i++) {  //잔여수량만큼 loop
-							int tmtbGoodsListCnt = 0;
-							for (Goods tmtbGoods : tmtbGoodsList) {
-								if (i == tmtbGoodsListCnt) {
-									result.add(tmtbGoods);
-									tCount--;
-									break;
-								}
-								tmtbGoodsListCnt++;
-							}
-						}
-					}
-
-				}
-			}
-		} else {		// 장바구니 다다익선 팝업 조회 쿼리
-			for (int tmtb : arrTmtbSq) {
-				if(tmtb > 0) {
-					goods.setTmtbSq(tmtb);
-					Collection<Goods> tmtbGoodsList = goodsDao.getTmtbGoodsList(goods);
-					if (tmtbGoodsList == null || tmtbGoodsList.isEmpty()) {
-						continue;
-					}
-
-					if (tCount <= 0) { //잔여수가 없으면 종료
-						break;
-					}
-
-					//다다익선 조회 상품 수
-					rCount = tmtbGoodsList.size();
-
-					if (tCount > rCount) { 	//조회수보다 잔여수가 클경우
-						result.addAll(tmtbGoodsList);
-						tCount = tCount - rCount; //남은 잔여수 계산
-					} else {
-						if (tCount == rCount) {	//잔여 수량과 조회수가 같은면 종료
-							result.addAll(tmtbGoodsList);
-							break;
-						} else {
-
-							for (int i = 0; i < tCount; i++) {  //잔여수량만큼 loop
-								int tmtbGoodsListCnt = 0;
-								for (Goods tmtbGoods : tmtbGoodsList) {
-									if (i == tmtbGoodsListCnt) {
-										result.add(tmtbGoods);
-										tCount--;
-										break;
-									}
-									tmtbGoodsListCnt++;
-								}
-							}
-						}
-
-					}
-				}
-			}
-		}
-
-		return result;
-	}
-
-	/**
-	 * 상품 추천상품 목록
-	 * @param goods
-	 * @return
-	 * @author eskim
-	 * @date 2021. 3. 8
-	 */
-	public Collection<Goods> getRecommendGoodsList(Goods goods) {
-		return goodsDao.getRecommendGoodsList(goods);
-	}
-
-	/**
-	 * 재입고 알림 미 알림 조회
-	 * @param goods
-	 * @return
-	 * @author eskim
-	 * @date 2021. 3. 10
-	 */
-	public ReinboundInform getNotReinboundInform(ReinboundInform reinboundInform) {
-		return goodsDao.getNotReinboundInform(reinboundInform);
-	}
-
-	/**
-	 * 재입고알림 생성
-	 * @param goods
-	 * @return
-	 * @author eskim
-	 * @date 2021. 3. 10
-	 */
-	@Transactional("shopTxnManager")
-	public void createReinboundInform(ReinboundInform reinboundInform) {
-		goodsDao.createReinboundInform(reinboundInform);
-	}
-
-	/**
-	 * 재입고알림 수정
-	 * @param goods
-	 * @return
-	 * @author eskim
-	 * @date 2021. 3. 10
-	 */
-	@Transactional("shopTxnManager")
-	public void updateReinboundInform(ReinboundInform reinboundInform) {
-		goodsDao.updateReinboundInform(reinboundInform);
-	}
-
-	/**
-	 * 재입고 알림 신청 저장
-	 *
-	 * @param reinboundInform
-	 * @return void
-	 * @author eskim
-	 * @since 2021. 03. 17
-	 */
-	@Transactional("shopTxnManager")
-	public void saveGoodsInstockAlarmForm(ReinboundInform reinboundInform) {
-
-		if (!TsfSession.isLogin()) {
-			throw new IllegalStateException("로그인을 해야합니다.");
-		}
-
-		reinboundInform.setCustNo(TsfSession.getInfo().getCustNo());
-		reinboundInform.setRegNo(TsfSession.getInfo().getCustNo());
-		reinboundInform.setUpdNo(TsfSession.getInfo().getCustNo());
-
-		// 미알림 조회
-		ReinboundInform tmpReinboundInform = goodsDao.getNotReinboundInform(reinboundInform);
-
-		if (tmpReinboundInform == null || tmpReinboundInform.getRinbdInfoSq() <= 0) {
-			goodsDao.createReinboundInform(reinboundInform);
-		} else {
-			reinboundInform.setRinbdInfoSq(tmpReinboundInform.getRinbdInfoSq());
-			goodsDao.updateReinboundInform(reinboundInform);
-		}
-
-	}
-
-	/**
-	 * 실측사이즈 조회
-	 *
-	 * @param goods
-	 * @return
-	 * @author eskim
-	 * @date 2021. 3. 10
-	 */
-	public Collection<Measurement> getMeasurementList(Goods goods) {
-
-		return goodsDao.getMeasurementList(goods);
-	}
-
-	/**
-	 * 실측사이즈 조회
-	 *
-	 * @param goods
-	 * @return
-	 * @author eskim
-	 * @date 2021. 3. 10
-	 */
-	public Collection<MeasurementStyle> getMeasurementListNew(Goods goods) {
-		GagaMap result = new GagaMap();
-		// 행, 열 변환
-		Collection<Measurement> measurementList = goodsDao.getMeasurementList(goods);
-		Collection<MeasurementStyle> measurementStyleList = new ArrayList<MeasurementStyle>();
-
-		if (measurementList == null || measurementList.isEmpty()) {
-			return measurementStyleList;
-		}
-
-		int colSize = measurementList.size(); 	// 열 column
-		int rowSize = 5; // 상의하위포함 최대사이즈
-
-		String[][] arrMeasurementList = new String[rowSize + 1][colSize + 1];
-
-		// 사이즈 설정
-		int yIndex = 0;
-		for (Measurement measurement : measurementList) {
-			arrMeasurementList[0][0] = measurement.getTypecd();
-			yIndex++;
-			arrMeasurementList[0][yIndex] = measurement.getOptCd2();
-
-			// 부위명 설정
-			arrMeasurementList[1][0] = measurement.getTypecd();
-			arrMeasurementList[2][0] = measurement.getTypecd();
-			arrMeasurementList[3][0] = measurement.getTypecd();
-			arrMeasurementList[4][0] = measurement.getTypecd();
-			arrMeasurementList[5][0] = measurement.getTypecd();
-			arrMeasurementList[1][yIndex] = String.valueOf(measurement.getValue1());
-			arrMeasurementList[2][yIndex] = String.valueOf(measurement.getValue2());
-			arrMeasurementList[3][yIndex] = String.valueOf(measurement.getValue3());
-			arrMeasurementList[4][yIndex] = String.valueOf(measurement.getValue4());
-			arrMeasurementList[5][yIndex] = String.valueOf(measurement.getValue5());
-
-//			 arrMeasurementList = [[하의, 100, 110, 120, 130, 140, 150],
-//			                       [하의, 42.0, 44.0, 46.0, 48.0, 52.0, 54.0],
-//			                       [하의, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
-//			                       [하의, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
-//			                       [하의, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
-//			                       [하의, 51.0, 60.0, 65.0, 75.0, 79.0, 87.0]]
-//			                    	   
-		}
-
-		for (int i = 0; i < 6; i++) {
-			MeasurementStyle measurementStyle = new MeasurementStyle();
-			measurementStyle.setGoodsCd(goods.getGoodsCd());
-			measurementStyle.setSizeCount(colSize);
-
-			//log.info("arrMeasurementList[0].length = {}", arrMeasurementList[0].length);
-			for (int j = 0; j < arrMeasurementList[0].length; j++) {
-				switch (j) {
-					case 0:
-						measurementStyle.setTypecd(arrMeasurementList[i][j]);
-						break;
-					case 1:
-						measurementStyle.setSize1(arrMeasurementList[i][j]);
-						break;
-					case 2:
-						measurementStyle.setSize2(arrMeasurementList[i][j]);
-						break;
-					case 3:
-						measurementStyle.setSize3(arrMeasurementList[i][j]);
-						break;
-					case 4:
-						measurementStyle.setSize4(arrMeasurementList[i][j]);
-						break;
-					case 5:
-						measurementStyle.setSize5(arrMeasurementList[i][j]);
-						break;
-					case 6:
-						measurementStyle.setSize6(arrMeasurementList[i][j]);
-						break;
-					case 7:
-						measurementStyle.setSize7(arrMeasurementList[i][j]);
-						break;
-					case 8:
-						measurementStyle.setSize8(arrMeasurementList[i][j]);
-						break;
-					case 9:
-						measurementStyle.setSize9(arrMeasurementList[i][j]);
-						break;
-					case 10:
-						measurementStyle.setSize10(arrMeasurementList[i][j]);
-						break;
-					case 11:
-						measurementStyle.setSize11(arrMeasurementList[i][j]);
-						break;
-					case 12:
-						measurementStyle.setSize12(arrMeasurementList[i][j]);
-						break;
-					case 13:
-						measurementStyle.setSize13(arrMeasurementList[i][j]);
-						break;
-					case 14:
-						measurementStyle.setSize14(arrMeasurementList[i][j]);
-						break;
-					case 15:
-						measurementStyle.setSize15(arrMeasurementList[i][j]);
-						break;
-					case 16:
-						measurementStyle.setSize16(arrMeasurementList[i][j]);
-						break;
-					case 17:
-						measurementStyle.setSize17(arrMeasurementList[i][j]);
-						break;
-					case 18:
-						measurementStyle.setSize18(arrMeasurementList[i][j]);
-						break;
-					case 19:
-						measurementStyle.setSize19(arrMeasurementList[i][j]);
-						break;
-					case 20:
-						measurementStyle.setSize20(arrMeasurementList[i][j]);
-						break;
-				}
-			}
-			measurementStyleList.add(measurementStyle);
-		}
-
-		//log.info("measurementStyleList = {}", measurementStyleList);
-
-		return measurementStyleList;
-	}
-
-	/**
-	 * 사이즈 정보 조회
-	 *
-	 * @param sizeInfo
-	 * @return
-	 * @author eskim
-	 * @date 2021. 3. 10
-	 */
-	public Collection<SizeInfo> getSizeInfoList(SizeInfo sizeInfo) {
-		return goodsDao.getSizeInfoList(sizeInfo);
-	}
-
-	/**
-	 * 상품 쿠폰 다운 처리
-	 *
-	 * @param coupon
-	 * @return int
-	 * @author eskim
-	 * @since 2021.03.15
-	 */
-	@Transactional("shopTxnManager")
-	public String createGoodsCoupon(Goods goods) {
-		return couponService.createGoodsCoupon(goods);
-	}
-
-	/**
-	 * 세트상품 구성상품정보 조회
-	 *
-	 * @param
-	 * @return
-	 * @author eskim
-	 * @since 2021. 3. 21
-	 */
-	public Collection<GoodsCompose> getGoodsSetComposeList(Goods goods) {
-		Collection<GoodsCompose> getGoodsSetComposeList = goodsDao.getGoodsSetComposeList(goods);
-		for (GoodsCompose goodsCompose : getGoodsSetComposeList) {
-			Goods tmpGoods = new Goods();
-			tmpGoods.setGoodsCd(goodsCompose.getCompsGoodsCd());
-			tmpGoods.setSupplyCompCd(goods.getSupplyCompCd());
-			tmpGoods.setFrontGb(goods.getFrontGb());
-			tmpGoods.setIsApp(goods.getIsApp());
-			tmpGoods.setSiteCd(goods.getSiteCd());
-			tmpGoods.setCustGb(goods.getCustGb());
-			tmpGoods.setCustNo(goods.getCustNo());
-
-			// 상품상세
-			Goods resultGoods = this.getGoodsDesc(tmpGoods);
-			if (resultGoods != null) {
-//				goodsCompose.setGoodsTitle(resultGoods.getGoodsTitle());
-//				goodsCompose.setGoodsTitleDesc(resultGoods.getGoodsTitleDesc());
-//				goodsCompose.setGoodsSpecialDesc(resultGoods.getGoodsSpecialDesc());
-//				goodsCompose.setGoodsTopDesc(resultGoods.getGoodsTopDesc());
-//				goodsCompose.setGoodsDownDesc(resultGoods.getGoodsDownDesc());
-				goodsCompose.setGoodsDesc(resultGoods.getGoodsDesc());
-			}
-
-			// 상품 옵션1(색상) 정보
-			goodsCompose.setGoodsOption1List(goodsDao.getGoodsOption1List(tmpGoods));
-			// 상품 옵션2(사이즈) 정보
-			//goodsExtend.setGoodsOption2List(goodsDao.getGoodsOption2List(tmpGoods));
-			// 고시 정보
-			goodsCompose.setGoodsNotiList(goodsDao.getGoodsNotiList(tmpGoods));
-			// 이미지 정보
-			goodsCompose.setGoodsImgList(goodsDao.getGoodsImgList(tmpGoods));
-			// 상품 안전인증 정보
-			goodsCompose.setGoodsSafeNo(goodsDao.getGoodsSafeNo(tmpGoods));
-
-		}
-		return getGoodsSetComposeList;
-	}
-
-	/**
-	 * 상품의 다다익선 목록 
-	 * @param goods
-	 * @return
-	 * @author eskim
-	 * @date 2021. 4. 11
-	 */
-	public Collection<Tmtb> getTmtbList(Goods goods) {
-		return goodsDao.getTmtbList(goods);
-	}
-
-	/**
-	 * 상품의 다다익선 목록 
-	 * @param goods
-	 * @return
-	 * @author eskim
-	 * @date 2021. 4. 13
-	 */
-	public Collection<Freegift> getFreeGoodsList(Goods goods) {
-		return goodsDao.getFreeGoodsList(goods);
-	}
-
-	/**
-	 * 컨텐츠카테고리상품 목록(메인용)
-	 * @param cate - 카테고리 정보
-	 * @return
-	 * @author gagamel
-	 * @since 2021. 3. 25
-	 */
-	public Collection<Goods> getContentsCategoryGoodsListMain(Cate4Srch cate) {
-		cate.setSiteCd(TscConstants.Site.STYLE24.value());
-		cate.setFrontGb(TsfSession.getFrontGb());
-		cate.setCustGb(TsfSession.getCustGb());
-		cate.setCustNo(TsfSession.isLogin() ? TsfSession.getInfo().getCustNo() : 0);
-
-		Collection<Goods> goodsList = new ArrayList<>();
-
-		if (cate.getContentsLoc().equals("SCM002") || cate.getContentsLoc().equals("SBM007") || cate.getContentsLoc().equals("SMM003") || cate.getContentsLoc().equals("SBM003") || cate.getContentsLoc().equals("SBMM007")) { // 신상품인 경우
-			int maxRow = 20;
-			if (cate.getContentsLoc().equals("SBM003")) {
-				maxRow = 3;
-			}
-
-			goodsList = goodsDao.getContentsCategoryGoodsListMain(cate);
-
-			// 조회된 데이터가 없거나 건수가 20개 미만이면 신규상품(=정상상품) 조회
-			if (goodsList == null || goodsList.size() < maxRow) {
-				if (goodsList != null) {
-					// 제외상품 설정
-					StringBuilder sb = new StringBuilder();
-					for (Goods goods : goodsList) {
-						sb.append(goods.getGoodsCd()).append(",");
-					}
-					if (sb != null && !sb.toString().equals("")) {
-						cate.setExceptGoodsArr(sb.toString().substring(0, sb.toString().length() - 1).split(","));
-					}
-				}
-				maxRow = maxRow - goodsList.size();
-				cate.setMaxRow(maxRow);
-				cate.setCateGb("G032_101");
-				if (cate.getContentsLoc().equals("SMM003") || cate.getContentsLoc().equals("SBM003") || cate.getContentsLoc().equals("SBM007")) {
-					cate.setCate1No(null);
-				}
-
-				if (cate.getContentsLoc().equals("SCM002")) {
-					goodsList.addAll(goodsDao.getCategoryMainNewGoodsList(cate));
-				} else {
-					goodsList.addAll(goodsDao.getContentsCategoryNewGoodsList(cate));
-				}
-			}
-		} else if (cate.getContentsLoc().equals("SCM003") || cate.getContentsLoc().equals("SBM008") || cate.getContentsLoc().equals("SBM009") || cate.getContentsLoc().equals("SOM003") || cate.getContentsLoc().equals("SOM002")) { // 베스트상품인 경우
-			// TODO: 추천솔루션
-			int dispCnt = cate.getMaxRow();
-
-			goodsList = goodsDao.getContentsCategoryGoodsListMain(cate);
-			// 수동설정 데이터 없거나 노출갯수보다 작으면 추천솔루션 데이터 표출
-			if(dispCnt > goodsList.size()){
-				int cnt = 0;
-				cnt = dispCnt - goodsList.size();
-
-				// TODO : 추천솔루션
-				Collection<Eigeneai.Result> itemList = new ArrayList<>();
-				if(cate.getContentsLoc().equals("SCM003")){
-					itemList = eigeneaiApi.getCategoryWeeklySellBestGoodsList(cnt, cate.getCate1No(), TsfSession.getFrontGb());
-				}else if(cate.getContentsLoc().equals("SBM008")){
-					itemList = eigeneaiApi.getBrandWeeklySellBestGoodsList(cnt, cate.getBrandGroupNo(), TsfSession.getFrontGb());
-				}else if(cate.getContentsLoc().equals("SBM009")){
-					itemList = eigeneaiApi.getBrandMonthlyClickBestGoodsList(cnt, cate.getBrandGroupNo(), TsfSession.getFrontGb());
-				}else if(cate.getContentsLoc().equals("SOM002")){
-					itemList = eigeneaiApi.getOutletMonthlyClickBestGoodsList(cnt, TsfSession.getFrontGb());
-				}else{
-					// SOM003 아울렛 베스트
-					itemList = eigeneaiApi.getOutletWeeklySellBestGoodsList(cnt, TsfSession.getFrontGb());
-				}
-
-				for(Eigeneai.Result tempData: itemList){
-					Goods tempBest = new Goods();
-					tempBest.setBrandGroupNm(tempData.getProduct().getBrandName());
-					tempBest.setGoodsCd(tempData.getProduct().getItemId());
-					tempBest.setGoodsFullNm(tempData.getProduct().getItemName());
-					tempBest.setListPrice((int) tempData.getProduct().getOriginalPrice());
-					tempBest.setCurrPrice((int) tempData.getProduct().getSalePrice());
-					tempBest.setSysImgNm(tempData.getProduct().getItemImage());
-					tempBest.setItemUrl(tempData.getProduct().getItemUrl());
-					goodsList.add(tempBest);
-				}
-			}
-
-			for (Goods temp : goodsList) {
-				if (temp.getSizes() != null) {
-					temp.setSizeArr(temp.getSizes().split(","));
-				}
-				if (temp.getColorChips() != null) {
-					temp.setColorArr(temp.getColorChips().split(","));
-				}
-				if (temp.getIcon() != null) {
-					temp.setBenefitArr(temp.getIcon().split(","));
-				}
-			}
-		} else if (cate.getContentsLoc().equals("SBM013") || cate.getContentsLoc().equals("SBMM013")) {
-			GoodsSearch goodsSearch = new GoodsSearch();
-			goodsSearch.setSiteCd(TscConstants.Site.STYLE24.value());
-			goodsSearch.setCateGb("G032_101");
-			goodsSearch.setFrontGb(TsfSession.getFrontGb());
-			goodsSearch.setFormalGb(cate.getFormalGb());
-			goodsSearch.setCustGb(cate.getCustGb());
-			goodsSearch.setCustNo(cate.getCustNo());
-			goodsSearch.setBrandGroupNo(cate.getBrandGroupNo());
-			goodsSearch.setMaxRow(cate.getMaxRow());
-			goodsList = goodsDao.getBrandNewGoodsList(goodsSearch);
-
-			for (Goods temp : goodsList) {
-				if (temp.getSizes() != null) {
-					temp.setSizeArr(temp.getSizes().split(","));
-				}
-				if (temp.getColorChips() != null) {
-					temp.setColorArr(temp.getColorChips().split(","));
-				}
-				if (temp.getBenefits() != null) {
-					temp.setBenefitArr(temp.getBenefits().split(","));
-				}
-			}
-		} else {
-			goodsList = goodsDao.getContentsCategoryGoodsListMain(cate);
-		}
-
-		return goodsList;
-	}
-	
-	/**
-	 * 컨텐츠카테고리상품 목록
-	 * @param cate - 카테고리 정보
-	 * @return
-	 * @author jmh
-	 * @since 2021. 8. 13
-	 */
-	public Collection<Goods> getContentsCategoryGoodsList(Cate4Srch cate) {
-		cate.setSiteCd(TscConstants.Site.STYLE24.value());
-		cate.setFrontGb(TsfSession.getFrontGb());
-		cate.setCustGb(TsfSession.getCustGb());
-		cate.setCustNo(TsfSession.isLogin() ? TsfSession.getInfo().getCustNo() : 0);
-
-		Collection<Goods> goodsList = new ArrayList<>();
-
-		if (cate.getContentsLoc().equals("SCM002") || cate.getContentsLoc().equals("SBM007") || cate.getContentsLoc().equals("SMM003") || cate.getContentsLoc().equals("SBM003") || cate.getContentsLoc().equals("SBMM007")) { // 신상품인 경우
-			int maxRow = 20;
-			if (cate.getContentsLoc().equals("SBM003")) {
-				maxRow = 3;
-			}
-
-			goodsList = goodsDao.getContentsCategoryGoodsList(cate);
-
-			// 조회된 데이터가 없거나 건수가 20개 미만이면 신규상품(=정상상품) 조회
-			if (goodsList == null || goodsList.size() < maxRow) {
-				if (goodsList != null) {
-					// 제외상품 설정
-					StringBuilder sb = new StringBuilder();
-					for (Goods goods : goodsList) {
-						sb.append(goods.getGoodsCd()).append(",");
-					}
-					if (sb != null && !sb.toString().equals("")) {
-						cate.setExceptGoodsArr(sb.toString().substring(0, sb.toString().length() - 1).split(","));
-					}
-				}
-				maxRow = maxRow - goodsList.size();
-				cate.setMaxRow(maxRow);
-				cate.setCateGb("G032_101");
-				if (cate.getContentsLoc().equals("SMM003") || cate.getContentsLoc().equals("SBM003") || cate.getContentsLoc().equals("SBM007")) {
-					cate.setCate1No(null);
-				}
-
-				if (cate.getContentsLoc().equals("SCM002")) {
-					goodsList.addAll(goodsDao.getCategoryMainNewGoodsList(cate));
-				} else {
-					goodsList.addAll(goodsDao.getContentsCategoryNewGoodsList(cate));
-				}
-			}
-		} else if (cate.getContentsLoc().equals("SCM003") || cate.getContentsLoc().equals("SBM008") || cate.getContentsLoc().equals("SBM009") || cate.getContentsLoc().equals("SOM003") || cate.getContentsLoc().equals("SOM002")) { // 베스트상품인 경우
-			// TODO: 추천솔루션
-			int dispCnt = cate.getMaxRow();
-
-			goodsList = goodsDao.getContentsCategoryGoodsList(cate);
-			// 수동설정 데이터 없거나 노출갯수보다 작으면 추천솔루션 데이터 표출
-			if(dispCnt > goodsList.size()){
-				int cnt = 0;
-				cnt = dispCnt - goodsList.size();
-
-				// TODO : 추천솔루션
-				Collection<Eigeneai.Result> itemList = new ArrayList<>();
-				if(cate.getContentsLoc().equals("SCM003")){
-					itemList = eigeneaiApi.getCategoryWeeklySellBestGoodsList(cnt, cate.getCate1No(), TsfSession.getFrontGb());
-				}else if(cate.getContentsLoc().equals("SBM008")){
-					itemList = eigeneaiApi.getBrandWeeklySellBestGoodsList(cnt, cate.getBrandGroupNo(), TsfSession.getFrontGb());
-				}else if(cate.getContentsLoc().equals("SBM009")){
-					itemList = eigeneaiApi.getBrandMonthlyClickBestGoodsList(cnt, cate.getBrandGroupNo(), TsfSession.getFrontGb());
-				}else if(cate.getContentsLoc().equals("SOM002")){
-					itemList = eigeneaiApi.getOutletMonthlyClickBestGoodsList(cnt, TsfSession.getFrontGb());
-				}else{
-					// SOM003 아울렛 베스트
-					itemList = eigeneaiApi.getOutletWeeklySellBestGoodsList(cnt, TsfSession.getFrontGb());
-				}
-
-				for(Eigeneai.Result tempData: itemList){
-					Goods tempBest = new Goods();
-					tempBest.setBrandGroupNm(tempData.getProduct().getBrandName());
-					tempBest.setGoodsCd(tempData.getProduct().getItemId());
-					tempBest.setGoodsFullNm(tempData.getProduct().getItemName());
-					tempBest.setListPrice((int) tempData.getProduct().getOriginalPrice());
-					tempBest.setCurrPrice((int) tempData.getProduct().getSalePrice());
-					tempBest.setSysImgNm(tempData.getProduct().getItemImage());
-					tempBest.setItemUrl(tempData.getProduct().getItemUrl());
-					goodsList.add(tempBest);
-				}
-			}
-
-			for (Goods temp : goodsList) {
-				if (temp.getSizes() != null) {
-					temp.setSizeArr(temp.getSizes().split(","));
-				}
-				if (temp.getColorChips() != null) {
-					temp.setColorArr(temp.getColorChips().split(","));
-				}
-				if (temp.getIcon() != null) {
-					temp.setBenefitArr(temp.getIcon().split(","));
-				}
-			}
-		} else if (cate.getContentsLoc().equals("SBM013") || cate.getContentsLoc().equals("SBMM013")) {
-			GoodsSearch goodsSearch = new GoodsSearch();
-			goodsSearch.setSiteCd(TscConstants.Site.STYLE24.value());
-			goodsSearch.setCateGb("G032_101");
-			goodsSearch.setFrontGb(TsfSession.getFrontGb());
-			goodsSearch.setFormalGb(cate.getFormalGb());
-			goodsSearch.setCustGb(cate.getCustGb());
-			goodsSearch.setCustNo(cate.getCustNo());
-			goodsSearch.setBrandGroupNo(cate.getBrandGroupNo());
-			goodsSearch.setMaxRow(cate.getMaxRow());
-			goodsList = goodsDao.getBrandNewGoodsList(goodsSearch);
-
-			for (Goods temp : goodsList) {
-				if (temp.getSizes() != null) {
-					temp.setSizeArr(temp.getSizes().split(","));
-				}
-				if (temp.getColorChips() != null) {
-					temp.setColorArr(temp.getColorChips().split(","));
-				}
-				if (temp.getBenefits() != null) {
-					temp.setBenefitArr(temp.getBenefits().split(","));
-				}
-			}
-		} else {
-			goodsList = goodsDao.getContentsCategoryGoodsList(cate);
-		}
-
-		return goodsList;
-	}
-
-	/**
-	 * ep쿠폰 다운 처리
-	 *
-	 * @param coupon
-	 * @return int
-	 * @author eskim
-	 * @since 2021.04.15
-	 */
-	@Transactional("shopTxnManager")
-	public String createEpCoupon(Goods goods) {
-		return couponService.createEpCoupon(goods);
-	}
-
-	/**
-	 * 카테고리별 상품수
-	 * @param params - 검색엔진 정보
-	 * @return
-	 * @author bin2107
-	 * @date 2021. 4. 7
-	 */
-	public int getCategoryGoodsCount(SearchEngine params) {
-		return goodsDao.getCategoryGoodsCount(params);
-	}
-
-	/**
-	 * 카테고리별 상품 목록
-	 * @param params - 검색엔진 정보
-	 * @return
-	 * @author bin2107
-	 * @date 2021. 4. 8
-	 */
-	public Collection<SearchEngine> getCategoryGoodsList(SearchEngine params) {
-		return goodsDao.getCategoryGoodsList(params);
-	}
-
-	/**
-	 * 검색상품 총건수
-	 * @param params - 검색엔진 정보
-	 * @return
-	 * @author gagamel
-	 * @date 2021. 5. 6
-	 */
-	public int getSearchGoodsCount(SearchEngine params) {
-		return goodsDao.getSearchGoodsCount(params);
-	}
-
-	/**
-	 * 검색상품 목록
-	 * @param params - 검색엔진 정보
-	 * @return
-	 * @author gagamel
-	 * @date 2021. 5. 6
-	 */
-	public Collection<SearchEngine> getSearchGoodsList(SearchEngine params) {
-		return goodsDao.getSearchGoodsList(params);
-	}
-	
-	
-	/**
-	 * 상품 다른 색상의 productno 찾기
-	 * @param goods - 상품정보
-	 * @return
-	 * @author eskim
-	 * @date 2021. 7. 28
-	 */
-	public Collection<GoodsStock> getProductNoByGoodsColor(Goods goods) {
-		return goodsDao.getProductNoByGoodsColor(goods);
-	}
-
-}
+package com.style24.front.biz.service;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.style24.core.support.env.TscConstants;
+import com.style24.front.biz.dao.TsfDisplayDao;
+import com.style24.front.biz.dao.TsfGoodsDao;
+import com.style24.front.biz.thirdparty.EigeneaiApi;
+import com.style24.front.support.security.session.TsfSession;
+import com.style24.persistence.domain.CardPromotion;
+import com.style24.persistence.domain.Cate4Srch;
+import com.style24.persistence.domain.Delivery;
+import com.style24.persistence.domain.Freegift;
+import com.style24.persistence.domain.Goods;
+import com.style24.persistence.domain.GoodsCompose;
+import com.style24.persistence.domain.GoodsContents;
+import com.style24.persistence.domain.GoodsDesc;
+import com.style24.persistence.domain.GoodsImg;
+import com.style24.persistence.domain.GoodsNotiInfo;
+import com.style24.persistence.domain.GoodsSafeNo;
+import com.style24.persistence.domain.GoodsSearch;
+import com.style24.persistence.domain.GoodsStock;
+import com.style24.persistence.domain.GoodsVideo;
+import com.style24.persistence.domain.GoodsViewHst;
+import com.style24.persistence.domain.Measurement;
+import com.style24.persistence.domain.MeasurementStyle;
+import com.style24.persistence.domain.Notice;
+import com.style24.persistence.domain.ReinboundInform;
+import com.style24.persistence.domain.SizeInfo;
+import com.style24.persistence.domain.Tmtb;
+import com.style24.persistence.domain.eigene.Eigeneai;
+import com.style24.persistence.domain.searchengine.SearchEngine;
+
+import lombok.extern.slf4j.Slf4j;
+
+import com.gagaframework.web.parameter.GagaMap;
+
+/**
+ * 상품 Service
+ *
+ * @author gagamel
+ * @since 2020. 12. 29
+ */
+@Service
+@Slf4j
+public class TsfGoodsService {
+
+	@Autowired
+	private TsfGoodsDao goodsDao;
+
+	@Autowired
+	private TsfCouponService couponService;
+
+	@Autowired
+	private TsfDisplayDao displayDao;
+
+	@Autowired
+	private ObjectMapper mapper;
+
+	@Autowired
+	private EigeneaiApi eigeneaiApi;
+
+	/**
+	 * 상품뷰이력 생성
+	 *
+	 * @param goodsCd - 상품코드
+	 * @param ithrCd - 유입코드
+	 * @return
+	 * @author eskim
+	 * @since 2021. 2. 09
+	 */
+	@Transactional("shopTxnManager")
+	public void createGoodsViewHst(String goodsCd, String ithrCd) {
+		// 상품뷰이력 생성
+		GoodsViewHst goodsViewHst = new GoodsViewHst();
+		goodsViewHst.setGoodsCd(goodsCd);
+		goodsViewHst.setJsessionId(TsfSession.getSessionId());
+		goodsViewHst.setSiteCd(TscConstants.Site.STYLE24.value());
+		goodsViewHst.setFrontGb(TsfSession.getFrontGb());
+		goodsViewHst.setAfLinkCd(ithrCd);
+		String referer = TsfSession.getHttpServletRequest().getHeader("Referer");
+		if (StringUtils.isNotBlank(referer)) {
+			byte[] referBytes = referer.getBytes();
+			if (referBytes.length > 1000) {
+				goodsViewHst.setReferer(new String(referBytes, 0, 1000));
+			} else {
+				goodsViewHst.setReferer(referer);
+			}
+		}
+
+		if (TsfSession.getInfo() != null) {
+			goodsViewHst.setCustNo(TsfSession.getInfo().getCustNo());
+		}
+
+		goodsDao.createGoodsViewHst(goodsViewHst);
+	}
+
+	/**
+	 * 상품 네비게이션 조회
+	 * @param goods
+	 * @return
+	 * @author eskim
+	 * @since 2021. 02. 09
+	 */
+	public Cate4Srch getGoodsNavigation(Goods goods) {
+		return goodsDao.getGoodsNavigation(goods);
+	}
+
+	/**
+	 * 상품 정보 조회
+	 * @param goods
+	 * @return
+	 * @author eskim
+	 * @since 2021. 01. 28
+	 */
+	public Goods getGoodsInfo(Goods goods) {
+		return goodsDao.getGoodsInfo(goods);
+	}
+
+	/**
+	 * 상품 DESC 조회
+	 *
+	 * @param resultGoods
+	 * @return
+	 * @author eskim
+	 * @since 2021. 2. 17
+	 */
+	public Goods getGoodsDesc(Goods resultGoods) {
+
+		GoodsDesc goods = new GoodsDesc();
+		goods.setGoodsCd(resultGoods.getGoodsCd());
+
+		//상품상세 구분(10:상품타이틀,20:상품타이틀내용,30:상품특징,40:상위컨텐츠,50:하위컨텐츠,60:상위컨텐츠-모바일,70:하위컨텐츠-모바일,80:상품상세(as-is,입점))
+
+		// 상품타이틀
+		goods.setDescGb("10");
+		String goodsTitle = this.getGoodsDescList(goods);
+		resultGoods.setGoodsTitle(goodsTitle);
+		// 상품타이틀내용
+		goods.setDescGb("20");
+		String goodsTitleDesc = this.getGoodsDescList(goods);
+		resultGoods.setGoodsTitleDesc(goodsTitleDesc);
+		// 상품특징
+		goods.setDescGb("30");
+		String goodsSpecialDesc = this.getGoodsDescList(goods);
+		resultGoods.setGoodsSpecialDesc(goodsSpecialDesc);
+
+		if ("P".equals(TsfSession.getFrontGb())) {
+			// 상품 상세 pc 상단
+			goods.setDescGb("40");
+			String goodsPcTopDesc = this.getGoodsDescList(goods);
+			resultGoods.setGoodsTopDesc(goodsPcTopDesc);
+
+			// 상품 상세 pc 하단
+			goods.setDescGb("50");
+			String goodsPcDownDesc = this.getGoodsDescList(goods);
+			resultGoods.setGoodsDownDesc(goodsPcDownDesc);
+
+		} else {
+			// 상품 상세 mobile 상단
+			goods.setDescGb("60");
+			String goodsMobileTopDesc = this.getGoodsDescList(goods);
+			resultGoods.setGoodsTopDesc(goodsMobileTopDesc);
+
+			// 상품 상세 mpbile 하단
+			goods.setDescGb("70");
+			String goodsMobileDownDesc = this.getGoodsDescList(goods);
+			resultGoods.setGoodsDownDesc(goodsMobileDownDesc);
+		}
+
+		// 상품특징
+		goods.setDescGb("80");
+		String goodsDesc = this.getGoodsDescList(goods);
+		resultGoods.setGoodsDesc(goodsDesc);
+
+		return resultGoods;
+	}
+
+	/**
+	 * 상품 상세 정보 조회
+	 *
+	 * @param goods
+	 * @return
+	 * @author eskim
+	 * @since 2021. 2. 17
+	 */
+	private String getGoodsDescList(GoodsDesc goods) {
+		Collection<GoodsDesc> goodsDescList = goodsDao.getGoodsDescList(goods);
+		StringBuilder goodsDesc = new StringBuilder();
+		if (goodsDescList != null && !goodsDescList.isEmpty()) {
+			for (GoodsDesc tmpGoodsDesc : goodsDescList) {
+				goodsDesc.append(tmpGoodsDesc.getGoodsDesc());
+			}
+		}
+		return goodsDesc.toString();
+	}
+
+	/**
+	 * 상품 이미지 정보
+	 *
+	 * @param goodsCd
+	 * @return
+	 * @author eskim
+	 * @since 2021. 2. 9
+	 */
+	public Collection<GoodsImg> getGoodsImgList(Goods goods) {
+		return goodsDao.getGoodsImgList(goods);
+	}
+
+	/**
+	 * 상품 동영상정보
+	 *
+	 * @param goodsCd
+	 * @return
+	 * @author eskim
+	 * @since 2021. 2. 9
+	 */
+	public Collection<GoodsVideo> getVideoList(GoodsVideo goodsVideo) {
+		return goodsDao.getVideoList(goodsVideo);
+	}
+
+	/**
+	 * 구성 상품 정보 조회
+	 * @param goods
+	 * @return
+	 * @author xodud1202
+	 * @since 2021. 01. 28
+	 */
+	public Goods getGoodsCompsInfo(Goods goods) {
+		return goodsDao.getGoodsCompsInfo(goods);
+	}
+
+	/**
+	 * 상품 재고 정보
+	 * @param goodsStock
+	 * @return
+	 * @author xodud1202
+	 * @since 2021. 01. 28
+	 */
+	public GoodsStock getGoodsStockInfo(GoodsStock goodsStock) {
+		return goodsDao.getGoodsStockInfo(goodsStock);
+	}
+
+	/**
+	 * 상품 재고 체크
+	 * @param param
+	 * goodsCd   (원상품코드) 필수
+	 * goodsType (상품타입) 필수
+	 * optCd     (옵션코드) 필수
+	 * goodsQty  (확인 재고 수량) 필수
+	 * itemCd    (세트 구성 상품코드) 세트
+	 * @return String
+	 * @author xodud1202
+	 * @since 2021. 01. 28
+	 */
+	public String getCheckStock(GoodsStock param) {
+		// 상품 마스터 정보 확인
+		Goods goodsInfo = new Goods();
+		goodsInfo.setGoodsCd(param.getGoodsCd());
+		goodsInfo.setSiteCd(TscConstants.Site.STYLE24.value());
+		goodsInfo = getGoodsInfo(goodsInfo);
+
+		if (TscConstants.GoodsStat.SOLDOUT.value().equals(goodsInfo.getGoodsStat())) {
+			return param.getGoodsCd() + "는 품절 상품입니다.";
+		}
+
+		if (param.getGoodsType().equals(TscConstants.GoodsType.SET.value())) {		// 세트상품이면 구성 상품코드로 조회
+			Goods compsInfo = new Goods();
+			compsInfo.setGoodsCd(param.getGoodsCd());
+			compsInfo.setCompsGoodsCd(param.getItemCd());
+			compsInfo.setGoodsType(param.getGoodsType());
+
+			compsInfo = goodsDao.getGoodsCompsInfo(compsInfo);						// 구성상품 정보 조회
+
+			if (TscConstants.GoodsStat.SOLDOUT.value().equals(compsInfo.getGoodsStat())) {
+				return compsInfo.getGoodsNm() + " 상품은 품절입니다.";
+			} else if (!TscConstants.GoodsStat.APPR.value().equals(compsInfo.getGoodsStat())) {
+				return compsInfo.getGoodsNm() + " 상품은 구매할 수 없습니다.";
+			}
+
+			GoodsStock stockCheck = new GoodsStock();								// 재고 조회 결과
+			stockCheck.setGoodsCd(param.getItemCd());
+			stockCheck.setOptCd(param.getOptCd());
+
+			stockCheck = goodsDao.getGoodsStockInfo(stockCheck);					// 구성 상품 재고 조회
+
+			if (stockCheck == null) {
+				return "재고체크 실패했습니다. 새로고침 후 다시 시도해주세요.";
+			}
+
+			if ("Y".equals(stockCheck.getSoldoutYn())) {
+				return stockCheck.getOptCd2() + " 옵션은 품절입니다.";
+			}
+
+			if (param.getGoodsQty() * compsInfo.getQty() > stockCheck.getCurrStockQty()) {
+				return compsInfo.getGoodsNm() + " 옵션의 재고가 충분하지 않습니다.";
+			}
+		} else {
+			GoodsStock stockCheck = new GoodsStock();								// 재고 조회 결과
+			stockCheck.setGoodsCd(param.getGoodsCd());
+			stockCheck.setOptCd(param.getOptCd());
+
+			stockCheck = goodsDao.getGoodsStockInfo(stockCheck);					// 구성 상품 재고 조회
+
+			if (stockCheck == null) {
+				return "재고체크 실패했습니다. 새로고침 후 다시 시도해주세요.";
+			}
+
+			if ("Y".equals(stockCheck.getSoldoutYn())) {
+				return stockCheck.getOptCd2() + " 옵션은 품절입니다.";
+			}
+
+			if (param.getGoodsQty() > stockCheck.getCurrStockQty()) {
+				return "옵션의 재고가 충분하지 않습니다.";
+			}
+		}
+
+		return "SUCCESS";
+	}
+
+	/**
+	 * 딜상품 구성상품정보 조회
+	 *
+	 * @param goods
+	 * @return
+	 * @author eskim
+	 * @since 2021. 2. 9
+	 */
+	public Collection<Goods> getGoodsDealComposeList(Goods goods) {
+		return goodsDao.getGoodsDealComposeList(goods);
+	}
+
+	/**
+	 * 상품 옵션1 목록
+	 *
+	 * @param goods
+	 * @return
+	 * @author eskim
+	 * @since 2021. 2. 9
+	 */
+	public Collection<GoodsStock> getGoodsOption1List(Goods goods) {
+		return goodsDao.getGoodsOption1List(goods);
+	}
+
+	/**
+	 * 상품 옵션2 목록
+	 *
+	 * @param goods
+	 * @return
+	 * @author eskim
+	 * @since 2021. 2. 9
+	 */
+	public Collection<GoodsStock> getGoodsOption2List(Goods goods) {
+		return goodsDao.getGoodsOption2List(goods);
+	}
+
+	/**
+	 * 상품 옵션 목록 - 입점용
+	 *
+	 * @param goods
+	 * @return
+	 * @author eskim
+	 * @since 2021. 3. 18
+	 */
+	public Collection<GoodsStock> getGoodsOptionList(Goods goods) {
+		return goodsDao.getGoodsOptionList(goods);
+	}
+
+	/**
+	 * 상품 고시정보
+	 *
+	 * @param goods
+	 * @return
+	 * @author eskim
+	 * @since 2021. 2. 17
+	 */
+	public Collection<GoodsNotiInfo> getGoodsNotiList(Goods goods) {
+		return goodsDao.getGoodsNotiList(goods);
+	}
+
+	/**
+	 * 카드 혜택
+	 *
+	 * @param cardPromotion
+	 * @return
+	 * @author eskim
+	 * @since 2021. 2. 17
+	 */
+	public Collection<CardPromotion> getCardPromotionList(CardPromotion cardPromotion) {
+		return goodsDao.getCardPromotionList(cardPromotion);
+	}
+
+	/**
+	 * 핫딜 상품 조회
+	 *
+	 * @param goods
+	 * @return
+	 * @author eskim
+	 * @since 2021. 2. 17
+	 */
+	public Goods getSocialGoods(Goods goods) {
+		return goodsDao.getSocialGoods(goods);
+	}
+
+	/**
+	 * 상품예약판매정보 조회
+	 *
+	 * @param goods
+	 * @return
+	 * @author eskim
+	 * @since 2021. 2. 17
+	 */
+	public Goods getGoodsResSell(Goods resultGoods) {
+
+		Goods goods = goodsDao.getGoodsResSell(resultGoods);
+		if (goods != null) {
+			resultGoods.setDelvResDt(goods.getDelvResDt());
+		}
+
+		return resultGoods;
+	}
+
+	/**
+	 * 상품 사이즈 선택 시 재고수량 가져오기
+	 *
+	 * @param goods
+	 * @return
+	 * @author eskim
+	 * @since 2020. 7. 9
+	 */
+	public int getGoodsStockQty(GoodsStock goodsStock) {
+		int result = 0;
+		// 예약상품 여부 확인
+		//int goodsResSellCount = goodsDao.getGoodsResSellCount(goodsStock.getGoodsCd());
+
+		//if ("N".equals(goodsStock.getSelfGoodsYn()) || goodsResSellCount > 0) {
+			result = goodsDao.getGoodsStockQty(goodsStock);
+		//} else {
+		//	result = goodsDao.getGoodsStoreStockQty(goodsStock);
+		//}
+		return result;
+	}
+
+	/**
+	 * 세트 상품 사이즈 선택 시 재고수량 가져오기
+	 *
+	 * @param goods
+	 * @return
+	 * @author eskim
+	 * @since 2021. 3. 22
+	 */
+	public int getGoodsSetStockQty(GoodsStock goodsStock) {
+
+//		input param
+//		arrGoodsOption : goodsOption // [{goodsCd|optCd|qty},{goodsCd|optCd|qty}]
+//		,minOrdQty : minOrdQty
+//		,maxOrdQty : maxOrdQty
+//		,goodsCd : mGoodsCd
+//		,selfGoodsYn : selfGoodsYn
+
+		int result = 0;
+		int index = 0;	// 상품순서
+		//int masterStoreCnt = 0;
+		//boolean stockCheck = false;
+		boolean returnFlag = false;
+		//String[][] arrGoodsStoreList = null;	// 상품코드, 매장코드, 상품별 주문수량
+
+		//log.info("[getGoodsSetStockQty] goodsStock = {}", goodsStock);
+
+		// 예약상품 여부 확인
+		//int goodsResSellCount = goodsDao.getGoodsResSellCount(goodsStock.getGoodsCd());
+
+		int ableOrderCnt = 0;
+		for (String arrGoodsCd : goodsStock.getArrGoodsOption()) {	// [{goodsCd|optCd|qty},{goodsCd|optCd|qty}]
+
+			String[] goodsSizeInfo = arrGoodsCd.split("\\|");
+			//log.info("[getGoodsSetStockQty] goodsSizeInfo = {}", goodsSizeInfo);
+			if (goodsSizeInfo.length == 3) {
+
+				GoodsStock tmpStock = new GoodsStock();
+				tmpStock.setGoodsCd(goodsSizeInfo[0]);
+				tmpStock.setOptCd(goodsSizeInfo[1]);
+				int qty = Integer.parseInt(goodsSizeInfo[2]);	// 한번에 주문해야하는 상품수량
+//				int stockByGoodsSize = goodsDao.getGoodsStockQty(tmpStock);
+				int stockByGoodsSize = 0;
+				//if ("N".equals(goodsStock.getSelfGoodsYn()) || goodsResSellCount > 0) {
+					stockByGoodsSize = goodsDao.getGoodsStockQty(tmpStock);
+				//} else {
+				//	stockByGoodsSize = goodsDao.getGoodsStoreStockQty(tmpStock);
+				//}
+
+				//log.info("[getGoodsSetStockQty] stockByGoodsSize = {}", stockByGoodsSize);
+				if (stockByGoodsSize <= 0) {
+					returnFlag = true;
+					break;
+				} else {
+					if (index == 0) {	//첫번째 상품 기준 생성
+						ableOrderCnt = stockByGoodsSize / qty;	// 주문가능 횟수
+					} else {
+						int orderCnt = stockByGoodsSize / qty;	// 주문가능 횟수
+
+						if (ableOrderCnt >= orderCnt) {
+							ableOrderCnt = orderCnt;
+						}
+					}
+				}
+				//log.info("[getGoodsSetStockQty] ableOrderCnt = {}", ableOrderCnt);
+			} else {
+				returnFlag = true;
+				break;
+			}
+			index++;
+		}
+		result = ableOrderCnt;	//주문 가능 수량
+
+		if (returnFlag) {
+			return 0;
+		}
+
+		if (goodsStock.getMinOrdQty() > result) {
+			result = 0;
+		}
+
+		if (goodsStock.getMaxOrdQty() < result) {
+			result = goodsStock.getMaxOrdQty();
+		}
+
+		return result;
+	}
+
+	/**
+	 * 상품  공지 목록
+	 * @param goods
+	 * @return
+	 * @author eskim
+	 * @since 2021. 03. 07
+	 */
+	public Collection<Notice> getGoodsNoticeList(Goods goods) {
+		return goodsDao.getGoodsNoticeList(goods);
+	}
+	
+	/**
+	 * 상세용 컨텐츠 목록
+	 * @param goodsContents
+	 * @return
+	 * @author eskim
+	 * @since 2021. 07. 14
+	 */
+	public Collection<GoodsContents> getGoodsContentsList(GoodsContents goodsContents) {
+		return goodsDao.getGoodsContentsList(goodsContents);
+	}
+	
+	
+
+	/**
+	 * 상품  안전인증 정보
+	 * @param goods
+	 * @return
+	 * @author eskim
+	 * @since 2021. 03. 07
+	 */
+	public GoodsSafeNo getGoodsSafeNo(Goods goods) {
+		return goodsDao.getGoodsSafeNo(goods);
+	}
+
+	/**
+	 * 상품  배송안내정보
+	 * @param goodsCd
+	 * @return
+	 * @author eskim
+	 * @since 2021. 03. 08
+	 */
+	public Delivery getGoodsDeliveryInfo(String goodsCd) {
+		return goodsDao.getGoodsDeliveryInfo(goodsCd);
+	}
+
+	/**
+	 * 상품 다다익선 목록
+	 * @param goods
+	 * @return
+	 * @author eskim
+	 * @date 2021. 3. 8
+	 */
+	public Collection<Goods> getTmtbGoodsList(Goods goods) {
+		Integer[] arrTmtbSq = goods.getArrTmtbSq();		// 장바구니 다다익선 추천상품 적용을 위해 백업.
+		goods.setArrTmtbSq(null);		// 배열 사용하여 진행시에 IN절에 걸려 query timeout 걸려 null처리
+		Collection<Goods> result = new ArrayList<Goods>();
+
+		Collection<Tmtb> tmtbSqList = goodsDao.getTmtbSqList(goods);
+		if (tmtbSqList == null || tmtbSqList.isEmpty()) {
+			return result;
+		}
+		//log.info("[tmtbSqList]={}",tmtbSqList);
+		//log.info("[goods]={}",goods);
+		int rCount = 0;	//다다익선 조회수
+		int tCount = goods.getMaxRownum();	//리턴 잔여수
+		if (tCount == 0) {
+			tCount = 20;
+		}
+
+		// 상품상세 다다익선 조회 쿼리
+		if(arrTmtbSq == null || arrTmtbSq.length < 1) {
+			for (Tmtb tmtb : tmtbSqList) {
+				goods.setTmtbSq(tmtb.getTmtbSq());
+				Collection<Goods> tmtbGoodsList = goodsDao.getTmtbGoodsList(goods);
+				if (tmtbGoodsList == null || tmtbGoodsList.isEmpty()) {
+					continue;
+				}
+
+				if (tCount <= 0) { //잔여수가 없으면 종료
+					break;
+				}
+
+				//다다익선 조회 상품 수
+				rCount = tmtbGoodsList.size();
+
+				if (tCount > rCount) { 	//조회수보다 잔여수가 클경우
+					result.addAll(tmtbGoodsList);
+					tCount = tCount - rCount; //남은 잔여수 계산
+				} else {
+					if (tCount == rCount) {	//잔여 수량과 조회수가 같은면 종료
+						result.addAll(tmtbGoodsList);
+						break;
+					} else {
+
+						for (int i = 0; i < tCount; i++) {  //잔여수량만큼 loop
+							int tmtbGoodsListCnt = 0;
+							for (Goods tmtbGoods : tmtbGoodsList) {
+								if (i == tmtbGoodsListCnt) {
+									result.add(tmtbGoods);
+									tCount--;
+									break;
+								}
+								tmtbGoodsListCnt++;
+							}
+						}
+					}
+
+				}
+			}
+		} else {		// 장바구니 다다익선 팝업 조회 쿼리
+			for (int tmtb : arrTmtbSq) {
+				if(tmtb > 0) {
+					goods.setTmtbSq(tmtb);
+					Collection<Goods> tmtbGoodsList = goodsDao.getTmtbGoodsList(goods);
+					if (tmtbGoodsList == null || tmtbGoodsList.isEmpty()) {
+						continue;
+					}
+
+					if (tCount <= 0) { //잔여수가 없으면 종료
+						break;
+					}
+
+					//다다익선 조회 상품 수
+					rCount = tmtbGoodsList.size();
+
+					if (tCount > rCount) { 	//조회수보다 잔여수가 클경우
+						result.addAll(tmtbGoodsList);
+						tCount = tCount - rCount; //남은 잔여수 계산
+					} else {
+						if (tCount == rCount) {	//잔여 수량과 조회수가 같은면 종료
+							result.addAll(tmtbGoodsList);
+							break;
+						} else {
+
+							for (int i = 0; i < tCount; i++) {  //잔여수량만큼 loop
+								int tmtbGoodsListCnt = 0;
+								for (Goods tmtbGoods : tmtbGoodsList) {
+									if (i == tmtbGoodsListCnt) {
+										result.add(tmtbGoods);
+										tCount--;
+										break;
+									}
+									tmtbGoodsListCnt++;
+								}
+							}
+						}
+
+					}
+				}
+			}
+		}
+
+		return result;
+	}
+
+	/**
+	 * 상품 추천상품 목록
+	 * @param goods
+	 * @return
+	 * @author eskim
+	 * @date 2021. 3. 8
+	 */
+	public Collection<Goods> getRecommendGoodsList(Goods goods) {
+		return goodsDao.getRecommendGoodsList(goods);
+	}
+
+	/**
+	 * 재입고 알림 미 알림 조회
+	 * @param goods
+	 * @return
+	 * @author eskim
+	 * @date 2021. 3. 10
+	 */
+	public ReinboundInform getNotReinboundInform(ReinboundInform reinboundInform) {
+		return goodsDao.getNotReinboundInform(reinboundInform);
+	}
+
+	/**
+	 * 재입고알림 생성
+	 * @param goods
+	 * @return
+	 * @author eskim
+	 * @date 2021. 3. 10
+	 */
+	@Transactional("shopTxnManager")
+	public void createReinboundInform(ReinboundInform reinboundInform) {
+		goodsDao.createReinboundInform(reinboundInform);
+	}
+
+	/**
+	 * 재입고알림 수정
+	 * @param goods
+	 * @return
+	 * @author eskim
+	 * @date 2021. 3. 10
+	 */
+	@Transactional("shopTxnManager")
+	public void updateReinboundInform(ReinboundInform reinboundInform) {
+		goodsDao.updateReinboundInform(reinboundInform);
+	}
+
+	/**
+	 * 재입고 알림 신청 저장
+	 *
+	 * @param reinboundInform
+	 * @return void
+	 * @author eskim
+	 * @since 2021. 03. 17
+	 */
+	@Transactional("shopTxnManager")
+	public void saveGoodsInstockAlarmForm(ReinboundInform reinboundInform) {
+
+		if (!TsfSession.isLogin()) {
+			throw new IllegalStateException("로그인을 해야합니다.");
+		}
+
+		reinboundInform.setCustNo(TsfSession.getInfo().getCustNo());
+		reinboundInform.setRegNo(TsfSession.getInfo().getCustNo());
+		reinboundInform.setUpdNo(TsfSession.getInfo().getCustNo());
+
+		// 미알림 조회
+		ReinboundInform tmpReinboundInform = goodsDao.getNotReinboundInform(reinboundInform);
+
+		if (tmpReinboundInform == null || tmpReinboundInform.getRinbdInfoSq() <= 0) {
+			goodsDao.createReinboundInform(reinboundInform);
+		} else {
+			reinboundInform.setRinbdInfoSq(tmpReinboundInform.getRinbdInfoSq());
+			goodsDao.updateReinboundInform(reinboundInform);
+		}
+
+	}
+
+	/**
+	 * 실측사이즈 조회
+	 *
+	 * @param goods
+	 * @return
+	 * @author eskim
+	 * @date 2021. 3. 10
+	 */
+	public Collection<Measurement> getMeasurementList(Goods goods) {
+
+		return goodsDao.getMeasurementList(goods);
+	}
+
+	/**
+	 * 실측사이즈 조회
+	 *
+	 * @param goods
+	 * @return
+	 * @author eskim
+	 * @date 2021. 3. 10
+	 */
+	public Collection<MeasurementStyle> getMeasurementListNew(Goods goods) {
+		GagaMap result = new GagaMap();
+		// 행, 열 변환
+		Collection<Measurement> measurementList = goodsDao.getMeasurementList(goods);
+		Collection<MeasurementStyle> measurementStyleList = new ArrayList<MeasurementStyle>();
+
+		if (measurementList == null || measurementList.isEmpty()) {
+			return measurementStyleList;
+		}
+
+		int colSize = measurementList.size(); 	// 열 column
+		int rowSize = 5; // 상의하위포함 최대사이즈
+
+		String[][] arrMeasurementList = new String[rowSize + 1][colSize + 1];
+
+		// 사이즈 설정
+		int yIndex = 0;
+		for (Measurement measurement : measurementList) {
+			arrMeasurementList[0][0] = measurement.getTypecd();
+			yIndex++;
+			arrMeasurementList[0][yIndex] = measurement.getOptCd2();
+
+			// 부위명 설정
+			arrMeasurementList[1][0] = measurement.getTypecd();
+			arrMeasurementList[2][0] = measurement.getTypecd();
+			arrMeasurementList[3][0] = measurement.getTypecd();
+			arrMeasurementList[4][0] = measurement.getTypecd();
+			arrMeasurementList[5][0] = measurement.getTypecd();
+			arrMeasurementList[1][yIndex] = String.valueOf(measurement.getValue1());
+			arrMeasurementList[2][yIndex] = String.valueOf(measurement.getValue2());
+			arrMeasurementList[3][yIndex] = String.valueOf(measurement.getValue3());
+			arrMeasurementList[4][yIndex] = String.valueOf(measurement.getValue4());
+			arrMeasurementList[5][yIndex] = String.valueOf(measurement.getValue5());
+
+//			 arrMeasurementList = [[하의, 100, 110, 120, 130, 140, 150],
+//			                       [하의, 42.0, 44.0, 46.0, 48.0, 52.0, 54.0],
+//			                       [하의, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
+//			                       [하의, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
+//			                       [하의, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
+//			                       [하의, 51.0, 60.0, 65.0, 75.0, 79.0, 87.0]]
+//			                    	   
+		}
+
+		for (int i = 0; i < 6; i++) {
+			MeasurementStyle measurementStyle = new MeasurementStyle();
+			measurementStyle.setGoodsCd(goods.getGoodsCd());
+			measurementStyle.setSizeCount(colSize);
+
+			//log.info("arrMeasurementList[0].length = {}", arrMeasurementList[0].length);
+			for (int j = 0; j < arrMeasurementList[0].length; j++) {
+				switch (j) {
+					case 0:
+						measurementStyle.setTypecd(arrMeasurementList[i][j]);
+						break;
+					case 1:
+						measurementStyle.setSize1(arrMeasurementList[i][j]);
+						break;
+					case 2:
+						measurementStyle.setSize2(arrMeasurementList[i][j]);
+						break;
+					case 3:
+						measurementStyle.setSize3(arrMeasurementList[i][j]);
+						break;
+					case 4:
+						measurementStyle.setSize4(arrMeasurementList[i][j]);
+						break;
+					case 5:
+						measurementStyle.setSize5(arrMeasurementList[i][j]);
+						break;
+					case 6:
+						measurementStyle.setSize6(arrMeasurementList[i][j]);
+						break;
+					case 7:
+						measurementStyle.setSize7(arrMeasurementList[i][j]);
+						break;
+					case 8:
+						measurementStyle.setSize8(arrMeasurementList[i][j]);
+						break;
+					case 9:
+						measurementStyle.setSize9(arrMeasurementList[i][j]);
+						break;
+					case 10:
+						measurementStyle.setSize10(arrMeasurementList[i][j]);
+						break;
+					case 11:
+						measurementStyle.setSize11(arrMeasurementList[i][j]);
+						break;
+					case 12:
+						measurementStyle.setSize12(arrMeasurementList[i][j]);
+						break;
+					case 13:
+						measurementStyle.setSize13(arrMeasurementList[i][j]);
+						break;
+					case 14:
+						measurementStyle.setSize14(arrMeasurementList[i][j]);
+						break;
+					case 15:
+						measurementStyle.setSize15(arrMeasurementList[i][j]);
+						break;
+					case 16:
+						measurementStyle.setSize16(arrMeasurementList[i][j]);
+						break;
+					case 17:
+						measurementStyle.setSize17(arrMeasurementList[i][j]);
+						break;
+					case 18:
+						measurementStyle.setSize18(arrMeasurementList[i][j]);
+						break;
+					case 19:
+						measurementStyle.setSize19(arrMeasurementList[i][j]);
+						break;
+					case 20:
+						measurementStyle.setSize20(arrMeasurementList[i][j]);
+						break;
+				}
+			}
+			measurementStyleList.add(measurementStyle);
+		}
+
+		//log.info("measurementStyleList = {}", measurementStyleList);
+
+		return measurementStyleList;
+	}
+
+	/**
+	 * 사이즈 정보 조회
+	 *
+	 * @param sizeInfo
+	 * @return
+	 * @author eskim
+	 * @date 2021. 3. 10
+	 */
+	public Collection<SizeInfo> getSizeInfoList(SizeInfo sizeInfo) {
+		return goodsDao.getSizeInfoList(sizeInfo);
+	}
+
+	/**
+	 * 상품 쿠폰 다운 처리
+	 *
+	 * @param coupon
+	 * @return int
+	 * @author eskim
+	 * @since 2021.03.15
+	 */
+	@Transactional("shopTxnManager")
+	public String createGoodsCoupon(Goods goods) {
+		return couponService.createGoodsCoupon(goods);
+	}
+
+	/**
+	 * 세트상품 구성상품정보 조회
+	 *
+	 * @param
+	 * @return
+	 * @author eskim
+	 * @since 2021. 3. 21
+	 */
+	public Collection<GoodsCompose> getGoodsSetComposeList(Goods goods) {
+		Collection<GoodsCompose> getGoodsSetComposeList = goodsDao.getGoodsSetComposeList(goods);
+		for (GoodsCompose goodsCompose : getGoodsSetComposeList) {
+			Goods tmpGoods = new Goods();
+			tmpGoods.setGoodsCd(goodsCompose.getCompsGoodsCd());
+			tmpGoods.setSupplyCompCd(goods.getSupplyCompCd());
+			tmpGoods.setFrontGb(goods.getFrontGb());
+			tmpGoods.setIsApp(goods.getIsApp());
+			tmpGoods.setSiteCd(goods.getSiteCd());
+			tmpGoods.setCustGb(goods.getCustGb());
+			tmpGoods.setCustNo(goods.getCustNo());
+
+			// 상품상세
+			Goods resultGoods = this.getGoodsDesc(tmpGoods);
+			if (resultGoods != null) {
+//				goodsCompose.setGoodsTitle(resultGoods.getGoodsTitle());
+//				goodsCompose.setGoodsTitleDesc(resultGoods.getGoodsTitleDesc());
+//				goodsCompose.setGoodsSpecialDesc(resultGoods.getGoodsSpecialDesc());
+//				goodsCompose.setGoodsTopDesc(resultGoods.getGoodsTopDesc());
+//				goodsCompose.setGoodsDownDesc(resultGoods.getGoodsDownDesc());
+				goodsCompose.setGoodsDesc(resultGoods.getGoodsDesc());
+			}
+
+			// 상품 옵션1(색상) 정보
+			goodsCompose.setGoodsOption1List(goodsDao.getGoodsOption1List(tmpGoods));
+			// 상품 옵션2(사이즈) 정보
+			//goodsExtend.setGoodsOption2List(goodsDao.getGoodsOption2List(tmpGoods));
+			// 고시 정보
+			goodsCompose.setGoodsNotiList(goodsDao.getGoodsNotiList(tmpGoods));
+			// 이미지 정보
+			goodsCompose.setGoodsImgList(goodsDao.getGoodsImgList(tmpGoods));
+			// 상품 안전인증 정보
+			goodsCompose.setGoodsSafeNo(goodsDao.getGoodsSafeNo(tmpGoods));
+
+		}
+		return getGoodsSetComposeList;
+	}
+
+	/**
+	 * 상품의 다다익선 목록 
+	 * @param goods
+	 * @return
+	 * @author eskim
+	 * @date 2021. 4. 11
+	 */
+	public Collection<Tmtb> getTmtbList(Goods goods) {
+		return goodsDao.getTmtbList(goods);
+	}
+
+	/**
+	 * 상품의 다다익선 목록 
+	 * @param goods
+	 * @return
+	 * @author eskim
+	 * @date 2021. 4. 13
+	 */
+	public Collection<Freegift> getFreeGoodsList(Goods goods) {
+		return goodsDao.getFreeGoodsList(goods);
+	}
+
+	/**
+	 * 컨텐츠카테고리상품 목록(메인용)
+	 * @param cate - 카테고리 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 3. 25
+	 */
+	public Collection<Goods> getContentsCategoryGoodsListMain(Cate4Srch cate) {
+		cate.setSiteCd(TscConstants.Site.STYLE24.value());
+		cate.setFrontGb(TsfSession.getFrontGb());
+		cate.setCustGb(TsfSession.getCustGb());
+		cate.setCustNo(TsfSession.isLogin() ? TsfSession.getInfo().getCustNo() : 0);
+
+		Collection<Goods> goodsList = new ArrayList<>();
+
+		if (cate.getContentsLoc().equals("SCM002") || cate.getContentsLoc().equals("SBM007") || cate.getContentsLoc().equals("SMM003") || cate.getContentsLoc().equals("SBM003") || cate.getContentsLoc().equals("SBMM007")) { // 신상품인 경우
+			int maxRow = 20;
+			if (cate.getContentsLoc().equals("SBM003")) {
+				maxRow = 3;
+			}
+
+			goodsList = goodsDao.getContentsCategoryGoodsListMain(cate);
+
+			// 조회된 데이터가 없거나 건수가 20개 미만이면 신규상품(=정상상품) 조회
+			if (goodsList == null || goodsList.size() < maxRow) {
+				if (goodsList != null) {
+					// 제외상품 설정
+					StringBuilder sb = new StringBuilder();
+					for (Goods goods : goodsList) {
+						sb.append(goods.getGoodsCd()).append(",");
+					}
+					if (sb != null && !sb.toString().equals("")) {
+						cate.setExceptGoodsArr(sb.toString().substring(0, sb.toString().length() - 1).split(","));
+					}
+				}
+				maxRow = maxRow - goodsList.size();
+				cate.setMaxRow(maxRow);
+				cate.setCateGb("G032_101");
+				if (cate.getContentsLoc().equals("SMM003") || cate.getContentsLoc().equals("SBM003") || cate.getContentsLoc().equals("SBM007")) {
+					cate.setCate1No(null);
+				}
+
+				if (cate.getContentsLoc().equals("SCM002")) {
+					goodsList.addAll(goodsDao.getCategoryMainNewGoodsList(cate));
+				} else {
+					goodsList.addAll(goodsDao.getContentsCategoryNewGoodsList(cate));
+				}
+			}
+		} else if (cate.getContentsLoc().equals("SCM003") || cate.getContentsLoc().equals("SBM008") || cate.getContentsLoc().equals("SBM009") || cate.getContentsLoc().equals("SOM003") || cate.getContentsLoc().equals("SOM002")) { // 베스트상품인 경우
+			// TODO: 추천솔루션
+			int dispCnt = cate.getMaxRow();
+
+			goodsList = goodsDao.getContentsCategoryGoodsListMain(cate);
+			// 수동설정 데이터 없거나 노출갯수보다 작으면 추천솔루션 데이터 표출
+			if(dispCnt > goodsList.size()){
+				int cnt = 0;
+				cnt = dispCnt - goodsList.size();
+
+				// TODO : 추천솔루션
+				Collection<Eigeneai.Result> itemList = new ArrayList<>();
+				if(cate.getContentsLoc().equals("SCM003")){
+					itemList = eigeneaiApi.getCategoryWeeklySellBestGoodsList(cnt, cate.getCate1No(), TsfSession.getFrontGb());
+				}else if(cate.getContentsLoc().equals("SBM008")){
+					itemList = eigeneaiApi.getBrandWeeklySellBestGoodsList(cnt, cate.getBrandGroupNo(), TsfSession.getFrontGb());
+				}else if(cate.getContentsLoc().equals("SBM009")){
+					itemList = eigeneaiApi.getBrandMonthlyClickBestGoodsList(cnt, cate.getBrandGroupNo(), TsfSession.getFrontGb());
+				}else if(cate.getContentsLoc().equals("SOM002")){
+					itemList = eigeneaiApi.getOutletMonthlyClickBestGoodsList(cnt, TsfSession.getFrontGb());
+				}else{
+					// SOM003 아울렛 베스트
+					itemList = eigeneaiApi.getOutletWeeklySellBestGoodsList(cnt, TsfSession.getFrontGb());
+				}
+
+				for(Eigeneai.Result tempData: itemList){
+					Goods tempBest = new Goods();
+					tempBest.setBrandGroupNm(tempData.getProduct().getBrandName());
+					tempBest.setGoodsCd(tempData.getProduct().getItemId());
+					tempBest.setGoodsFullNm(tempData.getProduct().getItemName());
+					tempBest.setListPrice((int) tempData.getProduct().getOriginalPrice());
+					tempBest.setCurrPrice((int) tempData.getProduct().getSalePrice());
+					tempBest.setSysImgNm(tempData.getProduct().getItemImage());
+					tempBest.setItemUrl(tempData.getProduct().getItemUrl());
+					goodsList.add(tempBest);
+				}
+			}
+
+			for (Goods temp : goodsList) {
+				if (temp.getSizes() != null) {
+					temp.setSizeArr(temp.getSizes().split(","));
+				}
+				if (temp.getColorChips() != null) {
+					temp.setColorArr(temp.getColorChips().split(","));
+				}
+				if (temp.getIcon() != null) {
+					temp.setBenefitArr(temp.getIcon().split(","));
+				}
+			}
+		} else if (cate.getContentsLoc().equals("SBM013") || cate.getContentsLoc().equals("SBMM013")) {
+			GoodsSearch goodsSearch = new GoodsSearch();
+			goodsSearch.setSiteCd(TscConstants.Site.STYLE24.value());
+			goodsSearch.setCateGb("G032_101");
+			goodsSearch.setFrontGb(TsfSession.getFrontGb());
+			goodsSearch.setFormalGb(cate.getFormalGb());
+			goodsSearch.setCustGb(cate.getCustGb());
+			goodsSearch.setCustNo(cate.getCustNo());
+			goodsSearch.setBrandGroupNo(cate.getBrandGroupNo());
+			goodsSearch.setMaxRow(cate.getMaxRow());
+			goodsList = goodsDao.getBrandNewGoodsList(goodsSearch);
+
+			for (Goods temp : goodsList) {
+				if (temp.getSizes() != null) {
+					temp.setSizeArr(temp.getSizes().split(","));
+				}
+				if (temp.getColorChips() != null) {
+					temp.setColorArr(temp.getColorChips().split(","));
+				}
+				if (temp.getBenefits() != null) {
+					temp.setBenefitArr(temp.getBenefits().split(","));
+				}
+			}
+		} else {
+			goodsList = goodsDao.getContentsCategoryGoodsListMain(cate);
+		}
+
+		return goodsList;
+	}
+	
+	/**
+	 * 컨텐츠카테고리상품 목록
+	 * @param cate - 카테고리 정보
+	 * @return
+	 * @author jmh
+	 * @since 2021. 8. 13
+	 */
+	public Collection<Goods> getContentsCategoryGoodsList(Cate4Srch cate) {
+		cate.setSiteCd(TscConstants.Site.STYLE24.value());
+		cate.setFrontGb(TsfSession.getFrontGb());
+		cate.setCustGb(TsfSession.getCustGb());
+		cate.setCustNo(TsfSession.isLogin() ? TsfSession.getInfo().getCustNo() : 0);
+		Collection<Goods> goodsList = new ArrayList<>();
+
+		if (cate.getContentsLoc().equals("SCM002") || cate.getContentsLoc().equals("SBM007") || cate.getContentsLoc().equals("SMM003") || cate.getContentsLoc().equals("SBM003") || cate.getContentsLoc().equals("SBMM007")) { // 신상품인 경우
+			int maxRow = 20;
+			if (cate.getContentsLoc().equals("SBM003")) {
+				maxRow = 3;
+			}
+
+			goodsList = goodsDao.getContentsCategoryGoodsList(cate);
+
+			// 조회된 데이터가 없거나 건수가 20개 미만이면 신규상품(=정상상품) 조회
+			if (goodsList == null || goodsList.size() < maxRow) {
+				if (goodsList != null) {
+					// 제외상품 설정
+					StringBuilder sb = new StringBuilder();
+					for (Goods goods : goodsList) {
+						sb.append(goods.getGoodsCd()).append(",");
+					}
+					if (sb != null && !sb.toString().equals("")) {
+						cate.setExceptGoodsArr(sb.toString().substring(0, sb.toString().length() - 1).split(","));
+					}
+				}
+				maxRow = maxRow - goodsList.size();
+				cate.setMaxRow(maxRow);
+				cate.setCateGb("G032_101");
+				if (cate.getContentsLoc().equals("SMM003") || cate.getContentsLoc().equals("SBM003") || cate.getContentsLoc().equals("SBM007")) {
+					cate.setCate1No(null);
+				}
+
+				if (cate.getContentsLoc().equals("SCM002")) {
+					goodsList.addAll(goodsDao.getCategoryMainNewGoodsList(cate));
+				} else {
+					goodsList.addAll(goodsDao.getContentsCategoryNewGoodsList(cate));
+				}
+			}
+		} else if (cate.getContentsLoc().equals("SCM003") || cate.getContentsLoc().equals("SBM008") || cate.getContentsLoc().equals("SBM009") || cate.getContentsLoc().equals("SOM003") || cate.getContentsLoc().equals("SOM002")) { // 베스트상품인 경우
+			// TODO: 추천솔루션
+			int dispCnt = cate.getMaxRow();
+
+			goodsList = goodsDao.getContentsCategoryGoodsList(cate);
+			// 수동설정 데이터 없거나 노출갯수보다 작으면 추천솔루션 데이터 표출
+			if(dispCnt > goodsList.size()){
+				int cnt = 0;
+				cnt = dispCnt - goodsList.size();
+
+				// TODO : 추천솔루션
+				Collection<Eigeneai.Result> itemList = new ArrayList<>();
+				if(cate.getContentsLoc().equals("SCM003")){
+					itemList = eigeneaiApi.getCategoryWeeklySellBestGoodsList(cnt, cate.getCate1No(), TsfSession.getFrontGb(), "CATE");
+				}else if(cate.getContentsLoc().equals("SBM008")){
+					itemList = eigeneaiApi.getBrandWeeklySellBestGoodsList(cnt, cate.getBrandGroupNo(), TsfSession.getFrontGb());
+				}else if(cate.getContentsLoc().equals("SBM009")){
+					itemList = eigeneaiApi.getBrandMonthlyClickBestGoodsList(cnt, cate.getBrandGroupNo(), TsfSession.getFrontGb());
+				}else if(cate.getContentsLoc().equals("SOM002")){
+					itemList = eigeneaiApi.getOutletMonthlyClickBestGoodsList(cnt, TsfSession.getFrontGb());
+				}else{
+					// SOM003 아울렛 베스트
+					itemList = eigeneaiApi.getOutletWeeklySellBestGoodsList(cnt, TsfSession.getFrontGb());
+				}
+
+				for(Eigeneai.Result tempData: itemList){
+					Goods tempBest = new Goods();
+					tempBest.setBrandGroupNm(tempData.getProduct().getBrandName());
+					tempBest.setGoodsCd(tempData.getProduct().getItemId());
+					tempBest.setGoodsFullNm(tempData.getProduct().getItemName());
+					tempBest.setListPrice((int) tempData.getProduct().getOriginalPrice());
+					tempBest.setCurrPrice((int) tempData.getProduct().getSalePrice());
+					tempBest.setSysImgNm(tempData.getProduct().getItemImage());
+					tempBest.setItemUrl(tempData.getProduct().getItemUrl());
+					goodsList.add(tempBest);
+				}
+			}
+
+			for (Goods temp : goodsList) {
+				if (temp.getSizes() != null) {
+					temp.setSizeArr(temp.getSizes().split(","));
+				}
+				if (temp.getColorChips() != null) {
+					temp.setColorArr(temp.getColorChips().split(","));
+				}
+				if (temp.getIcon() != null) {
+					temp.setBenefitArr(temp.getIcon().split(","));
+				}
+			}
+		} else if (cate.getContentsLoc().equals("SBM013") || cate.getContentsLoc().equals("SBMM013")) {
+			GoodsSearch goodsSearch = new GoodsSearch();
+			goodsSearch.setSiteCd(TscConstants.Site.STYLE24.value());
+			goodsSearch.setCateGb("G032_101");
+			goodsSearch.setFrontGb(TsfSession.getFrontGb());
+			goodsSearch.setFormalGb(cate.getFormalGb());
+			goodsSearch.setCustGb(cate.getCustGb());
+			goodsSearch.setCustNo(cate.getCustNo());
+			goodsSearch.setBrandGroupNo(cate.getBrandGroupNo());
+			goodsSearch.setMaxRow(cate.getMaxRow());
+			goodsList = goodsDao.getBrandNewGoodsList(goodsSearch);
+
+			for (Goods temp : goodsList) {
+				if (temp.getSizes() != null) {
+					temp.setSizeArr(temp.getSizes().split(","));
+				}
+				if (temp.getColorChips() != null) {
+					temp.setColorArr(temp.getColorChips().split(","));
+				}
+				if (temp.getBenefits() != null) {
+					temp.setBenefitArr(temp.getBenefits().split(","));
+				}
+			}
+		} else {
+			goodsList = goodsDao.getContentsCategoryGoodsList(cate);
+		}
+
+		return goodsList;
+	}
+
+	/**
+	 * ep쿠폰 다운 처리
+	 *
+	 * @param coupon
+	 * @return int
+	 * @author eskim
+	 * @since 2021.04.15
+	 */
+	@Transactional("shopTxnManager")
+	public String createEpCoupon(Goods goods) {
+		return couponService.createEpCoupon(goods);
+	}
+
+	/**
+	 * 카테고리별 상품수
+	 * @param params - 검색엔진 정보
+	 * @return
+	 * @author bin2107
+	 * @date 2021. 4. 7
+	 */
+	public int getCategoryGoodsCount(SearchEngine params) {
+		return goodsDao.getCategoryGoodsCount(params);
+	}
+
+	/**
+	 * 카테고리별 상품 목록
+	 * @param params - 검색엔진 정보
+	 * @return
+	 * @author bin2107
+	 * @date 2021. 4. 8
+	 */
+	public Collection<SearchEngine> getCategoryGoodsList(SearchEngine params) {
+		return goodsDao.getCategoryGoodsList(params);
+	}
+
+	/**
+	 * 검색상품 총건수
+	 * @param params - 검색엔진 정보
+	 * @return
+	 * @author gagamel
+	 * @date 2021. 5. 6
+	 */
+	public int getSearchGoodsCount(SearchEngine params) {
+		return goodsDao.getSearchGoodsCount(params);
+	}
+
+	/**
+	 * 검색상품 목록
+	 * @param params - 검색엔진 정보
+	 * @return
+	 * @author gagamel
+	 * @date 2021. 5. 6
+	 */
+	public Collection<SearchEngine> getSearchGoodsList(SearchEngine params) {
+		return goodsDao.getSearchGoodsList(params);
+	}
+	
+	
+	/**
+	 * 상품 다른 색상의 productno 찾기
+	 * @param goods - 상품정보
+	 * @return
+	 * @author eskim
+	 * @date 2021. 7. 28
+	 */
+	public Collection<GoodsStock> getProductNoByGoodsColor(Goods goods) {
+		return goodsDao.getProductNoByGoodsColor(goods);
+	}
+
+}

+ 68 - 2
src/main/java/com/style24/front/biz/thirdparty/EigeneaiApi.java

@@ -8,6 +8,8 @@ import java.util.Collection;
 
 import javax.annotation.PostConstruct;
 
+import org.json.simple.JSONObject;
+import org.json.simple.parser.JSONParser;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
@@ -45,7 +47,7 @@ public class EigeneaiApi {
 
 	@Autowired
 	private TsfGoodsDao goodsDao;
-
+	
 	@PostConstruct
 	public void init() {
 		log.debug("\n\n---- Eigene.ai initialization started ----");
@@ -58,7 +60,7 @@ public class EigeneaiApi {
 	 * 카테고리별 주간판매베스트추천상품 목록
 	 * 사용되는 화면 영역)
 	 * 		메인 > 베스트 영역
-	 * 		카테고리메인 > 베스트 상품
+	 * 		카테고리메인 > 베스트 상품(22.01.13 제외)
 	 * 		베스트 > 카테고리별 베스트
 	 * @param size - 결과에 포함할 상품수
 	 * @param cate1No - 카테고리번호1
@@ -78,6 +80,28 @@ public class EigeneaiApi {
 		return new ArrayList<Result>();
 	}
 
+	/**
+	 * 카테고리별 주간판매베스트추천상품 목록
+	 * 사용되는 화면 영역)
+	 * 		카테고리메인 > 베스트 상품(22.01.13 추가)
+	 * @param size - 결과에 포함할 상품수
+	 * @param cate1No - 카테고리번호1
+	 * @return
+	 * @author jmh
+	 * @since 2021. 11. 30
+	 */
+	public Collection<Result> getCategoryWeeklySellBestGoodsList(int size, Integer cate1No, String frontGb, String rcType) {
+		String gb = "M".equals(frontGb) ? "mo" : "pc";
+		String requestUrl = apiUrl + "/m060?cuid=" + cuid + "&size=" + size + "&incids=" + cate1No + "&rccode="+gb+"_ctgr_m60";
+		
+		Eigeneai eigeneai = this.getEigeneaiInfo(requestUrl);
+		if (eigeneai.getResults() != null && !eigeneai.getResults().isEmpty()) {
+			return eigeneai.getResults();
+		}
+
+		return new ArrayList<Result>();
+	}
+
 //	/**
 //	 * 매출급상승 카테고리 목록
 //	 * 사용되는 화면 영역)
@@ -581,5 +605,47 @@ public class EigeneaiApi {
 
 		return new ArrayList<Result>();
 	}
+	
+	
+	/**
+	 * 매출급상승 카테고리 목록
+	 * 사용되는 화면 영역)
+	 * 		메인 > MD추천상품
+	 * @return
+	 * @author jmh
+	 * @since 2022. 1. 14
+	 */
+	public JSONObject getSoaringSalesCategoryList(String frontGb) {
+		String gb = "M".equals(frontGb) ? "mo" : "pc";
+		String requestUrl = apiUrl + "/m074?cuid=" + cuid + "&size=10&rccode="+gb+"_main_m74";
+		
+		URI url = URI.create(requestUrl);
+		JSONObject resultObj;
+		
+		try {
+			// GET방식으로 호출
+			ResponseEntity<String> responseEntity = restTemplate.getForEntity(url, String.class);
+			//log.info("responseEntity.getStatusCode(): {} ", responseEntity.getStatusCode());
+
+			String responseJson = responseEntity.getBody();
+			//log.info("abcd responseEntity.getBody(): {}", responseJson);
+			
+			JSONParser parser = new JSONParser();
+			Object obj = parser.parse( responseJson );
+			JSONObject jsonBody = (JSONObject) obj;
+			
+			resultObj = (JSONObject) jsonBody.get("groupedResults");
 
+			if (!responseEntity.getStatusCode().equals(HttpStatus.OK)) {
+				return null;
+			}
+		} catch (RestClientException e) {
+			return null;
+		} catch (Exception e) {
+			return null;
+		}
+		
+		return resultObj;
+	}
+	
 }

+ 7 - 5
src/main/java/com/style24/front/biz/web/TsfDisplayController.java

@@ -228,11 +228,13 @@ public class TsfDisplayController extends TsfBaseController {
 			if (contentsLoc.equals("SMM007")) {
 				mainLayout.setBrandPickList(displayService.getContentsForGoodsMain(contents));
 			}
-
-			if (contentsLoc.equals("SMM009") || contentsLoc.equals("SMM012")) {
-				if (contentsLoc.equals("SMM009")) {
-					contents.setMaxRow(5);
-				}
+			
+			if(contentsLoc.equals("SMM009")) {
+				contents.setMaxRow(5);
+				mainLayout.setMdPickList(displayService.getContentsForGoodsMainMdPick(contents));
+			}
+			
+			if (contentsLoc.equals("SMM012")) {
 				mainLayout.setMdPickList(displayService.getContentsForGoodsMain(contents));
 			}
 

+ 526 - 526
src/main/webapp/WEB-INF/views/mob/display/BestMainFormMob.html

@@ -1,526 +1,526 @@
-<!DOCTYPE html>
-<html lang="ko"
-	xmlns:th="http://www.thymeleaf.org"
-	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
-	layout:decorator="mob/common/layout/DefaultLayoutMob">
-<!--
- *******************************************************************************
- * @source  : BestMainFormMob.html
- * @desc    : 베스트메인 Page
- *============================================================================
- * STYLE24
- * Copyright(C) 2020 TSIT, All rights reserved.
- *============================================================================
- * VER  DATE         AUTHOR      DESCRIPTION
- * ===  ===========  ==========  =============================================
- * 1.0  2021.05.10   bin2107     최초 작성
- *******************************************************************************
- -->
-<body>
-
-<th:block layout:fragment="content">
-  <main role="" id="" class="container dp">
-
-    <section class="content dp_best">
-      <div class="inner wide">
-        <div class="category_nav">
-          <ul id="cateListArea">
-            <li class="" id="li0"><button type="button" onclick="fnBestListSearch(this,'');">전체</button></li>
-            <th:block th:each="item, stat : ${bestCateList}">
-              <li class="" th:id="${'li'+item.cateNo}"><button type="button" th:onclick="fnBestListSearch(this,[[${item.cateNo}]]);" th:text="${item.cateNm}">여성</button></li>
-            </th:block>
-          </ul>
-        </div>
-      </div>
-      <div class="inner bg_gray">
-        <div class="view_item">
-          <div class="count_wrap">
-            <div>
-              <p>지금 많이 <span>보고 있어요</span></p>
-            </div>
-            <div>
-              <ul class="dp_util">
-                <li><a href="javascript:void(0);" id="researchBtn" class="refresh" th:text="${#calendars.format(#calendars.createNow(), 'HH:mm')+' 기준'}">17:30 기준</a></li>
-              </ul>
-            </div>
-          </div>
-          <div class="swiper-container item_list">
-            <div class="swiper-wrapper" id="itemViewArea">
-            </div>
-          </div>
-        </div>
-      </div>
-
-      <div class="inner">
-        <div class="best_item">
-          <h2 class="dp_subtitle">베스트 TOP 100</h2>
-          <div class="item_list">
-            <div class="count_wrap">
-              <ul class="dp_util">
-                <li>
-                  <div class="open_categori sex">
-                    <a id="filter">구매 성별 전체
-                    </a>
-                  </div>
-                </li>
-                <li>
-                  <div class="open_categori age">
-                    <a id="filter">구매 연령 전체
-                    </a>
-                  </div>
-                </li>
-              </ul>
-            </div>
-            <div class="list_content">
-              <div class="itemsGrp" id="prodArea">
-              </div>
-            </div>
-            <div class="list_last" id="divLastPage" style="display: none;">마지막페이지 입니다.</div>
-          </div>
-        </div>
-      </div>
-    </section>
-
-    <!-- 카테고리 -->
-    <div class="category_box">
-      <div class="lap">
-        <div class="category_close">카테고리닫기</div>
-        <div class="category_list">
-          <!-- 카테고리 선택 -->
-          <div class="selcet_list">
-            <ul>
-              <li class="active"><a href="javascript:void(0)">구매성별 전체</a></li>
-              <li><a href="javascript:void(0)">구매성별1</a></li>
-              <li><a href="javascript:void(0)">구매성별2</a></li>
-              <li><a href="javascript:void(0)">구매성별3</a></li>
-              <li><a href="javascript:void(0)">구매성별4</a></li>
-            </ul>
-          </div>
-          <!-- //카테고리 선택 -->
-        </div>
-      </div>
-    </div>
-    <!-- //카테고리 -->
-
-    <!-- 210415_최신상품순 리스트 팝업 추가 -->
-    <div id="odDatePop1" class="popup_box odDatePop">
-      <div class="lap">
-        <div class="popup_close">카테고리닫기</div>
-        <div class="popup_head sr-only">
-          <h2 class="">기간 선택 팝업</h2>
-        </div>
-        <div class="popup_con">
-          <div class="button_list clear">
-            <button type="button" class="on" onclick="fnGetEigenD002(this, 'gender');" data-id="" ><span>구매성별 전체</span></button>
-            <button type="button" onclick="fnGetEigenD002(this, 'gender');" data-id="A" ><span>남성</span></button>
-            <button type="button" onclick="fnGetEigenD002(this, 'gender');" data-id="B" ><span>여성</span></button>
-          </div>
-        </div>
-      </div>
-    </div>
-    <div id="odDatePop2" class="popup_box odDatePop">
-      <div class="lap">
-        <div class="popup_close">카테고리닫기</div>
-        <div class="popup_head sr-only">
-          <h2 class="">기간 선택 팝업</h2>
-        </div>
-        <div class="popup_con">
-          <div class="button_list clear">
-            <button type="button" class="on" onclick="fnGetEigenD002(this, 'age');" data-id="" ><span>구매연령 전체</span></button>
-            <button type="button" onclick="fnGetEigenD002(this, 'age');" data-id="10" ><span>10대</span></button>
-            <button type="button" onclick="fnGetEigenD002(this, 'age');" data-id="20" ><span>20대</span></button>
-            <button type="button" onclick="fnGetEigenD002(this, 'age');" data-id="30" ><span>30대</span></button>
-            <button type="button" onclick="fnGetEigenD002(this, 'age');" data-id="40" ><span>40대</span></button>
-            <button type="button" onclick="fnGetEigenD002(this, 'age');" data-id="50" ><span>50대 이상</span></button>
-          </div>
-        </div>
-      </div>
-    </div>
-  </main>
-
-  <form id="bestGoodsForm" name="bestGoodsForm">
-    <input type="hidden" name="pageNo" id="pageNo" value ="1"/>
-    <input type="hidden" name="pageSize" value ="50"/>
-    <input type="hidden" name="cateNo" value=""/>
-    <input type="hidden" name="sortGb"/>
-  </form>
-
-  <!-- 수동설정 + 추천솔루션 카운트 문제로 인해 인피티니스크롤 제거 협의 21-07-21 -->
-<!--	<script src="/ux/plugins/gaga/gaga.infinite.scrollSession.js"></script>-->
-<!--	<script src="/ux/plugins/jquery/jquery.history.min.js"></script>-->
-<!--	<script th:src="@{'/biz/goods.js?v=' + ${#calendars.format(#calendars.createNow(), 'yyyyMMddHHmmss')}}" src="/biz/goods.js"></script>-->
-
-
-  <script th:inline="javascript">
-    /*<![CDATA[*/
-    var bestCateList = [[${bestCateList}]];
-    $(document).ready(function(){
-      $(document).on('click','.sub_category .more_btn',function(){
-        $(this).toggleClass('on');
-        $('.sub_category .cate_wrap').toggleClass('on');
-        if($(this).hasClass('on')){
-          $(this).find('span').text('접기');
-        }else{
-          $(this).find('span').text('더보기');
-        }
-      });
-
-      //카테고리
-      function category(){
-        var categoryOpen=$(".open_categori .select_dress");
-        var categoryClose=$(".category_box .category_close");
-        var categoryPop=$(".category_box");
-
-        categoryOpen.on("click",function(){
-          categoryPop.show();
-          categoryPop.addClass("active");
-          $("body").css({"overflow":"hidden"});
-        });
-
-        categoryClose.on("click",function(){
-          categoryPop.hide();
-          $("body").css({"overflow":"visible"});
-        });
-      }
-      category();
-
-      // 210415_팝업관련 추가
-      //기간 선택 팝업
-      $(document).on("click", ".open_categori.sex", function(){
-        $('#odDatePop1').show().addClass("active");
-        $("body").css({"overflow":"hidden"});
-      });
-      $(document).on("click", ".open_categori.age", function(){
-        $('#odDatePop2').show().addClass("active");
-        $("body").css({"overflow":"hidden"});
-      });
-      //팝업_닫기
-      $('.popup_close').on("click",function(){
-        $('.popup_box').hide().removeClass('active');
-        $("body").css({"overflow":"visible"});
-      });
-
-      //210510_수정 : 토스트 팝업 버튼 on 클래스 제어.
-      $(document).on('click','.popup_box .button_list button',function(){
-        $(this).siblings('.button_list button').removeClass('on');
-        $(this).addClass('on');
-      })
-
-      //210510_추가 : 토스트 팝업 button 클릭 시 팝업 닫기.
-      $(document).on('click','.popup_box.odDatePop .button_list button',function(){
-        $(this).parents('.popup_box.odDatePop').hide().removeClass('active');
-        $("body").css({"overflow":"visible"});
-      })
-
-      $(document).on('click','.popup_box.odDatePop .button_list button',function(){
-        $(this).parents('.popup_box.odDatePop').hide().removeClass('active');
-        $("body").css({"overflow":"visible"});
-      })
-    });
-
-    var fnBestListSearch = function (obj, cateNo){
-      $.each($("#cateListArea").find('li').find('button'), function() {
-        $(this).removeClass();
-      });
-      if(gagajf.isNull(cateNo)){
-        $("#li0").find("button").addClass('active');
-      }else{
-        $("#li"+cateNo).find("button").addClass('active');
-      }
-
-      $("#bestGoodsForm input[name=cateNo]").val(cateNo);
-
-      // 카테고리별 실시간 베스트 상품 조회 getRealtimeViewBestGoodsList
-      fnRealtimeViewBestList(cateNo);
-
-      // TOP100 조회
-      fnBestTop100List();
-    }
-
-    var fnRealtimeViewBestList = function (cateNo){
-      if(gagajf.isNull(cateNo)){
-        cateNo = "";
-      }
-      var data = {cateNo : cateNo};
-      var html = '';
-
-      $.getJSON('/display/realtime/best/list' , data, function (result, status){
-        $("#itemViewArea").html('');
-        // console.log(result);
-        if(result.length > 0){
-          $.each(result, function (idx, item){
-            // 2021.08.30 이미지 null 처리
-            if (item.itemName != null) {
-              var imgUrl = '';
-
-              html += '<div class="swiper-slide">\n';
-              html += '	<div class="item_prod">\n';
-              html += '		<div class="item_state">\n';
-              html += '			<a href="javascript:void(0);" class="itemLink" onclick="cfnGoToGoodsDetail(\''+item.itemId+'\',\'\',\'\',\'\',\'\',\'rts_mo_best&rtscode=mo_best\')">\n';
-              html += '				<div class="itemPic">\n';
-              html += '				<img alt="BLACK-a" class=" vLHTC pd_img" src="' + item.imageUrl + '">\n';
-              html += '				</div>\n';
-              html += '				<div class="itemName">'+item.itemName+'</div>\n';
-              if(item.count < 10){
-                html += '				<div class="viewCount">10명 미만</div>\n';
-              }else{
-                html += '				<div class="viewCount">'+item.count.addComma()+'명 보는중</div>\n';
-              }
-              html += '			</a>\n';
-              html += '		</div>\n';
-              html += '	</div>\n';
-              html += '</div>\n';
-            }
-          });
-        }
-
-        $("#itemViewArea").append(html);
-        $("#researchBtn").attr("onclick","fnRealtimeViewBestList("+cateNo+");");
-        /* SLIDE - 지금많이 보고있어요 */
-        //210624_ 추가 : 슬라이드 속성 추가.
-        var dp_viewitem_slide = new Swiper('.view_item .swiper-container', {
-          slidesPerView: 'auto',
-          slidesPerView: 3,
-          spaceBetween: 8,
-          speed: 1000,
-          centerMode: true,
-          a11y: {
-            enabled: true,
-            notificationClass: 'swiper-notification',
-            prevSlideMessage: '이전 슬라이드',
-            nextSlideMessage: '다음 슬라이드',
-            firstSlideMessage: '첫번째 슬라이드 입니다',
-            lastSlideMessage: '마지막 슬라이드 입니다',
-            paginationBulletMessage: '슬라이드 {{index}}로 이동',
-          },
-          autoplay : {
-            delay : 3000,   // 시간 설정
-            disableOnInteraction: true,
-          },
-        });
-      });
-    }
-
-    var fnBestTop100List = function (){
-      gagajf.ajaxFormSubmit("/display/best/main/goods/list", document.bestGoodsForm,  fnCallbackBestTop100);
-    }
-
-    let bestCnt = 0;
-    let eigenBestCnt = 0;
-
-    var fnCallbackBestTop100 = function (result){
-      $("#prodArea").html('');
-      var tag = '';
-
-      bestCnt = result.dataList.length;
-
-      if(result.dataList.length > 0){
-        $.each(result.dataList, function (idx, item){
-          tag += '<div class="item_prod">\n';
-          tag += '	<div class="item_state">\n';
-          tag += '		<button type="button" class="itemLike"  onclick="wishlistDelete(this)" goodsCd="'+item.goodsCd+'" goodsNm="'+ item.goodsNm+'" ithrCd="" contentsLoc="IN10_01" planDtlSq="">관심상품 추가</button>\n';
-          tag += '		<a href="javascript:void(0);" class="itemLink" onclick="cfnGoToGoodsDetail(\''+item.goodsCd+'\', \''+item.colorCd+'\')">\n';
-          tag += '<div class="shape ';
-          if(idx==0){
-            tag += ' ranker';
-          }
-          tag += '"><span>'+(idx+1)+'</span></div>\n';
-          tag += '			<div class="itemPic">\n';
-          tag += '				<img alt="BLUE-a" class=" vLHTC pd_img" src="' + _uploadGoodsUrl + '/' + item.sysImgNm + '">\n';
-          tag += '			</div>\n';
-          tag += '			<p class="itemBrand">'+item.brandGroupNm+'</p>\n';
-          if (item.goodsTnm != null && item.goodsTnm != '') {
-            tag+='					<div class="itemComment">'+item.goodsTnm+'</div>\n';
-          }
-          tag += '			<div class="itemName">'+item.goodsFullNm+'</div>\n';
-          tag += '			<p class="itemPrice">';
-          if (item.currPrice != item.listPrice) {
-            tag += '						<span class="itemPrice_original">' + item.listPrice.addComma() + '</span>\n';
-          }
-          tag += item.currPrice.addComma();
-          if (item.currPrice != item.listPrice) {
-            tag+='						<span class=" itemPercent">'+ Math.round((item.listPrice - item.currPrice) / (item.listPrice * 1.0) * 100) +'%</span>\n';
-          }
-          tag += '			</p>\n';
-          tag += '			<div class="itemcolorchip">\n';
-          if(!gagajf.isNull(item.colorChips)){
-            var colorArr = item.colorChips.split(",");
-            var colorCd = '';
-            var rgbColor = '';
-            for(let i=0; i<colorArr.length; i++){
-              var colorInfo = colorArr[i].split(":");
-              colorCd = colorInfo[0];
-              rgbColor = colorInfo[1];
-              if(rgbColor=='#FFFFFF'){
-                tag += '	<span class="chip_color" style="background-color: '+rgbColor+';border:1px solid #aaa;" value="'+colorCd+'">'+colorCd+'</span>\n';
-              }else{
-                tag += '	<span class="chip_color" style="background-color: '+rgbColor+'" value="'+colorCd+'">'+colorCd+'</span>\n';
-              }
-            }
-          }
-          tag += '			</div>\n';
-          if(!gagajf.isNull(item.icon)){
-            var iconArr = item.icon.split(",");
-            var iconGb = '';
-            var iconNm = '';
-            tag += '	<p class="itemBadge">\n';
-            let arrCnt;
-            if(iconArr.length > 2){
-              arrCnt = 3;
-            }else{
-              arrCnt = iconArr.length;
-            }
-            for(let i=0; i<arrCnt; i++){
-              var iconInfo = iconArr[i].split(":");
-              iconGb = iconInfo[0];
-              iconNm = iconInfo[1];
-              tag += '	<span class="badge13" value="'+iconGb+'">'+iconNm+' </span>\n';
-            }
-            tag += '	</p>';
-          }
-
-          tag += '		</a>\n';
-          tag += '	</div>\n';
-          tag += '</div>\n';
-        });
-
-        $("#prodArea").append(tag);
-      }
-
-      // 수동설정이 100미만이면 추천솔루션 데이터 추가 조회
-      if(bestCnt < 100){
-        eigenBestCnt = 100 - bestCnt;
-        fnGetEigenBestData(eigenBestCnt);
-      }
-    }
-
-    // 추천솔루션 데이터 추가 조회
-    var fnGetEigenBestData = function (cnt){
-      var eigenUrl = '';
-      var selectCateNo = $("#bestGoodsForm input[name=cateNo]").val();
-      var rccode = "";
-      if(gagajf.isNull(selectCateNo)){
-        /* cateNo 전체 일 때 */
-        rccode = "mo_best_m61";
-        eigenUrl = 'https://api.eigene.io/rec/m061?size='+cnt+'&cuid=1252aed4-78dc-46e8-b784-94ac42e86dd4' +"&rccode=mo_best_m61";
-      }else{
-    	  rccode = "mo_best_m60";
-        eigenUrl = 'https://api.eigene.io/rec/m060?size='+cnt+'&cuid=1252aed4-78dc-46e8-b784-94ac42e86dd4&incids='+selectCateNo +"&rccode=mo_best_m60";
-      }
-      var tag = '';
-	  
-      $.getJSON(eigenUrl, function (result, status){
-        if (status === 'success') {
-          if (!gagajf.isNull(result.results)) {
-            $.each(result.results, function (idx, item) {
-              tag += '<div class="item_prod">\n';
-              tag += '	<div class="item_state">\n';
-              tag += '		<button type="button" class="itemLike"  onclick="wishlistDelete(this)" goodsCd="'+item.product.itemId+'" goodsNm="'+ item.product.itemName+'" ithrCd="" contentsLoc="IN10_01" planDtlSq="">관심상품 추가</button>\n';
-              tag += '		<a href="javascript:void(0);" class="itemLink" onclick="cfnGoToGoodsDetail(\''+item.product.itemId+'\', \'\', \'\', \'\', \'\', \''+rccode+'\')">\n';
-              tag += '<div class="shape ';
-              if(cnt == 100 && idx==0){
-                tag += ' ranker';
-              }
-              tag += '"><span>'+(idx+1)+'</span></div>\n';
-              tag += '			<div class="itemPic">\n';
-              tag += '				<img alt="BLUE-a" class=" vLHTC pd_img" src="'+ item.product.itemImage +'">\n';
-              tag += '			</div>\n';
-              tag += '			<p class="itemBrand">'+item.product.brandName+'</p>\n';
-              tag += '			<div class="itemName">'+item.product.itemName+'</div>\n';
-              tag += '			<p class="itemPrice">';
-              if (item.product.originalPrice != item.product.salePrice) {
-                tag += '						<span class="itemPrice_original">' + item.product.originalPrice.addComma() + '</span>\n';
-              }
-              tag += item.product.salePrice.addComma();
-              if (item.product.originalPrice != item.product.salePrice) {
-                tag+='						<span class=" itemPercent">'+ Math.round((item.product.originalPrice - item.product.salePrice) / (item.product.originalPrice * 1.0) * 100) +'%</span>\n';
-              }
-              tag += '			</p>\n';
-              tag += '		</a>\n';
-              tag += '	</div>\n';
-              tag += '</div>\n';
-            });
-            $("#prodArea").append(tag);
-          }
-        }
-      });
-    }
-
-    // 구매 성별/연령 별 베스트 상품 추천
-    var fnGetEigenD002 = function (obj, key){
-      var gender = '';
-      var age = '';
-
-      if(key == 'gender'){
-        gender = $(obj).attr("data-id");
-        $("#odDatePop2").find(".popup_con .button_list").find("button").each(function (){
-          if($(this).hasClass("on")){
-            age = $(this).attr("data-id");
-          }
-        });
-      }else{
-        age = $(obj).attr("data-id");
-        $("#odDatePop1").find(".popup_con .button_list").find("button").each(function (){
-          if($(this).hasClass("on")){
-            gender = $(this).attr("data-id");
-          }
-        });
-      }
-
-      if(gagajf.isNull(gender) && gagajf.isNull(age)){
-        $("#prodArea").html('');
-        fnGetEigenBestData(100);
-      }else{
-        $("#prodArea").html('');
-        var eigenUrl = 'https://api.eigene.io/rec/d002?size=100&cuid=1252aed4-78dc-46e8-b784-94ac42e86dd4&gender='+gender+'&age='+age +"&rccode=mo_best_d2";
-        var tag = '';
-        $.getJSON(eigenUrl, function (result, status){
-          if (status === 'success') {
-            if (!gagajf.isNull(result.results)) {
-              $.each(result.results, function (idx, item) {
-                tag += '<div class="item_prod">\n';
-                tag += '	<div class="item_state">\n';
-                tag += '		<button type="button" class="itemLike"  onclick="wishlistDelete(this)" goodsCd="'+item.product.itemId+'" goodsNm="'+ item.product.itemName+'" ithrCd="" contentsLoc="IN10_01" planDtlSq="">관심상품 추가</button>\n';
-                tag += '		<a href="javascript:void(0);" class="itemLink" onclick="cfnGoToGoodsDetail(\''+item.product.itemId+'\', \'\', \'\', \'\', \'\', \'mo_best_d2\')">\n';
-                tag += '<div class="shape ';
-                if(idx==0){
-                  tag += ' ranker';
-                }
-                tag += '"><span>'+(idx+1)+'</span></div>\n';
-                tag += '			<div class="itemPic">\n';
-                tag += '				<img alt="BLUE-a" class=" vLHTC pd_img" src="'+ item.product.itemImage +'">\n';
-                tag += '			</div>\n';
-                tag += '			<p class="itemBrand">'+item.product.brandName+'</p>\n';
-                tag += '			<div class="itemName">'+item.product.itemName+'</div>\n';
-                tag += '			<p class="itemPrice">';
-                if (item.product.originalPrice != item.product.salePrice) {
-                  tag += '						<span class="itemPrice_original">' + item.product.originalPrice.addComma() + '</span>\n';
-                }
-                tag += item.product.salePrice.addComma();
-                if (item.product.originalPrice != item.product.salePrice) {
-                  tag+='						<span class=" itemPercent">'+ Math.round((item.product.originalPrice - item.product.salePrice) / (item.product.originalPrice * 1.0) * 100) +'%</span>\n';
-                }
-                tag += '			</p>\n';
-                tag += '		</a>\n';
-                tag += '	</div>\n';
-                tag += '</div>\n';
-              });
-              $("#prodArea").append(tag);
-            }
-          }
-        });
-      }
-    }
-
-    $(document).ready(function() {
-      fnBestListSearch();
-    });
-
-
-    /*]]>*/
-  </script>
-
-</th:block>
-
-</body>
-</html>
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org"
+	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
+	layout:decorator="mob/common/layout/DefaultLayoutMob">
+<!--
+ *******************************************************************************
+ * @source  : BestMainFormMob.html
+ * @desc    : 베스트메인 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.05.10   bin2107     최초 작성
+ *******************************************************************************
+ -->
+<body>
+
+<th:block layout:fragment="content">
+  <main role="" id="" class="container dp">
+
+    <section class="content dp_best">
+      <div class="inner wide">
+        <div class="category_nav">
+          <ul id="cateListArea">
+            <li class="" id="li0"><button type="button" onclick="fnBestListSearch(this,'');">전체</button></li>
+            <th:block th:each="item, stat : ${bestCateList}">
+              <li class="" th:id="${'li'+item.cateNo}"><button type="button" th:onclick="fnBestListSearch(this,[[${item.cateNo}]]);" th:text="${item.cateNm}">여성</button></li>
+            </th:block>
+          </ul>
+        </div>
+      </div>
+      <div class="inner bg_gray">
+        <div class="view_item">
+          <div class="count_wrap">
+            <div>
+              <p>지금 많이 <span>보고 있어요</span></p>
+            </div>
+            <div>
+              <ul class="dp_util">
+                <li><a href="javascript:void(0);" id="researchBtn" class="refresh" th:text="${#calendars.format(#calendars.createNow(), 'HH:mm')+' 기준'}">17:30 기준</a></li>
+              </ul>
+            </div>
+          </div>
+          <div class="swiper-container item_list">
+            <div class="swiper-wrapper" id="itemViewArea">
+            </div>
+          </div>
+        </div>
+      </div>
+
+      <div class="inner">
+        <div class="best_item">
+          <h2 class="dp_subtitle">베스트 TOP 100</h2>
+          <div class="item_list">
+            <div class="count_wrap">
+              <ul class="dp_util">
+                <li>
+                  <div class="open_categori sex">
+                    <a id="filter">구매 성별 전체
+                    </a>
+                  </div>
+                </li>
+                <li>
+                  <div class="open_categori age">
+                    <a id="filter">구매 연령 전체
+                    </a>
+                  </div>
+                </li>
+              </ul>
+            </div>
+            <div class="list_content">
+              <div class="itemsGrp" id="prodArea">
+              </div>
+            </div>
+            <div class="list_last" id="divLastPage" style="display: none;">마지막페이지 입니다.</div>
+          </div>
+        </div>
+      </div>
+    </section>
+
+    <!-- 카테고리 -->
+    <div class="category_box">
+      <div class="lap">
+        <div class="category_close">카테고리닫기</div>
+        <div class="category_list">
+          <!-- 카테고리 선택 -->
+          <div class="selcet_list">
+            <ul>
+              <li class="active"><a href="javascript:void(0)">구매성별 전체</a></li>
+              <li><a href="javascript:void(0)">구매성별1</a></li>
+              <li><a href="javascript:void(0)">구매성별2</a></li>
+              <li><a href="javascript:void(0)">구매성별3</a></li>
+              <li><a href="javascript:void(0)">구매성별4</a></li>
+            </ul>
+          </div>
+          <!-- //카테고리 선택 -->
+        </div>
+      </div>
+    </div>
+    <!-- //카테고리 -->
+
+    <!-- 210415_최신상품순 리스트 팝업 추가 -->
+    <div id="odDatePop1" class="popup_box odDatePop">
+      <div class="lap">
+        <div class="popup_close">카테고리닫기</div>
+        <div class="popup_head sr-only">
+          <h2 class="">기간 선택 팝업</h2>
+        </div>
+        <div class="popup_con">
+          <div class="button_list clear">
+            <button type="button" class="on" onclick="fnGetEigenD002(this, 'gender');" data-id="" ><span>구매성별 전체</span></button>
+            <button type="button" onclick="fnGetEigenD002(this, 'gender');" data-id="A" ><span>남성</span></button>
+            <button type="button" onclick="fnGetEigenD002(this, 'gender');" data-id="B" ><span>여성</span></button>
+          </div>
+        </div>
+      </div>
+    </div>
+    <div id="odDatePop2" class="popup_box odDatePop">
+      <div class="lap">
+        <div class="popup_close">카테고리닫기</div>
+        <div class="popup_head sr-only">
+          <h2 class="">기간 선택 팝업</h2>
+        </div>
+        <div class="popup_con">
+          <div class="button_list clear">
+            <button type="button" class="on" onclick="fnGetEigenD002(this, 'age');" data-id="" ><span>구매연령 전체</span></button>
+            <button type="button" onclick="fnGetEigenD002(this, 'age');" data-id="10" ><span>10대</span></button>
+            <button type="button" onclick="fnGetEigenD002(this, 'age');" data-id="20" ><span>20대</span></button>
+            <button type="button" onclick="fnGetEigenD002(this, 'age');" data-id="30" ><span>30대</span></button>
+            <button type="button" onclick="fnGetEigenD002(this, 'age');" data-id="40" ><span>40대</span></button>
+            <button type="button" onclick="fnGetEigenD002(this, 'age');" data-id="50" ><span>50대 이상</span></button>
+          </div>
+        </div>
+      </div>
+    </div>
+  </main>
+
+  <form id="bestGoodsForm" name="bestGoodsForm">
+    <input type="hidden" name="pageNo" id="pageNo" value ="1"/>
+    <input type="hidden" name="pageSize" value ="50"/>
+    <input type="hidden" name="cateNo" value=""/>
+    <input type="hidden" name="sortGb"/>
+  </form>
+
+  <!-- 수동설정 + 추천솔루션 카운트 문제로 인해 인피티니스크롤 제거 협의 21-07-21 -->
+<!--	<script src="/ux/plugins/gaga/gaga.infinite.scrollSession.js"></script>-->
+<!--	<script src="/ux/plugins/jquery/jquery.history.min.js"></script>-->
+<!--	<script th:src="@{'/biz/goods.js?v=' + ${#calendars.format(#calendars.createNow(), 'yyyyMMddHHmmss')}}" src="/biz/goods.js"></script>-->
+
+
+  <script th:inline="javascript">
+    /*<![CDATA[*/
+    var bestCateList = [[${bestCateList}]];
+    $(document).ready(function(){
+      $(document).on('click','.sub_category .more_btn',function(){
+        $(this).toggleClass('on');
+        $('.sub_category .cate_wrap').toggleClass('on');
+        if($(this).hasClass('on')){
+          $(this).find('span').text('접기');
+        }else{
+          $(this).find('span').text('더보기');
+        }
+      });
+
+      //카테고리
+      function category(){
+        var categoryOpen=$(".open_categori .select_dress");
+        var categoryClose=$(".category_box .category_close");
+        var categoryPop=$(".category_box");
+
+        categoryOpen.on("click",function(){
+          categoryPop.show();
+          categoryPop.addClass("active");
+          $("body").css({"overflow":"hidden"});
+        });
+
+        categoryClose.on("click",function(){
+          categoryPop.hide();
+          $("body").css({"overflow":"visible"});
+        });
+      }
+      category();
+
+      // 210415_팝업관련 추가
+      //기간 선택 팝업
+      $(document).on("click", ".open_categori.sex", function(){
+        $('#odDatePop1').show().addClass("active");
+        $("body").css({"overflow":"hidden"});
+      });
+      $(document).on("click", ".open_categori.age", function(){
+        $('#odDatePop2').show().addClass("active");
+        $("body").css({"overflow":"hidden"});
+      });
+      //팝업_닫기
+      $('.popup_close').on("click",function(){
+        $('.popup_box').hide().removeClass('active');
+        $("body").css({"overflow":"visible"});
+      });
+
+      //210510_수정 : 토스트 팝업 버튼 on 클래스 제어.
+      $(document).on('click','.popup_box .button_list button',function(){
+        $(this).siblings('.button_list button').removeClass('on');
+        $(this).addClass('on');
+      })
+
+      //210510_추가 : 토스트 팝업 button 클릭 시 팝업 닫기.
+      $(document).on('click','.popup_box.odDatePop .button_list button',function(){
+        $(this).parents('.popup_box.odDatePop').hide().removeClass('active');
+        $("body").css({"overflow":"visible"});
+      })
+
+      $(document).on('click','.popup_box.odDatePop .button_list button',function(){
+        $(this).parents('.popup_box.odDatePop').hide().removeClass('active');
+        $("body").css({"overflow":"visible"});
+      })
+    });
+
+    var fnBestListSearch = function (obj, cateNo){
+      $.each($("#cateListArea").find('li').find('button'), function() {
+        $(this).removeClass();
+      });
+      if(gagajf.isNull(cateNo)){
+        $("#li0").find("button").addClass('active');
+      }else{
+        $("#li"+cateNo).find("button").addClass('active');
+      }
+
+      $("#bestGoodsForm input[name=cateNo]").val(cateNo);
+
+      // 카테고리별 실시간 베스트 상품 조회 getRealtimeViewBestGoodsList
+      fnRealtimeViewBestList(cateNo);
+
+      // TOP100 조회
+      fnBestTop100List();
+    }
+
+    var fnRealtimeViewBestList = function (cateNo){
+      if(gagajf.isNull(cateNo)){
+        cateNo = "";
+      }
+      var data = {cateNo : cateNo};
+      var html = '';
+
+      $.getJSON('/display/realtime/best/list' , data, function (result, status){
+        $("#itemViewArea").html('');
+        // console.log(result);
+        if(result.length > 0){
+          $.each(result, function (idx, item){
+            // 2021.08.30 이미지 null 처리
+            if (item.itemName != null) {
+              var imgUrl = '';
+
+              html += '<div class="swiper-slide">\n';
+              html += '	<div class="item_prod">\n';
+              html += '		<div class="item_state">\n';
+              html += '			<a href="javascript:void(0);" class="itemLink" onclick="cfnGoToGoodsDetail(\''+item.itemId+'\',\'\',\'\',\'\',\'\',\'rts_mo_best&rtscode=mo_best\')">\n';
+              html += '				<div class="itemPic">\n';
+              html += '				<img alt="BLACK-a" class=" vLHTC pd_img" src="' + item.imageUrl + '">\n';
+              html += '				</div>\n';
+              html += '				<div class="itemName">'+item.itemName+'</div>\n';
+              if(item.count < 10){
+                html += '				<div class="viewCount">10명 미만</div>\n';
+              }else{
+                html += '				<div class="viewCount">'+item.count.addComma()+'명 보는중</div>\n';
+              }
+              html += '			</a>\n';
+              html += '		</div>\n';
+              html += '	</div>\n';
+              html += '</div>\n';
+            }
+          });
+        }
+
+        $("#itemViewArea").append(html);
+        $("#researchBtn").attr("onclick","fnRealtimeViewBestList("+cateNo+");");
+        /* SLIDE - 지금많이 보고있어요 */
+        //210624_ 추가 : 슬라이드 속성 추가.
+        var dp_viewitem_slide = new Swiper('.view_item .swiper-container', {
+          slidesPerView: 'auto',
+          slidesPerView: 3,
+          spaceBetween: 8,
+          speed: 1000,
+          centerMode: true,
+          a11y: {
+            enabled: true,
+            notificationClass: 'swiper-notification',
+            prevSlideMessage: '이전 슬라이드',
+            nextSlideMessage: '다음 슬라이드',
+            firstSlideMessage: '첫번째 슬라이드 입니다',
+            lastSlideMessage: '마지막 슬라이드 입니다',
+            paginationBulletMessage: '슬라이드 {{index}}로 이동',
+          },
+          autoplay : {
+            delay : 3000,   // 시간 설정
+            disableOnInteraction: true,
+          },
+        });
+      });
+    }
+
+    var fnBestTop100List = function (){
+      gagajf.ajaxFormSubmit("/display/best/main/goods/list", document.bestGoodsForm,  fnCallbackBestTop100);
+    }
+
+    let bestCnt = 0;
+    let eigenBestCnt = 0;
+
+    var fnCallbackBestTop100 = function (result){
+      $("#prodArea").html('');
+      var tag = '';
+
+      bestCnt = result.dataList.length;
+
+      if(result.dataList.length > 0){
+        $.each(result.dataList, function (idx, item){
+          tag += '<div class="item_prod">\n';
+          tag += '	<div class="item_state">\n';
+          tag += '		<button type="button" class="itemLike"  onclick="wishlistDelete(this)" goodsCd="'+item.goodsCd+'" goodsNm="'+ item.goodsNm+'" ithrCd="" contentsLoc="IN10_01" planDtlSq="">관심상품 추가</button>\n';
+          tag += '		<a href="javascript:void(0);" class="itemLink" onclick="cfnGoToGoodsDetail(\''+item.goodsCd+'\', \''+item.colorCd+'\', \'\', \'\', \'\', \'mo_best_m60\')">\n';
+          tag += '<div class="shape ';
+          if(idx==0){
+            tag += ' ranker';
+          }
+          tag += '"><span>'+(idx+1)+'</span></div>\n';
+          tag += '			<div class="itemPic">\n';
+          tag += '				<img alt="BLUE-a" class=" vLHTC pd_img" src="' + _uploadGoodsUrl + '/' + item.sysImgNm + '">\n';
+          tag += '			</div>\n';
+          tag += '			<p class="itemBrand">'+item.brandGroupNm+'</p>\n';
+          if (item.goodsTnm != null && item.goodsTnm != '') {
+            tag+='					<div class="itemComment">'+item.goodsTnm+'</div>\n';
+          }
+          tag += '			<div class="itemName">'+item.goodsFullNm+'</div>\n';
+          tag += '			<p class="itemPrice">';
+          if (item.currPrice != item.listPrice) {
+            tag += '						<span class="itemPrice_original">' + item.listPrice.addComma() + '</span>\n';
+          }
+          tag += item.currPrice.addComma();
+          if (item.currPrice != item.listPrice) {
+            tag+='						<span class=" itemPercent">'+ Math.round((item.listPrice - item.currPrice) / (item.listPrice * 1.0) * 100) +'%</span>\n';
+          }
+          tag += '			</p>\n';
+          tag += '			<div class="itemcolorchip">\n';
+          if(!gagajf.isNull(item.colorChips)){
+            var colorArr = item.colorChips.split(",");
+            var colorCd = '';
+            var rgbColor = '';
+            for(let i=0; i<colorArr.length; i++){
+              var colorInfo = colorArr[i].split(":");
+              colorCd = colorInfo[0];
+              rgbColor = colorInfo[1];
+              if(rgbColor=='#FFFFFF'){
+                tag += '	<span class="chip_color" style="background-color: '+rgbColor+';border:1px solid #aaa;" value="'+colorCd+'">'+colorCd+'</span>\n';
+              }else{
+                tag += '	<span class="chip_color" style="background-color: '+rgbColor+'" value="'+colorCd+'">'+colorCd+'</span>\n';
+              }
+            }
+          }
+          tag += '			</div>\n';
+          if(!gagajf.isNull(item.icon)){
+            var iconArr = item.icon.split(",");
+            var iconGb = '';
+            var iconNm = '';
+            tag += '	<p class="itemBadge">\n';
+            let arrCnt;
+            if(iconArr.length > 2){
+              arrCnt = 3;
+            }else{
+              arrCnt = iconArr.length;
+            }
+            for(let i=0; i<arrCnt; i++){
+              var iconInfo = iconArr[i].split(":");
+              iconGb = iconInfo[0];
+              iconNm = iconInfo[1];
+              tag += '	<span class="badge13" value="'+iconGb+'">'+iconNm+' </span>\n';
+            }
+            tag += '	</p>';
+          }
+
+          tag += '		</a>\n';
+          tag += '	</div>\n';
+          tag += '</div>\n';
+        });
+
+        $("#prodArea").append(tag);
+      }
+
+      // 수동설정이 100미만이면 추천솔루션 데이터 추가 조회
+      if(bestCnt < 100){
+        eigenBestCnt = 100 - bestCnt;
+        fnGetEigenBestData(eigenBestCnt);
+      }
+    }
+
+    // 추천솔루션 데이터 추가 조회
+    var fnGetEigenBestData = function (cnt){
+      var eigenUrl = '';
+      var selectCateNo = $("#bestGoodsForm input[name=cateNo]").val();
+      var rccode = "";
+      if(gagajf.isNull(selectCateNo)){
+        /* cateNo 전체 일 때 */
+        rccode = "mo_best_m61";
+        eigenUrl = 'https://api.eigene.io/rec/m061?size='+cnt+'&cuid=1252aed4-78dc-46e8-b784-94ac42e86dd4' +"&rccode=mo_best_m61";
+      }else{
+    	  rccode = "mo_best_m60";
+        eigenUrl = 'https://api.eigene.io/rec/m060?size='+cnt+'&cuid=1252aed4-78dc-46e8-b784-94ac42e86dd4&incids='+selectCateNo +"&rccode=mo_best_m60";
+      }
+      var tag = '';
+	  
+      $.getJSON(eigenUrl, function (result, status){
+        if (status === 'success') {
+          if (!gagajf.isNull(result.results)) {
+            $.each(result.results, function (idx, item) {
+              tag += '<div class="item_prod">\n';
+              tag += '	<div class="item_state">\n';
+              tag += '		<button type="button" class="itemLike"  onclick="wishlistDelete(this)" goodsCd="'+item.product.itemId+'" goodsNm="'+ item.product.itemName+'" ithrCd="" contentsLoc="IN10_01" planDtlSq="">관심상품 추가</button>\n';
+              tag += '		<a href="javascript:void(0);" class="itemLink" onclick="cfnGoToGoodsDetail(\''+item.product.itemId+'\', \'\', \'\', \'\', \'\', \''+rccode+'\')">\n';
+              tag += '<div class="shape ';
+              if(cnt == 100 && idx==0){
+                tag += ' ranker';
+              }
+              tag += '"><span>'+(idx+1)+'</span></div>\n';
+              tag += '			<div class="itemPic">\n';
+              tag += '				<img alt="BLUE-a" class=" vLHTC pd_img" src="'+ item.product.itemImage +'">\n';
+              tag += '			</div>\n';
+              tag += '			<p class="itemBrand">'+item.product.brandName+'</p>\n';
+              tag += '			<div class="itemName">'+item.product.itemName+'</div>\n';
+              tag += '			<p class="itemPrice">';
+              if (item.product.originalPrice != item.product.salePrice) {
+                tag += '						<span class="itemPrice_original">' + item.product.originalPrice.addComma() + '</span>\n';
+              }
+              tag += item.product.salePrice.addComma();
+              if (item.product.originalPrice != item.product.salePrice) {
+                tag+='						<span class=" itemPercent">'+ Math.round((item.product.originalPrice - item.product.salePrice) / (item.product.originalPrice * 1.0) * 100) +'%</span>\n';
+              }
+              tag += '			</p>\n';
+              tag += '		</a>\n';
+              tag += '	</div>\n';
+              tag += '</div>\n';
+            });
+            $("#prodArea").append(tag);
+          }
+        }
+      });
+    }
+
+    // 구매 성별/연령 별 베스트 상품 추천
+    var fnGetEigenD002 = function (obj, key){
+      var gender = '';
+      var age = '';
+
+      if(key == 'gender'){
+        gender = $(obj).attr("data-id");
+        $("#odDatePop2").find(".popup_con .button_list").find("button").each(function (){
+          if($(this).hasClass("on")){
+            age = $(this).attr("data-id");
+          }
+        });
+      }else{
+        age = $(obj).attr("data-id");
+        $("#odDatePop1").find(".popup_con .button_list").find("button").each(function (){
+          if($(this).hasClass("on")){
+            gender = $(this).attr("data-id");
+          }
+        });
+      }
+
+      if(gagajf.isNull(gender) && gagajf.isNull(age)){
+        $("#prodArea").html('');
+        fnGetEigenBestData(100);
+      }else{
+        $("#prodArea").html('');
+        var eigenUrl = 'https://api.eigene.io/rec/d002?size=100&cuid=1252aed4-78dc-46e8-b784-94ac42e86dd4&gender='+gender+'&age='+age +"&rccode=mo_best_d2";
+        var tag = '';
+        $.getJSON(eigenUrl, function (result, status){
+          if (status === 'success') {
+            if (!gagajf.isNull(result.results)) {
+              $.each(result.results, function (idx, item) {
+                tag += '<div class="item_prod">\n';
+                tag += '	<div class="item_state">\n';
+                tag += '		<button type="button" class="itemLike"  onclick="wishlistDelete(this)" goodsCd="'+item.product.itemId+'" goodsNm="'+ item.product.itemName+'" ithrCd="" contentsLoc="IN10_01" planDtlSq="">관심상품 추가</button>\n';
+                tag += '		<a href="javascript:void(0);" class="itemLink" onclick="cfnGoToGoodsDetail(\''+item.product.itemId+'\', \'\', \'\', \'\', \'\', \'mo_best_d2\')">\n';
+                tag += '<div class="shape ';
+                if(idx==0){
+                  tag += ' ranker';
+                }
+                tag += '"><span>'+(idx+1)+'</span></div>\n';
+                tag += '			<div class="itemPic">\n';
+                tag += '				<img alt="BLUE-a" class=" vLHTC pd_img" src="'+ item.product.itemImage +'">\n';
+                tag += '			</div>\n';
+                tag += '			<p class="itemBrand">'+item.product.brandName+'</p>\n';
+                tag += '			<div class="itemName">'+item.product.itemName+'</div>\n';
+                tag += '			<p class="itemPrice">';
+                if (item.product.originalPrice != item.product.salePrice) {
+                  tag += '						<span class="itemPrice_original">' + item.product.originalPrice.addComma() + '</span>\n';
+                }
+                tag += item.product.salePrice.addComma();
+                if (item.product.originalPrice != item.product.salePrice) {
+                  tag+='						<span class=" itemPercent">'+ Math.round((item.product.originalPrice - item.product.salePrice) / (item.product.originalPrice * 1.0) * 100) +'%</span>\n';
+                }
+                tag += '			</p>\n';
+                tag += '		</a>\n';
+                tag += '	</div>\n';
+                tag += '</div>\n';
+              });
+              $("#prodArea").append(tag);
+            }
+          }
+        });
+      }
+    }
+
+    $(document).ready(function() {
+      fnBestListSearch();
+    });
+
+
+    /*]]>*/
+  </script>
+
+</th:block>
+
+</body>
+</html>

+ 509 - 509
src/main/webapp/WEB-INF/views/mob/display/BrandSearchLayerMob.html

@@ -1,509 +1,509 @@
-<!DOCTYPE html>
-<html lang="ko"
-	xmlns:th="http://www.thymeleaf.org">
-<!--
- *******************************************************************************
- * @source  : BrandSearchLayerMob.html
- * @desc    : 검색 레이어 Page
- *============================================================================
- * STYLE24
- * Copyright(C) 2020 TSIT, All rights reserved.
- *============================================================================
- * VER  DATE         AUTHOR      DESCRIPTION
- * ===  ===========  ==========  =============================================
- * 1.0  2021.07.12   bin2107     최초 작성
- *******************************************************************************
- -->
-<body>
-<div class="modal-dialog" role="document">
-	<div class="modal-content">
-		<div class="modal-header htop">
-			<h5 class="modal-title sr-only" id="schPopLabel">통합검색</h5>
-		</div>
-		<div class="modal-body">
-			<section class="sch_result">
-				<!-- 1.통합검색 default -->
-				<div class="inner">
-					<form id="searchMainForm" name="searchMainForm">
-						<input type="hidden" name="brandGroupNo" th:value="${brandGroupNo}"/>
-						<div class="sch_title">
-							<input type="text" class="form_control" name="keyword" placeholder="브랜드 검색어를 입력하세요." autocomplete="off" onkeyup="fnOnkeyupKeyword(this);">
-							<button type="button" class="btn_x" id="deleteKeyword" style="display:none;">X</button>
-							<button type="button" class="btn_sch" id="btnSearchKeyword"><img th:src="${@environment.getProperty('domain.uximage')} + '/images/mo/ico_btn_search.png'" alt=""></button>
-						</div>
-					</form>
-				</div>
-
-				<div class="inner default_box" id="defaultArea">
-					<div class="filter-list">
-						<div class="f_left">
-							<h3>최근 검색어</h3>
-						</div>
-						<div class="f_right">
-						</div>
-					</div>
-					<div class="search-list" th:classappend="${#lists.isEmpty(recentlyKeywordList)?'nodata':''}"> <!-- 검색데이터 없을시 nodata 클래스 추가. -->
-						<ul>
-							<li th:if="${recentlyKeywordList}" th:each="oneData, status : ${recentlyKeywordList}">
-								<a href="javascript:void(0);" th:onclick="fnSearchKeyword([[${oneData}]])">
-									<p th:text="${oneData}"></p>
-								</a>
-								<button type="button" class="xBtn" th:onclick="fnDeleteCookie(this,[[${oneData}]]);"><span>삭제</span></button>
-							</li>
-						</ul>
-						<p class="nodata_txt" th:if="${#lists.isEmpty(recentlyKeywordList)}">최근 검색어가 없습니다.</p>
-					</div>
-					<h3 class="hot-key" th:if="${brandGroupNo==null}">STYLE24에서 검색되고 있어요</h3>
-					<div class="related_keyword" th:if="${brandGroupNo==null}">
-						<div class="sub_category">
-							<div class="cate_wrap" id="popularKeyArea">
-		<!--						<a href="javascript:;" class="on">전체</a>-->
-							</div>
-						</div>
-					</div>
-				</div>
-				<!-- //1.통합검색 default -->
-
-				<!-- 3.지금 많이 보고 있어요 상품. -->
-				<div class="inner default_box" id="popularArea">
-					<div class="now_view">
-						<div class="store_product">
-							<div class="allresult-tit">
-								<h3>지금 많이 보고 있어요</h3>
-								<button class="btn_refresh" onclick="fnRealtimeGoodsList();"><span th:text="${#calendars.format(#calendars.createNow(), 'HH:mm')}">17:30</span> 기준</button>
-							</div>
-							<div class="swiper-container sch_product">
-								<div class="swiper-wrapper" id="itemViewArea">
-									<th:block th:each="item, status : ${realtimeGoodsList}">
-										<div class="swiper-slide">
-											<div class="item_prod">
-												<button type="button" class="itemLike" th:classappend="${item.wishCnt > 0}? 'likeit' : ''" onclick="cfnMoPutWishList(this);" th:attr="goodsCd=${item.itemId}">관심상품 추가</button>
-												<a th:href="${item.itemUrl} + '&rccode=rts_mo_search&rtscode=mo_search'">
-													<img th:src="${item.imageUrl}" alt="">
-													<div class="s-text">
-														<div class="itemName" th:text="${item.itemName}"></div>
-														<p class="itemTag" th:text="${item.count < 10 ? '10명 미만' : item.count + '명 보는중'}">508명 보는중</p>
-													</div>
-												</a>
-											</div>
-										</div>
-									</th:block>
-								</div>
-							</div>
-						</div>
-					</div>
-				</div>
-				<!-- //3.지금 많이 보고 있어요 상품. -->
-
-				<!-- 4.검색어 타이핑 -->
-				<div class="inner searching_box" id="keyupArea" style="display:none;">
-<!--					<div class="filter-list store-list">-->
-<!--					</div>-->
-					<div class="relative-list">
-					</div>
-				</div>
-				<div class="inner empty_box2" id="relateGoodsDiv" style="display:none;">
-					<div class="recommand_product">
-						<div class="store_product">
-							<div class="swiper-container recommand_slide">
-								<h3>관련상품</h3>
-								<div class="swiper-wrapper" id="relateArea">
-
-								</div>
-							</div>
-						</div>
-					</div>
-				</div>
-				<!-- //4.검색어 타이핑 -->
-
-				<!-- 3.검색결과 없을때 -->
-				<div class="inner empty_box" id="noDataArea" style="display:none;">
-					<div class="relative-list nodata"> <!-- 검색결과 없을 시 nodata 클래스 추가 -->
-						<p class="nodata_txt">&lsquo;<span id="noDataKeyword"></span>&rsquo; 에 맞는 상품을 찾지 못했습니다.<br>검색어를 변경해 보세요.</p>
-					</div>
-					<h3 class="hot-key">STYLE24에서 검색되고 있어요</h3>
-					<div class="related_keyword">
-						<div class="sub_category">
-							<div class="cate_wrap" id="noDataRelatedKeyword">
-
-							</div>
-						</div>
-					</div>
-				</div>
-				<div class="inner empty_box" id="recommandArea" style="display:none;">
-					<div class="recommand_product">
-						<div class="store_product">
-							<div class="swiper-container recommand_slide">
-								<h3>이런 상품은 어떤가요?</h3>
-								<div class="swiper-wrapper" id="recommendItemArea">
-
-								</div>
-							</div>
-						</div>
-					</div>
-				</div>
-				<!-- //3.검색결과 없을때 -->
-			</section>
-		</div>
-	</div>
-</div>
-<script src="/ux/plugins/gaga/gaga.paging.js"></script>
-<script th:inline="javascript">
-	/*<![CDATA[*/
-	var enterBool = false;
-	var swiperschProduct = new Swiper('.swiper-container.sch_product', {
-		slidesPerView: 3,
-		spaceBetween: 7,
-		autoplay: {
-			delay: 4000,
-		},
-		freeMode: true,
-		//centeredSlides: true,
-	});
-
-	var swiperschProduct = new Swiper('.swiper-container.recommand_slide', {
-		slidesPerView: 2.2,
-		spaceBetween: 8,
-		autoplay: {
-			delay: 4000,
-		},
-		freeMode: true,
-		//centeredSlides: true,
-	});
-
-	$(".itemLike").click(function () {
-		$(this).toggleClass("likeit");
-	});
-
-	var ckKeyword = "st24ck_today_keyword";
-	var fnSetKeywordCookie = function(keyword) {
-		var arrKeyword = new Array;
-		var arrTempKeyword = new Array;
-		var j = 0;
-
-		arrKeyword = gagajf.getCookie(ckKeyword).split(",");
-
-		if (arrKeyword.length > 0) {
-			for (var i = 0; i < arrKeyword.length; i++) {
-				// 쿠키에 없으면
-				if (arrKeyword[i] != keyword && arrKeyword[i] != "") {
-					arrTempKeyword[j++] = arrKeyword[i];
-				}
-			}
-
-			arrTempKeyword[j++] = keyword;
-		} else {
-			gagajf.setCookie(ckKeyword, keyword, 1);
-		}
-
-		gagajf.setCookie(ckKeyword, arrTempKeyword, 1);
-	}
-
-	// 키워드 검색
-	$('#btnSearchKeyword').on('click', function() {
-		if (!gagajf.validation($('#searchMainForm'))) {
-			return false;
-		}
-
-		if( !enterBool ){
-			enterBool = true;
-			// 검색결과 상품목록 호출(있으면 검색결과 페이지로 이동)
-			gagajf.ajaxFormSubmit("/display/search/goods/list_cnt", document.searchMainForm, function(result) {
-				enterBool = false;
-				if( "0" == result.response_cnt){
-					$('.sch_result .default_box').hide();
-					$('.sch_result .searching_box').hide();
-					$('.sch_result .empty_box2').hide();
-					$('.sch_result .empty_box').show();
-					$("#noDataArea").find('#noDataKeyword').text($("#searchMainForm").find('input[name=keyword]').val());
-	
-					// 검색어 연관 상품 추천
-					fnRecommendItemList($("#searchMainForm").find('input[name=keyword]').val());
-					// 인기검색어
-					fnTrendKeywordList();
-	
-				}else{
-					let keyword = encodeURIComponent($('#searchMainForm input[name=keyword]').val());
-	
-					// 쿠키 세팅
-					fnSetKeywordCookie(keyword);
-	
-					let actionUrl = _PAGE_BRAND_SEARCH_GOODS + '?keyword=' + keyword + '&brandGroupNo=' + $('#searchMainForm input[name=brandGroupNo]').val();
-	
-					cfnGoToPage(actionUrl);
-				}
-			}, true);
-		}
-	});
-
-	// 검색어 찾기
-	var fnGetAutoSearch = function (){
-		gagajf.ajaxFormSubmit("/display/search/auto/complete", document.searchMainForm, fnAutoCompleteList);
-	}
-
-	// 검색어 찾기 결과
-	var fnAutoCompleteList = function (result){
-		if( enterBool ) return;
-
-		if(result && result.autoKeywords && result.autoKeywords.length==0 && gagajf.isNull(result.goodsList)){
-			$('.sch_result .default_box').hide();
-			$('.sch_result .searching_box').hide();
-			$('.sch_result .empty_box2').hide();
-
-		}else{
-			$('.sch_result .default_box').hide();
-			$('.sch_result .searching_box').show();
-			$('.sch_result .empty_box').hide();
-			$('.sch_result .empty_box2').hide();
-			// 자동완성 키워드
-			if(result.autoKeywords != null && result.autoKeywords.length > 0){
-				$("#keyupArea").show();
-				$("#keyupArea").find(".relative-list").html('');
-				let tag = '';
-				tag += '<ul>\n';
-				$.each(result.autoKeywords, function (idx,item){
-					tag += '<li>\n';
-					tag += '	<a href="javascript:void(0);">\n';
-					tag += '		<p><span>'+result.autoKeywords[idx]+'</span></p>\n';
-					tag += '	</a>\n';
-					tag += '</li>\n';
-				});
-				tag += '</ul>\n';
-				$("#keyupArea").find(".relative-list").append(tag);
-			}else{
-				$("#keyupArea").find(".relative-list").html('');
-				$("#keyupArea").hide();
-			}
-
-			// if(result.cateList != null && result.cateList.length > 0){
-			// 	$("#keyupCateArea").find(".sch_category").html('');
-			// 	let tag = '';
-			// 	tag += '<h3>카테고리</h3>\n';
-			// 	tag += '<ul>\n';
-			// 	$.each(result.cateList, function (idx, item){
-			// 		tag +='<li>\n';
-			// 		tag +='	<a href="javascript:void(0);" onclick="cfnGoToGoodsList(0,\'G032_101\' ';
-			// 		if(item.cate1No != null){
-			// 			tag += ', '+item.cate1No;
-			// 		}
-			// 		if(item.cate2No != null){
-			// 			tag += ', '+item.cate2No;
-			// 		}
-			// 		if(item.cate3No != null){
-			// 			tag += ', '+item.cate3No;
-			// 		}
-			// 		if(item.cate4No != null){
-			// 			tag += ', '+item.cate4No;
-			// 		}
-			// 		if(item.cate5No != null){
-			// 			tag += ', '+item.cate5No;
-			// 		}
-			// 		tag += ');">\n';
-			// 		if(item.cate1Nm != null){
-			// 			tag += '		<span>'+item.cate1Nm+'</span>\n';
-			// 		}
-			// 		if(item.cate2Nm != null){
-			// 			tag += '		<span>'+item.cate2Nm+'</span>\n';
-			// 		}
-			// 		if(item.cate3Nm != null){
-			// 			tag += '		<span>'+item.cate3Nm+'</span>\n';
-			// 		}
-			// 		if(item.cate4Nm != null){
-			// 			tag += '		<span>'+item.cate4Nm+'</span>\n';
-			// 		}
-			// 		if(item.cate5Nm != null){
-			// 			tag += '		<span>'+item.cate5Nm+'</span>\n';
-			// 		}
-			// 		tag +='	</a>\n';
-			// 		tag +='</li>\n';
-			// 	});
-			// 	tag += '</ul>\n';
-			//
-			// 	$("#keyupCateArea").find(".sch_category").append(tag);
-			// }else{
-			// 	$("#keyupCateArea").find(".sch_category").html('');
-			// }
-
-			if(!gagajf.isNull(result.goodsList)){
-				$("#relateGoodsDiv").show();
-				$("#relateArea").html('');
-				let tag = '';
-				$.each(result.goodsList, function (idx, item){
-					//console.log(item);
-					if(idx<5) {
-						tag += '<div class="swiper-slide">\n';
-						tag += '	<div class="item_prod">\n';
-						tag += '		<div class="item_state">\n';
-						tag += '		<button type="button" class="itemLike';
-						if(item.likeIt == 'likeit'){
-							tag += ' likeit';
-						}
-						tag += '" onclick="cfnMoPutWishList(this);" goodsCd="'+item.goodsCd+'">관심상품 추가</button>\n';
-						//tag += '			<button type="button" class="itemLike">관심상품 추가</button>\n';
-						tag += '			<a href="javascript:void(0);" class="itemLink" onclick="cfnGoToGoodsDetail(\'' + item.goodsCd + '\',\'' + item.colorCd + '\');">\n';
-						tag += '				<div class="itemPic">\n';
-						tag += '					<img class="vLHTC pd_img" src="'+item.sysImgNm+'" alt="">\n';
-						tag += '				</div>\n';
-						tag += '				<p class="itemBrand">'+item.brandGroupNm+'</p>\n';
-						tag += '				<div class="itemName">'+item.goodsFullNm+'</div>\n';
-						tag += '				<p class="itemPrice">\n';
-						if(item.listPrice != item.currPrice) {
-							tag += '			<span class="itemPrice_original">'+ item.listPrice.addComma() +'</span>\n';
-						}
-						tag += item.currPrice.addComma() ;
-						if(item.listPrice != item.currPrice) {
-							tag += '			<span class="itemPercent">' + Math.round((item.listPrice - item.currPrice) / (item.listPrice * 1.0) * 100) + '%</span>\n';
-						}
-						tag += '				</p>\n';
-						tag += '			</a>\n';
-						tag += '		</div>\n';
-						tag += '	</div>\n';
-						tag += '</div>\n';
-					}
-				});
-				$("#relateArea").html(tag);
-				var swiperschProduct5 = new Swiper('.swiper-container.recommand_slide', {
-					slidesPerView: 2.2,
-					spaceBetween: 8,
-					autoplay: {
-						delay: 4000,
-					},
-					freeMode: true,
-					//centeredSlides: true,
-				});
-			}else{
-				$("#relateArea").html('');
-				$("#relateGoodsDiv").hide();
-			}
-		}
-	}
-
-	// 검색어 입력
-	var fnOnkeyupKeyword = function (obj){
-		if( 13 != event.keyCode){
-			enterBool = false;
-			var searchValue = $(obj).val();
-			if(searchValue.length > 0){
-				fnGetAutoSearch();
-			}else{
-				$('.sch_result .default_box').show();
-				$('.sch_result .searching_box').hide();
-				$('.sch_result .empty_box').hide();
-				$('.sch_result .empty_box2').hide();
-			}
-		}else{
-			// 엔터친 후, 그 전에 검색한 결과가 오고있으므로
-			enterBool = true;
-		}
-	}
-
-	document.getElementById("deleteKeyword").onclick = function (){
-		$("#searchMainForm").find("input[name=keyword]").val('');
-		fnOnkeyupKeyword($("#searchMainForm").find("input[name=keyword]"));
-	}
-
-	$(document).ready( function() {
-		$("#keyupArea").hide();
-		$("#keyupCateArea").hide();
-		$("#deleteKeyword").hide();
-		$("#noDataArea").hide();
-		$("#recommandArea").hide();
-		$("#relateGoodsDiv").hide();
-	});
-
-	// 선택 단어 검색
-	var fnSearchKeyword = function (obj){
-		$("#searchMainForm").find("input[name=keyword]").val(obj);
-		$('#btnSearchKeyword').trigger('click');
-	}
-
-	// 선택 단어 삭제
-	var fnDeleteCookie = function (obj, keyword){
-		$(obj).closest('li').remove();
-		gagajf.setCookie('st24ck_today_keyword',keyword, -1);
-	}
-
-	// 검색어 입력 후 엔터키
-	$('#searchMainForm input[name=keyword]').keypress(function (event) {
-		if (event.which === 13) {
-			event.preventDefault();
-			$('#btnSearchKeyword').trigger('click');
-		}
-	});
-
-	// 인기검색어 조회
-	var fnTrendKeywordList = function (){
-		$("#noDataRelatedKeyword").html('');
-		var html = '';
-		$.getJSON('/display/search/trend/keyword/list', function (result){
-			if(result.trendList.length > 0){
-				$.each(result.trendList, function (idx, item){
-					html += '<a href="javascript:void(0);" onclick="fnSearchKeyword(\''+item.keyword+'\');"><span>#</span>'+item.keyword+'</a>';
-				});
-			}
-			$("#noDataRelatedKeyword").append(html);
-		});
-	}
-
-	// 검색어 연관 상품 추천
-	var fnRecommendItemList = function (keyword){
-		if(gagajf.isNull(keyword)){
-			keyword = "";
-		}
-		var data = {keyword : keyword.trim()};
-		var html = '';
-
-		$.getJSON('/display/recommend/item/list', data, function (result){
-			$("#recommendItemArea").html('');
-			$("#recommandArea").show();
-
-			if(result.length > 0){
-				$.each(result, function (idx, item){
-					html += '<div class="swiper-slide">\n';
-					html += '	<div class="item_prod">\n';
-					html += '		<div class="item_state">\n';
-					html += '			<button type="button" class="itemLike">관심상품 추가</button>\n';
-					html += '			<a href="'+item.product.itemUrl+'" class="itemLink">\n';
-					html += '				<div class="itemPic">\n';
-					html += '					<img class="vLHTC pd_img" src="'+item.product.itemImage+'" alt="">\n';
-					html += '				</div>\n';
-					html += '				<p class="itemBrand">'+item.product.brandName+'</p>\n';
-					html += '				<div class="itemName">'+item.product.itemName+'</div>\n';
-					html += '				<p class="itemPrice">\n';
-					if(item.product.salePrice < item.product.originalPrice) {
-						html += '			<span class="itemPrice_original">'+ item.product.originalPrice.addComma() +'</span>\n';
-					}
-					html += item.product.salePrice.addComma() ;
-					if(item.product.salePrice < item.product.originalPrice) {
-						html += '			<span class="itemPercent">' + Math.round((item.product.originalPrice - item.product.salePrice) / (item.product.originalPrice * 1.0) * 100) + '%</span>\n';
-					}
-					html += '				</p>\n';
-					html += '			</a>\n';
-					html += '		</div>\n';
-					html += '	</div>\n';
-					html += '</div>\n';
-				});
-				$("#recommendItemArea").append(html);
-
-				var swiperschProduct4 = new Swiper('.swiper-container.recommand_slide', {
-					slidesPerView: 2.2,
-					spaceBetween: 8,
-					autoplay: {
-						delay: 4000,
-					},
-					freeMode: true,
-					//centeredSlides: true,
-				});
-			}else{
-				$("#recommendItemArea").html('');
-				$("#recommandArea").hide();
-			}
-
-		});
-	}
-
-	/*]]>*/
-</script>
-
-</body>
-</html>
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : BrandSearchLayerMob.html
+ * @desc    : 검색 레이어 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.07.12   bin2107     최초 작성
+ *******************************************************************************
+ -->
+<body>
+<div class="modal-dialog" role="document">
+	<div class="modal-content">
+		<div class="modal-header htop">
+			<h5 class="modal-title sr-only" id="schPopLabel">통합검색</h5>
+		</div>
+		<div class="modal-body">
+			<section class="sch_result">
+				<!-- 1.통합검색 default -->
+				<div class="inner">
+					<form id="searchMainForm" name="searchMainForm">
+						<input type="hidden" name="brandGroupNo" th:value="${brandGroupNo}"/>
+						<div class="sch_title">
+							<input type="text" class="form_control" name="keyword" placeholder="브랜드 검색어를 입력하세요." autocomplete="off" onkeyup="fnOnkeyupKeyword(this);">
+							<button type="button" class="btn_x" id="deleteKeyword" style="display:none;">X</button>
+							<button type="button" class="btn_sch" id="btnSearchKeyword"><img th:src="${@environment.getProperty('domain.uximage')} + '/images/mo/ico_btn_search.png'" alt=""></button>
+						</div>
+					</form>
+				</div>
+
+				<div class="inner default_box" id="defaultArea">
+					<div class="filter-list">
+						<div class="f_left">
+							<h3>최근 검색어</h3>
+						</div>
+						<div class="f_right">
+						</div>
+					</div>
+					<div class="search-list" th:classappend="${#lists.isEmpty(recentlyKeywordList)?'nodata':''}"> <!-- 검색데이터 없을시 nodata 클래스 추가. -->
+						<ul>
+							<li th:if="${recentlyKeywordList}" th:each="oneData, status : ${recentlyKeywordList}">
+								<a href="javascript:void(0);" th:onclick="fnSearchKeyword([[${oneData}]])">
+									<p th:text="${oneData}"></p>
+								</a>
+								<button type="button" class="xBtn" th:onclick="fnDeleteCookie(this,[[${oneData}]]);"><span>삭제</span></button>
+							</li>
+						</ul>
+						<p class="nodata_txt" th:if="${#lists.isEmpty(recentlyKeywordList)}">최근 검색어가 없습니다.</p>
+					</div>
+					<h3 class="hot-key" th:if="${brandGroupNo==null}">STYLE24에서 검색되고 있어요</h3>
+					<div class="related_keyword" th:if="${brandGroupNo==null}">
+						<div class="sub_category">
+							<div class="cate_wrap" id="popularKeyArea">
+		<!--						<a href="javascript:;" class="on">전체</a>-->
+							</div>
+						</div>
+					</div>
+				</div>
+				<!-- //1.통합검색 default -->
+
+				<!-- 3.지금 많이 보고 있어요 상품. -->
+				<div class="inner default_box" id="popularArea">
+					<div class="now_view">
+						<div class="store_product">
+							<div class="allresult-tit">
+								<h3>지금 많이 보고 있어요</h3>
+								<button class="btn_refresh" onclick="fnRealtimeGoodsList();"><span th:text="${#calendars.format(#calendars.createNow(), 'HH:mm')}">17:30</span> 기준</button>
+							</div>
+							<div class="swiper-container sch_product">
+								<div class="swiper-wrapper" id="itemViewArea">
+									<th:block th:each="item, status : ${realtimeGoodsList}">
+										<div class="swiper-slide">
+											<div class="item_prod">
+												<button type="button" class="itemLike" th:classappend="${item.wishCnt > 0}? 'likeit' : ''" onclick="cfnMoPutWishList(this);" th:attr="goodsCd=${item.itemId}">관심상품 추가</button>
+												<a th:href="${item.itemUrl} + '&rccode=rts_mo_search&rtscode=mo_search'">
+													<img th:src="${item.imageUrl}" alt="">
+													<div class="s-text">
+														<div class="itemName" th:text="${item.itemName}"></div>
+														<p class="itemTag" th:text="${item.count < 10 ? '10명 미만' : item.count + '명 보는중'}">508명 보는중</p>
+													</div>
+												</a>
+											</div>
+										</div>
+									</th:block>
+								</div>
+							</div>
+						</div>
+					</div>
+				</div>
+				<!-- //3.지금 많이 보고 있어요 상품. -->
+
+				<!-- 4.검색어 타이핑 -->
+				<div class="inner searching_box" id="keyupArea" style="display:none;">
+<!--					<div class="filter-list store-list">-->
+<!--					</div>-->
+					<div class="relative-list">
+					</div>
+				</div>
+				<div class="inner empty_box2" id="relateGoodsDiv" style="display:none;">
+					<div class="recommand_product">
+						<div class="store_product">
+							<div class="swiper-container recommand_slide">
+								<h3>관련상품</h3>
+								<div class="swiper-wrapper" id="relateArea">
+
+								</div>
+							</div>
+						</div>
+					</div>
+				</div>
+				<!-- //4.검색어 타이핑 -->
+
+				<!-- 3.검색결과 없을때 -->
+				<div class="inner empty_box" id="noDataArea" style="display:none;">
+					<div class="relative-list nodata"> <!-- 검색결과 없을 시 nodata 클래스 추가 -->
+						<p class="nodata_txt">&lsquo;<span id="noDataKeyword"></span>&rsquo; 에 맞는 상품을 찾지 못했습니다.<br>검색어를 변경해 보세요.</p>
+					</div>
+					<h3 class="hot-key">STYLE24에서 검색되고 있어요</h3>
+					<div class="related_keyword">
+						<div class="sub_category">
+							<div class="cate_wrap" id="noDataRelatedKeyword">
+
+							</div>
+						</div>
+					</div>
+				</div>
+				<div class="inner empty_box" id="recommandArea" style="display:none;">
+					<div class="recommand_product">
+						<div class="store_product">
+							<div class="swiper-container recommand_slide">
+								<h3>이런 상품은 어떤가요?</h3>
+								<div class="swiper-wrapper" id="recommendItemArea">
+
+								</div>
+							</div>
+						</div>
+					</div>
+				</div>
+				<!-- //3.검색결과 없을때 -->
+			</section>
+		</div>
+	</div>
+</div>
+<script src="/ux/plugins/gaga/gaga.paging.js"></script>
+<script th:inline="javascript">
+	/*<![CDATA[*/
+	var enterBool = false;
+	var swiperschProduct = new Swiper('.swiper-container.sch_product', {
+		slidesPerView: 3,
+		spaceBetween: 7,
+		autoplay: {
+			delay: 4000,
+		},
+		freeMode: true,
+		//centeredSlides: true,
+	});
+
+	var swiperschProduct = new Swiper('.swiper-container.recommand_slide', {
+		slidesPerView: 2.2,
+		spaceBetween: 8,
+		autoplay: {
+			delay: 4000,
+		},
+		freeMode: true,
+		//centeredSlides: true,
+	});
+
+	$(".itemLike").click(function () {
+		$(this).toggleClass("likeit");
+	});
+
+	var ckKeyword = "st24ck_today_keyword";
+	var fnSetKeywordCookie = function(keyword) {
+		var arrKeyword = new Array;
+		var arrTempKeyword = new Array;
+		var j = 0;
+
+		arrKeyword = gagajf.getCookie(ckKeyword).split(",");
+
+		if (arrKeyword.length > 0) {
+			for (var i = 0; i < arrKeyword.length; i++) {
+				// 쿠키에 없으면
+				if (arrKeyword[i] != keyword && arrKeyword[i] != "") {
+					arrTempKeyword[j++] = arrKeyword[i];
+				}
+			}
+
+			arrTempKeyword[j++] = keyword;
+		} else {
+			gagajf.setCookie(ckKeyword, keyword, 1);
+		}
+
+		gagajf.setCookie(ckKeyword, arrTempKeyword, 1);
+	}
+
+	// 키워드 검색
+	$('#btnSearchKeyword').on('click', function() {
+		if (!gagajf.validation($('#searchMainForm'))) {
+			return false;
+		}
+
+		if( !enterBool ){
+			enterBool = true;
+			// 검색결과 상품목록 호출(있으면 검색결과 페이지로 이동)
+			gagajf.ajaxFormSubmit("/display/search/goods/list_cnt", document.searchMainForm, function(result) {
+				enterBool = false;
+				if( "0" == result.response_cnt){
+					$('.sch_result .default_box').hide();
+					$('.sch_result .searching_box').hide();
+					$('.sch_result .empty_box2').hide();
+					$('.sch_result .empty_box').show();
+					$("#noDataArea").find('#noDataKeyword').text($("#searchMainForm").find('input[name=keyword]').val());
+	
+					// 검색어 연관 상품 추천
+					fnRecommendItemList($("#searchMainForm").find('input[name=keyword]').val());
+					// 인기검색어
+					fnTrendKeywordList();
+	
+				}else{
+					let keyword = encodeURIComponent($('#searchMainForm input[name=keyword]').val());
+	
+					// 쿠키 세팅
+					fnSetKeywordCookie(keyword);
+	
+					let actionUrl = _PAGE_BRAND_SEARCH_GOODS + '?keyword=' + keyword + '&brandGroupNo=' + $('#searchMainForm input[name=brandGroupNo]').val();
+	
+					cfnGoToPage(actionUrl);
+				}
+			}, true);
+		}
+	});
+
+	// 검색어 찾기
+	var fnGetAutoSearch = function (){
+		gagajf.ajaxFormSubmit("/display/search/auto/complete", document.searchMainForm, fnAutoCompleteList);
+	}
+
+	// 검색어 찾기 결과
+	var fnAutoCompleteList = function (result){
+		if( enterBool ) return;
+
+		if(result && result.autoKeywords && result.autoKeywords.length==0 && gagajf.isNull(result.goodsList)){
+			$('.sch_result .default_box').hide();
+			$('.sch_result .searching_box').hide();
+			$('.sch_result .empty_box2').hide();
+
+		}else{
+			$('.sch_result .default_box').hide();
+			$('.sch_result .searching_box').show();
+			$('.sch_result .empty_box').hide();
+			$('.sch_result .empty_box2').hide();
+			// 자동완성 키워드
+			if(result.autoKeywords != null && result.autoKeywords.length > 0){
+				$("#keyupArea").show();
+				$("#keyupArea").find(".relative-list").html('');
+				let tag = '';
+				tag += '<ul>\n';
+				$.each(result.autoKeywords, function (idx,item){
+					tag += '<li>\n';
+					tag += '	<a href="javascript:void(0);">\n';
+					tag += '		<p><span>'+result.autoKeywords[idx]+'</span></p>\n';
+					tag += '	</a>\n';
+					tag += '</li>\n';
+				});
+				tag += '</ul>\n';
+				$("#keyupArea").find(".relative-list").append(tag);
+			}else{
+				$("#keyupArea").find(".relative-list").html('');
+				$("#keyupArea").hide();
+			}
+
+			// if(result.cateList != null && result.cateList.length > 0){
+			// 	$("#keyupCateArea").find(".sch_category").html('');
+			// 	let tag = '';
+			// 	tag += '<h3>카테고리</h3>\n';
+			// 	tag += '<ul>\n';
+			// 	$.each(result.cateList, function (idx, item){
+			// 		tag +='<li>\n';
+			// 		tag +='	<a href="javascript:void(0);" onclick="cfnGoToGoodsList(0,\'G032_101\' ';
+			// 		if(item.cate1No != null){
+			// 			tag += ', '+item.cate1No;
+			// 		}
+			// 		if(item.cate2No != null){
+			// 			tag += ', '+item.cate2No;
+			// 		}
+			// 		if(item.cate3No != null){
+			// 			tag += ', '+item.cate3No;
+			// 		}
+			// 		if(item.cate4No != null){
+			// 			tag += ', '+item.cate4No;
+			// 		}
+			// 		if(item.cate5No != null){
+			// 			tag += ', '+item.cate5No;
+			// 		}
+			// 		tag += ');">\n';
+			// 		if(item.cate1Nm != null){
+			// 			tag += '		<span>'+item.cate1Nm+'</span>\n';
+			// 		}
+			// 		if(item.cate2Nm != null){
+			// 			tag += '		<span>'+item.cate2Nm+'</span>\n';
+			// 		}
+			// 		if(item.cate3Nm != null){
+			// 			tag += '		<span>'+item.cate3Nm+'</span>\n';
+			// 		}
+			// 		if(item.cate4Nm != null){
+			// 			tag += '		<span>'+item.cate4Nm+'</span>\n';
+			// 		}
+			// 		if(item.cate5Nm != null){
+			// 			tag += '		<span>'+item.cate5Nm+'</span>\n';
+			// 		}
+			// 		tag +='	</a>\n';
+			// 		tag +='</li>\n';
+			// 	});
+			// 	tag += '</ul>\n';
+			//
+			// 	$("#keyupCateArea").find(".sch_category").append(tag);
+			// }else{
+			// 	$("#keyupCateArea").find(".sch_category").html('');
+			// }
+
+			if(!gagajf.isNull(result.goodsList)){
+				$("#relateGoodsDiv").show();
+				$("#relateArea").html('');
+				let tag = '';
+				$.each(result.goodsList, function (idx, item){
+					//console.log(item);
+					if(idx<5) {
+						tag += '<div class="swiper-slide">\n';
+						tag += '	<div class="item_prod">\n';
+						tag += '		<div class="item_state">\n';
+						tag += '		<button type="button" class="itemLike';
+						if(item.likeIt == 'likeit'){
+							tag += ' likeit';
+						}
+						tag += '" onclick="cfnMoPutWishList(this);" goodsCd="'+item.goodsCd+'">관심상품 추가</button>\n';
+						//tag += '			<button type="button" class="itemLike">관심상품 추가</button>\n';
+						tag += '			<a href="javascript:void(0);" class="itemLink" onclick="cfnGoToGoodsDetail(\'' + item.goodsCd + '\',\'' + item.colorCd + '\');">\n';
+						tag += '				<div class="itemPic">\n';
+						tag += '					<img class="vLHTC pd_img" src="'+item.sysImgNm+'" alt="">\n';
+						tag += '				</div>\n';
+						tag += '				<p class="itemBrand">'+item.brandGroupNm+'</p>\n';
+						tag += '				<div class="itemName">'+item.goodsFullNm+'</div>\n';
+						tag += '				<p class="itemPrice">\n';
+						if(item.listPrice != item.currPrice) {
+							tag += '			<span class="itemPrice_original">'+ item.listPrice.addComma() +'</span>\n';
+						}
+						tag += item.currPrice.addComma() ;
+						if(item.listPrice != item.currPrice) {
+							tag += '			<span class="itemPercent">' + Math.round((item.listPrice - item.currPrice) / (item.listPrice * 1.0) * 100) + '%</span>\n';
+						}
+						tag += '				</p>\n';
+						tag += '			</a>\n';
+						tag += '		</div>\n';
+						tag += '	</div>\n';
+						tag += '</div>\n';
+					}
+				});
+				$("#relateArea").html(tag);
+				var swiperschProduct5 = new Swiper('.swiper-container.recommand_slide', {
+					slidesPerView: 2.2,
+					spaceBetween: 8,
+					autoplay: {
+						delay: 4000,
+					},
+					freeMode: true,
+					//centeredSlides: true,
+				});
+			}else{
+				$("#relateArea").html('');
+				$("#relateGoodsDiv").hide();
+			}
+		}
+	}
+
+	// 검색어 입력
+	var fnOnkeyupKeyword = function (obj){
+		if( 13 != event.keyCode){
+			enterBool = false;
+			var searchValue = $(obj).val();
+			if(searchValue.length > 0){
+				fnGetAutoSearch();
+			}else{
+				$('.sch_result .default_box').show();
+				$('.sch_result .searching_box').hide();
+				$('.sch_result .empty_box').hide();
+				$('.sch_result .empty_box2').hide();
+			}
+		}else{
+			// 엔터친 후, 그 전에 검색한 결과가 오고있으므로
+			enterBool = true;
+		}
+	}
+
+	document.getElementById("deleteKeyword").onclick = function (){
+		$("#searchMainForm").find("input[name=keyword]").val('');
+		fnOnkeyupKeyword($("#searchMainForm").find("input[name=keyword]"));
+	}
+
+	$(document).ready( function() {
+		$("#keyupArea").hide();
+		$("#keyupCateArea").hide();
+		$("#deleteKeyword").hide();
+		$("#noDataArea").hide();
+		$("#recommandArea").hide();
+		$("#relateGoodsDiv").hide();
+	});
+
+	// 선택 단어 검색
+	var fnSearchKeyword = function (obj){
+		$("#searchMainForm").find("input[name=keyword]").val(obj);
+		$('#btnSearchKeyword').trigger('click');
+	}
+
+	// 선택 단어 삭제
+	var fnDeleteCookie = function (obj, keyword){
+		$(obj).closest('li').remove();
+		gagajf.setCookie('st24ck_today_keyword',keyword, -1);
+	}
+
+	// 검색어 입력 후 엔터키
+	$('#searchMainForm input[name=keyword]').keypress(function (event) {
+		if (event.which === 13) {
+			event.preventDefault();
+			$('#btnSearchKeyword').trigger('click');
+		}
+	});
+
+	// 인기검색어 조회
+	var fnTrendKeywordList = function (){
+		$("#noDataRelatedKeyword").html('');
+		var html = '';
+		$.getJSON('/display/search/trend/keyword/list', function (result){
+			if(result.trendList.length > 0){
+				$.each(result.trendList, function (idx, item){
+					html += '<a href="javascript:void(0);" onclick="fnSearchKeyword(\''+item.keyword+'\');"><span>#</span>'+item.keyword+'</a>';
+				});
+			}
+			$("#noDataRelatedKeyword").append(html);
+		});
+	}
+
+	// 검색어 연관 상품 추천
+	var fnRecommendItemList = function (keyword){
+		if(gagajf.isNull(keyword)){
+			keyword = "";
+		}
+		var data = {keyword : keyword.trim()};
+		var html = '';
+
+		$.getJSON('/display/recommend/item/list', data, function (result){
+			$("#recommendItemArea").html('');
+			$("#recommandArea").show();
+
+			if(result.length > 0){
+				$.each(result, function (idx, item){
+					html += '<div class="swiper-slide">\n';
+					html += '	<div class="item_prod">\n';
+					html += '		<div class="item_state">\n';
+					html += '			<button type="button" class="itemLike">관심상품 추가</button>\n';
+					html += '			<a href="'+item.product.itemUrl+'&rccode=mo_search_s3" class="itemLink">\n';
+					html += '				<div class="itemPic">\n';
+					html += '					<img class="vLHTC pd_img" src="'+item.product.itemImage+'" alt="">\n';
+					html += '				</div>\n';
+					html += '				<p class="itemBrand">'+item.product.brandName+'</p>\n';
+					html += '				<div class="itemName">'+item.product.itemName+'</div>\n';
+					html += '				<p class="itemPrice">\n';
+					if(item.product.salePrice < item.product.originalPrice) {
+						html += '			<span class="itemPrice_original">'+ item.product.originalPrice.addComma() +'</span>\n';
+					}
+					html += item.product.salePrice.addComma() ;
+					if(item.product.salePrice < item.product.originalPrice) {
+						html += '			<span class="itemPercent">' + Math.round((item.product.originalPrice - item.product.salePrice) / (item.product.originalPrice * 1.0) * 100) + '%</span>\n';
+					}
+					html += '				</p>\n';
+					html += '			</a>\n';
+					html += '		</div>\n';
+					html += '	</div>\n';
+					html += '</div>\n';
+				});
+				$("#recommendItemArea").append(html);
+
+				var swiperschProduct4 = new Swiper('.swiper-container.recommand_slide', {
+					slidesPerView: 2.2,
+					spaceBetween: 8,
+					autoplay: {
+						delay: 4000,
+					},
+					freeMode: true,
+					//centeredSlides: true,
+				});
+			}else{
+				$("#recommendItemArea").html('');
+				$("#recommandArea").hide();
+			}
+
+		});
+	}
+
+	/*]]>*/
+</script>
+
+</body>
+</html>

+ 648 - 648
src/main/webapp/WEB-INF/views/mob/display/SearchLayerMob.html

@@ -1,648 +1,648 @@
-<!DOCTYPE html>
-<html lang="ko"
-	  xmlns:th="http://www.thymeleaf.org">
-<!--
- *******************************************************************************
- * @source  : SearchLayerMob.html
- * @desc    : 검색 레이어 Page
- *============================================================================
- * STYLE24
- * Copyright(C) 2020 TSIT, All rights reserved.
- *============================================================================
- * VER  DATE         AUTHOR      DESCRIPTION
- * ===  ===========  ==========  =============================================
- * 1.0  2021.06.14   bin2107     최초 작성
- *******************************************************************************
- -->
-<body>
-<div class="modal-dialog" role="document">
-	<div class="modal-content">
-		<div class="modal-header htop">
-			<h5 class="modal-title sr-only" id="schPopLabel">통합검색</h5>
-		</div>
-		<div class="modal-body">
-			<section class="sch_result">
-				<!-- 1.통합검색 default -->
-				<div class="inner">
-					<form id="searchMainForm" name="searchMainForm">
-						<input type="hidden" name="brandGroupNo" th:value="${brandGroupNo}"/>
-						<div class="sch_title">
-							<input type="text" class="form_control" name="keyword" placeholder="검색어를 입력하세요." autocomplete="off" onkeyup="fnOnkeyupKeyword(this);">
-							<button type="button" class="btn_x" id="deleteKeyword" style="display:none;">X</button>
-							<button type="button" class="btn_sch" id="btnSearchKeyword"><img th:src="${@environment.getProperty('domain.uximage')} + '/images/mo/ico_btn_search.png'" alt=""></button>
-						</div>
-					</form>
-				</div>
-
-				<div class="inner default_box" id="defaultArea">
-					<div class="filter-list">
-						<div class="f_left">
-							<h3>최근 검색어</h3>
-						</div>
-						<div class="f_right">
-						</div>
-					</div>
-					<div class="search-list" th:classappend="${#lists.isEmpty(recentlyKeywordList)?'nodata':''}"> <!-- 검색데이터 없을시 nodata 클래스 추가. -->
-						<ul>
-							<li th:if="${recentlyKeywordList}" th:each="oneData, status : ${recentlyKeywordList}">
-								<a href="javascript:void(0);" th:onclick="fnSearchKeyword([[${oneData}]])">
-									<p th:text="${oneData}"></p>
-								</a>
-								<button type="button" class="xBtn" th:onclick="fnDeleteCookie(this,[[${oneData}]]);"><span>삭제</span></button>
-							</li>
-						</ul>
-						<p class="nodata_txt" th:if="${#lists.isEmpty(recentlyKeywordList)}">최근 검색어가 없습니다.</p>
-					</div>
-					<h3 class="hot-key" th:if="${brandGroupNo==null}">STYLE24에서 검색되고 있어요</h3>
-					<div class="related_keyword" th:if="${brandGroupNo==null}">
-						<div class="sub_category">
-							<div class="cate_wrap" id="popularKeyArea">
-								<!--						<a href="javascript:;" class="on">전체</a>-->
-							</div>
-						</div>
-					</div>
-				</div>
-				<!-- //1.통합검색 default -->
-
-				<!-- 3.지금 많이 보고 있어요 상품. -->
-				<div class="inner default_box" id="popularArea">
-					<div class="now_view">
-						<div class="store_product">
-							<div class="allresult-tit">
-								<h3>지금 많이 보고 있어요</h3>
-								<button type="button" class="btn_refresh" onclick="fnRealtimeGoodsList();"><span th:text="${#calendars.format(#calendars.createNow(), 'HH:mm')}">17:30</span> 기준</button>
-							</div>
-							<div class="swiper-container sch_product">
-								<div class="swiper-wrapper" id="itemViewArea">
-									<th:block th:each="item, status : ${realtimeGoodsList}">
-										<div class="swiper-slide">
-											<div class="item_prod">
-												<button type="button" class="itemLike" th:classappend="${item.wishCnt > 0}? 'likeit' : ''" onclick="cfnMoPutWishList(this);" th:attr="goodsCd=${item.itemId}">관심상품 추가</button>
-												<a th:href="${item.itemUrl} + '&rccode=rts_mo_search&rtscode=mo_search'">
-													<img th:src="${item.imageUrl}" alt="">
-													<div class="s-text">
-														<div class="itemName" th:text="${item.itemName}"></div>
-														<p class="itemTag" th:text="${item.count < 10 ? '10명 미만' : item.count + '명 보는중'}">508명 보는중</p>
-													</div>
-												</a>
-											</div>
-										</div>
-									</th:block>
-								</div>
-							</div>
-						</div>
-					</div>
-				</div>
-				<!-- //3.지금 많이 보고 있어요 상품. -->
-
-				<!-- 4.검색어 타이핑 -->
-				<div class="inner searching_box" id="keyupArea" style="display:none;" th:if="${brandGroupNo==null}">
-					<div class="filter-list store-list" id="brandStoreArea">
-					</div>
-					<div class="relative-list">
-					</div>
-				</div>
-				<div class="inner searching_box" id="keyupCateArea" style="display:none;" th:if="${brandGroupNo==null}">
-					<div class="sch_category">
-					</div>
-				</div>
-				<div class="inner empty_box2" id="relateArea" style="display:none;">
-					<div class="recommand_product">
-						<div class="store_product">
-							<div class="swiper-container recommand_slide">
-								<h3>관련상품</h3>
-								<div class="swiper-wrapper" id="relateItemArea">
-
-								</div>
-							</div>
-						</div>
-					</div>
-				</div>
-				<!-- //4.검색어 타이핑 -->
-
-				<!-- 3.검색결과 없을때 -->
-				<div class="inner empty_box" id="noDataArea" style="display:none;">
-					<div class="relative-list nodata"> <!-- 검색결과 없을 시 nodata 클래스 추가 -->
-						<p class="nodata_txt">&lsquo;<span id="noDataKeyword"></span>&rsquo; 에 맞는 상품을 찾지 못했습니다.<br>검색어를 변경해 보세요.</p>
-					</div>
-					<h3 class="hot-key">STYLE24에서 검색되고 있어요</h3>
-					<div class="related_keyword">
-						<div class="sub_category">
-							<div class="cate_wrap" id="noDataRelatedKeyword">
-
-							</div>
-						</div>
-					</div>
-				</div>
-				<div class="inner empty_box" id="recommandArea" style="display:none;">
-					<div class="recommand_product">
-						<div class="store_product">
-							<div class="swiper-container recommand_slide">
-								<h3>이런 상품은 어떤가요?</h3>
-								<div class="swiper-wrapper" id="recommendItemArea">
-
-								</div>
-							</div>
-						</div>
-					</div>
-				</div>
-				<!-- //3.검색결과 없을때 -->
-			</section>
-		</div>
-	</div>
-</div>
-<script src="/ux/plugins/gaga/gaga.paging.js"></script>
-<script th:inline="javascript">
-	/*<![CDATA[*/
-	var enterBool = false;
-	var trendKeywordList = [[${trendKeywordList.trendList}]];
-
-	var swiperschProduct = new Swiper('.swiper-container.sch_product', {
-		slidesPerView: 3,
-		spaceBetween: 6,
-		autoplay: {
-			delay: 4000,
-		},
-		freeMode: true,
-		//centeredSlides: true,
-	});
-
-
-	var schProdLength = $('.sch_product .swiper-slide').length;
-	if (schProdLength < 4) {
-		var swiperschProduct = new Swiper('.swiper-container.sch_product', {
-			slidesPerView: 3,
-			spaceBetween: 6,
-			autoplay: false,
-			freeMode: false,
-			loop:false,
-			a11y: {
-				enabled: true,
-				notificationClass: 'swiper-notification',
-			},
-		});
-	} else {
-		var swiperschProduct = new Swiper('.swiper-container.sch_product', {
-			slidesPerView: 3,
-			spaceBetween: 6,
-			autoplay: {
-				delay: 4000,
-			},
-			freeMode: true,
-			loop:true,
-			a11y: {
-				enabled: true,
-				notificationClass: 'swiper-notification',
-				firstSlideMessage: '첫번째 슬라이드 입니다',
-				lastSlideMessage: '마지막 슬라이드 입니다',
-			},
-		});
-	};
-
-	var schRecommendLength = $('.recommand_slide .swiper-slide').length;
-	if (schRecommendLength < 3) {
-		var swiperschProduct = new Swiper('.swiper-container.recommand_slide', {
-			slidesPerView: 2.2,
-			spaceBetween: 8,
-			autoplay: false,
-			freeMode: false,
-			loop:false,
-			a11y: {
-				enabled: true,
-				notificationClass: 'swiper-notification',
-			},
-		});
-	} else {
-		var swiperschProduct = new Swiper('.swiper-container.recommand_slide', {
-			slidesPerView: 2.2,
-			spaceBetween: 8,
-			autoplay: {
-				delay: 4000,
-			},
-			freeMode: true,
-			loop:true,
-			a11y: {
-				enabled: true,
-				notificationClass: 'swiper-notification',
-				firstSlideMessage: '첫번째 슬라이드 입니다',
-				lastSlideMessage: '마지막 슬라이드 입니다',
-			},
-		});
-	};
-
-	$(".itemLike").click(function () {
-		$(this).toggleClass("likeit");
-	});
-
-	var ckKeyword = "st24ck_today_keyword";
-	var fnSetKeywordCookie = function(keyword) {
-		var arrKeyword = new Array;
-		var arrTempKeyword = new Array;
-		var j = 0;
-
-		arrKeyword = gagajf.getCookie(ckKeyword).split(",");
-
-		if (arrKeyword.length > 0) {
-			for (var i = 0; i < arrKeyword.length; i++) {
-				// 쿠키에 없으면
-				if (arrKeyword[i] != keyword && arrKeyword[i] != "") {
-					arrTempKeyword[j++] = arrKeyword[i];
-				}
-			}
-
-			arrTempKeyword[j++] = keyword;
-		} else {
-			gagajf.setCookie(ckKeyword, keyword, 1);
-		}
-
-		gagajf.setCookie(ckKeyword, arrTempKeyword, 1);
-	}
-
-	// 키워드 검색
-	$('#btnSearchKeyword').on('click', function() {
-		if (!gagajf.validation($('#searchMainForm'))) {
-			return false;
-		}
-
-		if( !enterBool ){
-			enterBool = true;
-			// 검색결과 상품목록 호출(있으면 검색결과 페이지로 이동)
-			gagajf.ajaxFormSubmit("/display/search/goods/list_cnt", document.searchMainForm, function(result) {
-				enterBool = false;
-				if( "0" == result.response_cnt){
-					$('.sch_result .default_box').hide();
-					$('.sch_result .searching_box').hide();
-					$('.sch_result .empty_box2').hide();
-					$('.sch_result .empty_box').show();
-					$("#noDataArea").find('#noDataKeyword').text($("#searchMainForm").find('input[name=keyword]').val());
-	
-					// 검색어 연관 상품 추천
-					fnRecommendItemList($("#searchMainForm").find('input[name=keyword]').val());
-					// 인기검색어
-					fnTrendKeywordList();
-	
-				}else{
-					let keyword = encodeURIComponent($('#searchMainForm input[name=keyword]').val());
-	
-					// 쿠키 세팅
-					fnSetKeywordCookie(keyword);
-	
-					let actionUrl = _PAGE_SEARCH_GOODS + '?keyword=' + keyword + '&brandGroupNo=' + $('#searchMainForm input[name=brandGroupNo]').val();
-					cfnGoToPage(actionUrl);
-				}
-			}, true);
-		}
-	});
-
-	// 검색어 찾기
-	var fnGetAutoSearch = function (){
-		gagajf.ajaxFormSubmit("/display/search/auto/complete", document.searchMainForm, fnAutoCompleteList);
-	}
-
-	// 검색어 찾기 결과
-	var fnAutoCompleteList = function (result){
-		if( enterBool ) return;
-
-		if(result.autoKeywords.length==0 && gagajf.isNull(result.brand.brandGroupNo) && result.cateList.length == 0 && gagajf.isNull(result.goodsList)){
-			$('.sch_result .default_box').hide();
-			$('.sch_result .searching_box').hide();
-
-		}else{
-			$('.sch_result .default_box').hide();
-			$('.sch_result .searching_box').show();
-			$('.sch_result .empty_box').hide();
-			$('.sch_result .empty_box2').hide();
-			// 자동완성 키워드
-			if(result.autoKeywords != null && result.autoKeywords.length > 0){
-				$("#keyupArea").find(".relative-list").html('');
-				let tag = '';
-				tag += '<ul>\n';
-				$.each(result.autoKeywords, function (idx,item){
-					tag += '<li>\n';
-					tag += '	<a href="javascript:void(0);" onclick="fnSearchKeyword(\''+result.autoKeywords[idx]+'\');">\n';
-					tag += '		<p><span>'+result.autoKeywords[idx]+'</span></p>\n';
-					tag += '	</a>\n';
-					tag += '</li>\n';
-				});
-				tag += '</ul>\n';
-				$("#keyupArea").find(".relative-list").append(tag);
-			}else{
-				$("#keyupArea").find(".relative-list").html('');
-			}
-
-			// 브랜드
-			if(result.brand != null && !gagajf.isNull(result.brand.brandGroupNo)){
-				$("#brandStoreArea").show();
-				$("#keyupArea").find(".store-list").html('');
-				let tag = '';
-				tag += '<div class="f_left">\n';
-				tag += '	<h3>'+result.brand.brandGroupNm+' 공식 스토어</h3>\n';
-				tag += '</div>\n';
-				tag += '<div class="f_right">\n';
-				tag += '	<a href="javascript:void(0);" onclick="cfnGoToBrandMain('+result.brand.brandGroupNo+');">바로가기</a>\n';
-				tag += '</div>\n';
-				$("#keyupArea").find(".store-list").append(tag);
-			}else{
-				$("#keyupArea").find(".store-list").html('');
-				$("#brandStoreArea").hide();
-			}
-
-			if(result.cateList != null && result.cateList.length > 0){
-				$("#keyupCateArea").show();
-				$("#keyupCateArea").find(".sch_category").html('');
-				let tag = '';
-				tag += '<h3>카테고리</h3>\n';
-				tag += '<ul>\n';
-				$.each(result.cateList, function (idx, item){
-					tag +='<li>\n';
-					tag +='	<a href="javascript:void(0);" onclick="cfnGoToGoodsList(0,\'G032_101\' ';
-					if(item.cate1No != null){
-						tag += ', '+item.cate1No;
-					}
-					if(item.cate2No != null){
-						tag += ', '+item.cate2No;
-					}
-					if(item.cate3No != null){
-						tag += ', '+item.cate3No;
-					}
-					if(item.cate4No != null){
-						tag += ', '+item.cate4No;
-					}
-					if(item.cate5No != null){
-						tag += ', '+item.cate5No;
-					}
-					tag += ');">\n';
-					if(item.cate1Nm != null){
-						tag += '		<span>'+item.cate1Nm+'</span>\n';
-					}
-					if(item.cate2Nm != null){
-						tag += '		<span>'+item.cate2Nm+'</span>\n';
-					}
-					if(item.cate3Nm != null){
-						tag += '		<span>'+item.cate3Nm+'</span>\n';
-					}
-					if(item.cate4Nm != null){
-						tag += '		<span>'+item.cate4Nm+'</span>\n';
-					}
-					if(item.cate5Nm != null){
-						tag += '		<span>'+item.cate5Nm+'</span>\n';
-					}
-					tag +='	</a>\n';
-					tag +='</li>\n';
-				});
-				tag += '</ul>\n';
-
-				$("#keyupCateArea").find(".sch_category").append(tag);
-			}else{
-				$("#keyupCateArea").find(".sch_category").html('');
-				$("#keyupCateArea").hide();
-			}
-
-			if(!gagajf.isNull(result.goodsList)){
-				$("#relateArea").show();
-				$("#relateItemArea").html('');
-				let tag = '';
-				$.each(result.goodsList, function (idx, item){
-					if(idx<5) {
-						tag += '<div class="swiper-slide">\n';
-						tag += '	<div class="item_prod">\n';
-						tag += '		<div class="item_state">\n';
-						tag += '		<button type="button" class="itemLike';
-						if(item.likeIt == 'likeit'){
-							tag += ' likeit';
-						}
-						tag += '" onclick="cfnMoPutWishList(this);" goodsCd="'+item.goodsCd+'">관심상품 추가</button>\n';
-						//tag += '			<button type="button" class="itemLike">관심상품 추가</button>\n';
-						tag += '			<a href="javascript:void(0);" class="itemLink" onclick="cfnGoToGoodsDetail(\'' + item.goodsCd + '\',\'' + item.colorCd + '\');">\n';
-						tag += '				<div class="itemPic">\n';
-						tag += '					<img class="vLHTC pd_img" src="'+item.sysImgNm+'" alt="">\n';
-						tag += '				</div>\n';
-						tag += '				<p class="itemBrand">'+item.brandGroupNm+'</p>\n';
-						tag += '				<div class="itemName">'+item.goodsFullNm+'</div>\n';
-						tag += '				<p class="itemPrice">\n';
-						if(item.listPrice != item.currPrice) {
-							tag += '			<span class="itemPrice_original">'+ item.listPrice.addComma() +'</span>\n';
-						}
-						tag += item.currPrice.addComma() ;
-						if(item.listPrice != item.currPrice) {
-							tag += '			<span class="itemPercent">' + Math.round((item.listPrice - item.currPrice) / (item.listPrice * 1.0) * 100) + '%</span>\n';
-						}
-						tag += '				</p>\n';
-						tag += '			</a>\n';
-						tag += '		</div>\n';
-						tag += '	</div>\n';
-						tag += '</div>\n';
-					}
-				});
-				$("#relateItemArea").html(tag);
-				var swiperschProduct4 = new Swiper('.swiper-container.recommand_slide', {
-					slidesPerView: 2.2,
-					spaceBetween: 8,
-					autoplay: {
-						delay: 4000,
-					},
-					freeMode: true,
-					//centeredSlides: true,
-				});
-			}else{
-				$("#relateItemArea").html('');
-				$("#relateArea").hide();
-			}
-		}
-	}
-
-	// 검색어 입력
-	var fnOnkeyupKeyword = function (obj){
-		if( 13 != event.keyCode){
-			enterBool = false;
-			var searchValue = $(obj).val();
-			if(searchValue.length > 0){
-				fnGetAutoSearch();
-			}else{
-				$('.sch_result .default_box').show();
-				$('.sch_result .searching_box').hide();
-				$('.sch_result .empty_box').hide();
-				$('.sch_result .empty_box2').hide();
-			}
-		}else{
-			// 엔터친 후, 그 전에 검색한 결과가 오고있으므로
-			enterBool = true;
-		}
-	}
-
-	document.getElementById("deleteKeyword").onclick = function (){
-		$("#searchMainForm").find("input[name=keyword]").val('');
-		fnOnkeyupKeyword($("#searchMainForm").find("input[name=keyword]"));
-	}
-
-	$(document).ready( function() {
-		if (trendKeywordList.length > 0) {
-			$("#popularKeyArea").html('');
-
-			trendKeywordList.forEach(function (item, idx) {
-				if(item.keyword.indexOf("테스트") < 0){
-					var tag = '';
-					if (idx < 10) {
-						tag += '	<a href="javascript:void(0);" onclick="fnSearchKeyword(\''+item.keyword+'\');">'+ item.keyword +'</a>';
-					}
-					$("#popularKeyArea").append(tag);
-				}
-			});
-		}else{
-			$("#popularKeyArea").html('');
-		}
-
-		$("#keyupArea").hide();
-		$("#keyupCateArea").hide();
-		$("#deleteKeyword").hide();
-		$("#noDataArea").hide();
-		$("#recommandArea").hide();
-		$("#relateArea").hide();
-	});
-
-	// 선택 단어 검색
-	var fnSearchKeyword = function (obj){
-		$("#searchMainForm").find("input[name=keyword]").val(obj);
-		$('#btnSearchKeyword').trigger('click');
-	}
-
-	// 선택 단어 삭제
-	var fnDeleteCookie = function (obj, keyword){
-		$(obj).closest('li').remove();
-		gagajf.setCookie('st24ck_today_keyword',keyword, -1);
-	}
-
-	// 검색어 입력 후 엔터키
-	$('#searchMainForm input[name=keyword]').keypress(function (event) {
-		if (event.which === 13) {
-			event.preventDefault();
-			$('#btnSearchKeyword').trigger('click');
-		}
-	});
-
-	// 인기검색어 조회
-	var fnTrendKeywordList = function (){
-		$("#noDataRelatedKeyword").html('');
-		var html = '';
-		$.getJSON('/display/search/trend/keyword/list', function (result){
-			if(result.trendList.length > 0){
-				$.each(result.trendList, function (idx, item){
-					html += '<a href="javascript:void(0);" onclick="fnSearchKeyword(\''+item.keyword+'\');"><span>#</span>'+item.keyword+'</a>';
-				});
-			}
-			$("#noDataRelatedKeyword").append(html);
-		});
-	}
-
-	// 실시간 상품 새로고침
-	var fnRealtimeGoodsList = function (){
-		$("#itemViewArea").html('');
-		var html = '';
-
-		$.getJSON('/display/realtime/goods/list', function (result){
-			// console.log(result);
-			if(result.length > 0){
-				$.each(result, function (idx, item){
-					html += '<div class="swiper-slide">\n';
-					html += '	<div class="item_prod">\n';
-					html += '		<button type="button" class="itemLike';
-					if(item.wishCnt > 0){
-						html += ' likeit';
-					}
-					html += '" onclick="cfnMoPutWishList(this);" goodsCd="'+item.itemId+'">관심상품 추가</button>\n';
-					html += '		<a href="'+item.itemUrl+'">\n';
-					html += '			<img src="'+item.imageUrl+'" alt="">\n';
-					html += '				<div class="s-text">\n';
-					html += '					<div class="itemName">'+item.itemName+'</div>\n';
-					if(item.count < 10){
-						html += '			<p class="itemTag">10명 미만</p>\n';
-					}else{
-						html += '			<p class="itemTag">'+item.count.addComma()+'명 보는중</p>\n';
-					}
-					html += '				</div>\n';
-					html += '		</a>\n';
-					html += '	</div>\n';
-					html += '</div>\n';
-				});
-			}
-			$("#itemViewArea").append(html);
-
-			var swiperschProduct2 = new Swiper('.swiper-container.sch_product', {
-				slidesPerView: 3,
-				spaceBetween: 7,
-				autoplay: {
-					delay: 4000,
-				},
-				freeMode: true,
-				//centeredSlides: true,
-			});
-		});
-	}
-
-	// 검색어 연관 상품 추천
-	var fnRecommendItemList = function (keyword){
-		if(gagajf.isNull(keyword)){
-			keyword = "";
-		}
-		var data = {keyword : keyword.trim()};
-		var html = '';
-
-		$.getJSON('/display/recommend/item/list', data, function (result){
-			$("#recommendItemArea").html('');
-			$("#recommandArea").show();
-
-			if(result.length > 0){
-				$.each(result, function (idx, item){
-					html += '<div class="swiper-slide">\n';
-					html += '	<div class="item_prod">\n';
-					html += '		<div class="item_state">\n';
-					html += '		<button type="button" class="itemLike';
-					if(item.product.wishCnt > 0){
-						html += ' likeit';
-					}
-					html += '" onclick="cfnMoPutWishList(this);" goodsCd="'+item.product.itemId+'">관심상품 추가</button>\n';
-					//html += '			<button type="button" class="itemLike">관심상품 추가</button>\n';
-					html += '			<a href="'+item.product.itemUrl+'" class="itemLink">\n';
-					html += '				<div class="itemPic">\n';
-					html += '					<img class="vLHTC pd_img" src="'+item.product.itemImage+'" alt="">\n';
-					html += '				</div>\n';
-					html += '				<p class="itemBrand">'+item.product.brandName+'</p>\n';
-					html += '				<div class="itemName">'+item.product.itemName+'</div>\n';
-					html += '				<p class="itemPrice">\n';
-					if(item.product.salePrice < item.product.originalPrice) {
-						html += '			<span class="itemPrice_original">'+ item.product.originalPrice.addComma() +'</span>\n';
-					}
-					html += item.product.salePrice.addComma() ;
-					if(item.product.salePrice < item.product.originalPrice) {
-						html += '			<span class="itemPercent">' + Math.round((item.product.originalPrice - item.product.salePrice) / (item.product.originalPrice * 1.0) * 100) + '%</span>\n';
-					}
-					html += '				</p>\n';
-					html += '			</a>\n';
-					html += '		</div>\n';
-					html += '	</div>\n';
-					html += '</div>\n';
-				});
-
-				$("#recommendItemArea").append(html);
-
-				var swiperschProduct3 = new Swiper('.swiper-container.recommand_slide', {
-					slidesPerView: 2.2,
-					spaceBetween: 8,
-					autoplay: {
-						delay: 4000,
-					},
-					freeMode: true,
-					//centeredSlides: true,
-				});
-
-			}else{
-				$("#recommendItemArea").html('');
-				$("#recommandArea").hide();
-			}
-		});
-	}
-	/*]]>*/
-</script>
-
-</body>
-</html>
+<!DOCTYPE html>
+<html lang="ko"
+	  xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : SearchLayerMob.html
+ * @desc    : 검색 레이어 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.06.14   bin2107     최초 작성
+ *******************************************************************************
+ -->
+<body>
+<div class="modal-dialog" role="document">
+	<div class="modal-content">
+		<div class="modal-header htop">
+			<h5 class="modal-title sr-only" id="schPopLabel">통합검색</h5>
+		</div>
+		<div class="modal-body">
+			<section class="sch_result">
+				<!-- 1.통합검색 default -->
+				<div class="inner">
+					<form id="searchMainForm" name="searchMainForm">
+						<input type="hidden" name="brandGroupNo" th:value="${brandGroupNo}"/>
+						<div class="sch_title">
+							<input type="text" class="form_control" name="keyword" placeholder="검색어를 입력하세요." autocomplete="off" onkeyup="fnOnkeyupKeyword(this);">
+							<button type="button" class="btn_x" id="deleteKeyword" style="display:none;">X</button>
+							<button type="button" class="btn_sch" id="btnSearchKeyword"><img th:src="${@environment.getProperty('domain.uximage')} + '/images/mo/ico_btn_search.png'" alt=""></button>
+						</div>
+					</form>
+				</div>
+
+				<div class="inner default_box" id="defaultArea">
+					<div class="filter-list">
+						<div class="f_left">
+							<h3>최근 검색어</h3>
+						</div>
+						<div class="f_right">
+						</div>
+					</div>
+					<div class="search-list" th:classappend="${#lists.isEmpty(recentlyKeywordList)?'nodata':''}"> <!-- 검색데이터 없을시 nodata 클래스 추가. -->
+						<ul>
+							<li th:if="${recentlyKeywordList}" th:each="oneData, status : ${recentlyKeywordList}">
+								<a href="javascript:void(0);" th:onclick="fnSearchKeyword([[${oneData}]])">
+									<p th:text="${oneData}"></p>
+								</a>
+								<button type="button" class="xBtn" th:onclick="fnDeleteCookie(this,[[${oneData}]]);"><span>삭제</span></button>
+							</li>
+						</ul>
+						<p class="nodata_txt" th:if="${#lists.isEmpty(recentlyKeywordList)}">최근 검색어가 없습니다.</p>
+					</div>
+					<h3 class="hot-key" th:if="${brandGroupNo==null}">STYLE24에서 검색되고 있어요</h3>
+					<div class="related_keyword" th:if="${brandGroupNo==null}">
+						<div class="sub_category">
+							<div class="cate_wrap" id="popularKeyArea">
+								<!--						<a href="javascript:;" class="on">전체</a>-->
+							</div>
+						</div>
+					</div>
+				</div>
+				<!-- //1.통합검색 default -->
+
+				<!-- 3.지금 많이 보고 있어요 상품. -->
+				<div class="inner default_box" id="popularArea">
+					<div class="now_view">
+						<div class="store_product">
+							<div class="allresult-tit">
+								<h3>지금 많이 보고 있어요</h3>
+								<button type="button" class="btn_refresh" onclick="fnRealtimeGoodsList();"><span th:text="${#calendars.format(#calendars.createNow(), 'HH:mm')}">17:30</span> 기준</button>
+							</div>
+							<div class="swiper-container sch_product">
+								<div class="swiper-wrapper" id="itemViewArea">
+									<th:block th:each="item, status : ${realtimeGoodsList}">
+										<div class="swiper-slide">
+											<div class="item_prod">
+												<button type="button" class="itemLike" th:classappend="${item.wishCnt > 0}? 'likeit' : ''" onclick="cfnMoPutWishList(this);" th:attr="goodsCd=${item.itemId}">관심상품 추가</button>
+												<a th:href="${item.itemUrl} + '&rccode=rts_mo_search&rtscode=mo_search'">
+													<img th:src="${item.imageUrl}" alt="">
+													<div class="s-text">
+														<div class="itemName" th:text="${item.itemName}"></div>
+														<p class="itemTag" th:text="${item.count < 10 ? '10명 미만' : item.count + '명 보는중'}">508명 보는중</p>
+													</div>
+												</a>
+											</div>
+										</div>
+									</th:block>
+								</div>
+							</div>
+						</div>
+					</div>
+				</div>
+				<!-- //3.지금 많이 보고 있어요 상품. -->
+
+				<!-- 4.검색어 타이핑 -->
+				<div class="inner searching_box" id="keyupArea" style="display:none;" th:if="${brandGroupNo==null}">
+					<div class="filter-list store-list" id="brandStoreArea">
+					</div>
+					<div class="relative-list">
+					</div>
+				</div>
+				<div class="inner searching_box" id="keyupCateArea" style="display:none;" th:if="${brandGroupNo==null}">
+					<div class="sch_category">
+					</div>
+				</div>
+				<div class="inner empty_box2" id="relateArea" style="display:none;">
+					<div class="recommand_product">
+						<div class="store_product">
+							<div class="swiper-container recommand_slide">
+								<h3>관련상품</h3>
+								<div class="swiper-wrapper" id="relateItemArea">
+
+								</div>
+							</div>
+						</div>
+					</div>
+				</div>
+				<!-- //4.검색어 타이핑 -->
+
+				<!-- 3.검색결과 없을때 -->
+				<div class="inner empty_box" id="noDataArea" style="display:none;">
+					<div class="relative-list nodata"> <!-- 검색결과 없을 시 nodata 클래스 추가 -->
+						<p class="nodata_txt">&lsquo;<span id="noDataKeyword"></span>&rsquo; 에 맞는 상품을 찾지 못했습니다.<br>검색어를 변경해 보세요.</p>
+					</div>
+					<h3 class="hot-key">STYLE24에서 검색되고 있어요</h3>
+					<div class="related_keyword">
+						<div class="sub_category">
+							<div class="cate_wrap" id="noDataRelatedKeyword">
+
+							</div>
+						</div>
+					</div>
+				</div>
+				<div class="inner empty_box" id="recommandArea" style="display:none;">
+					<div class="recommand_product">
+						<div class="store_product">
+							<div class="swiper-container recommand_slide">
+								<h3>이런 상품은 어떤가요?</h3>
+								<div class="swiper-wrapper" id="recommendItemArea">
+
+								</div>
+							</div>
+						</div>
+					</div>
+				</div>
+				<!-- //3.검색결과 없을때 -->
+			</section>
+		</div>
+	</div>
+</div>
+<script src="/ux/plugins/gaga/gaga.paging.js"></script>
+<script th:inline="javascript">
+	/*<![CDATA[*/
+	var enterBool = false;
+	var trendKeywordList = [[${trendKeywordList.trendList}]];
+
+	var swiperschProduct = new Swiper('.swiper-container.sch_product', {
+		slidesPerView: 3,
+		spaceBetween: 6,
+		autoplay: {
+			delay: 4000,
+		},
+		freeMode: true,
+		//centeredSlides: true,
+	});
+
+
+	var schProdLength = $('.sch_product .swiper-slide').length;
+	if (schProdLength < 4) {
+		var swiperschProduct = new Swiper('.swiper-container.sch_product', {
+			slidesPerView: 3,
+			spaceBetween: 6,
+			autoplay: false,
+			freeMode: false,
+			loop:false,
+			a11y: {
+				enabled: true,
+				notificationClass: 'swiper-notification',
+			},
+		});
+	} else {
+		var swiperschProduct = new Swiper('.swiper-container.sch_product', {
+			slidesPerView: 3,
+			spaceBetween: 6,
+			autoplay: {
+				delay: 4000,
+			},
+			freeMode: true,
+			loop:true,
+			a11y: {
+				enabled: true,
+				notificationClass: 'swiper-notification',
+				firstSlideMessage: '첫번째 슬라이드 입니다',
+				lastSlideMessage: '마지막 슬라이드 입니다',
+			},
+		});
+	};
+
+	var schRecommendLength = $('.recommand_slide .swiper-slide').length;
+	if (schRecommendLength < 3) {
+		var swiperschProduct = new Swiper('.swiper-container.recommand_slide', {
+			slidesPerView: 2.2,
+			spaceBetween: 8,
+			autoplay: false,
+			freeMode: false,
+			loop:false,
+			a11y: {
+				enabled: true,
+				notificationClass: 'swiper-notification',
+			},
+		});
+	} else {
+		var swiperschProduct = new Swiper('.swiper-container.recommand_slide', {
+			slidesPerView: 2.2,
+			spaceBetween: 8,
+			autoplay: {
+				delay: 4000,
+			},
+			freeMode: true,
+			loop:true,
+			a11y: {
+				enabled: true,
+				notificationClass: 'swiper-notification',
+				firstSlideMessage: '첫번째 슬라이드 입니다',
+				lastSlideMessage: '마지막 슬라이드 입니다',
+			},
+		});
+	};
+
+	$(".itemLike").click(function () {
+		$(this).toggleClass("likeit");
+	});
+
+	var ckKeyword = "st24ck_today_keyword";
+	var fnSetKeywordCookie = function(keyword) {
+		var arrKeyword = new Array;
+		var arrTempKeyword = new Array;
+		var j = 0;
+
+		arrKeyword = gagajf.getCookie(ckKeyword).split(",");
+
+		if (arrKeyword.length > 0) {
+			for (var i = 0; i < arrKeyword.length; i++) {
+				// 쿠키에 없으면
+				if (arrKeyword[i] != keyword && arrKeyword[i] != "") {
+					arrTempKeyword[j++] = arrKeyword[i];
+				}
+			}
+
+			arrTempKeyword[j++] = keyword;
+		} else {
+			gagajf.setCookie(ckKeyword, keyword, 1);
+		}
+
+		gagajf.setCookie(ckKeyword, arrTempKeyword, 1);
+	}
+
+	// 키워드 검색
+	$('#btnSearchKeyword').on('click', function() {
+		if (!gagajf.validation($('#searchMainForm'))) {
+			return false;
+		}
+
+		if( !enterBool ){
+			enterBool = true;
+			// 검색결과 상품목록 호출(있으면 검색결과 페이지로 이동)
+			gagajf.ajaxFormSubmit("/display/search/goods/list_cnt", document.searchMainForm, function(result) {
+				enterBool = false;
+				if( "0" == result.response_cnt){
+					$('.sch_result .default_box').hide();
+					$('.sch_result .searching_box').hide();
+					$('.sch_result .empty_box2').hide();
+					$('.sch_result .empty_box').show();
+					$("#noDataArea").find('#noDataKeyword').text($("#searchMainForm").find('input[name=keyword]').val());
+	
+					// 검색어 연관 상품 추천
+					fnRecommendItemList($("#searchMainForm").find('input[name=keyword]').val());
+					// 인기검색어
+					fnTrendKeywordList();
+	
+				}else{
+					let keyword = encodeURIComponent($('#searchMainForm input[name=keyword]').val());
+	
+					// 쿠키 세팅
+					fnSetKeywordCookie(keyword);
+	
+					let actionUrl = _PAGE_SEARCH_GOODS + '?keyword=' + keyword + '&brandGroupNo=' + $('#searchMainForm input[name=brandGroupNo]').val();
+					cfnGoToPage(actionUrl);
+				}
+			}, true);
+		}
+	});
+
+	// 검색어 찾기
+	var fnGetAutoSearch = function (){
+		gagajf.ajaxFormSubmit("/display/search/auto/complete", document.searchMainForm, fnAutoCompleteList);
+	}
+
+	// 검색어 찾기 결과
+	var fnAutoCompleteList = function (result){
+		if( enterBool ) return;
+
+		if(result.autoKeywords.length==0 && gagajf.isNull(result.brand.brandGroupNo) && result.cateList.length == 0 && gagajf.isNull(result.goodsList)){
+			$('.sch_result .default_box').hide();
+			$('.sch_result .searching_box').hide();
+
+		}else{
+			$('.sch_result .default_box').hide();
+			$('.sch_result .searching_box').show();
+			$('.sch_result .empty_box').hide();
+			$('.sch_result .empty_box2').hide();
+			// 자동완성 키워드
+			if(result.autoKeywords != null && result.autoKeywords.length > 0){
+				$("#keyupArea").find(".relative-list").html('');
+				let tag = '';
+				tag += '<ul>\n';
+				$.each(result.autoKeywords, function (idx,item){
+					tag += '<li>\n';
+					tag += '	<a href="javascript:void(0);" onclick="fnSearchKeyword(\''+result.autoKeywords[idx]+'\');">\n';
+					tag += '		<p><span>'+result.autoKeywords[idx]+'</span></p>\n';
+					tag += '	</a>\n';
+					tag += '</li>\n';
+				});
+				tag += '</ul>\n';
+				$("#keyupArea").find(".relative-list").append(tag);
+			}else{
+				$("#keyupArea").find(".relative-list").html('');
+			}
+
+			// 브랜드
+			if(result.brand != null && !gagajf.isNull(result.brand.brandGroupNo)){
+				$("#brandStoreArea").show();
+				$("#keyupArea").find(".store-list").html('');
+				let tag = '';
+				tag += '<div class="f_left">\n';
+				tag += '	<h3>'+result.brand.brandGroupNm+' 공식 스토어</h3>\n';
+				tag += '</div>\n';
+				tag += '<div class="f_right">\n';
+				tag += '	<a href="javascript:void(0);" onclick="cfnGoToBrandMain('+result.brand.brandGroupNo+');">바로가기</a>\n';
+				tag += '</div>\n';
+				$("#keyupArea").find(".store-list").append(tag);
+			}else{
+				$("#keyupArea").find(".store-list").html('');
+				$("#brandStoreArea").hide();
+			}
+
+			if(result.cateList != null && result.cateList.length > 0){
+				$("#keyupCateArea").show();
+				$("#keyupCateArea").find(".sch_category").html('');
+				let tag = '';
+				tag += '<h3>카테고리</h3>\n';
+				tag += '<ul>\n';
+				$.each(result.cateList, function (idx, item){
+					tag +='<li>\n';
+					tag +='	<a href="javascript:void(0);" onclick="cfnGoToGoodsList(0,\'G032_101\' ';
+					if(item.cate1No != null){
+						tag += ', '+item.cate1No;
+					}
+					if(item.cate2No != null){
+						tag += ', '+item.cate2No;
+					}
+					if(item.cate3No != null){
+						tag += ', '+item.cate3No;
+					}
+					if(item.cate4No != null){
+						tag += ', '+item.cate4No;
+					}
+					if(item.cate5No != null){
+						tag += ', '+item.cate5No;
+					}
+					tag += ');">\n';
+					if(item.cate1Nm != null){
+						tag += '		<span>'+item.cate1Nm+'</span>\n';
+					}
+					if(item.cate2Nm != null){
+						tag += '		<span>'+item.cate2Nm+'</span>\n';
+					}
+					if(item.cate3Nm != null){
+						tag += '		<span>'+item.cate3Nm+'</span>\n';
+					}
+					if(item.cate4Nm != null){
+						tag += '		<span>'+item.cate4Nm+'</span>\n';
+					}
+					if(item.cate5Nm != null){
+						tag += '		<span>'+item.cate5Nm+'</span>\n';
+					}
+					tag +='	</a>\n';
+					tag +='</li>\n';
+				});
+				tag += '</ul>\n';
+
+				$("#keyupCateArea").find(".sch_category").append(tag);
+			}else{
+				$("#keyupCateArea").find(".sch_category").html('');
+				$("#keyupCateArea").hide();
+			}
+
+			if(!gagajf.isNull(result.goodsList)){
+				$("#relateArea").show();
+				$("#relateItemArea").html('');
+				let tag = '';
+				$.each(result.goodsList, function (idx, item){
+					if(idx<5) {
+						tag += '<div class="swiper-slide">\n';
+						tag += '	<div class="item_prod">\n';
+						tag += '		<div class="item_state">\n';
+						tag += '		<button type="button" class="itemLike';
+						if(item.likeIt == 'likeit'){
+							tag += ' likeit';
+						}
+						tag += '" onclick="cfnMoPutWishList(this);" goodsCd="'+item.goodsCd+'">관심상품 추가</button>\n';
+						//tag += '			<button type="button" class="itemLike">관심상품 추가</button>\n';
+						tag += '			<a href="javascript:void(0);" class="itemLink" onclick="cfnGoToGoodsDetail(\'' + item.goodsCd + '\',\'' + item.colorCd + '\');">\n';
+						tag += '				<div class="itemPic">\n';
+						tag += '					<img class="vLHTC pd_img" src="'+item.sysImgNm+'" alt="">\n';
+						tag += '				</div>\n';
+						tag += '				<p class="itemBrand">'+item.brandGroupNm+'</p>\n';
+						tag += '				<div class="itemName">'+item.goodsFullNm+'</div>\n';
+						tag += '				<p class="itemPrice">\n';
+						if(item.listPrice != item.currPrice) {
+							tag += '			<span class="itemPrice_original">'+ item.listPrice.addComma() +'</span>\n';
+						}
+						tag += item.currPrice.addComma() ;
+						if(item.listPrice != item.currPrice) {
+							tag += '			<span class="itemPercent">' + Math.round((item.listPrice - item.currPrice) / (item.listPrice * 1.0) * 100) + '%</span>\n';
+						}
+						tag += '				</p>\n';
+						tag += '			</a>\n';
+						tag += '		</div>\n';
+						tag += '	</div>\n';
+						tag += '</div>\n';
+					}
+				});
+				$("#relateItemArea").html(tag);
+				var swiperschProduct4 = new Swiper('.swiper-container.recommand_slide', {
+					slidesPerView: 2.2,
+					spaceBetween: 8,
+					autoplay: {
+						delay: 4000,
+					},
+					freeMode: true,
+					//centeredSlides: true,
+				});
+			}else{
+				$("#relateItemArea").html('');
+				$("#relateArea").hide();
+			}
+		}
+	}
+
+	// 검색어 입력
+	var fnOnkeyupKeyword = function (obj){
+		if( 13 != event.keyCode){
+			enterBool = false;
+			var searchValue = $(obj).val();
+			if(searchValue.length > 0){
+				fnGetAutoSearch();
+			}else{
+				$('.sch_result .default_box').show();
+				$('.sch_result .searching_box').hide();
+				$('.sch_result .empty_box').hide();
+				$('.sch_result .empty_box2').hide();
+			}
+		}else{
+			// 엔터친 후, 그 전에 검색한 결과가 오고있으므로
+			enterBool = true;
+		}
+	}
+
+	document.getElementById("deleteKeyword").onclick = function (){
+		$("#searchMainForm").find("input[name=keyword]").val('');
+		fnOnkeyupKeyword($("#searchMainForm").find("input[name=keyword]"));
+	}
+
+	$(document).ready( function() {
+		if (trendKeywordList.length > 0) {
+			$("#popularKeyArea").html('');
+
+			trendKeywordList.forEach(function (item, idx) {
+				if(item.keyword.indexOf("테스트") < 0){
+					var tag = '';
+					if (idx < 10) {
+						tag += '	<a href="javascript:void(0);" onclick="fnSearchKeyword(\''+item.keyword+'\');">'+ item.keyword +'</a>';
+					}
+					$("#popularKeyArea").append(tag);
+				}
+			});
+		}else{
+			$("#popularKeyArea").html('');
+		}
+
+		$("#keyupArea").hide();
+		$("#keyupCateArea").hide();
+		$("#deleteKeyword").hide();
+		$("#noDataArea").hide();
+		$("#recommandArea").hide();
+		$("#relateArea").hide();
+	});
+
+	// 선택 단어 검색
+	var fnSearchKeyword = function (obj){
+		$("#searchMainForm").find("input[name=keyword]").val(obj);
+		$('#btnSearchKeyword').trigger('click');
+	}
+
+	// 선택 단어 삭제
+	var fnDeleteCookie = function (obj, keyword){
+		$(obj).closest('li').remove();
+		gagajf.setCookie('st24ck_today_keyword',keyword, -1);
+	}
+
+	// 검색어 입력 후 엔터키
+	$('#searchMainForm input[name=keyword]').keypress(function (event) {
+		if (event.which === 13) {
+			event.preventDefault();
+			$('#btnSearchKeyword').trigger('click');
+		}
+	});
+
+	// 인기검색어 조회
+	var fnTrendKeywordList = function (){
+		$("#noDataRelatedKeyword").html('');
+		var html = '';
+		$.getJSON('/display/search/trend/keyword/list', function (result){
+			if(result.trendList.length > 0){
+				$.each(result.trendList, function (idx, item){
+					html += '<a href="javascript:void(0);" onclick="fnSearchKeyword(\''+item.keyword+'\');"><span>#</span>'+item.keyword+'</a>';
+				});
+			}
+			$("#noDataRelatedKeyword").append(html);
+		});
+	}
+
+	// 실시간 상품 새로고침
+	var fnRealtimeGoodsList = function (){
+		$("#itemViewArea").html('');
+		var html = '';
+
+		$.getJSON('/display/realtime/goods/list', function (result){
+			// console.log(result);
+			if(result.length > 0){
+				$.each(result, function (idx, item){
+					html += '<div class="swiper-slide">\n';
+					html += '	<div class="item_prod">\n';
+					html += '		<button type="button" class="itemLike';
+					if(item.wishCnt > 0){
+						html += ' likeit';
+					}
+					html += '" onclick="cfnMoPutWishList(this);" goodsCd="'+item.itemId+'">관심상품 추가</button>\n';
+					html += '		<a href="'+item.itemUrl+'&rccode=rts_mo_search&rtscode=mo_search">\n';
+					html += '			<img src="'+item.imageUrl+'" alt="">\n';
+					html += '				<div class="s-text">\n';
+					html += '					<div class="itemName">'+item.itemName+'</div>\n';
+					if(item.count < 10){
+						html += '			<p class="itemTag">10명 미만</p>\n';
+					}else{
+						html += '			<p class="itemTag">'+item.count.addComma()+'명 보는중</p>\n';
+					}
+					html += '				</div>\n';
+					html += '		</a>\n';
+					html += '	</div>\n';
+					html += '</div>\n';
+				});
+			}
+			$("#itemViewArea").append(html);
+
+			var swiperschProduct2 = new Swiper('.swiper-container.sch_product', {
+				slidesPerView: 3,
+				spaceBetween: 7,
+				autoplay: {
+					delay: 4000,
+				},
+				freeMode: true,
+				//centeredSlides: true,
+			});
+		});
+	}
+
+	// 검색어 연관 상품 추천
+	var fnRecommendItemList = function (keyword){
+		if(gagajf.isNull(keyword)){
+			keyword = "";
+		}
+		var data = {keyword : keyword.trim()};
+		var html = '';
+
+		$.getJSON('/display/recommend/item/list', data, function (result){
+			$("#recommendItemArea").html('');
+			$("#recommandArea").show();
+
+			if(result.length > 0){
+				$.each(result, function (idx, item){
+					html += '<div class="swiper-slide">\n';
+					html += '	<div class="item_prod">\n';
+					html += '		<div class="item_state">\n';
+					html += '		<button type="button" class="itemLike';
+					if(item.product.wishCnt > 0){
+						html += ' likeit';
+					}
+					html += '" onclick="cfnMoPutWishList(this);" goodsCd="'+item.product.itemId+'">관심상품 추가</button>\n';
+					//html += '			<button type="button" class="itemLike">관심상품 추가</button>\n';
+					html += '			<a href="'+item.product.itemUrl+'&rccode=mo_search_s3" class="itemLink">\n';
+					html += '				<div class="itemPic">\n';
+					html += '					<img class="vLHTC pd_img" src="'+item.product.itemImage+'" alt="">\n';
+					html += '				</div>\n';
+					html += '				<p class="itemBrand">'+item.product.brandName+'</p>\n';
+					html += '				<div class="itemName">'+item.product.itemName+'</div>\n';
+					html += '				<p class="itemPrice">\n';
+					if(item.product.salePrice < item.product.originalPrice) {
+						html += '			<span class="itemPrice_original">'+ item.product.originalPrice.addComma() +'</span>\n';
+					}
+					html += item.product.salePrice.addComma() ;
+					if(item.product.salePrice < item.product.originalPrice) {
+						html += '			<span class="itemPercent">' + Math.round((item.product.originalPrice - item.product.salePrice) / (item.product.originalPrice * 1.0) * 100) + '%</span>\n';
+					}
+					html += '				</p>\n';
+					html += '			</a>\n';
+					html += '		</div>\n';
+					html += '	</div>\n';
+					html += '</div>\n';
+				});
+
+				$("#recommendItemArea").append(html);
+
+				var swiperschProduct3 = new Swiper('.swiper-container.recommand_slide', {
+					slidesPerView: 2.2,
+					spaceBetween: 8,
+					autoplay: {
+						delay: 4000,
+					},
+					freeMode: true,
+					//centeredSlides: true,
+				});
+
+			}else{
+				$("#recommendItemArea").html('');
+				$("#recommandArea").hide();
+			}
+		});
+	}
+	/*]]>*/
+</script>
+
+</body>
+</html>

+ 478 - 478
src/main/webapp/WEB-INF/views/web/display/BrandSearchLayerWeb.html

@@ -1,479 +1,479 @@
-<!DOCTYPE html>
-<html lang="ko"
-	xmlns:th="http://www.thymeleaf.org">
-<!--
- *******************************************************************************
- * @source  : BrandSearchLayerWeb.html
- * @desc    : 검색 레이어 Page
- *============================================================================
- * STYLE24
- * Copyright(C) 2020 TSIT, All rights reserved.
- *============================================================================
- * VER  DATE         AUTHOR      DESCRIPTION
- * ===  ===========  ==========  =============================================
- * 1.0  2021.07.12   bin2107     최초 작성
- *******************************************************************************
- -->
-<h2 class="sr-only">통합검색</h2>
-<div class="cont_search">
-	<div class="area_input">
-		<form id="brandSearchMainForm" name="brandSearchMainForm">
-			<input type="hidden" name="brandGroupNo" th:value="${brandGroupNo}"/>
-			<fieldset>
-				<legend>통합검색</legend>
-				<input type="text" name="keyword" value="" placeholder="검색어를 입력하세요." class="search_input" title="검색어 입력" maxlength="100" required="required" data-valid-name="검색어" autocomplete="off" onkeyup="fnOnkeyupKeyword(this);"/>
-				<button type="button" class="sch_btn" id="btnSearchKeyword"><i class="ico ico_search"><em>검색</em></i></button>
-			</fieldset>
-		</form>
-	</div>
-	<div class="area_result">
-		<!-- 검색결과 입력 전 -->
-		<div class="default_box">
-			<div class="recent_blk">
-				<h3>최근 검색어</h3>
-				<!-- 최근검색어 있을 시 노출 -->
-				<div class="list_recent_keword" th:if="${not #lists.isEmpty(recentlyKeywordList)}">
-					<ul>
-						<li th:if="${recentlyKeywordList}" th:each="oneData, status : ${recentlyKeywordList}">
-							<a href="javascript:void(0);" th:text="${oneData}" th:onclick="fnSearchKeyword([[${oneData}]])">슬랙스</a>
-							<button type="button" class="btn_delete" th:onclick="fnDeleteCookie(this,[[${oneData}]]);" ><span>삭제</span></button>
-						</li>
-					</ul>
-				</div>
-				<button type="button" class="btn_underline" th:if="${not #lists.isEmpty(recentlyKeywordList)}"><span>전체삭제</span></button>
-				<!-- //최근검색어 있을 시 노출 -->
-				<!-- 최근검색어 없을 시 노출 -->
-				<div class="empty_txt" th:if="${#lists.isEmpty(recentlyKeywordList)}">
-					최근 검색어가 없습니다.
-				</div>
-				<!-- //최근검색어 없을 시 노출 -->
-			</div>
-			<div class="realtime_blk">
-				<h3>지금 고객님들이 많이 보고 있어요</h3>
-				<div class="modify_timer">
-					<button type="button" onclick="fnRealtimeGoodsList();"><span><em class="time" th:text="${#calendars.format(#calendars.createNow(), 'HH:mm')}">17:30</em> 기준</span></button>
-				</div>
-				<div class="realtime_wrap">
-				
-					<div class="swiper-container">
-	           			<div class="swiper-wrapper itemsGrp" id="itemViewArea">
-							<th:block th:each="item, status : ${realtimeGoodsList}">
-								<div class="swiper-slide">
-									<div class="item_prod">
-										<div class="item_state">
-											<a th:href="${item.itemUrl} + '&rccode=rts_pc_search&rtscode=pc_search'" class="itemLink">
-												<div class="itemPic">
-													<img alt="" class="vLHTC pd_img" th:src="${item.imageUrl}">
-												</div>
-												<div class="itemName" th:text="${item.itemName}"></div>
-												<div class="viewCount"><span th:text="${item.count < 10 ? '10명 미만' : item.count + '명 보는중'}"></span></div>
-											</a>
-										</div>
-									</div>
-								</div>
-							</th:block>
-						</div>
-						<div class="swiper-controls">
-			                <div class="swiper-scrollbar"></div>
-			            </div>
-						
-					</div>
-				</div>
-			</div>
-		</div>
-		<!-- //검색결과 입력 전 -->
-		<!-- 검색결과 입력 후 -->
-		<div class="searching_box" style="display:none;">
-			<div class="autokeyword_blk">
-
-			</div>
-
-			<div class="pd_list relate" id="relateGoodsDiv">
-				<h3>관련상품</h3>
-				<div class="realtime_wrap">
-					<div class="itemsGrp">
-
-					</div>
-				</div>
-			</div>
-		</div>
-		<!-- //검색결과 입력 후 -->
-
-		<!-- 검색결과 없을때 노출 -->
-		<div class="empty_box" style="display: none">
-			<div class="">
-				<div class="nodata">
-					<p>
-						<span class="keyword" id="noDataKeyword"></span>에 맞는 상품을 찾지 못했습니다.<br>
-						검색어를 변경해 보세요.
-					</p>
-				</div>
-				<div class="pd_list recommend">
-					<h3>이런 상품은 어떤가요?</h3>
-					<div class="itemsGrp" id="recommendItemArea">
-	
-					</div>
-				</div>
-			</div>
-			<!-- //검색결과 없을때 노출 -->
-		</div>
-	</div>
-</div>
-<button type="button" class="btn_close_search" onclick="fnClose();"><span>닫기</span></button>
-
-<script src="/ux/plugins/gaga/gaga.paging.js"></script>
-<script th:inline="javascript">
-	/*<![CDATA[*/
-	var enterBool = false;
-	var fnClose = function() {
-		$("body").removeClass("lock");
-		$("#brand_layer_search").removeClass('active');
-	}
-	
-	// 검색어 입력 후 엔터키
-	$('#brandSearchMainForm input[name=keyword]').keypress(function (event) {
-		if (event.which === 13) {
-			event.preventDefault();
-			$('#btnSearchKeyword').trigger('click');
-		}
-	});
-	
-	var ckKeyword = "st24ck_today_keyword";
-	var fnSetKeywordCookie = function(keyword) {
-		var arrKeyword = new Array;
-		var arrTempKeyword = new Array;
-		var j = 0;
-
-		arrKeyword = gagajf.getCookie(ckKeyword).split(",");
-
-		if (arrKeyword.length > 0) {
-			for (var i = 0; i < arrKeyword.length; i++) {
-				// 쿠키에 없으면
-				if (arrKeyword[i] != keyword && arrKeyword[i] != "") {
-					arrTempKeyword[j++] = arrKeyword[i];
-				}
-			}
-
-			arrTempKeyword[j++] = keyword;
-		} else {
-			gagajf.setCookie(ckKeyword, keyword, 1);
-		}
-
-		gagajf.setCookie(ckKeyword, arrTempKeyword, 1);
-	}
-	
-	// 키워드 검색
-	$('#btnSearchKeyword').on('click', function() {
-		if (!gagajf.validation($('#brandSearchMainForm'))) {
-			return false;
-		}
-		
-		if( !enterBool ){
-			enterBool = true;
-			// 검색결과 상품목록 호출(있으면 검색결과 페이지로 이동)
-			gagajf.ajaxFormSubmit("/display/search/goods/list_cnt", document.brandSearchMainForm, function(result) {
-				enterBool = false;
-				if( "0" == result.response_cnt){
-					$('.common_search .area_result .default_box').hide();
-					$('.common_search .area_result .searching_box').hide();
-					$('.common_search .area_result .empty_box').show();
-					$('.empty_box .nodata').find('#noDataKeyword').text("'"+$("#brandSearchMainForm").find('input[name=keyword]').val()+"'");
-					
-					// 검색결과 페이지에서 검색팝업 띄웠을때 (검색결과 페이지에 정의되어있으므로 내용 안뜨는 오류)
-					if( 1 == $("input[name=keyword]").length ){
-						$(".common_search .recommend").show();
-						// 검색어 연관 상품 추천
-						fnRecommendItemList($("#brandSearchMainForm").find('input[name=keyword]').val());
-					}else{
-						$(".common_search .recommend").hide();
-					}
-					
-				}else{
-					let keyword = encodeURIComponent($('#brandSearchMainForm input[name=keyword]').val());
-					
-					// 쿠키 세팅
-					fnSetKeywordCookie(keyword);
-					
-					let actionUrl = _PAGE_BRAND_SEARCH_GOODS + '?keyword=' + keyword + '&brandGroupNo=' + $('#brandSearchMainForm input[name=brandGroupNo]').val();
-					cfnGoToPage(actionUrl);
-				}
-			}, true);
-		}
-	});
-
-	var submain_slide;
-	$(document).ready( function() {
-		$("#brand_layer_search").addClass('active');
-
-		//통합검색 - 검색어 입력 시
-		//
-		
-		// 지금 고객님들이 많이 보고 있어요
-		//210730_ 추가 : 지금 고객님들이 많이 보고 있어요 슬라이드 swiper 옵션 추가.
-		submain_slide = new Swiper('.realtime_wrap .swiper-container', {
-			slidesPerView: 5,
-			watchOverflow:true,
-			freeMode:true,
-			observer: true,
-			observeParents: true,
-			speed:1000,
-			scrollbar: {
-				el: '.realtime_wrap .swiper-scrollbar',
-				hide: false,
-			},
-		});
-	});
-
-	// 검색어 찾기
-	var fnGetAutoSearch = function (){
-		gagajf.ajaxFormSubmit("/display/search/auto/complete", document.brandSearchMainForm, fnAutoCompleteList);
-	}
-
-	// 검색어 찾기 결과
-	var fnAutoCompleteList = function (result){
-		if( enterBool ) return;
-				
-		if(result.autoKeywords.length==0 && gagajf.isNull(result.goodsList)){
-			$('.common_search .area_result .default_box').hide();
-			$('.common_search .area_result .searching_box').hide();
-			
-		}else{
-			$('.common_search .area_result .default_box').hide();
-			$('.common_search .area_result .searching_box').show();
-			$('.common_search .area_result .empty_box').hide();
-			// 자동완성 키워드
-			if(result.autoKeywords != null && result.autoKeywords.length > 0){
-				$(".autokeyword_blk").html('');
-				let tag = '';
-				tag += '<ul>\n';
-				$.each(result.autoKeywords, function (idx, item){
-					//<a href="javascript:void(0);"><em>가</em>을컬리수</a>
-					tag += '<li><a href="javascript:void(0);">'+result.autoKeywords[idx]+'</a></li>\n';
-				});
-				tag += '</ul>\n';
-				$(".autokeyword_blk").append(tag);
-			}else{
-				$(".autokeyword_blk").html('');
-				let tag = '';
-				tag += '<ul>\n';
-				tag += '<li></li>\n';
-				tag += '</ul>\n';
-				$(".autokeyword_blk").append(tag);
-			}
-
-			//if(result.brand != null && !gagajf.isNull(result.brand.brandGroupNo)){
-			//	$(".find_brand").html('');
-			//	let tag = '';
-			//	tag += '<h3><a href="javascript:void(0);" onclick="cfnGoToBrandMain('+result.brand.brandGroupNo+');">'+result.brand.brandGroupNm+' 샵 바로가기</a></h3>\n';
-			//	$(".find_brand").append(tag);
-			//}else{
-			//	$(".find_brand").html('');
-			//}
-
-			//if(result.cateList != null && result.cateList.length > 0){
-			//	$(".find_category").html('');
-			//	let tag = '';
-			//	tag += '<ul>\n';
-			//	$.each(result.cateList, function (idx, item){
-			//		tag += '<li>\n';
-			//		tag += '	<span class="category_txt">카테고리</span>\n';
-			//		tag += '	<a href="javascript:void(0);" onclick="cfnGoToGoodsList(0,\'G032_101\' ';
-			//		if(item.cate1No != null){
-			//			tag += ', '+item.cate1No;
-			//		}
-			//		if(item.cate2No != null){
-			//			tag += ', '+item.cate2No;
-			//		}
-			//		if(item.cate3No != null){
-			//			tag += ', '+item.cate3No;
-			//		}
-			//		if(item.cate4No != null){
-			//			tag += ', '+item.cate4No;
-			//		}
-			//		if(item.cate5No != null){
-			//			tag += ', '+item.cate5No;
-			//		}
-			//		tag += ');">\n';
-			//		if(item.cate1Nm != null){
-			//			tag += '		<span>'+item.cate1Nm+'</span>\n';
-			//		}
-			//		if(item.cate2Nm != null){
-			//			tag += '		<span>'+item.cate2Nm+'</span>\n';
-			//		}
-			//		if(item.cate3Nm != null){
-			//			tag += '		<span>'+item.cate3Nm+'</span>\n';
-			//		}
-			//		if(item.cate4Nm != null){
-			//			tag += '		<span>'+item.cate4Nm+'</span>\n';
-			//		}
-			//		if(item.cate5Nm != null){
-			//			tag += '		<span>'+item.cate5Nm+'</span>\n';
-			//		}
-			//		tag += '	</a>\n';
-			//		tag += '</li>\n';
-			//	});
-			//	tag += '</ul>\n';
-			//	$(".find_category").append(tag);
-			//}else{
-			//	$(".find_category").html('');
-			//}
-			if(!gagajf.isNull(result.goodsList)){
-				$("#relateGoodsDiv").show();
-				$(".pd_list .realtime_wrap .itemsGrp").html('');
-				let tag = '';
-				$.each(result.goodsList, function (idx, item){
-					if(idx<5) {
-						tag += '<div class="item_prod">\n';
-						tag += '	<div class="item_state">\n';
-						tag += '		<a href="javascript:void(0);" class="itemLink">\n';
-						tag += '			<div class="itemPic">\n';
-						tag += '				<img alt="" class="vLHTC pd_img" src="' + item.sysImgNm + '">\n';
-						tag += '			</div>\n';
-						tag += '			<p class="itemBrand">' + item.brandGroupNm + '</p>\n';
-						tag += '			<div class="itemName">' + item.goodsFullNm + '</div>\n';
-						tag += '			<p class="itemPrice cols">\n';
-						if (item.listPrice != item.currPrice) {
-							tag += '				<span class="itemPrice_original">' + item.listPrice.addComma() + '</span>\n';
-						}
-						tag += item.currPrice.addComma();
-						if (item.listPrice != item.currPrice) {
-							tag += '				<span class="itemPercent">' + Math.round((item.listPrice - item.currPrice) / (item.listPrice * 1.0) * 100) + '%</span>\n';
-						}
-						tag += '			</p>\n';
-						tag += '		</a>\n';
-						tag += '	</div>\n';
-						tag += '</div>\n';
-					}
-				});
-
-				$(".pd_list .realtime_wrap .itemsGrp").append(tag);
-			}else{
-				$(".pd_list .realtime_wrap .itemsGrp").html('');
-				$("#relateGoodsDiv").hide();
-			}
-		}
-	}
-
-	var fnOnkeyupKeyword = function (obj){
-		if( 13 != event.keyCode){
-			enterBool = false;
-			var searchValue = $(obj).val();
-			if(searchValue.length > 0) {
-				fnGetAutoSearch();
-			} else if (searchValue.length == 0) {
-				$('.common_search .area_result .searching_box').hide();
-				$('.common_search .area_result .default_box').show();
-				$('.common_search .area_result .empty_box').hide();
-			}
-		}else{
-			// 엔터친 후, 그 전에 검색한 결과가 오고있으므로 
-			enterBool = true;	
-		}
-	}
-
-	// 선택 단어 검색
-	var fnSearchKeyword = function (obj){
-		$("#brandSearchMainForm").find("input[name=keyword]").val(obj);
-		$('#btnSearchKeyword').trigger('click');
-	}
-
-	// 선택 단어 삭제
-	var fnDeleteCookie = function (obj, keyword){
-		$(obj).closest('li').remove();
-		gagajf.setCookie('st24ck_today_keyword',keyword, -1);
-	}
-
-	// 실시간 상품 새로고침
-	var fnRealtimeGoodsList = function (){
-		$("#itemViewArea").html('');
-		var html = '';
-		$.getJSON('/display/realtime/goods/list', function (result){
-			if(result.length > 0){
-				$.each(result, function (idx, item){
-					html += '<div class="swiper-slide">\n';
-					html += '	<div class="item_prod">\n';
-					html += '		<div class="item_state">\n';
-					html += '			<a href="'+item.itemUrl+'" class="itemLink">\n';
-					html += '				<div class="itemPic">\n';
-					html += '					<img alt="" class="vLHTC pd_img" src="'+item.imageUrl+'">\n';
-					html += '				</div>\n';
-					html += '				<div class="itemName">'+item.itemName+'</div>\n';
-					if(item.count < 10){
-						html += '			<div class="viewCount"><span>10명</span> 미만</div>\n';
-					}else{
-						html += '			<div class="viewCount"><span>'+item.count.addComma()+'</span>명 보는중</div>\n';
-					}
-					html += '			</a>\n';
-					html += '		</div>\n';
-					html += '	</div>\n';
-					html += '</div>\n';
-									
-				})
-			}
-			$("#itemViewArea").append(html);
-			
-			// 슬라이드 사이즈 때문에 재설정함
-			submain_slide = new Swiper('.realtime_wrap .swiper-container', {
-				slidesPerView: 5,
-				watchOverflow:true,
-				freeMode:true,
-				observer: true,
-				observeParents: true,
-				speed:1000,
-				scrollbar: {
-					el: '.realtime_wrap .swiper-scrollbar',
-					hide: false,
-				},
-			});
-		});
-	}
-
-	// 검색어 연관 상품 추천
-	var fnRecommendItemList = function (keyword){
-		if(gagajf.isNull(keyword)){
-			keyword = "";
-		}
-		var data = {keyword : keyword};
-		var html = '';
-
-		$.getJSON('/display/recommend/item/list', data, function (result){
-			$("#recommendItemArea").html('');
-			$("#recommendItemArea").show();
-			
-			if(result.length > 0){
-				$.each(result, function (idx, item){
-					html += '<div class="item_prod">\n';
-					html += '	<div class="item_state">\n';
-					html += '		<a href="'+item.product.itemUrl+'" class="itemLink">\n';
-					html += '			<div class="itemPic">\n';
-					html += '				<img alt="" class="vLHTC pd_img" src="'+item.product.itemImage+'">\n';
-					html += '			</div>\n';
-					html += '			<p class="itemBrand">'+item.product.brandName+'</p>\n';
-					html += '			<div class="itemName">'+item.product.itemName+'</div>\n';
-					html += '			<p class="itemPrice cols">\n';
-					if(item.product.salePrice < item.product.originalPrice) {
-						html += '			<span class="itemPrice_original">'+ item.product.originalPrice.addComma() +'</span>\n';
-					}
-					html += item.product.salePrice.addComma() ;
-					if(item.product.salePrice < item.product.originalPrice) {
-						html += '			<span class="itemPercent">' + Math.round((item.product.originalPrice - item.product.salePrice) / (item.product.originalPrice * 1.0) * 100) + '%</span>\n';
-					}
-					html += '			</p>\n';
-					html += '		</a>\n';
-					html += '	</div>\n';
-					html += '</div>\n';
-				});
-				
-				$("#recommendItemArea").append(html);
-				
-			}else{
-				$("#recommendItemArea").html('');
-				$("#recommendItemArea").hide();
-			}
-			
-		});
-	}
-
-	/*]]>*/
-</script>
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : BrandSearchLayerWeb.html
+ * @desc    : 검색 레이어 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.07.12   bin2107     최초 작성
+ *******************************************************************************
+ -->
+<h2 class="sr-only">통합검색</h2>
+<div class="cont_search">
+	<div class="area_input">
+		<form id="brandSearchMainForm" name="brandSearchMainForm">
+			<input type="hidden" name="brandGroupNo" th:value="${brandGroupNo}"/>
+			<fieldset>
+				<legend>통합검색</legend>
+				<input type="text" name="keyword" value="" placeholder="검색어를 입력하세요." class="search_input" title="검색어 입력" maxlength="100" required="required" data-valid-name="검색어" autocomplete="off" onkeyup="fnOnkeyupKeyword(this);"/>
+				<button type="button" class="sch_btn" id="btnSearchKeyword"><i class="ico ico_search"><em>검색</em></i></button>
+			</fieldset>
+		</form>
+	</div>
+	<div class="area_result">
+		<!-- 검색결과 입력 전 -->
+		<div class="default_box">
+			<div class="recent_blk">
+				<h3>최근 검색어</h3>
+				<!-- 최근검색어 있을 시 노출 -->
+				<div class="list_recent_keword" th:if="${not #lists.isEmpty(recentlyKeywordList)}">
+					<ul>
+						<li th:if="${recentlyKeywordList}" th:each="oneData, status : ${recentlyKeywordList}">
+							<a href="javascript:void(0);" th:text="${oneData}" th:onclick="fnSearchKeyword([[${oneData}]])">슬랙스</a>
+							<button type="button" class="btn_delete" th:onclick="fnDeleteCookie(this,[[${oneData}]]);" ><span>삭제</span></button>
+						</li>
+					</ul>
+				</div>
+				<button type="button" class="btn_underline" th:if="${not #lists.isEmpty(recentlyKeywordList)}"><span>전체삭제</span></button>
+				<!-- //최근검색어 있을 시 노출 -->
+				<!-- 최근검색어 없을 시 노출 -->
+				<div class="empty_txt" th:if="${#lists.isEmpty(recentlyKeywordList)}">
+					최근 검색어가 없습니다.
+				</div>
+				<!-- //최근검색어 없을 시 노출 -->
+			</div>
+			<div class="realtime_blk">
+				<h3>지금 고객님들이 많이 보고 있어요</h3>
+				<div class="modify_timer">
+					<button type="button" onclick="fnRealtimeGoodsList();"><span><em class="time" th:text="${#calendars.format(#calendars.createNow(), 'HH:mm')}">17:30</em> 기준</span></button>
+				</div>
+				<div class="realtime_wrap">
+				
+					<div class="swiper-container">
+	           			<div class="swiper-wrapper itemsGrp" id="itemViewArea">
+							<th:block th:each="item, status : ${realtimeGoodsList}">
+								<div class="swiper-slide">
+									<div class="item_prod">
+										<div class="item_state">
+											<a th:href="${item.itemUrl} + '&rccode=rts_pc_search&rtscode=pc_search'" class="itemLink">
+												<div class="itemPic">
+													<img alt="" class="vLHTC pd_img" th:src="${item.imageUrl}">
+												</div>
+												<div class="itemName" th:text="${item.itemName}"></div>
+												<div class="viewCount"><span th:text="${item.count < 10 ? '10명 미만' : item.count + '명 보는중'}"></span></div>
+											</a>
+										</div>
+									</div>
+								</div>
+							</th:block>
+						</div>
+						<div class="swiper-controls">
+			                <div class="swiper-scrollbar"></div>
+			            </div>
+						
+					</div>
+				</div>
+			</div>
+		</div>
+		<!-- //검색결과 입력 전 -->
+		<!-- 검색결과 입력 후 -->
+		<div class="searching_box" style="display:none;">
+			<div class="autokeyword_blk">
+
+			</div>
+
+			<div class="pd_list relate" id="relateGoodsDiv">
+				<h3>관련상품</h3>
+				<div class="realtime_wrap">
+					<div class="itemsGrp">
+
+					</div>
+				</div>
+			</div>
+		</div>
+		<!-- //검색결과 입력 후 -->
+
+		<!-- 검색결과 없을때 노출 -->
+		<div class="empty_box" style="display: none">
+			<div class="">
+				<div class="nodata">
+					<p>
+						<span class="keyword" id="noDataKeyword"></span>에 맞는 상품을 찾지 못했습니다.<br>
+						검색어를 변경해 보세요.
+					</p>
+				</div>
+				<div class="pd_list recommend">
+					<h3>이런 상품은 어떤가요?</h3>
+					<div class="itemsGrp" id="recommendItemArea">
+	
+					</div>
+				</div>
+			</div>
+			<!-- //검색결과 없을때 노출 -->
+		</div>
+	</div>
+</div>
+<button type="button" class="btn_close_search" onclick="fnClose();"><span>닫기</span></button>
+
+<script src="/ux/plugins/gaga/gaga.paging.js"></script>
+<script th:inline="javascript">
+	/*<![CDATA[*/
+	var enterBool = false;
+	var fnClose = function() {
+		$("body").removeClass("lock");
+		$("#brand_layer_search").removeClass('active');
+	}
+	
+	// 검색어 입력 후 엔터키
+	$('#brandSearchMainForm input[name=keyword]').keypress(function (event) {
+		if (event.which === 13) {
+			event.preventDefault();
+			$('#btnSearchKeyword').trigger('click');
+		}
+	});
+	
+	var ckKeyword = "st24ck_today_keyword";
+	var fnSetKeywordCookie = function(keyword) {
+		var arrKeyword = new Array;
+		var arrTempKeyword = new Array;
+		var j = 0;
+
+		arrKeyword = gagajf.getCookie(ckKeyword).split(",");
+
+		if (arrKeyword.length > 0) {
+			for (var i = 0; i < arrKeyword.length; i++) {
+				// 쿠키에 없으면
+				if (arrKeyword[i] != keyword && arrKeyword[i] != "") {
+					arrTempKeyword[j++] = arrKeyword[i];
+				}
+			}
+
+			arrTempKeyword[j++] = keyword;
+		} else {
+			gagajf.setCookie(ckKeyword, keyword, 1);
+		}
+
+		gagajf.setCookie(ckKeyword, arrTempKeyword, 1);
+	}
+	
+	// 키워드 검색
+	$('#btnSearchKeyword').on('click', function() {
+		if (!gagajf.validation($('#brandSearchMainForm'))) {
+			return false;
+		}
+		
+		if( !enterBool ){
+			enterBool = true;
+			// 검색결과 상품목록 호출(있으면 검색결과 페이지로 이동)
+			gagajf.ajaxFormSubmit("/display/search/goods/list_cnt", document.brandSearchMainForm, function(result) {
+				enterBool = false;
+				if( "0" == result.response_cnt){
+					$('.common_search .area_result .default_box').hide();
+					$('.common_search .area_result .searching_box').hide();
+					$('.common_search .area_result .empty_box').show();
+					$('.empty_box .nodata').find('#noDataKeyword').text("'"+$("#brandSearchMainForm").find('input[name=keyword]').val()+"'");
+					
+					// 검색결과 페이지에서 검색팝업 띄웠을때 (검색결과 페이지에 정의되어있으므로 내용 안뜨는 오류)
+					if( 1 == $("input[name=keyword]").length ){
+						$(".common_search .recommend").show();
+						// 검색어 연관 상품 추천
+						fnRecommendItemList($("#brandSearchMainForm").find('input[name=keyword]').val());
+					}else{
+						$(".common_search .recommend").hide();
+					}
+					
+				}else{
+					let keyword = encodeURIComponent($('#brandSearchMainForm input[name=keyword]').val());
+					
+					// 쿠키 세팅
+					fnSetKeywordCookie(keyword);
+					
+					let actionUrl = _PAGE_BRAND_SEARCH_GOODS + '?keyword=' + keyword + '&brandGroupNo=' + $('#brandSearchMainForm input[name=brandGroupNo]').val();
+					cfnGoToPage(actionUrl);
+				}
+			}, true);
+		}
+	});
+
+	var submain_slide;
+	$(document).ready( function() {
+		$("#brand_layer_search").addClass('active');
+
+		//통합검색 - 검색어 입력 시
+		//
+		
+		// 지금 고객님들이 많이 보고 있어요
+		//210730_ 추가 : 지금 고객님들이 많이 보고 있어요 슬라이드 swiper 옵션 추가.
+		submain_slide = new Swiper('.realtime_wrap .swiper-container', {
+			slidesPerView: 5,
+			watchOverflow:true,
+			freeMode:true,
+			observer: true,
+			observeParents: true,
+			speed:1000,
+			scrollbar: {
+				el: '.realtime_wrap .swiper-scrollbar',
+				hide: false,
+			},
+		});
+	});
+
+	// 검색어 찾기
+	var fnGetAutoSearch = function (){
+		gagajf.ajaxFormSubmit("/display/search/auto/complete", document.brandSearchMainForm, fnAutoCompleteList);
+	}
+
+	// 검색어 찾기 결과
+	var fnAutoCompleteList = function (result){
+		if( enterBool ) return;
+				
+		if(result.autoKeywords.length==0 && gagajf.isNull(result.goodsList)){
+			$('.common_search .area_result .default_box').hide();
+			$('.common_search .area_result .searching_box').hide();
+			
+		}else{
+			$('.common_search .area_result .default_box').hide();
+			$('.common_search .area_result .searching_box').show();
+			$('.common_search .area_result .empty_box').hide();
+			// 자동완성 키워드
+			if(result.autoKeywords != null && result.autoKeywords.length > 0){
+				$(".autokeyword_blk").html('');
+				let tag = '';
+				tag += '<ul>\n';
+				$.each(result.autoKeywords, function (idx, item){
+					//<a href="javascript:void(0);"><em>가</em>을컬리수</a>
+					tag += '<li><a href="javascript:void(0);">'+result.autoKeywords[idx]+'</a></li>\n';
+				});
+				tag += '</ul>\n';
+				$(".autokeyword_blk").append(tag);
+			}else{
+				$(".autokeyword_blk").html('');
+				let tag = '';
+				tag += '<ul>\n';
+				tag += '<li></li>\n';
+				tag += '</ul>\n';
+				$(".autokeyword_blk").append(tag);
+			}
+
+			//if(result.brand != null && !gagajf.isNull(result.brand.brandGroupNo)){
+			//	$(".find_brand").html('');
+			//	let tag = '';
+			//	tag += '<h3><a href="javascript:void(0);" onclick="cfnGoToBrandMain('+result.brand.brandGroupNo+');">'+result.brand.brandGroupNm+' 샵 바로가기</a></h3>\n';
+			//	$(".find_brand").append(tag);
+			//}else{
+			//	$(".find_brand").html('');
+			//}
+
+			//if(result.cateList != null && result.cateList.length > 0){
+			//	$(".find_category").html('');
+			//	let tag = '';
+			//	tag += '<ul>\n';
+			//	$.each(result.cateList, function (idx, item){
+			//		tag += '<li>\n';
+			//		tag += '	<span class="category_txt">카테고리</span>\n';
+			//		tag += '	<a href="javascript:void(0);" onclick="cfnGoToGoodsList(0,\'G032_101\' ';
+			//		if(item.cate1No != null){
+			//			tag += ', '+item.cate1No;
+			//		}
+			//		if(item.cate2No != null){
+			//			tag += ', '+item.cate2No;
+			//		}
+			//		if(item.cate3No != null){
+			//			tag += ', '+item.cate3No;
+			//		}
+			//		if(item.cate4No != null){
+			//			tag += ', '+item.cate4No;
+			//		}
+			//		if(item.cate5No != null){
+			//			tag += ', '+item.cate5No;
+			//		}
+			//		tag += ');">\n';
+			//		if(item.cate1Nm != null){
+			//			tag += '		<span>'+item.cate1Nm+'</span>\n';
+			//		}
+			//		if(item.cate2Nm != null){
+			//			tag += '		<span>'+item.cate2Nm+'</span>\n';
+			//		}
+			//		if(item.cate3Nm != null){
+			//			tag += '		<span>'+item.cate3Nm+'</span>\n';
+			//		}
+			//		if(item.cate4Nm != null){
+			//			tag += '		<span>'+item.cate4Nm+'</span>\n';
+			//		}
+			//		if(item.cate5Nm != null){
+			//			tag += '		<span>'+item.cate5Nm+'</span>\n';
+			//		}
+			//		tag += '	</a>\n';
+			//		tag += '</li>\n';
+			//	});
+			//	tag += '</ul>\n';
+			//	$(".find_category").append(tag);
+			//}else{
+			//	$(".find_category").html('');
+			//}
+			if(!gagajf.isNull(result.goodsList)){
+				$("#relateGoodsDiv").show();
+				$(".pd_list .realtime_wrap .itemsGrp").html('');
+				let tag = '';
+				$.each(result.goodsList, function (idx, item){
+					if(idx<5) {
+						tag += '<div class="item_prod">\n';
+						tag += '	<div class="item_state">\n';
+						tag += '		<a href="'+item.product.itemUrl+'&rccode=pc_search_s3" class="itemLink">\n';
+						tag += '			<div class="itemPic">\n';
+						tag += '				<img alt="" class="vLHTC pd_img" src="' + item.sysImgNm + '">\n';
+						tag += '			</div>\n';
+						tag += '			<p class="itemBrand">' + item.brandGroupNm + '</p>\n';
+						tag += '			<div class="itemName">' + item.goodsFullNm + '</div>\n';
+						tag += '			<p class="itemPrice cols">\n';
+						if (item.listPrice != item.currPrice) {
+							tag += '				<span class="itemPrice_original">' + item.listPrice.addComma() + '</span>\n';
+						}
+						tag += item.currPrice.addComma();
+						if (item.listPrice != item.currPrice) {
+							tag += '				<span class="itemPercent">' + Math.round((item.listPrice - item.currPrice) / (item.listPrice * 1.0) * 100) + '%</span>\n';
+						}
+						tag += '			</p>\n';
+						tag += '		</a>\n';
+						tag += '	</div>\n';
+						tag += '</div>\n';
+					}
+				});
+
+				$(".pd_list .realtime_wrap .itemsGrp").append(tag);
+			}else{
+				$(".pd_list .realtime_wrap .itemsGrp").html('');
+				$("#relateGoodsDiv").hide();
+			}
+		}
+	}
+
+	var fnOnkeyupKeyword = function (obj){
+		if( 13 != event.keyCode){
+			enterBool = false;
+			var searchValue = $(obj).val();
+			if(searchValue.length > 0) {
+				fnGetAutoSearch();
+			} else if (searchValue.length == 0) {
+				$('.common_search .area_result .searching_box').hide();
+				$('.common_search .area_result .default_box').show();
+				$('.common_search .area_result .empty_box').hide();
+			}
+		}else{
+			// 엔터친 후, 그 전에 검색한 결과가 오고있으므로 
+			enterBool = true;	
+		}
+	}
+
+	// 선택 단어 검색
+	var fnSearchKeyword = function (obj){
+		$("#brandSearchMainForm").find("input[name=keyword]").val(obj);
+		$('#btnSearchKeyword').trigger('click');
+	}
+
+	// 선택 단어 삭제
+	var fnDeleteCookie = function (obj, keyword){
+		$(obj).closest('li').remove();
+		gagajf.setCookie('st24ck_today_keyword',keyword, -1);
+	}
+
+	// 실시간 상품 새로고침
+	var fnRealtimeGoodsList = function (){
+		$("#itemViewArea").html('');
+		var html = '';
+		$.getJSON('/display/realtime/goods/list', function (result){
+			if(result.length > 0){
+				$.each(result, function (idx, item){
+					html += '<div class="swiper-slide">\n';
+					html += '	<div class="item_prod">\n';
+					html += '		<div class="item_state">\n';
+					html += '		    <a href="'+item.itemUrl+'&rccode=rts_pc_search&rtscode=pc_search" class="itemLink">\n';
+					html += '				<div class="itemPic">\n';
+					html += '					<img alt="" class="vLHTC pd_img" src="'+item.imageUrl+'">\n';
+					html += '				</div>\n';
+					html += '				<div class="itemName">'+item.itemName+'</div>\n';
+					if(item.count < 10){
+						html += '			<div class="viewCount"><span>10명</span> 미만</div>\n';
+					}else{
+						html += '			<div class="viewCount"><span>'+item.count.addComma()+'</span>명 보는중</div>\n';
+					}
+					html += '			</a>\n';
+					html += '		</div>\n';
+					html += '	</div>\n';
+					html += '</div>\n';
+									
+				})
+			}
+			$("#itemViewArea").append(html);
+			
+			// 슬라이드 사이즈 때문에 재설정함
+			submain_slide = new Swiper('.realtime_wrap .swiper-container', {
+				slidesPerView: 5,
+				watchOverflow:true,
+				freeMode:true,
+				observer: true,
+				observeParents: true,
+				speed:1000,
+				scrollbar: {
+					el: '.realtime_wrap .swiper-scrollbar',
+					hide: false,
+				},
+			});
+		});
+	}
+
+	// 검색어 연관 상품 추천
+	var fnRecommendItemList = function (keyword){
+		if(gagajf.isNull(keyword)){
+			keyword = "";
+		}
+		var data = {keyword : keyword};
+		var html = '';
+
+		$.getJSON('/display/recommend/item/list', data, function (result){
+			$("#recommendItemArea").html('');
+			$("#recommendItemArea").show();
+			
+			if(result.length > 0){
+				$.each(result, function (idx, item){
+					html += '<div class="item_prod">\n';
+					html += '	<div class="item_state">\n';
+					html += '		<a href="'+item.product.itemUrl+'&rccode=pc_search_s3" class="itemLink">\n';
+					html += '			<div class="itemPic">\n';
+					html += '				<img alt="" class="vLHTC pd_img" src="'+item.product.itemImage+'">\n';
+					html += '			</div>\n';
+					html += '			<p class="itemBrand">'+item.product.brandName+'</p>\n';
+					html += '			<div class="itemName">'+item.product.itemName+'</div>\n';
+					html += '			<p class="itemPrice cols">\n';
+					if(item.product.salePrice < item.product.originalPrice) {
+						html += '			<span class="itemPrice_original">'+ item.product.originalPrice.addComma() +'</span>\n';
+					}
+					html += item.product.salePrice.addComma() ;
+					if(item.product.salePrice < item.product.originalPrice) {
+						html += '			<span class="itemPercent">' + Math.round((item.product.originalPrice - item.product.salePrice) / (item.product.originalPrice * 1.0) * 100) + '%</span>\n';
+					}
+					html += '			</p>\n';
+					html += '		</a>\n';
+					html += '	</div>\n';
+					html += '</div>\n';
+				});
+				
+				$("#recommendItemArea").append(html);
+				
+			}else{
+				$("#recommendItemArea").html('');
+				$("#recommendItemArea").hide();
+			}
+			
+		});
+	}
+
+	/*]]>*/
+</script>
 </html>

+ 511 - 511
src/main/webapp/WEB-INF/views/web/display/SearchLayerWeb.html

@@ -1,512 +1,512 @@
-<!DOCTYPE html>
-<html lang="ko"
-	xmlns:th="http://www.thymeleaf.org">
-<!--
- *******************************************************************************
- * @source  : SearchLayerWeb.html
- * @desc    : 검색 레이어 Page
- *============================================================================
- * STYLE24
- * Copyright(C) 2020 TSIT, All rights reserved.
- *============================================================================
- * VER  DATE         AUTHOR      DESCRIPTION
- * ===  ===========  ==========  =============================================
- * 1.0  2021.05.11   bin2107     최초 작성
- *******************************************************************************
- -->
-<h2 class="sr-only">통합검색</h2>
-<div class="cont_search">
-	<div class="area_input">
-		<form id="searchMainForm" name="searchMainForm">
-			<input type="hidden" name="brandGroupNo" th:value="${brandGroupNo}"/>
-			
-			<fieldset>
-				<legend>통합검색</legend>
-				<input type="text" name="keyword" value="" placeholder="검색어를 입력하세요." class="search_input" title="검색어 입력" maxlength="100" required="required" data-valid-name="검색어" autocomplete="off" onkeyup="fnOnkeyupKeyword(this);"/>
-				<button type="button" class="sch_btn" id="btnSearchKeyword"><i class="ico ico_search"><em>검색</em></i></button>
-			</fieldset>
-		</form>
-	</div>
-	<div class="area_result">
-		<!-- 검색결과 입력 전 -->
-		<div class="default_box">
-			<div class="recent_blk">
-				<h3>최근 검색어</h3>
-				<!-- 최근검색어 있을 시 노출 -->
-				<div class="list_recent_keword" th:if="${not #lists.isEmpty(recentlyKeywordList)}">
-					<ul>
-						<li th:if="${recentlyKeywordList}" th:each="oneData, status : ${recentlyKeywordList}">
-							<a href="javascript:void(0);" th:text="${oneData}" th:onclick="fnSearchKeyword([[${oneData}]])">슬랙스</a>
-							<button type="button" class="btn_delete" th:onclick="fnDeleteCookie(this,[[${oneData}]]);" ><span>삭제</span></button>
-						</li>
-					</ul>
-				</div>
-				<button type="button" class="btn_underline" th:if="${not #lists.isEmpty(recentlyKeywordList)}"><span>전체삭제</span></button>
-				<!-- //최근검색어 있을 시 노출 -->
-				<!-- 최근검색어 없을 시 노출 -->
-				<div class="empty_txt" th:if="${#lists.isEmpty(recentlyKeywordList)}">
-					최근 검색어가 없습니다.
-				</div>
-				<!-- //최근검색어 없을 시 노출 -->
-			</div>
-			<div class="popular_blk" th:if="${brandGroupNo==null}">
-				<h3>STYLE24에서 검색되고 있어요</h3>
-				<div class="list_popular_keword">
-					<ul id="popularKeyArea">
-					</ul>
-				</div>
-			</div>
-			<div class="realtime_blk">
-				<h3>지금 고객님들이 많이 보고 있어요</h3>
-				<div class="modify_timer">
-					<button type="button" onclick="fnRealtimeGoodsList();"><span><em class="time" th:text="${#calendars.format(#calendars.createNow(), 'HH:mm')}">17:30</em> 기준</span></button>
-				</div>
-				<div class="realtime_wrap">
-				
-					<div class="swiper-container">
-	           			<div class="swiper-wrapper itemsGrp" id="itemViewArea">
-							<th:block th:each="item, status : ${realtimeGoodsList}">
-								<div class="swiper-slide">
-									<div class="item_prod">
-										<div class="item_state">
-											<a th:href="${item.itemUrl} + '&rccode=rts_pc_search&rtscode=pc_search'" class="itemLink">
-												<div class="itemPic">
-													<img alt="" class="vLHTC pd_img" th:src="${item.imageUrl}">
-												</div>
-												<div class="itemName" th:text="${item.itemName}"></div>
-												<div class="viewCount"><span th:text="${item.count < 10 ? '10명 미만' : item.count + '명 보는중'}"></span></div>
-											</a>
-										</div>
-									</div>
-								</div>
-							</th:block>
-						</div>
-						<div class="swiper-controls">
-			                <div class="swiper-scrollbar"></div>
-			            </div>
-						
-					</div>
-				</div>
-			</div>
-		</div>
-		<!-- //검색결과 입력 전 -->
-		<!-- 검색결과 입력 후 -->
-		<div class="searching_box" style="display:none;">
-			<div class="autokeyword_blk" th:if="${brandGroupNo==null}">
-			</div>
-			<div class="exfind_blk" th:if="${brandGroupNo==null}">
-				<!-- 검색어 매칭 브랜드 있을 시 노출  -->
-				<div class="find_brand">
-				</div>
-				<!-- //검색어 매칭 브랜드 있을 시 노출  -->
-				<!-- 검색어 매칭 카테고리 있을 시 노출  -->
-				<div class="find_category">
-				</div>
-				<!-- //검색어 매칭 카테고리 있을 시 노출  -->
-			</div>
-
-			<div class="pd_list relate" id="relateGoodsDiv">
-				<h3>관련상품</h3>
-				<div class="realtime_wrap">
-					<div class="itemsGrp">
-					</div>
-				</div>
-			</div>
-		</div>
-		<!-- //검색결과 입력 후 -->
-
-		<!-- 검색결과 없을때 노출 -->
-		<div class="empty_box" style="display: none">
-			<div class="">
-				<div class="nodata">
-					<p>
-						<span class="keyword" id="noDataKeyword"></span>에 맞는 상품을 찾지 못했습니다.<br>
-						검색어를 변경해 보세요.
-					</p>
-				</div>
-				<div class="pd_list recommend">
-					<h3>이런 상품은 어떤가요?</h3>
-					<div class="itemsGrp" id="recommendItemArea">
-					</div>
-				</div>
-			</div>
-		<!-- //검색결과 없을때 노출 -->
-		</div>
-	</div>
-</div>
-<button type="button" class="btn_close_search" onclick="fnClose();"><span>닫기</span></button>
-
-<script src="/ux/plugins/gaga/gaga.paging.js"></script>
-<script th:inline="javascript">
-	/*<![CDATA[*/
-	var enterBool = false;
-	var trendKeywordList = [[${trendKeywordList.trendList}]];
-
-	var fnClose = function() {
-		$("body").removeClass("lock");
-		$("#layer_search").removeClass('active');
-	}
-	
-	// 검색어 입력 후 엔터키
-	$('#searchMainForm input[name=keyword]').keypress(function (event) {
-		if (event.which === 13) {
-			event.preventDefault();
-			$('#btnSearchKeyword').trigger('click');
-		}
-	});
-	
-	var ckKeyword = "st24ck_today_keyword";
-	var fnSetKeywordCookie = function(keyword) {
-		var arrKeyword = new Array;
-		var arrTempKeyword = new Array;
-		var j = 0;
-
-		arrKeyword = gagajf.getCookie(ckKeyword).split(",");
-
-		if (arrKeyword.length > 0) {
-			for (var i = 0; i < arrKeyword.length; i++) {
-				// 쿠키에 없으면
-				if (arrKeyword[i] != keyword && arrKeyword[i] != "") {
-					arrTempKeyword[j++] = arrKeyword[i];
-				}
-			}
-
-			arrTempKeyword[j++] = keyword;
-		} else {
-			gagajf.setCookie(ckKeyword, keyword, 1);
-		}
-
-		gagajf.setCookie(ckKeyword, arrTempKeyword, 1);
-	}
-	
-	// 키워드 검색
-	$('#btnSearchKeyword').on('click', function() {
-		if (!gagajf.validation($('#searchMainForm'))) {
-			return false;
-		}
-		
-		if( !enterBool ){
-			enterBool = true;
-			// 검색결과 상품목록 호출(있으면 검색결과 페이지로 이동)
-			gagajf.ajaxFormSubmit("/display/search/goods/list_cnt", document.searchMainForm, function(result) {
-				enterBool = false;
-				if( "0" == result.response_cnt){
-					$('.common_search .area_result .default_box').hide();
-					$('.common_search .area_result .searching_box').hide();
-					$('.common_search .area_result .empty_box').show();
-					$('.empty_box .nodata').find('#noDataKeyword').text("'"+$("#searchMainForm").find('input[name=keyword]').val()+"'");
-					
-					// 검색결과 페이지에서 검색팝업 띄웠을때 (검색결과 페이지에 정의되어있으므로 내용 안뜨는 오류)
-					console.log("= "+$("input[name=keyword]").length);
-					if( 1 == $("input[name=keyword]").length ){
-						$(".common_search .recommend").show();
-						// 검색어 연관 상품 추천
-						fnRecommendItemList($("#searchMainForm").find('input[name=keyword]').val());
-					}else{
-						$(".common_search .recommend").hide();
-					}
-					
-				}else{
-					let keyword = encodeURIComponent($('#searchMainForm input[name=keyword]').val());
-					
-					// 쿠키 세팅
-					fnSetKeywordCookie(keyword);
-					
-					let actionUrl = _PAGE_SEARCH_GOODS + '?keyword=' + keyword + '&brandGroupNo=' + $('#searchMainForm input[name=brandGroupNo]').val();
-					cfnGoToPage(actionUrl);
-				}
-			}, true);
-		}
-	});
-
-	var submain_slide;
-	$(document).ready( function() {
-		$("#layer_search").addClass('active');
-
-		if (trendKeywordList.length > 0) {
-			$("#popularKeyArea").html('');
-			trendKeywordList.forEach(function (item, idx) {
-				if(item.keyword.indexOf("테스트") < 0){
-					var tag = '';
-					if (idx < 10) {
-						tag += '<li>';
-						tag += '	<a href="javascript:void(0);" onclick="fnSearchKeyword(\''+item.keyword+'\');">'+ item.keyword +'</a>';
-						tag += '</li>';
-					}
-					$("#popularKeyArea").append(tag);
-				}
-			});
-		}else{
-			$("#popularKeyArea").html('');
-		}
-
-		//통합검색 - 검색어 입력 시
-		//
-		
-		// 지금 고객님들이 많이 보고 있어요
-		//210730_ 추가 : 지금 고객님들이 많이 보고 있어요 슬라이드 swiper 옵션 추가.
-		submain_slide = new Swiper('.realtime_wrap .swiper-container', {
-			slidesPerView: 5,
-			watchOverflow:true,
-			freeMode:true,
-			observer: true,
-			observeParents: true,
-			speed:1000,
-			scrollbar: {
-				el: '.realtime_wrap .swiper-scrollbar',
-				hide: false,
-			},
-		});
-	});
-
-	// 검색어 찾기
-	var fnGetAutoSearch = function (){
-		gagajf.ajaxFormSubmit("/display/search/auto/complete", document.searchMainForm, fnAutoCompleteList);
-	}
-
-	// 검색어 찾기 결과
-	var fnAutoCompleteList = function (result){
-		if( enterBool ) return;
-		
-		if(result.autoKeywords.length==0 && gagajf.isNull(result.brand.brandGroupNo) && result.cateList.length == 0 && gagajf.isNull(result.goodsList)){
-			$('.common_search .area_result .default_box').hide();
-			$('.common_search .area_result .searching_box').hide();
-				
-		}else{
-			$('.common_search .area_result .default_box').hide();
-			$('.common_search .area_result .searching_box').show();
-			$('.common_search .area_result .empty_box').hide();
-			// 자동완성 키워드
-			if(result.autoKeywords != null && result.autoKeywords.length > 0){
-				$(".autokeyword_blk").html('');
-				let tag = '';
-				tag += '<ul>\n';
-				$.each(result.autoKeywords, function (idx, item){
-					//<a href="javascript:void(0);"><em>가</em>을컬리수</a>
-					tag += '<li><a href="javascript:void(0);" onclick="fnSearchKeyword(\''+result.autoKeywords[idx]+'\');">'+result.autoKeywords[idx]+'</a></li>\n';
-				});
-				tag += '</ul>\n';
-				$(".autokeyword_blk").append(tag);
-			}else{
-				$(".autokeyword_blk").html('');
-				let tag = '';
-				tag += '<ul>\n';
-				tag += '<li></li>\n';
-				tag += '</ul>\n';
-				$(".autokeyword_blk").append(tag);
-			}
-
-			if(result.brand != null && !gagajf.isNull(result.brand.brandGroupNo)){
-				$(".find_brand").html('');
-				let tag = '';
-				tag += '<h3><a href="javascript:void(0);" onclick="cfnGoToBrandMain('+result.brand.brandGroupNo+');">'+result.brand.brandGroupNm+' 샵 바로가기</a></h3>\n';
-				$(".find_brand").append(tag);
-			}else{
-				$(".find_brand").html('');
-			}
-
-			if(result.cateList != null && result.cateList.length > 0){
-				$(".find_category").html('');
-				let tag = '';
-				tag += '<ul>\n';
-				$.each(result.cateList, function (idx, item){
-					tag += '<li>\n';
-					tag += '	<span class="category_txt">카테고리</span>\n';
-					tag += '	<a href="javascript:void(0);" onclick="cfnGoToGoodsList(0,\'G032_101\' ';
-					if(item.cate1No != null){
-						tag += ', '+item.cate1No;
-					}
-					if(item.cate2No != null){
-						tag += ', '+item.cate2No;
-					}
-					if(item.cate3No != null){
-						tag += ', '+item.cate3No;
-					}
-					if(item.cate4No != null){
-						tag += ', '+item.cate4No;
-					}
-					if(item.cate5No != null){
-						tag += ', '+item.cate5No;
-					}
-					tag += ');">\n';
-					if(item.cate1Nm != null){
-						tag += '		<span>'+item.cate1Nm+'</span>\n';
-					}
-					if(item.cate2Nm != null){
-						tag += '		<span>'+item.cate2Nm+'</span>\n';
-					}
-					if(item.cate3Nm != null){
-						tag += '		<span>'+item.cate3Nm+'</span>\n';
-					}
-					if(item.cate4Nm != null){
-						tag += '		<span>'+item.cate4Nm+'</span>\n';
-					}
-					if(item.cate5Nm != null){
-						tag += '		<span>'+item.cate5Nm+'</span>\n';
-					}
-					tag += '	</a>\n';
-					tag += '</li>\n';
-				});
-				tag += '</ul>\n';
-				$(".find_category").append(tag);
-			}else{
-				$(".find_category").html('');
-			}
-			if(!gagajf.isNull(result.goodsList)){
-				$("#relateGoodsDiv").show();
-				$(".pd_list .realtime_wrap .itemsGrp").html('');
-				let tag = '';
-				$.each(result.goodsList, function (idx, item){
-					if(idx<5) {
-						tag += '<div class="item_prod">\n';
-						tag += '	<div class="item_state">\n';
-						tag += '		<a href="javascript:void(0);" class="itemLink" onclick="cfnGoToGoodsDetail(\'' + item.goodsCd + '\',\'' + item.colorCd + '\', \'\',\'\',\'\',\'pc_search_s3\');">\n';
-						tag += '			<div class="itemPic">\n';
-						tag += '				<img alt="" class="vLHTC pd_img" src="' + item.sysImgNm + '">\n';
-						tag += '			</div>\n';
-						tag += '			<p class="itemBrand">' + item.brandGroupNm + '</p>\n';
-						tag += '			<div class="itemName">' + item.goodsFullNm + '</div>\n';
-						tag += '			<p class="itemPrice cols">\n';
-						if (item.listPrice != item.currPrice) {
-							tag += '				<span class="itemPrice_original">' + item.listPrice.addComma() + '</span>\n';
-						}
-						tag += item.currPrice.addComma();
-						if (item.listPrice != item.currPrice) {
-							tag += '				<span class="itemPercent">' + Math.round((item.listPrice - item.currPrice) / (item.listPrice * 1.0) * 100) + '%</span>\n';
-						}
-						tag += '			</p>\n';
-						tag += '		</a>\n';
-						tag += '	</div>\n';
-						tag += '</div>\n';
-					}
-				});
-
-				$(".pd_list .realtime_wrap .itemsGrp").append(tag);
-			}else{
-				$(".pd_list .realtime_wrap .itemsGrp").html('');
-				$("#relateGoodsDiv").hide();
-			}
-		}
-	}
-
-	var fnOnkeyupKeyword = function (obj){
-		if( 13 != event.keyCode){
-			enterBool = false;
-			var searchValue = $(obj).val();
-			if(searchValue.length > 0) {
-				fnGetAutoSearch();
-			} else if (searchValue.length == 0) {
-				$('.common_search .area_result .searching_box').hide();
-				$('.common_search .area_result .default_box').show();
-				$('.common_search .area_result .empty_box').hide();
-			}
-		}else{
-			// 엔터친 후, 그 전에 검색한 결과가 오고있으므로 
-			enterBool = true;	
-		}
-	}
-
-	// 선택 단어 검색
-	var fnSearchKeyword = function (obj){
-		$("#searchMainForm").find("input[name=keyword]").val(obj);
-		$('#btnSearchKeyword').trigger('click');
-	}
-
-	// 선택 단어 삭제
-	var fnDeleteCookie = function (obj, keyword){
-		$(obj).closest('li').remove();
-		gagajf.setCookie('st24ck_today_keyword',keyword, -1);
-	}
-
-	// 실시간 상품 새로고침
-	var fnRealtimeGoodsList = function (){
-		$("#itemViewArea").html('');
-		var html = '';
-		$.getJSON('/display/realtime/goods/list', function (result){
-			if(result.length > 0){
-				$.each(result, function (idx, item){
-					html += '<div class="swiper-slide">\n';
-					html += '	<div class="item_prod">\n';
-					html += '		<div class="item_state">\n';
-					html += '			<a href="'+item.itemUrl+'" class="itemLink">\n';
-					html += '				<div class="itemPic">\n';
-					html += '					<img alt="" class="vLHTC pd_img" src="'+item.imageUrl+'">\n';
-					html += '				</div>\n';
-					html += '				<div class="itemName">'+item.itemName+'</div>\n';
-					if(item.count < 10){
-						html += '			<div class="viewCount"><span>10명</span> 미만</div>\n';
-					}else{
-						html += '			<div class="viewCount"><span>'+item.count.addComma()+'</span>명 보는중</div>\n';
-					}
-					html += '			</a>\n';
-					html += '		</div>\n';
-					html += '	</div>\n';
-					html += '</div>\n';
-									
-				});
-			}
-			$("#itemViewArea").append(html);
-			
-			// 슬라이드 사이즈 때문에 재설정함
-			submain_slide = new Swiper('.realtime_wrap .swiper-container', {
-				slidesPerView: 5,
-				watchOverflow:true,
-				freeMode:true,
-				observer: true,
-				observeParents: true,
-				speed:1000,
-				scrollbar: {
-					el: '.realtime_wrap .swiper-scrollbar',
-					hide: false,
-				},
-			});
-		});
-	}
-
-	// 검색어 연관 상품 추천
-	var fnRecommendItemList = function (keyword){
-		if(gagajf.isNull(keyword)){
-			keyword = "";
-		}
-		var data = {keyword : keyword.trim()};
-		var html = '';
-
-		$.getJSON('/display/recommend/item/list', data, function (result){
-			$("#recommendItemArea").html('');
-			$("#recommendItemArea").show();
-			
-			if(result.length > 0){
-				$.each(result, function (idx, item){
-					html += '<div class="item_prod">\n';
-					html += '	<div class="item_state">\n';
-					html += '		<a href="'+item.product.itemUrl+'" class="itemLink">\n';
-					html += '			<div class="itemPic">\n';
-					html += '				<img alt="" class="vLHTC pd_img" src="'+item.product.itemImage+'">\n';
-					html += '			</div>\n';
-					html += '			<p class="itemBrand">'+item.product.brandName+'</p>\n';
-					html += '			<div class="itemName">'+item.product.itemName+'</div>\n';
-					html += '			<p class="itemPrice cols">\n';
-					if(item.product.salePrice < item.product.originalPrice) {
-						html += '			<span class="itemPrice_original">'+ item.product.originalPrice.addComma() +'</span>\n';
-					}
-					html += item.product.salePrice.addComma() ;
-					if(item.product.salePrice < item.product.originalPrice) {
-						html += '			<span class="itemPercent">' + Math.round((item.product.originalPrice - item.product.salePrice) / (item.product.originalPrice * 1.0) * 100) + '%</span>\n';
-					}
-					html += '			</p>\n';
-					html += '		</a>\n';
-					html += '	</div>\n';
-					html += '</div>\n';
-				});
-				
-				$("#recommendItemArea").append(html);
-				
-			}else{
-				$("#recommendItemArea").html('');
-				$("#recommendItemArea").hide();
-			}
-		});
-	}
-	/*]]>*/
-</script>
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : SearchLayerWeb.html
+ * @desc    : 검색 레이어 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.05.11   bin2107     최초 작성
+ *******************************************************************************
+ -->
+<h2 class="sr-only">통합검색</h2>
+<div class="cont_search">
+	<div class="area_input">
+		<form id="searchMainForm" name="searchMainForm">
+			<input type="hidden" name="brandGroupNo" th:value="${brandGroupNo}"/>
+			
+			<fieldset>
+				<legend>통합검색</legend>
+				<input type="text" name="keyword" value="" placeholder="검색어를 입력하세요." class="search_input" title="검색어 입력" maxlength="100" required="required" data-valid-name="검색어" autocomplete="off" onkeyup="fnOnkeyupKeyword(this);"/>
+				<button type="button" class="sch_btn" id="btnSearchKeyword"><i class="ico ico_search"><em>검색</em></i></button>
+			</fieldset>
+		</form>
+	</div>
+	<div class="area_result">
+		<!-- 검색결과 입력 전 -->
+		<div class="default_box">
+			<div class="recent_blk">
+				<h3>최근 검색어</h3>
+				<!-- 최근검색어 있을 시 노출 -->
+				<div class="list_recent_keword" th:if="${not #lists.isEmpty(recentlyKeywordList)}">
+					<ul>
+						<li th:if="${recentlyKeywordList}" th:each="oneData, status : ${recentlyKeywordList}">
+							<a href="javascript:void(0);" th:text="${oneData}" th:onclick="fnSearchKeyword([[${oneData}]])">슬랙스</a>
+							<button type="button" class="btn_delete" th:onclick="fnDeleteCookie(this,[[${oneData}]]);" ><span>삭제</span></button>
+						</li>
+					</ul>
+				</div>
+				<button type="button" class="btn_underline" th:if="${not #lists.isEmpty(recentlyKeywordList)}"><span>전체삭제</span></button>
+				<!-- //최근검색어 있을 시 노출 -->
+				<!-- 최근검색어 없을 시 노출 -->
+				<div class="empty_txt" th:if="${#lists.isEmpty(recentlyKeywordList)}">
+					최근 검색어가 없습니다.
+				</div>
+				<!-- //최근검색어 없을 시 노출 -->
+			</div>
+			<div class="popular_blk" th:if="${brandGroupNo==null}">
+				<h3>STYLE24에서 검색되고 있어요</h3>
+				<div class="list_popular_keword">
+					<ul id="popularKeyArea">
+					</ul>
+				</div>
+			</div>
+			<div class="realtime_blk">
+				<h3>지금 고객님들이 많이 보고 있어요</h3>
+				<div class="modify_timer">
+					<button type="button" onclick="fnRealtimeGoodsList();"><span><em class="time" th:text="${#calendars.format(#calendars.createNow(), 'HH:mm')}">17:30</em> 기준</span></button>
+				</div>
+				<div class="realtime_wrap">
+				
+					<div class="swiper-container">
+	           			<div class="swiper-wrapper itemsGrp" id="itemViewArea">
+							<th:block th:each="item, status : ${realtimeGoodsList}">
+								<div class="swiper-slide">
+									<div class="item_prod">
+										<div class="item_state">
+											<a th:href="${item.itemUrl} + '&rccode=rts_pc_search&rtscode=pc_search'" class="itemLink">
+												<div class="itemPic">
+													<img alt="" class="vLHTC pd_img" th:src="${item.imageUrl}">
+												</div>
+												<div class="itemName" th:text="${item.itemName}"></div>
+												<div class="viewCount"><span th:text="${item.count < 10 ? '10명 미만' : item.count + '명 보는중'}"></span></div>
+											</a>
+										</div>
+									</div>
+								</div>
+							</th:block>
+						</div>
+						<div class="swiper-controls">
+			                <div class="swiper-scrollbar"></div>
+			            </div>
+						
+					</div>
+				</div>
+			</div>
+		</div>
+		<!-- //검색결과 입력 전 -->
+		<!-- 검색결과 입력 후 -->
+		<div class="searching_box" style="display:none;">
+			<div class="autokeyword_blk" th:if="${brandGroupNo==null}">
+			</div>
+			<div class="exfind_blk" th:if="${brandGroupNo==null}">
+				<!-- 검색어 매칭 브랜드 있을 시 노출  -->
+				<div class="find_brand">
+				</div>
+				<!-- //검색어 매칭 브랜드 있을 시 노출  -->
+				<!-- 검색어 매칭 카테고리 있을 시 노출  -->
+				<div class="find_category">
+				</div>
+				<!-- //검색어 매칭 카테고리 있을 시 노출  -->
+			</div>
+
+			<div class="pd_list relate" id="relateGoodsDiv">
+				<h3>관련상품</h3>
+				<div class="realtime_wrap">
+					<div class="itemsGrp">
+					</div>
+				</div>
+			</div>
+		</div>
+		<!-- //검색결과 입력 후 -->
+
+		<!-- 검색결과 없을때 노출 -->
+		<div class="empty_box" style="display: none">
+			<div class="">
+				<div class="nodata">
+					<p>
+						<span class="keyword" id="noDataKeyword"></span>에 맞는 상품을 찾지 못했습니다.<br>
+						검색어를 변경해 보세요.
+					</p>
+				</div>
+				<div class="pd_list recommend">
+					<h3>이런 상품은 어떤가요?</h3>
+					<div class="itemsGrp" id="recommendItemArea">
+					</div>
+				</div>
+			</div>
+		<!-- //검색결과 없을때 노출 -->
+		</div>
+	</div>
+</div>
+<button type="button" class="btn_close_search" onclick="fnClose();"><span>닫기</span></button>
+
+<script src="/ux/plugins/gaga/gaga.paging.js"></script>
+<script th:inline="javascript">
+	/*<![CDATA[*/
+	var enterBool = false;
+	var trendKeywordList = [[${trendKeywordList.trendList}]];
+
+	var fnClose = function() {
+		$("body").removeClass("lock");
+		$("#layer_search").removeClass('active');
+	}
+	
+	// 검색어 입력 후 엔터키
+	$('#searchMainForm input[name=keyword]').keypress(function (event) {
+		if (event.which === 13) {
+			event.preventDefault();
+			$('#btnSearchKeyword').trigger('click');
+		}
+	});
+	
+	var ckKeyword = "st24ck_today_keyword";
+	var fnSetKeywordCookie = function(keyword) {
+		var arrKeyword = new Array;
+		var arrTempKeyword = new Array;
+		var j = 0;
+
+		arrKeyword = gagajf.getCookie(ckKeyword).split(",");
+
+		if (arrKeyword.length > 0) {
+			for (var i = 0; i < arrKeyword.length; i++) {
+				// 쿠키에 없으면
+				if (arrKeyword[i] != keyword && arrKeyword[i] != "") {
+					arrTempKeyword[j++] = arrKeyword[i];
+				}
+			}
+
+			arrTempKeyword[j++] = keyword;
+		} else {
+			gagajf.setCookie(ckKeyword, keyword, 1);
+		}
+
+		gagajf.setCookie(ckKeyword, arrTempKeyword, 1);
+	}
+	
+	// 키워드 검색
+	$('#btnSearchKeyword').on('click', function() {
+		if (!gagajf.validation($('#searchMainForm'))) {
+			return false;
+		}
+		
+		if( !enterBool ){
+			enterBool = true;
+			// 검색결과 상품목록 호출(있으면 검색결과 페이지로 이동)
+			gagajf.ajaxFormSubmit("/display/search/goods/list_cnt", document.searchMainForm, function(result) {
+				enterBool = false;
+				if( "0" == result.response_cnt){
+					$('.common_search .area_result .default_box').hide();
+					$('.common_search .area_result .searching_box').hide();
+					$('.common_search .area_result .empty_box').show();
+					$('.empty_box .nodata').find('#noDataKeyword').text("'"+$("#searchMainForm").find('input[name=keyword]').val()+"'");
+					
+					// 검색결과 페이지에서 검색팝업 띄웠을때 (검색결과 페이지에 정의되어있으므로 내용 안뜨는 오류)
+					console.log("= "+$("input[name=keyword]").length);
+					if( 1 == $("input[name=keyword]").length ){
+						$(".common_search .recommend").show();
+						// 검색어 연관 상품 추천
+						fnRecommendItemList($("#searchMainForm").find('input[name=keyword]').val());
+					}else{
+						$(".common_search .recommend").hide();
+					}
+					
+				}else{
+					let keyword = encodeURIComponent($('#searchMainForm input[name=keyword]').val());
+					
+					// 쿠키 세팅
+					fnSetKeywordCookie(keyword);
+					
+					let actionUrl = _PAGE_SEARCH_GOODS + '?keyword=' + keyword + '&brandGroupNo=' + $('#searchMainForm input[name=brandGroupNo]').val();
+					cfnGoToPage(actionUrl);
+				}
+			}, true);
+		}
+	});
+
+	var submain_slide;
+	$(document).ready( function() {
+		$("#layer_search").addClass('active');
+
+		if (trendKeywordList.length > 0) {
+			$("#popularKeyArea").html('');
+			trendKeywordList.forEach(function (item, idx) {
+				if(item.keyword.indexOf("테스트") < 0){
+					var tag = '';
+					if (idx < 10) {
+						tag += '<li>';
+						tag += '	<a href="javascript:void(0);" onclick="fnSearchKeyword(\''+item.keyword+'\');">'+ item.keyword +'</a>';
+						tag += '</li>';
+					}
+					$("#popularKeyArea").append(tag);
+				}
+			});
+		}else{
+			$("#popularKeyArea").html('');
+		}
+
+		//통합검색 - 검색어 입력 시
+		//
+		
+		// 지금 고객님들이 많이 보고 있어요
+		//210730_ 추가 : 지금 고객님들이 많이 보고 있어요 슬라이드 swiper 옵션 추가.
+		submain_slide = new Swiper('.realtime_wrap .swiper-container', {
+			slidesPerView: 5,
+			watchOverflow:true,
+			freeMode:true,
+			observer: true,
+			observeParents: true,
+			speed:1000,
+			scrollbar: {
+				el: '.realtime_wrap .swiper-scrollbar',
+				hide: false,
+			},
+		});
+	});
+
+	// 검색어 찾기
+	var fnGetAutoSearch = function (){
+		gagajf.ajaxFormSubmit("/display/search/auto/complete", document.searchMainForm, fnAutoCompleteList);
+	}
+
+	// 검색어 찾기 결과
+	var fnAutoCompleteList = function (result){
+		if( enterBool ) return;
+		
+		if(result.autoKeywords.length==0 && gagajf.isNull(result.brand.brandGroupNo) && result.cateList.length == 0 && gagajf.isNull(result.goodsList)){
+			$('.common_search .area_result .default_box').hide();
+			$('.common_search .area_result .searching_box').hide();
+				
+		}else{
+			$('.common_search .area_result .default_box').hide();
+			$('.common_search .area_result .searching_box').show();
+			$('.common_search .area_result .empty_box').hide();
+			// 자동완성 키워드
+			if(result.autoKeywords != null && result.autoKeywords.length > 0){
+				$(".autokeyword_blk").html('');
+				let tag = '';
+				tag += '<ul>\n';
+				$.each(result.autoKeywords, function (idx, item){
+					//<a href="javascript:void(0);"><em>가</em>을컬리수</a>
+					tag += '<li><a href="javascript:void(0);" onclick="fnSearchKeyword(\''+result.autoKeywords[idx]+'\');">'+result.autoKeywords[idx]+'</a></li>\n';
+				});
+				tag += '</ul>\n';
+				$(".autokeyword_blk").append(tag);
+			}else{
+				$(".autokeyword_blk").html('');
+				let tag = '';
+				tag += '<ul>\n';
+				tag += '<li></li>\n';
+				tag += '</ul>\n';
+				$(".autokeyword_blk").append(tag);
+			}
+
+			if(result.brand != null && !gagajf.isNull(result.brand.brandGroupNo)){
+				$(".find_brand").html('');
+				let tag = '';
+				tag += '<h3><a href="javascript:void(0);" onclick="cfnGoToBrandMain('+result.brand.brandGroupNo+');">'+result.brand.brandGroupNm+' 샵 바로가기</a></h3>\n';
+				$(".find_brand").append(tag);
+			}else{
+				$(".find_brand").html('');
+			}
+
+			if(result.cateList != null && result.cateList.length > 0){
+				$(".find_category").html('');
+				let tag = '';
+				tag += '<ul>\n';
+				$.each(result.cateList, function (idx, item){
+					tag += '<li>\n';
+					tag += '	<span class="category_txt">카테고리</span>\n';
+					tag += '	<a href="javascript:void(0);" onclick="cfnGoToGoodsList(0,\'G032_101\' ';
+					if(item.cate1No != null){
+						tag += ', '+item.cate1No;
+					}
+					if(item.cate2No != null){
+						tag += ', '+item.cate2No;
+					}
+					if(item.cate3No != null){
+						tag += ', '+item.cate3No;
+					}
+					if(item.cate4No != null){
+						tag += ', '+item.cate4No;
+					}
+					if(item.cate5No != null){
+						tag += ', '+item.cate5No;
+					}
+					tag += ');">\n';
+					if(item.cate1Nm != null){
+						tag += '		<span>'+item.cate1Nm+'</span>\n';
+					}
+					if(item.cate2Nm != null){
+						tag += '		<span>'+item.cate2Nm+'</span>\n';
+					}
+					if(item.cate3Nm != null){
+						tag += '		<span>'+item.cate3Nm+'</span>\n';
+					}
+					if(item.cate4Nm != null){
+						tag += '		<span>'+item.cate4Nm+'</span>\n';
+					}
+					if(item.cate5Nm != null){
+						tag += '		<span>'+item.cate5Nm+'</span>\n';
+					}
+					tag += '	</a>\n';
+					tag += '</li>\n';
+				});
+				tag += '</ul>\n';
+				$(".find_category").append(tag);
+			}else{
+				$(".find_category").html('');
+			}
+			if(!gagajf.isNull(result.goodsList)){
+				$("#relateGoodsDiv").show();
+				$(".pd_list .realtime_wrap .itemsGrp").html('');
+				let tag = '';
+				$.each(result.goodsList, function (idx, item){
+					if(idx<5) {
+						tag += '<div class="item_prod">\n';
+						tag += '	<div class="item_state">\n';
+						tag += '		<a href="javascript:void(0);" class="itemLink" onclick="cfnGoToGoodsDetail(\'' + item.goodsCd + '\',\'' + item.colorCd + '\', \'\',\'\',\'\',\'pc_search_s3\');">\n';
+						tag += '			<div class="itemPic">\n';
+						tag += '				<img alt="" class="vLHTC pd_img" src="' + item.sysImgNm + '">\n';
+						tag += '			</div>\n';
+						tag += '			<p class="itemBrand">' + item.brandGroupNm + '</p>\n';
+						tag += '			<div class="itemName">' + item.goodsFullNm + '</div>\n';
+						tag += '			<p class="itemPrice cols">\n';
+						if (item.listPrice != item.currPrice) {
+							tag += '				<span class="itemPrice_original">' + item.listPrice.addComma() + '</span>\n';
+						}
+						tag += item.currPrice.addComma();
+						if (item.listPrice != item.currPrice) {
+							tag += '				<span class="itemPercent">' + Math.round((item.listPrice - item.currPrice) / (item.listPrice * 1.0) * 100) + '%</span>\n';
+						}
+						tag += '			</p>\n';
+						tag += '		</a>\n';
+						tag += '	</div>\n';
+						tag += '</div>\n';
+					}
+				});
+
+				$(".pd_list .realtime_wrap .itemsGrp").append(tag);
+			}else{
+				$(".pd_list .realtime_wrap .itemsGrp").html('');
+				$("#relateGoodsDiv").hide();
+			}
+		}
+	}
+
+	var fnOnkeyupKeyword = function (obj){
+		if( 13 != event.keyCode){
+			enterBool = false;
+			var searchValue = $(obj).val();
+			if(searchValue.length > 0) {
+				fnGetAutoSearch();
+			} else if (searchValue.length == 0) {
+				$('.common_search .area_result .searching_box').hide();
+				$('.common_search .area_result .default_box').show();
+				$('.common_search .area_result .empty_box').hide();
+			}
+		}else{
+			// 엔터친 후, 그 전에 검색한 결과가 오고있으므로 
+			enterBool = true;	
+		}
+	}
+
+	// 선택 단어 검색
+	var fnSearchKeyword = function (obj){
+		$("#searchMainForm").find("input[name=keyword]").val(obj);
+		$('#btnSearchKeyword').trigger('click');
+	}
+
+	// 선택 단어 삭제
+	var fnDeleteCookie = function (obj, keyword){
+		$(obj).closest('li').remove();
+		gagajf.setCookie('st24ck_today_keyword',keyword, -1);
+	}
+
+	// 실시간 상품 새로고침
+	var fnRealtimeGoodsList = function (){
+		$("#itemViewArea").html('');
+		var html = '';
+		$.getJSON('/display/realtime/goods/list', function (result){
+			if(result.length > 0){
+				$.each(result, function (idx, item){
+					html += '<div class="swiper-slide">\n';
+					html += '	<div class="item_prod">\n';
+					html += '		<div class="item_state">\n';
+					html += '			<a href="'+item.itemUrl+'&rccode=rts_pc_search&rtscode=pc_search" class="itemLink">\n';
+					html += '				<div class="itemPic">\n';
+					html += '					<img alt="" class="vLHTC pd_img" src="'+item.imageUrl+'">\n';
+					html += '				</div>\n';
+					html += '				<div class="itemName">'+item.itemName+'</div>\n';
+					if(item.count < 10){
+						html += '			<div class="viewCount"><span>10명</span> 미만</div>\n';
+					}else{
+						html += '			<div class="viewCount"><span>'+item.count.addComma()+'</span>명 보는중</div>\n';
+					}
+					html += '			</a>\n';
+					html += '		</div>\n';
+					html += '	</div>\n';
+					html += '</div>\n';
+									
+				});
+			}
+			$("#itemViewArea").append(html);
+			
+			// 슬라이드 사이즈 때문에 재설정함
+			submain_slide = new Swiper('.realtime_wrap .swiper-container', {
+				slidesPerView: 5,
+				watchOverflow:true,
+				freeMode:true,
+				observer: true,
+				observeParents: true,
+				speed:1000,
+				scrollbar: {
+					el: '.realtime_wrap .swiper-scrollbar',
+					hide: false,
+				},
+			});
+		});
+	}
+
+	// 검색어 연관 상품 추천
+	var fnRecommendItemList = function (keyword){
+		if(gagajf.isNull(keyword)){
+			keyword = "";
+		}
+		var data = {keyword : keyword.trim()};
+		var html = '';
+
+		$.getJSON('/display/recommend/item/list', data, function (result){
+			$("#recommendItemArea").html('');
+			$("#recommendItemArea").show();
+			
+			if(result.length > 0){
+				$.each(result, function (idx, item){
+					html += '<div class="item_prod">\n';
+					html += '	<div class="item_state">\n';
+					html += '		<a href="'+item.product.itemUrl+'&rccode=pc_search_s3" class="itemLink">\n';
+					html += '			<div class="itemPic">\n';
+					html += '				<img alt="" class="vLHTC pd_img" src="'+item.product.itemImage+'">\n';
+					html += '			</div>\n';
+					html += '			<p class="itemBrand">'+item.product.brandName+'</p>\n';
+					html += '			<div class="itemName">'+item.product.itemName+'</div>\n';
+					html += '			<p class="itemPrice cols">\n';
+					if(item.product.salePrice < item.product.originalPrice) {
+						html += '			<span class="itemPrice_original">'+ item.product.originalPrice.addComma() +'</span>\n';
+					}
+					html += item.product.salePrice.addComma() ;
+					if(item.product.salePrice < item.product.originalPrice) {
+						html += '			<span class="itemPercent">' + Math.round((item.product.originalPrice - item.product.salePrice) / (item.product.originalPrice * 1.0) * 100) + '%</span>\n';
+					}
+					html += '			</p>\n';
+					html += '		</a>\n';
+					html += '	</div>\n';
+					html += '</div>\n';
+				});
+				
+				$("#recommendItemArea").append(html);
+				
+			}else{
+				$("#recommendItemArea").html('');
+				$("#recommendItemArea").hide();
+			}
+		});
+	}
+	/*]]>*/
+</script>
 </html>