Compare commits

...

5 Commits

Author SHA1 Message Date
이주일
15f299d842 fix: 추천상품 표시 순서 적용 2026-07-18 12:34:26 +09:00
이주일
49738b87bd fix: 추천상품 표시 설정 및 품절 안내 적용 2026-07-18 12:34:26 +09:00
이주일
1b52e2ecbd fix: 추천상품 PC 카드 목록 구조 통일 2026-07-18 12:34:26 +09:00
이주일
de7bb587e2 fix: 추천상품 카드 표시 기준 보정 2026-07-18 12:34:26 +09:00
이주일
de3c84957d feat: 게시판 연관상품 목록 표준화 2026-07-18 12:34:26 +09:00
4 changed files with 133 additions and 144 deletions

View File

@@ -567,19 +567,11 @@ public class BOGnrlbbscttService {
Map<String, Object> map = new HashMap<String, Object>();
// 게시글 연관상품 조회
List<DataMap> goodsList = new ArrayList<>();
DataMap result = new DataMap();
goodsList = mapper.selectBOBbscttDtlGoods(bbsctt);
/*게시판 설정 > 추천 상품 노출 선택 시 사용자 게시글 상세 상품 노출 */
if (!goodsList.isEmpty()) {
if ("sopmal".equals(bbsctt.getServerDv())) {
result = goodsService.selectBoGoodsRelateList(goodsList);
}
}
/*사용자 , 관리자 페이지 구분*/
if ("sopmal".equals(bbsctt.getServerDv())) {
map.put("goodsList", result);
map.put("goodsList", goodsList);
} else {
map.put("goodsList", goodsList);
}

View File

@@ -2656,19 +2656,43 @@
WHERE 1=1
AND FGI.GOODS_INNB = FBG.GOODS_INNB
AND FGI.SOPMAL_CD = FBG.SOPMAL_CD
AND FGI.IMG_KND = '03'
AND FGI.IMG_KND = '02'
AND FGI.CUT_NB = 1
LIMIT 1
)IMG
) AS GOODS_IMG_COURS
,FG.GOODS_NM
,FGO.CNSMRPRIC
,FGO.SLEPRIC
,FGO.STDR_DV_AT
,FN_GET_COMMCODE_NAME('GOODS_STTUS', FG.GOODS_STTUS_CD) AS GOODS_STTUS_NM
,FN_GET_COMMCODE_NAME('EXPSR', FG.EXPSR_DV_CD) AS EXPSR_NM
,FBG.ORDR_GOODS_OPTN_INNB
,FBG.SOPMAL_CD
,FBG.RE_ORDER_AT
,FG.GOODS_ICON_CD AS ICON_CD_NM_LIST
,FG.SRT_DC AS REPRSNT_DC
,FG.GOODS_STTUS_CD
,FEGI.GOODS_NM_EXPSR_AT
,FEGI.GOODS_NM_EXPSR_ORDR
,FEGI.REPRSNT_DC_EXPSR_AT
,FEGI.REPRSNT_DC_EXPSR_ORDR
,FEGI.PRIC_EXPSR_AT
,FEGI.PRIC_EXPSR_ORDR
,FEGI.RVW_EVL_SCRE_EXPSR_AT
,FEGI.RVW_EVL_SCRE_EXPSR_ORDR
,FEGI.ICON_EXPSR_AT
,FEGI.ICON_EXPSR_ORDR
,IFNULL(ROUND(FGO.CNSMRPRIC, 0), 0) AS CNSMRPRIC
,IFNULL(ROUND(FGO.SLEPRIC, 0), 0) AS SLEPRIC
,IFNULL(ROUND(((FGO.CNSMRPRIC - FGO.SLEPRIC) / NULLIF(FGO.CNSMRPRIC, 0)) * 100, 0), 0) AS SLE_PERCENT
,IFNULL((SELECT ROUND(AVG(FBA.EVL_SCORE), 1)
FROM GC_BOARDDATA_GOODS RBG
INNER JOIN GC_BOARDDATA RB ON RB.BBSCTT_INNB = RBG.BBSCTT_INNB AND RB.SOPMAL_CD = RBG.SOPMAL_CD
INNER JOIN GC_BOARDMANAGER RBM ON RBM.BBS_ID = RB.BBS_ID AND RBM.SOPMAL_CD = RB.SOPMAL_CD
LEFT JOIN GC_BOARDFORM RBF ON RBF.BBS_ID = RBM.BBS_ID AND RBF.SOPMAL_CD = RBM.SOPMAL_CD AND RBF.USE_AT = 'Y' AND RBF.ADIT_ITM_DV_CD = '04'
LEFT JOIN GC_BOARD_ADDITM FBA ON FBA.BBSCTT_INNB = RB.BBSCTT_INNB AND FBA.SOPMAL_CD = RB.SOPMAL_CD AND FBA.QESITM_INNB = RBF.QESITM_INNB
WHERE RBG.SOPMAL_CD = FG.SOPMAL_CD
AND RBG.GOODS_INNB IN (SELECT CAST(RVW_GROUP_NB AS DECIMAL(10)) FROM GC_GOODS_RVW_V WHERE SOPMAL_CD = FG.SOPMAL_CD AND GOODS_INNB = FG.GOODS_INNB)
AND RB.USE_AT = 'Y' AND RB.DEPTH = 0 AND RBM.BBS_TY_CD IN ('06', '07')), 0) AS AVG_EVL_SCORE
,IFNULL((SELECT COUNT(RB.BBSCTT_INNB)
FROM GC_BOARDDATA_GOODS RBG
INNER JOIN GC_BOARDDATA RB ON RB.BBSCTT_INNB = RBG.BBSCTT_INNB AND RB.SOPMAL_CD = RBG.SOPMAL_CD
INNER JOIN GC_BOARDMANAGER RBM ON RBM.BBS_ID = RB.BBS_ID AND RBM.SOPMAL_CD = RB.SOPMAL_CD
WHERE RBG.SOPMAL_CD = FG.SOPMAL_CD
AND RBG.GOODS_INNB IN (SELECT CAST(RVW_GROUP_NB AS DECIMAL(10)) FROM GC_GOODS_RVW_V WHERE SOPMAL_CD = FG.SOPMAL_CD AND GOODS_INNB = FG.GOODS_INNB)
AND RB.USE_AT = 'Y' AND RB.DEPTH = 0 AND RBM.BBS_TY_CD IN ('06', '07')), 0) AS CNT_EVL_SCOR
FROM GC_BOARDDATA_GOODS FBG
INNER JOIN GC_GOODS FG ON
FG.GOODS_INNB = FBG.GOODS_INNB
@@ -2676,6 +2700,9 @@
INNER JOIN GC_GOODS_OPTION FGO ON
FG.GOODS_INNB = FGO.GOODS_INNB
AND FG.SOPMAL_CD = FGO.SOPMAL_CD
LEFT JOIN GC_GOODS_EXPSR_INFO FEGI ON
FG.SOPMAL_CD = FEGI.SOPMAL_CD
AND FEGI.USE_AT = 'Y'
WHERE 1 = 1
AND FG.SOPMAL_CD =#{sopmalCd}
AND FBG.BBSCTT_INNB =
@@ -2688,6 +2715,16 @@
</otherwise>
</choose>
AND FGO.STDR_DV_AT = 'Y'
<if test="serverDv == 'sopmal'">
AND FGO.OPTN_EXPSR_AT = 'Y'
AND FGO.USE_AT = 'Y'
AND FG.USE_AT = 'Y'
AND FG.GOODS_KND_CD = '01'
AND FG.GOODS_STTUS_CD IN ('01', '02')
AND (FG.EXPSR_DV_CD = '01' OR (FG.EXPSR_DV_CD = '03' AND SYSDATE() BETWEEN FG.EXPSR_BGN_DT AND FG.EXPSR_END_DT))
ORDER BY CASE FG.GOODS_STTUS_CD WHEN '02' THEN 1 ELSE 0 END ASC, FBG.REGIST_DT ASC, FBG.GOODS_INNB ASC
LIMIT 12
</if>
</select>
<!-- 게시글 연관상품 삭제 (게시글 수정시)-->

