| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246 |
- package com.style24.front.biz.service;
- import java.util.Collection;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.cache.annotation.Cacheable;
- import org.springframework.stereotype.Service;
- import com.style24.core.biz.service.TscEnvsetService;
- import com.style24.core.support.env.TscConstants;
- import com.style24.front.biz.dao.TsfDisplayDao;
- import com.style24.front.support.env.TsfConstants;
- 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.Contents;
- import com.style24.persistence.domain.GnbTab;
- 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;
- /**
- * 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 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);
- }
- }
- }
- }
- return cate1List;
- }
- }
|