|
|
@@ -20,6 +20,7 @@ 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;
|
|
|
@@ -209,64 +210,203 @@ public class TsfDisplayService {
|
|
|
* @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());
|
|
|
+// // 카테고리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);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
- // 카테고리5 목록 담기
|
|
|
- cate4.setCate5List(displayDao.getCategory5List(cate));
|
|
|
+ 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);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- log.info("cate4List: {}", cate4List);
|
|
|
-
|
|
|
- // 카테고리4 목록 담기
|
|
|
- cate3.setCate4List(cate4List);
|
|
|
+ prevCate4No = cate4srch4.getCate4No();
|
|
|
}
|
|
|
+
|
|
|
+ cate3.setLeafYn(cate4List.size() > 0 ? "N" : "Y");
|
|
|
+ cate3.setCate4List(cate4List);
|
|
|
+ cate3List.add(cate3);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 카테고리3 목록 담기
|
|
|
- cate2.setCate3List(cate3List);
|
|
|
+ prevCate3No = cate4srch3.getCate3No();
|
|
|
}
|
|
|
+
|
|
|
+ cate2.setLeafYn(cate3List.size() > 0 ? "N" : "Y");
|
|
|
+ cate2.setCate3List(cate3List);
|
|
|
+ cate2List.add(cate2);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 카테고리2 목록 담기
|
|
|
- cate1.setCate2List(cate2List);
|
|
|
+ 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;
|
|
|
}
|
|
|
|
|
|
@@ -372,10 +512,10 @@ public class TsfDisplayService {
|
|
|
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 {
|
|
|
+ } else {
|
|
|
//우선순위 full 팝
|
|
|
popup.setPopupGb("F");
|
|
|
popupList = displayDao.getPopupList(popup);
|
|
|
@@ -389,9 +529,9 @@ public class TsfDisplayService {
|
|
|
result.set("popupGb", "H");
|
|
|
result.set("dataList", popupList);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// Collection<Popup>
|
|
|
-
|
|
|
+
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
@@ -487,7 +627,7 @@ public class TsfDisplayService {
|
|
|
cate4Srch.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
|
cate4Srch.setCateGb("G032_101");
|
|
|
|
|
|
- log.info("getBestItemCategoryGoodsList cate4Srch:::::::::{}",cate4Srch);
|
|
|
+ log.info("getBestItemCategoryGoodsList cate4Srch:::::::::{}", cate4Srch);
|
|
|
|
|
|
Collection<Goods> goodsList = goodsDao.getContentsCategoryGoodsList(cate4Srch);
|
|
|
|
|
|
@@ -539,11 +679,11 @@ public class TsfDisplayService {
|
|
|
Collection<Filter> resultList = new ArrayList<Filter>();
|
|
|
for (Filter filter : filterList) {
|
|
|
if (filter.getFilterGb().equals(filterGb)) {
|
|
|
- if("BENEFIT".equals(filterGb)){
|
|
|
- if(!filter.getFilterCd().equals("40")){
|
|
|
+ if ("BENEFIT".equals(filterGb)) {
|
|
|
+ if (!filter.getFilterCd().equals("40")) {
|
|
|
resultList.add(filter);
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
resultList.add(filter);
|
|
|
}
|
|
|
}
|
|
|
@@ -609,7 +749,7 @@ public class TsfDisplayService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 상품검색키워드 카테고리 목록
|
|
|
+ * 키워드를 이용한 전체 카테고리 목록
|
|
|
* @param keyword - 상품검색키워드
|
|
|
* @return
|
|
|
* @author gagamel
|
|
|
@@ -622,66 +762,7 @@ public class TsfDisplayService {
|
|
|
cate.setCateType(TsfConstants.CateType.GOODS.value()); // 상품분류카테고리
|
|
|
cate.setSoldoutGoodsDispYn(envsetService.getSoldoutGoodsDisplayYn(TscConstants.Site.STYLE24.value()));
|
|
|
cate.setKeyword(keyword);
|
|
|
-
|
|
|
- // 카테고리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;
|
|
|
+ return this.getAllCategoryList(cate);
|
|
|
}
|
|
|
|
|
|
public int getContentsCategoryGoodsCount(Contents contents) {
|