View File

@@ -16,6 +16,7 @@
--%>
<!DOCTYPE html>
<html lang="ko">
<spring:eval expression="@environment.getProperty('currency-unit.default')" var="curUnit"/>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -132,13 +133,13 @@
});
} else { //메인화면 호출 안할 시
// 상품 - 4열 슬라이드 타입 (이벤트 추천 상품 슬릭 이벤트)
$('.four-row-slick').slick({
$('.relate-goods-slick').slick({
slidesToShow: 4,
slidesToScroll: 4,
speed: 900,
infinite: true,
prevArrow: $('.four-row-slick__prev'),
nextArrow: $('.four-row-slick__next'),
prevArrow: $('.relate-goods-slick__prev'),
nextArrow: $('.relate-goods-slick__next'),
});
}
}
@@ -938,7 +939,7 @@
</div>
</c:if>
<%-------------------------------%>
<c:if test="${bbsInfo.recomendGoodsExpsrAt eq 'Y' && not empty goodsList.relateInfoList}">
<c:if test="${bbsInfo.recomendGoodsExpsrAt eq 'Y' && not empty goodsList}">
<div class="cartOrder">
<div class="main-section__container">
<section class="main-section main-section__four-row">
@@ -950,94 +951,77 @@
</div>
</div>
<div class="product-list-type1">
<div class="four-row-slick evtSlick">
<c:forEach var = "item" items="${goodsList.relateInfoList}">
<div class="${fn:length(goodsList) gt 4 ? 'four-row-slick relate-goods-slick evtSlick' : 'product-list-type1__list'}">
<c:forEach var = "item" items="${goodsList}">
<c:if test = "${not empty item.goodsInnb}">
<div class="product-unit">
<div class="product-unit-image">
<c:forEach var = "img" items = "${goodsList.relateImgList}">
<c:if test = "${item.goodsInnb eq img.goodsInnb}">
<button type="button" onclick = "fn_move_goods_dtl(<c:out value="${item.goodsInnb}"/>)" value="${item.goodsInnb}">
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<img src="<c:out value = "${cdnurl}${img.img}"/>" style="width: 100%;
height: 304px; /* 원하는 고정 높이 설정 */
object-fit: cover; /* 이미지 비율을 유지하면서 영역에 맞게 자름 */"
onerror="this.src='/pc/images/image_placeholder.png'" alt="해당 이미지에 대한 설명">
</button>
</c:if>
</c:forEach>
<c:if test="${item.goodsSttusCd eq '02'}">
<div class="sold-out"><span>입고 대기중</span></div>
</c:if>
<a class="product-detail" href="javascript:void(0);" onclick="fn_move_goods_dtl('<c:out value="${item.goodsInnb}"/>');">
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<img src="<c:out value = "${cdnurl}${item.goodsImgCours}"/>"
onerror="this.src='/pc/images/image_placeholder.png'" alt="<c:out value="${item.goodsNm}"/>">
</a>
</div>
<div class="product-unit-info">
<div class="product-badge-container">
<c:if test = "${not empty item.goodsIconCd}">
<c:forEach items="${fn:split(item.goodsIconCd, ',')}" var="icon">
<c:if test="${icon eq 'new'}">
<span class="product-badge new" data-badge-cd="new">NEW</span>
</c:if>
<c:if test="${icon eq 'hot'}">
<span class="product-badge hot" data-badge-cd="hot">HOT</span>
</c:if>
<c:if test="${icon eq 'best'}">
<span class="product-badge best" data-badge-cd="best">BEST</span>
</c:if>
<c:if test="${icon eq 'md-pick'}">
<span class="product-badge md-pick" data-badge-cd="md-pick">MD PICK</span>
</c:if>
<c:if test="${icon eq 'hot-deal'}">
<span class="product-badge four-row" data-badge-cd="four-row">HOT DEAL</span>
</c:if>
<div class="product-unit-info d-flex flex-column" style="flex-direction:column">
<c:if test="${not empty item.iconCdNmList && item.iconExpsrAt eq 'Y'}">
<div class="product-badge-container col order-${item.iconExpsrOrdr-1}" style="order: ${item.iconExpsrOrdr-1}">
<c:forEach items="${fn:split(item.iconCdNmList, ',')}" var="iconCdNm">
<span class="product-badge ${fn:toLowerCase(iconCdNm)}" data-badge-cd="${iconCdNm}">${fn:replace(fn:toUpperCase(iconCdNm), '-', ' ')}</span>
</c:forEach>
</c:if>
</div>
<div class="product-unit-info__inner">
<div class="product-unit-title">
<button type="button" onclick = "fn_move_goods_dtl(<c:out value="${item.goodsInnb}"/>)">
<c:out value = "${item.goodsNm}"/>
</button>
</div>
<div class="product-unit-price">
<c:forEach var="goodsOpt" items="${goodsList.relateGoodsOptList}">
<c:if test="${item.goodsInnb eq goodsOpt.goodsInnb && goodsOpt.stdrDvAt eq 'Y'}">
</c:if>
<c:if test="${item.goodsNmExpsrAt eq 'Y'}">
<div class="product-unit-title col order-${item.goodsNmExpsrOrdr-1}" style="order: ${item.goodsNmExpsrOrdr-1}">
<a href="javascript:void(0);" onclick="fn_move_goods_dtl('<c:out value="${item.goodsInnb}"/>');">
<c:out value = "${item.goodsNm}"/>
</a>
</div>
</c:if>
<c:if test="${item.pricExpsrAt eq 'Y'}">
<div class="product-unit-price col order-${item.pricExpsrOrdr-1}" style="order: ${item.pricExpsrOrdr-1}">
<div class="product-unit-price__price">
<span class="product-unit-price__original">
<fmt:formatNumber value="${goodsOpt.cnsmrpric}" pattern="#,###"/>
<span class="product-unit-price__original <c:if test="${item.slePercent eq 0}">visually-hidden</c:if>">
<fmt:formatNumber value="${item.cnsmrpric}"/> ${curUnit}
</span>
<span class="product-unit-price__current">
<fmt:formatNumber value="${goodsOpt.slepric}" pattern="#,###"/>
<fmt:formatNumber value="${item.slepric}"/> ${curUnit}
</span>
</div>
<div class="product-unit-price__sale">
<span class="percent"><c:out value = "${goodsOpt.slePercent}"/>%</span>
<div class="product-unit-price__sale <c:if test="${item.slePercent eq 0}">visually-hidden</c:if>">
<span class="percent"><c:out value = "${item.slePercent}"/> %</span>
</div>
</c:if>
</c:forEach>
</div>
<span class="product-unit-price__monthly-payment"><c:out value = "${item.srtDc}"/></span>
</div>
<div class="product-unit-rating">
</c:if>
<c:if test="${item.reprsntDcExpsrAt eq 'Y'}">
<div class="product-unit-price__monthly-payment col order-${item.reprsntDcExpsrOrdr-1}" style="order: ${item.reprsntDcExpsrOrdr-1}"><c:out value = "${item.reprsntDc}"/></div>
</c:if>
<c:if test="${item.rvwEvlScreExpsrAt eq 'Y'}">
<div class="product-unit-rating col order-${item.rvwEvlScreExpsrOrdr-1}" style="order: ${item.rvwEvlScreExpsrOrdr-1}">
<i class="icon icon_rating-star"></i>
<c:forEach var = "evlInfo" items="${goodsList.goodsRvwEvlList}">
<c:if test = "${evlInfo.goodsInnb eq item.goodsInnb}">
<span class="product-unit-rating__score"><c:out value = "${evlInfo.avgEvlScore}"/>${goodsOpt.goodInnb}</span>
<span class="product-unit-rating__count">(<fmt:formatNumber value="${evlInfo.cntBbsctt}" pattern="#,###"/>)</span>
</c:if>
</c:forEach>
<span class="product-unit-rating__score"><c:out value = "${item.avgEvlScore}"/></span>
<span class="product-unit-rating__count">(<fmt:formatNumber value="${item.cntEvlScor}"/>)</span>
</div>
</c:if>
</div>
</div>
</c:if>
</c:forEach>
</div>
<c:if test="${fn:length(goodsList) gt 4}">
<div class="four-row-slick__btn-container">
<button class="four-row-slick__prev">
<button class="relate-goods-slick__prev">
<i class="icon icon_prev02"></i>
<span class="visually-hidden">이전</span>
</button>
<button class="four-row-slick__next">
<button class="relate-goods-slick__next">
<i class="icon icon_next02"></i>
<span class="visually-hidden">다음</span>
</button>
</div>
</c:if>
</div>
</section>
</div>

View File

@@ -16,6 +16,7 @@
--%>
<!DOCTYPE html>
<html lang="ko">
<spring:eval expression="@environment.getProperty('currency-unit.default')" var="curUnit"/>
<head>
<jsp:include page="/WEB-INF/views/comm/mobile/Include.jsp"/>
@@ -1413,7 +1414,7 @@
</c:if>
<%-------------------------------%>
<%--연관상품영역--%>
<c:if test="${bbsInfo.recomendGoodsExpsrAt eq 'Y' && not empty goodsList.relateInfoList}">
<c:if test="${bbsInfo.recomendGoodsExpsrAt eq 'Y' && not empty goodsList}">
<section class="main-section main-section__category-type">
<div class="main-section-header">
<div class="main-section-title">
@@ -1423,91 +1424,66 @@
</div>
</div>
<div class="product-list-vertical-twoAndaHalf">
<div class="swiper product-list-vertical-twoAndaHalf__swiper">
<div class="swiper-wrapper">
<c:forEach var = "item" items="${goodsList.relateInfoList}">
<div class="${fn:length(goodsList) gt 4 ? 'swiper product-list-vertical-twoAndaHalf__swiper' : 'product-list-type-2cols'}">
<div class="${fn:length(goodsList) gt 4 ? 'swiper-wrapper' : 'product-list-type-2cols__list'}">
<c:forEach var = "item" items="${goodsList}">
<c:if test = "${not empty item.goodsInnb}">
<div class="swiper-slide">
<div class="${fn:length(goodsList) gt 4 ? 'swiper-slide' : ''}">
<div class="product-unit">
<div class="product-unit-image">
<c:if test = "item.goodsSttusCd ne '01'">
<c:if test="${item.goodsSttusCd eq '02'}">
<div class="sold-out">
<c:choose>
<c:when test ="${item.goodsSttusCd eq '02'}">
<span>입고 대기중</span>
</c:when>
<c:when test ="${item.goodsSttusCd eq '03'}">
<span>판매중지</span>
</c:when>
</c:choose>
<span>입고 대기중</span>
</div>
</c:if>
<c:forEach var="img" items="${goodsList.relateImgList}">
<c:if test="${item.goodsInnb eq img.goodsInnb}">
<a style="cursor:pointer" loading="lazy"
onclick = "fn_move_goods_dtl(<c:out value="${item.goodsInnb}"/>)">
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<img src="<c:out value = "${cdnurl}${img.img}"/>"
<img src="<c:out value = "${cdnurl}${item.goodsImgCours}"/>"
onerror="this.src='/pc/images/image_placeholder.png'"
alt="해당 이미지에 대한 설명">
alt="<c:out value="${item.goodsNm}"/>">
</a>
</c:if>
</c:forEach>
</div>
<div class="product-unit-info">
<c:set var="iconString" value="${item.goodsIconCd}" />
<c:set var="iconCdList" value="${fn:split(iconString, ',')}" />
<c:forEach var = "iconCd" items="${iconCdList}">
<c:if test = "${iconCd eq 'new'}">
<span class="product-badge new" data-badge-cd="new">NEW</span>
</c:if>
<c:if test = "${iconCd eq 'hot'}">
<span class="product-badge hot" data-badge-cd="hot">HOT</span>
</c:if>
<c:if test = "${iconCd eq 'best'}">
<span class="product-badge best" data-badge-cd="best">BEST</span>
</c:if>
<c:if test = "${iconCd eq 'md-pick'}">
<span class="product-badge md-pick" data-badge-cd="md-pick">MD PICK</span>
</c:if>
<c:if test = "${iconCd eq 'hot-deal'}">
<span class="product-badge four-row" data-badge-cd="four-row">HOT DEAL</span>
</c:if>
</c:forEach>
<div class="product-unit-info__inner">
<div class="product-unit-title">
<div class="product-unit-info d-flex flex-column" style="flex-direction:column">
<c:if test="${not empty item.iconCdNmList && item.iconExpsrAt eq 'Y'}">
<div class="product-badge-container col order-${item.iconExpsrOrdr-1}" style="order: ${item.iconExpsrOrdr-1}">
<c:forEach items="${fn:split(item.iconCdNmList, ',')}" var="iconCdNm">
<span class="product-badge ${fn:toLowerCase(iconCdNm)}" data-badge-cd="${iconCdNm}">${fn:replace(fn:toUpperCase(iconCdNm), '-', ' ')}</span>
</c:forEach>
</div>
</c:if>
<c:if test="${item.goodsNmExpsrAt eq 'Y'}">
<div class="product-unit-title col order-${item.goodsNmExpsrOrdr-1}" style="order: ${item.goodsNmExpsrOrdr-1}">
<a style="cursor:pointer" onclick = "fn_move_goods_dtl(<c:out value="${item.goodsInnb}"/>)">
<c:out value = "${item.goodsNm}"/>
</a>
</div>
<div class="product-unit-price">
<c:forEach var="goodsOpt" items="${goodsList.relateGoodsOptList}">
<c:if test="${item.goodsInnb eq goodsOpt.goodsInnb && goodsOpt.stdrDvAt eq 'Y'}">
</c:if>
<c:if test="${item.pricExpsrAt eq 'Y'}">
<div class="product-unit-price col order-${item.pricExpsrOrdr-1}" style="order: ${item.pricExpsrOrdr-1}">
<div class="product-unit-price__price">
<span class="product-unit-price__original">
<fmt:formatNumber value="${goodsOpt.cnsmrpric}" pattern="#,###"/>
<span class="product-unit-price__original <c:if test="${item.slePercent eq 0}">visually-hidden</c:if>">
<fmt:formatNumber value="${item.cnsmrpric}"/> ${curUnit}
</span>
<span class="product-unit-price__current">
<fmt:formatNumber value="${goodsOpt.slepric}" pattern="#,###"/>
<fmt:formatNumber value="${item.slepric}"/> ${curUnit}
</span>
</div>
<div class="product-unit-price__sale">
<span class="percent"><c:out value = "${goodsOpt.slePercent}"/>%</span>
<div class="product-unit-price__sale <c:if test="${item.slePercent eq 0}">visually-hidden</c:if>">
<span class="percent"><c:out value = "${item.slePercent}"/> %</span>
</div>
</c:if>
</c:forEach>
</div>
<span class="product-unit-price__monthly-payment"><c:out value = "${item.srtDc}"/></span>
</div>
<div class="product-unit-rating">
</c:if>
<c:if test="${item.reprsntDcExpsrAt eq 'Y'}">
<div class="product-unit-price__monthly-payment col order-${item.reprsntDcExpsrOrdr-1}" style="order: ${item.reprsntDcExpsrOrdr-1}"><c:out value = "${item.reprsntDc}"/></div>
</c:if>
<c:if test="${item.rvwEvlScreExpsrAt eq 'Y'}">
<div class="product-unit-rating col order-${item.rvwEvlScreExpsrOrdr-1}" style="order: ${item.rvwEvlScreExpsrOrdr-1}">
<i class="icon icon_rating-star"></i>
<c:forEach var = "evlInfo" items="${goodsList.goodsRvwEvlList}">
<c:if test = "${evlInfo.goodsInnb eq item.goodsInnb}">
<span class="product-unit-rating__score"><c:out value = "${evlInfo.avgEvlScore}"/>${goodsOpt.goodInnb}</span>
<span class="product-unit-rating__count">(<fmt:formatNumber value="${evlInfo.cntBbsctt}" pattern="#,###"/>)</span>
</c:if>
</c:forEach>
<span class="product-unit-rating__score"><c:out value = "${item.avgEvlScore}"/></span>
<span class="product-unit-rating__count">(<fmt:formatNumber value="${item.cntEvlScor}"/>)</span>
</div>
</c:if>
</div>
</div>
</div>