|
|
@@ -3,6 +3,18 @@ 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.core.env.Environment;
|
|
|
+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;
|
|
|
@@ -18,23 +30,13 @@ import com.style24.persistence.domain.Login;
|
|
|
import com.style24.persistence.domain.MainLayout;
|
|
|
import com.style24.persistence.domain.Popup;
|
|
|
import com.style24.persistence.domain.SearchKeyword;
|
|
|
-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.searchengine.Filter;
|
|
|
import com.style24.persistence.domain.searchengine.SearchEngine;
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
import com.gagaframework.web.parameter.GagaMap;
|
|
|
+import com.gagaframework.web.util.GagaFileUtil;
|
|
|
|
|
|
/**
|
|
|
* 전시 Service
|
|
|
@@ -55,6 +57,9 @@ public class TsfDisplayService {
|
|
|
@Autowired
|
|
|
private TsfGoodsDao goodsDao;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private Environment env;
|
|
|
+
|
|
|
/**
|
|
|
* GNB 브랜드그룹 목록
|
|
|
* @param contents - 컨텐츠 정보
|
|
|
@@ -557,15 +562,15 @@ public class TsfDisplayService {
|
|
|
data.setBannerList(displayDao.getContentsBannerList(data));
|
|
|
}
|
|
|
goodsList = (goodsDao.getContentsCategoryGoodsList(tempContents));
|
|
|
- if("SMM007".equals(data.getContentsLoc())){
|
|
|
+ if ("SMM007".equals(data.getContentsLoc())) {
|
|
|
int maxrow = 3;
|
|
|
- if(goodsList == null || goodsList.size() < 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());
|
|
|
+ cate.setMaxRow(maxrow - goodsList.size());
|
|
|
goodsList.addAll(goodsDao.getContentsCategoryNewGoodsList(cate));
|
|
|
}
|
|
|
}
|
|
|
@@ -696,15 +701,15 @@ public class TsfDisplayService {
|
|
|
String maxPrice = "0";
|
|
|
String minPrice = "0";
|
|
|
for (Filter filter : filterList) {
|
|
|
- if(!"".equals(filter.getFilterCd()) && !filter.getFilterCd().equals(null)){
|
|
|
- if(filter.getFilterGb().equals("PRICE")){
|
|
|
- if(idx==0){
|
|
|
+ if (!"".equals(filter.getFilterCd()) && !filter.getFilterCd().equals(null)) {
|
|
|
+ if (filter.getFilterGb().equals("PRICE")) {
|
|
|
+ if (idx == 0) {
|
|
|
minPrice = filter.getFilterCd();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
maxPrice = filter.getFilterCd();
|
|
|
}
|
|
|
idx++;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
if (filter.getFilterGb().equals(filterGb)) {
|
|
|
if ("BENEFIT".equals(filterGb)) {
|
|
|
if (!filter.getFilterCd().equals("40")) {
|
|
|
@@ -718,26 +723,26 @@ public class TsfDisplayService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(filterGb.equals("PRICE")){
|
|
|
+ if (filterGb.equals("PRICE")) {
|
|
|
int sliceVal = (Integer.parseInt(maxPrice) - Integer.parseInt(minPrice)) / 5;
|
|
|
- int tempPrice = 0 ;
|
|
|
+ int tempPrice = 0;
|
|
|
Filter temp = new Filter();
|
|
|
Collection<Filter> priceList = new ArrayList<Filter>();
|
|
|
- for(int i=0; i<6; i++){
|
|
|
+ for (int i = 0; i < 6; i++) {
|
|
|
tempPrice = 0;
|
|
|
temp = new Filter();
|
|
|
temp.setFilterGb("PRICE");
|
|
|
- if(i==0){
|
|
|
+ if (i == 0) {
|
|
|
// tempPrice = (int)Math.floor((Integer.parseInt(minPrice)) / 1000) * 1000 ;
|
|
|
tempPrice = (int)Math.floor((Integer.parseInt(minPrice)));
|
|
|
temp.setFilterCd(String.valueOf(tempPrice));
|
|
|
temp.setFilterNm(String.valueOf(tempPrice));
|
|
|
- }else if(i==5){
|
|
|
+ } else if (i == 5) {
|
|
|
tempPrice = (int)Math.floor((Integer.parseInt(maxPrice)));
|
|
|
temp.setFilterCd(String.valueOf(tempPrice));
|
|
|
temp.setFilterNm(String.valueOf(tempPrice));
|
|
|
- }else{
|
|
|
- tempPrice = (int)Math.floor((Integer.parseInt(minPrice) + sliceVal * i) / 1000) * 1000 ;
|
|
|
+ } else {
|
|
|
+ tempPrice = (int)Math.floor((Integer.parseInt(minPrice) + sliceVal * i) / 1000) * 1000;
|
|
|
temp.setFilterCd(String.valueOf(tempPrice));
|
|
|
temp.setFilterNm(String.valueOf(tempPrice));
|
|
|
}
|
|
|
@@ -854,4 +859,21 @@ public class TsfDisplayService {
|
|
|
public Collection<SearchKeyword> getSearchKeywordList(SearchKeyword searchKeyword) {
|
|
|
return displayDao.getSearchKeywordList(searchKeyword);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 스플래시 이미지 가져오기
|
|
|
+ * @param siteCd - 사이트코드
|
|
|
+ * @return
|
|
|
+ * @author gagamel
|
|
|
+ * @since 2021. 7. 5
|
|
|
+ */
|
|
|
+ @Cacheable(value = "splashimg")
|
|
|
+ public String getSplashImageUrl() {
|
|
|
+ String splashImg = displayDao.getSplashImage();
|
|
|
+ if (StringUtils.isBlank(splashImg)) {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ return "http:" + GagaFileUtil.getConcatenationPath(env.getProperty("upload.image.view"), "splashimg", splashImg);
|
|
|
+ }
|
|
|
+
|
|
|
}
|