|
@@ -22,6 +22,8 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
|
|
|
|
+import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
|
+import com.fasterxml.jackson.databind.type.TypeFactory;
|
|
|
import com.gagaframework.web.parameter.GagaMap;
|
|
import com.gagaframework.web.parameter.GagaMap;
|
|
|
import com.gagaframework.web.util.GagaCookieUtil;
|
|
import com.gagaframework.web.util.GagaCookieUtil;
|
|
|
import com.style24.core.biz.service.TscEnvsetService;
|
|
import com.style24.core.biz.service.TscEnvsetService;
|
|
@@ -41,7 +43,11 @@ import com.style24.front.support.security.session.TsfSession;
|
|
|
import com.style24.persistence.TscPageRequest;
|
|
import com.style24.persistence.TscPageRequest;
|
|
|
import com.style24.persistence.domain.BrandGroup;
|
|
import com.style24.persistence.domain.BrandGroup;
|
|
|
import com.style24.persistence.domain.Cate1;
|
|
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.Cate4Srch;
|
|
|
|
|
+import com.style24.persistence.domain.Cate5;
|
|
|
import com.style24.persistence.domain.Contents;
|
|
import com.style24.persistence.domain.Contents;
|
|
|
import com.style24.persistence.domain.GnbTab;
|
|
import com.style24.persistence.domain.GnbTab;
|
|
|
import com.style24.persistence.domain.Goods;
|
|
import com.style24.persistence.domain.Goods;
|
|
@@ -836,7 +842,9 @@ public class TsfDisplayController extends TsfBaseController {
|
|
|
cate1.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
cate1.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
|
cate1.setCateGb("G032_101");
|
|
cate1.setCateGb("G032_101");
|
|
|
cate1.setCate1No(params.getCate1No());
|
|
cate1.setCate1No(params.getCate1No());
|
|
|
- mav.addObject("cateList", diquest.getCategoryList(cate1));
|
|
|
|
|
|
|
+ Collection<Cate1> diquestCateList = getSortCategoryList(cate1);
|
|
|
|
|
+ mav.addObject("cateList", diquestCateList);
|
|
|
|
|
+
|
|
|
if (params.getBrandGroupNo() != null && params.getBrandGroupNo() > 0) {
|
|
if (params.getBrandGroupNo() != null && params.getBrandGroupNo() > 0) {
|
|
|
cate1.setCate1No(null);
|
|
cate1.setCate1No(null);
|
|
|
mav.addObject("brandCateList", diquest.getCategoryList(cate1));
|
|
mav.addObject("brandCateList", diquest.getCategoryList(cate1));
|
|
@@ -1566,7 +1574,9 @@ public class TsfDisplayController extends TsfBaseController {
|
|
|
cate1.setCateGb("G032_101");
|
|
cate1.setCateGb("G032_101");
|
|
|
// cate1.setCate1No(params.getCate1No());
|
|
// cate1.setCate1No(params.getCate1No());
|
|
|
|
|
|
|
|
- return diquest.getCategoryList(cate1);
|
|
|
|
|
|
|
+ Collection<Cate1> diquestCateList = getSortCategoryList(cate1);
|
|
|
|
|
+ //return diquest.getCategoryList(cate1);
|
|
|
|
|
+ return diquestCateList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -1620,4 +1630,104 @@ public class TsfDisplayController extends TsfBaseController {
|
|
|
|
|
|
|
|
return mav;
|
|
return mav;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 검색어 연관 상품 추천 목록
|
|
|
|
|
+ * @return
|
|
|
|
|
+ * @author jmh
|
|
|
|
|
+ * @since 2021. 12. 16
|
|
|
|
|
+ */
|
|
|
|
|
+ public Collection<Cate1> getSortCategoryList(SearchEngine cate1) {
|
|
|
|
|
+
|
|
|
|
|
+ Collection<Cate1> diquestCateList = diquest.getCategoryList(cate1);
|
|
|
|
|
+ Collection<Cate1> dbCateList = displayService.getAllCategoryList(TsfConstants.CateGb.BYITEM.value());// envsetInfo.getAllCateList();
|
|
|
|
|
+
|
|
|
|
|
+ // 21.12.16 메뉴 노출 순서 정렬요청 (검색엔진에 order by로 정렬해서 내려달라고 했으나, 추가 개발건이라고 유지보수로 해줄 수 없다고 함.)
|
|
|
|
|
+ ObjectMapper mapper = new ObjectMapper();
|
|
|
|
|
+ Collection<Cate1> dbList = mapper.convertValue(dbCateList, TypeFactory.defaultInstance().constructCollectionType(Collection.class, Cate1.class));
|
|
|
|
|
+ Collection<Cate1> sortCate1List = new ArrayList<Cate1>();
|
|
|
|
|
+ Collection<Cate2> sortCate2List = new ArrayList<Cate2>();
|
|
|
|
|
+ Collection<Cate3> sortCate3List = new ArrayList<Cate3>();
|
|
|
|
|
+ Collection<Cate4> sortCate4List = new ArrayList<Cate4>();
|
|
|
|
|
+ Collection<Cate5> sortCate5List = new ArrayList<Cate5>();
|
|
|
|
|
+
|
|
|
|
|
+ for(Cate1 dbCate1 : dbList) {
|
|
|
|
|
+ for( Cate1 diqCate1 : diquestCateList ) {
|
|
|
|
|
+ if(dbCate1.getCate1No().equals(diqCate1.getCate1No())) {
|
|
|
|
|
+
|
|
|
|
|
+ // Cate2 정렬 시작
|
|
|
|
|
+ sortCate2List = new ArrayList<Cate2>();
|
|
|
|
|
+ if( null != dbCate1.getCate2List() && null != diqCate1.getCate2List()) {
|
|
|
|
|
+ for( Cate2 dbCate2 : dbCate1.getCate2List()) {
|
|
|
|
|
+ for( Cate2 diqCate2 : diqCate1.getCate2List()) {
|
|
|
|
|
+ if( dbCate2.getCate2No().equals(diqCate2.getCate2No())) {
|
|
|
|
|
+
|
|
|
|
|
+ // Cate3 정렬 시작
|
|
|
|
|
+ sortCate3List = new ArrayList<Cate3>();
|
|
|
|
|
+ if( null != dbCate2.getCate3List() && null != diqCate2.getCate3List()) {
|
|
|
|
|
+ for( Cate3 dbCate3 : dbCate2.getCate3List()) {
|
|
|
|
|
+ for( Cate3 diqCate3 : diqCate2.getCate3List()) {
|
|
|
|
|
+ if( dbCate3.getCate3No().equals(diqCate3.getCate3No())) {
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // Cate4 정렬 시작
|
|
|
|
|
+ sortCate4List = new ArrayList<Cate4>();
|
|
|
|
|
+ if( null != dbCate3.getCate4List() && null != diqCate3.getCate4List()) {
|
|
|
|
|
+ for( Cate4 dbCate4 : dbCate3.getCate4List()) {
|
|
|
|
|
+ for( Cate4 diqCate4 : diqCate3.getCate4List()) {
|
|
|
|
|
+ if( dbCate4.getCate4No().equals(diqCate4.getCate4No())) {
|
|
|
|
|
+
|
|
|
|
|
+ // Cate5 정렬 시작
|
|
|
|
|
+ sortCate5List = new ArrayList<Cate5>();
|
|
|
|
|
+ if( null != dbCate4.getCate5List() && null != diqCate4.getCate5List()) {
|
|
|
|
|
+ for( Cate5 dbCate5 : dbCate4.getCate5List()) {
|
|
|
|
|
+ for( Cate5 diqCate5 : diqCate4.getCate5List()) {
|
|
|
|
|
+ if( dbCate5.getCate4No().equals(diqCate5.getCate4No())) {
|
|
|
|
|
+ sortCate5List.add(diqCate5);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // Cate3 정렬
|
|
|
|
|
+ diqCate4.setCate5List(sortCate5List);
|
|
|
|
|
+
|
|
|
|
|
+ sortCate4List.add(diqCate4);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // Cate3 정렬
|
|
|
|
|
+ diqCate3.setCate4List(sortCate4List);
|
|
|
|
|
+
|
|
|
|
|
+ sortCate3List.add(diqCate3);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // Cate3 정렬
|
|
|
|
|
+ diqCate2.setCate3List(sortCate3List);
|
|
|
|
|
+
|
|
|
|
|
+ sortCate2List.add(diqCate2);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // Cate2 정렬
|
|
|
|
|
+ diqCate1.setCate2List(sortCate2List);
|
|
|
|
|
+
|
|
|
|
|
+ // Cate1 정렬
|
|
|
|
|
+ sortCate1List.add(diqCate1);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return sortCate1List;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|