|
|
@@ -25,6 +25,7 @@ import com.style24.core.biz.service.TscEnvsetService;
|
|
|
import com.style24.core.biz.service.TscLookbookService;
|
|
|
import com.style24.core.support.env.TscConstants;
|
|
|
import com.style24.core.support.message.TscMessageByLocale;
|
|
|
+import com.style24.front.biz.service.TsfCommonService;
|
|
|
import com.style24.front.biz.service.TsfDisplayService;
|
|
|
import com.style24.front.biz.service.TsfGoodsService;
|
|
|
import com.style24.front.biz.service.TsfPlanningService;
|
|
|
@@ -47,6 +48,7 @@ import com.style24.persistence.domain.Plan;
|
|
|
import com.style24.persistence.domain.Popup;
|
|
|
import com.style24.persistence.domain.Social;
|
|
|
import com.style24.persistence.domain.searchengine.Filter;
|
|
|
+import com.style24.persistence.domain.searchengine.GoodsListResponse;
|
|
|
import com.style24.persistence.domain.searchengine.SearchEngine;
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -89,6 +91,9 @@ public class TsfDisplayController extends TsfBaseController {
|
|
|
@Autowired
|
|
|
private SearchEngineDiquest diquest;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TsfCommonService commonService;
|
|
|
+
|
|
|
/**
|
|
|
* PC보기. 모바일에서 <PC> 형태로 볼 때
|
|
|
* @return
|
|
|
@@ -948,18 +953,29 @@ public class TsfDisplayController extends TsfBaseController {
|
|
|
SearchEngine params = new SearchEngine();
|
|
|
params.setKeyword(keyword);
|
|
|
params.setBrandGroupNo(brandGroupNo == null ? 0 : brandGroupNo);
|
|
|
+ params.setFrontGb(TsfSession.getFrontGb());
|
|
|
|
|
|
ModelAndView mav = new ModelAndView(super.getDeviceViewName("display/SearchGoodsListForm"));
|
|
|
|
|
|
// mav.addObject("cateInfo", params);
|
|
|
|
|
|
- // 상품검색키워드 카테고리 목록
|
|
|
- mav.addObject("cateList", diquest.getCategoryList(params));
|
|
|
-// mav.addObject("cateList", displayService.getKeywordCategoryList(params.getKeyword()));
|
|
|
+ Collection<Filter> filterList = new ArrayList<Filter>();
|
|
|
|
|
|
- // 상품리스트 카테고리별 필터 목록
|
|
|
- Collection<Filter> filterList = diquest.getFilterList(params);
|
|
|
-// Collection<Filter> filterList = displayService.getSearchGoodsListCategoryFilterList(params);
|
|
|
+ // 검색엔진 연동 여부
|
|
|
+ String syncYn = commonService.getSearchEngineSyncYn();
|
|
|
+ if (syncYn.equals("Y")) { // 검색엔진을 통한 상품리스트 조회
|
|
|
+ // 상품검색키워드 카테고리 목록
|
|
|
+ mav.addObject("cateList", diquest.getCategoryList(params));
|
|
|
+
|
|
|
+ // 상품리스트 카테고리별 필터 목록
|
|
|
+ filterList = diquest.getFilterList(params);
|
|
|
+ } else { // DB를 통한 상품리스트 조회
|
|
|
+ // 상품검색키워드 카테고리 목록
|
|
|
+ mav.addObject("cateList", displayService.getKeywordCategoryList(params.getKeyword()));
|
|
|
+
|
|
|
+ // 상품리스트 카테고리별 필터 목록
|
|
|
+ filterList = displayService.getSearchGoodsListCategoryFilterList(params);
|
|
|
+ }
|
|
|
|
|
|
// 필터 설정
|
|
|
mav.addObject("filterBrandList", displayService.getCategoryFilterList(filterList, "BRAND"));
|
|
|
@@ -994,10 +1010,22 @@ public class TsfDisplayController extends TsfBaseController {
|
|
|
params.setFrontGb(TsfSession.getFrontGb());
|
|
|
params.setCustGb(TsfSession.getCustGb());
|
|
|
|
|
|
- pageable.setTotalCount(goodsService.getSearchGoodsCount(params));
|
|
|
- params.setPageable(pageable);
|
|
|
+ Collection<SearchEngine> dataList = new ArrayList<SearchEngine>();
|
|
|
+
|
|
|
+ // 검색엔진 연동 여부
|
|
|
+ String syncYn = commonService.getSearchEngineSyncYn();
|
|
|
+ if (syncYn.equals("Y")) { // 검색엔진을 통한 상품리스트 조회
|
|
|
+ GoodsListResponse response = diquest.getGoodsList(params);
|
|
|
+ pageable.setTotalCount(response.getTotalCount());
|
|
|
+ dataList = response.getResponse();
|
|
|
+ } else { // DB를 통한 상품리스트 조회
|
|
|
+ pageable.setTotalCount(goodsService.getSearchGoodsCount(params));
|
|
|
+ params.setPageable(pageable);
|
|
|
+ dataList = goodsService.getSearchGoodsList(params);
|
|
|
+ }
|
|
|
+
|
|
|
result.set("paging", pageable);
|
|
|
- result.set("dataList", goodsService.getSearchGoodsList(params));
|
|
|
+ result.set("dataList", dataList);
|
|
|
|
|
|
return result;
|
|
|
}
|