| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805 |
- 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.cache.annotation.Cacheable;
- import org.springframework.stereotype.Service;
- import com.style24.core.biz.service.TscEnvsetService;
- import com.style24.core.support.env.TscConstants;
- import com.style24.front.biz.dao.TsfDisplayDao;
- import com.style24.front.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.searchengine.Filter;
- 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 TsfDisplayService {
- @Autowired
- private TsfDisplayDao displayDao;
- @Autowired
- private TscEnvsetService envsetService;
- @Autowired
- private TsfGoodsDao goodsDao;
- /**
- * 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());
- 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());
- 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());
- 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());
- 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.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> getContentsForGoods(Contents contents) {
- Collection<Contents> 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())) {
- 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());
- 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> getBestItemForGoods(Contents contents) {
- contents.setContentsLoc("SCM003");
- 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());
- data.setGoodsList(goodsDao.getContentsCategoryGoodsList(tempCate));
- }
- 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);
- }
- 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);
- Collection<Goods> goodsList = goodsDao.getContentsCategoryGoodsList(cate4Srch);
- if (goodsList.size() < 100) {
- // TODO 추천솔루션
- }
- 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>();
- for (Filter filter : filterList) {
- if(!"".equals(filter.getFilterCd()) && !filter.getFilterCd().equals(null)){
- if (filter.getFilterGb().equals(filterGb)) {
- if ("BENEFIT".equals(filterGb)) {
- if (!filter.getFilterCd().equals("40")) {
- resultList.add(filter);
- }
- } else {
- resultList.add(filter);
- }
- }
- }
- }
- 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);
- }
- }
|