|
|
@@ -3,6 +3,7 @@ package com.style24.front.biz.service;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Collection;
|
|
|
|
|
|
+import com.style24.front.biz.thirdparty.EigeneaiApi;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -35,6 +36,7 @@ import com.style24.persistence.domain.ReinboundInform;
|
|
|
import com.style24.persistence.domain.SizeInfo;
|
|
|
import com.style24.persistence.domain.Tmtb;
|
|
|
import com.style24.persistence.domain.searchengine.SearchEngine;
|
|
|
+import com.style24.persistence.domain.eigene.Eigeneai;
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
@@ -62,6 +64,9 @@ public class TsfGoodsService {
|
|
|
@Autowired
|
|
|
private ObjectMapper mapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private EigeneaiApi eigeneaiApi;
|
|
|
+
|
|
|
/**
|
|
|
* 상품뷰이력 생성
|
|
|
*
|
|
|
@@ -1049,11 +1054,40 @@ public class TsfGoodsService {
|
|
|
goodsList.addAll(goodsDao.getContentsCategoryNewGoodsList(cate));
|
|
|
}
|
|
|
}
|
|
|
- } else if (cate.getContentsLoc().equals("SCM003") || cate.getContentsLoc().equals("SBM008")) { // 베스트상품인 경우
|
|
|
+ } else if (cate.getContentsLoc().equals("SCM003") || cate.getContentsLoc().equals("SBM008") || cate.getContentsLoc().equals("SBM009")) { // 베스트상품인 경우
|
|
|
// TODO: 추천솔루션
|
|
|
+ int dispCnt = cate.getMaxRow();
|
|
|
|
|
|
- // 추천솔루션 데이터가 없으면 베스트로 등록된 상품 조회
|
|
|
goodsList = goodsDao.getContentsCategoryGoodsList(cate);
|
|
|
+ // 수동설정 데이터 없거나 노출갯수보다 작으면 추천솔루션 데이터 표출
|
|
|
+ if(dispCnt > goodsList.size()){
|
|
|
+ int cnt = 0;
|
|
|
+ cnt = dispCnt - goodsList.size();
|
|
|
+
|
|
|
+ // TODO : 추천솔루션
|
|
|
+ Collection<Eigeneai.Result> itemList = new ArrayList<>();
|
|
|
+ if(cate.getContentsLoc().equals("SCM003")){
|
|
|
+ itemList = eigeneaiApi.getCategoryWeeklySellBestGoodsList(cnt, cate.getCate1No());
|
|
|
+ }else if(cate.getContentsLoc().equals("SBM008")){
|
|
|
+ itemList = eigeneaiApi.getBrandWeeklySellBestGoodsList(cnt, cate.getBrandGroupNo());
|
|
|
+ }else{
|
|
|
+ // SBM009 브랜드메인 MD PICK
|
|
|
+ itemList = eigeneaiApi.getBrandMonthlyClickBestGoodsList(cnt, cate.getBrandGroupNo());
|
|
|
+ }
|
|
|
+
|
|
|
+ for(Eigeneai.Result tempData: itemList){
|
|
|
+ Goods tempBest = new Goods();
|
|
|
+ tempBest.setBrandGroupNm(tempData.getProduct().getBrandName());
|
|
|
+ tempBest.setGoodsCd(tempData.getProduct().getItemId());
|
|
|
+ tempBest.setGoodsFullNm(tempData.getProduct().getItemName());
|
|
|
+ tempBest.setListPrice((int) tempData.getProduct().getOriginalPrice());
|
|
|
+ tempBest.setCurrPrice((int) tempData.getProduct().getSalePrice());
|
|
|
+ tempBest.setSysImgNm(tempData.getProduct().getItemImage());
|
|
|
+ tempBest.setItemUrl(tempData.getProduct().getItemUrl());
|
|
|
+ goodsList.add(tempBest);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
for (Goods temp : goodsList) {
|
|
|
if (temp.getSizes() != null) {
|
|
|
temp.setSizeArr(temp.getSizes().split(","));
|