Ver Fonte

기획전 상세 중간커밋

sowon4187 há 5 anos atrás
pai
commit
888ed650ff

+ 10 - 0
src/main/java/com/style24/front/biz/dao/TsfPlanningDao.java

@@ -492,4 +492,14 @@ public interface TsfPlanningDao {
 	 */
 	Integer getShotPlanSq(Plan plan);
 	
+	/**
+	 * 기획전 컨텐츠 정보 
+	 *
+	 * @param 기획전 번호
+	 * @return
+	 * @author sowon
+	 * @date 2021. 6. 3
+	 */
+	Collection<Plan> getPlanContentInfo(Plan plan);
+	
 }

+ 12 - 0
src/main/java/com/style24/front/biz/service/TsfPlanningService.java

@@ -683,4 +683,16 @@ public class TsfPlanningService {
 		return planningDao.getShotPlanSq(plan);
 	}
 	
+	/**
+	 * 기획전 컨텐츠 정보 
+	 *
+	 * @param 기획전 번호
+	 * @return
+	 * @author sowon
+	 * @date 2021. 6. 3
+	 */
+	 public Collection<Plan> getPlanContentInfo(Plan plan) {
+		 return planningDao.getPlanContentInfo(plan);
+	 }
+	
 }

+ 8 - 2
src/main/java/com/style24/front/biz/web/TsfPlanningController.java

@@ -198,11 +198,15 @@ public class TsfPlanningController extends TsfBaseController {
 		mav.addObject("fsrcInfoBtm", planningService.getPlanFsrcInfo(plan));
 
 		// 리뷰
+		plan.setTmplType("G082_10");
 		mav.addObject("reviewInfo", planningService.getPlanReviewInfo(review));
+		mav.addObject("reviewContent", planningService.getPlanContentInfo(plan));
 
 		// 쿠폰
+		plan.setTmplType("G082_20");
 		mav.addObject("couponInfo", planningService.getPlanCouponInfo(coupon));
-
+		mav.addObject("couponContent", planningService.getPlanContentInfo(plan));
+		
 		// 이미지
 		mav.addObject("imageInfo", planningService.getPlanImageInfo(plan));
 		
@@ -213,15 +217,17 @@ public class TsfPlanningController extends TsfBaseController {
 		// 상품1열 전시
 		plan.setTmplType("G082_50");
 		mav.addObject("goods1Info", planningService.getPlanGoodsDisplayList(plan));
+		mav.addObject("goods1Content", planningService.getPlanContentInfo(plan));
 
 		// 상품2열 전시
 		plan.setTmplType("G082_51");
-
 		mav.addObject("goods2Info", planningService.getPlanGoodsDisplayList(plan));
+		mav.addObject("goods2Content", planningService.getPlanContentInfo(plan));
 
 		// 상품4열 전시
 		plan.setTmplType("G082_52");
 		mav.addObject("goods4Info", planningService.getPlanGoodsDisplayList(plan));
+		mav.addObject("goods4Content", planningService.getPlanContentInfo(plan));
 		
 		// 코너 목록
 		mav.addObject("planCornerList", planningService.getPlanCornerList(plan));

+ 6 - 5
src/main/java/com/style24/persistence/mybatis/shop/TsfCoupon.xml

@@ -1001,9 +1001,10 @@
 		            GROUP  BY CC.CPN_ID, DATE_FORMAT(CC.AVAIL_STDT,'%Y.%m.%d %H:%i'), DATE_FORMAT(CC.AVAIL_EDDT,'%Y.%m.%d %H:%i')
 		           ) CC
 		         , TB_COUPON C
-		    WHERE  CC.CPN_ID = C.CPN_ID
+		    WHERE  CC.CPN_ID  = C.CPN_ID
 		    AND    C.CPN_STAT = 'G232_11' /*진행중인쿠폰*/
-		    AND    C.SITE_CD = #{siteCd}
+		    AND    C.SITE_CD  = #{siteCd}
+		    AND    C.CPN_ID   = #{cpnId}
 		)
 		, TAB_COUPON_REFVAL1 AS (
 		    SELECT CR.CPN_ID
@@ -1018,10 +1019,10 @@
 		                WHEN CR.CPN_TARGET = 'G260_12' /*브랜드*/ THEN (SELECT BRAND_KNM FROM TB_BRAND WHERE BRAND_CD = CR.REF_VAL AND USE_YN = 'Y')
 		                WHEN CR.CPN_TARGET = 'G260_13' /*업체*/ THEN (SELECT SUPPLY_COMP_NM FROM TB_SUPPLY_COMPANY WHERE SUPPLY_COMP_CD = CR.REF_VAL AND USE_YN = 'Y' AND SUPPLY_STAT = 'G010_30')
 		           END AS REF_VAL
-		         , RANK() OVER(PARTITION BY CR.CPN_ID, CR.CPN_TARGET ORDER BY REF_VAL) AS RK
-		    FROM   TAB_COUPON C LEFT OUTER JOIN TB_COUPON_REFVAL CR
-		             ON  C.CPN_ID = CR.CPN_ID
+		         , RANK() OVER(PARTITION BY CR.CPN_ID, CR.CPN_TARGET ORDER BY CR.REF_VAL) AS RK
+		    FROM     TB_COUPON_REFVAL CR
 		    WHERE    CR.CPN_TARGET != 'G260_14' /*제외상품아닌넘*/
+		    AND      CR.CPN_ID = #{cpnId}
 		)
 		, TAB_COUPON_REFVAL2 AS (
 		    SELECT CPN_ID

+ 23 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsfPlanning.xml

@@ -1695,4 +1695,27 @@
 		ORDER BY REG_DT DESC LIMIT 1
 	</select>
 	
+	<select id="getPlanContentInfo" resultType="Plan" parameterType="Plan">
+		/* TsfPlanning.getPlanContentInfo */	
+		SELECT PLAN_SQ 
+		     , PLAN_CONT_SQ 
+		     , TITLE 
+		     , LINK_URL 
+		     , LINK_OPEN_GB 
+		     , CPN_NOTE0 
+		     , CPN_NOTE1 
+		     , CPN_NOTE2 
+		     , CPN_NOTE3 
+		     , CPN_NOTE4 
+		     , CPN_NOTE5 
+		     , CPN_NOTE6 
+		     , CPN_NOTE7 
+		     , CPN_NOTE8 
+		     , CPN_NOTE9 
+		FROM TB_PLAN_CONTENTS
+		WHERE PLAN_SQ = #{planSq}
+		AND TMPL_TYPE = #{tmplType}
+		AND DISP_YN = 'Y'
+	</select>
+	
 </mapper>

+ 96 - 62
src/main/webapp/WEB-INF/views/web/planning/PlanningDetailFormWeb.html

@@ -90,25 +90,25 @@
             
             <th:block th:each="a, template : ${templateOrd}">
 				<th:block th:if="${a.tmplType == 'G082_10'}">
-						<div class="content wide dp_review" th:id="${a.tmplType}"></div> <!-- //리뷰 -->
+						<div class="content wide dp_review" th:id="${a.tmplType}" style="display: none"></div> <!-- //리뷰 -->
 					</th:block>
 				<th:block th:if="${a.tmplType == 'G082_20'}">
-						 <div class="content wide dp_coupon" th:id="${a.tmplType}"></div>  <!-- //할인쿠폰 -->
+						 <div class="content wide dp_coupon" th:id="${a.tmplType}" style="display: none"></div>  <!-- //할인쿠폰 -->
 					</th:block>
 				<th:block th:if="${a.tmplType == 'G082_30'}">
-						<div class="content dp_mid_banner" th:id="${a.tmplType}"></div> <!-- //이미지-->
+						<div class="content dp_mid_banner" th:id="${a.tmplType}" style="display: none"></div> <!-- //이미지-->
 					</th:block>
 				<th:block th:if="${a.tmplType == 'G082_50'}">
-						<div class="content dp_special" th:id="${a.tmplType + a.planContSq}"></div>
+						<div class="content dp_special" th:id="${a.tmplType + a.planContSq}" style="display: none"></div>
 				</th:block>
 				<th:block th:if="${a.tmplType == 'G082_51'}">
-						<div class="content dp_special" th:id="${a.tmplType + a.planContSq}"></div>
+						<div class="content dp_special" th:id="${a.tmplType + a.planContSq}" style="display: none"></div>
 				</th:block>
 				<th:block th:if="${a.tmplType == 'G082_52'}">
-						<div class="content dp_special" th:id="${a.tmplType + a.planContSq}"></div>
+						<div class="content dp_special" th:id="${a.tmplType + a.planContSq}" style="display: none"></div>
 				</th:block>
 				<th:block th:if="${a.tmplType == 'G082_60'}">
-						<div class="content dp_announce" th:id="${a.tmplType}"></div>
+						<div class="content dp_announce" th:id="${a.tmplType}" style="display: none"></div>
 				</th:block>
 			</th:block>
 			
@@ -245,13 +245,18 @@
 <script src="/ux/plugins/gaga/gaga.paging.js"></script>
 <script th:inline="javascript">
 let review = [[${reviewInfo}]];
+let reviewContent = [[${reviewContent}]];
 let coupon = [[${couponInfo}]];
+let couponContent = [[${couponContent}]];
 let plan = [[${planInfo}]];
 let image = [[${imageInfo}]];
 let notice = [[${noticeInfo}]];
 let goods1 = [[${goods1Info}]];
+let goods1Content = [[${goods1Content}]];
 let goods2 = [[${goods2Info}]];
+let goods2Content = [[${goods2Content}]];
 let goods4 = [[${goods4Info}]];
+let goods4Content = [[${goods4Content}]];
 let template =[[${templateOrd}]];
 let replyList = [[${replyList}]];
 let replyCount = [[${replyCount}]];
@@ -260,6 +265,8 @@ let planCornerGoodsList = [[${planCornerGoodsList}]];
 let planCornerList = [[${planCornerList}]];
 
 if(notice.length>0){
+	$("#G082_60").show();
+	
 	var html = '';
 	
 	html += '    <div class="cont_head">\n';
@@ -284,6 +291,7 @@ if(notice.length>0){
 	html += '    </div>\n';
 
 	$("#G082_60").append(html);
+	
 }
 
 
@@ -308,12 +316,8 @@ if(planCornerList.length>0){
 		html += '                 <h4>'+item.cornerNm+'</h4>\n';
 		html += '             </div>\n';
 		html += '             <div class="itemsGrp';
-		if (item.cornerDispType == 'G045_1') {
-			html += ' cut1';
-		}else if(item.cornerDispType == 'G045_2'){
+		if(item.cornerDispType == 'G045_2'){
 			html += ' cut2';
-		}else if(item.cornerDispType == 'G045_3'){
-			html += ' cut3';
 		}else if(item.cornerDispType == 'G045_4'){
 			html += ' cut4';
 		}else if(item.cornerDispType == 'G045_5'){
@@ -396,13 +400,13 @@ if(planCornerList.length>0){
 	
 }
 
-if(review.length>0){
-	
+if(review.length>0 || reviewContent[0].title != ''){
+	$("#G082_10").show();
 	var html = '';
 	
 	html += ' <div class="cont_head">\n';
 	html += ' 	<div>\n';
-	html += '		<h4>'+review[0].title+'</h4>\n';
+	html += '		<h4>'+reviewContent[0].title+'</h4>\n';
 	html += ' 	</div>\n';
 	html += '	<div class="cont_body">\n';
 	html += ' 		<div class="review_list">\n';
@@ -410,9 +414,19 @@ if(review.length>0){
 		html += '		<div class="reviw_box">\n'
 		html += '			<div class="best_review">\n';
 		if(item.reviewSysImg!= null){
-			html += '				<a href="javascript:void();" id="btn_pdBestReview_pop" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'Y\', \'Y\',\''+item.reviewSq+'\');">\n';
+			if (item.bestYn == 'Y') {
+				html += '				<a href="javascript:void();" id="btn_pdBestReview_pop" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'Y\', \'Y\',\''+item.reviewSq+'\');">\n';
+			}else{
+				html += '				<a href="javascript:void();" id="btn_pdBestReview_pop" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'N\', \'Y\',\''+item.reviewSq+'\');">\n';
+			}
+			
 		}else{
-			html += '				<a href="javascript:void();" id="btn_pdBestReview_pop" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'Y\', \'N\',\''+item.reviewSq+'\');">\n';
+			if (item.bestYn == 'Y') {
+				html += '				<a href="javascript:void();" id="btn_pdBestReview_pop" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'Y\', \'N\',\''+item.reviewSq+'\');">\n';
+			}else{
+				html += '				<a href="javascript:void();" id="btn_pdBestReview_pop" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'N\', \'N\',\''+item.reviewSq+'\');">\n';
+			}
+			
 		}
 		
 		html += '					<div class="pic">\n';
@@ -464,35 +478,40 @@ if(review.length>0){
 	html += '</div>\n';
 
 	$("#G082_10").append(html);
+
+	
 }
 
 if(image.length>0){
-	var html = '';
 	
-	html += '<div class="cont_body">\n     ';
-	html += '    <div class="mid_banner">\n';
-	html += '        <div class="swiper-container">\n';
-	html += '            <div class="swiper-wrapper">\n';
-	for (var i = 0; i < image.length; i++) {
-		html += '                	<div class="swiper-slide">\n';
-		if (image[i].linkOpenGb == 'M') {
-			html += '                    	<a href="'+image[i].linkUrl+'" target="_self"><img alt="" src="'+ _uploadImageUrl + image[i].itemVal +'"></a>\n';
-		}else{
-			html += '                    	<a href="'+image[i].linkUrl+'" target="_blank"><img alt="" src="'+ _uploadImageUrl + image[i].itemVal +'"></a>\n';
+	if (image[0].itemVal != null && image[0].itemVal != '') {
+		$("#G082_30").show();
+		var html = '';
+		
+		html += '<div class="cont_body">\n     ';
+		html += '    <div class="mid_banner">\n';
+		html += '        <div class="swiper-container">\n';
+		html += '            <div class="swiper-wrapper">\n';
+		for (var i = 0; i < image.length; i++) {
+			html += '                	<div class="swiper-slide">\n';
+			if (image[i].linkOpenGb == 'M') {
+				html += '                    	<a href="'+image[i].linkUrl+'" target="_self"><img alt="" src="'+ _uploadImageUrl + image[i].itemVal +'"></a>\n';
+			}else{
+				html += '                    	<a href="'+image[i].linkUrl+'" target="_blank"><img alt="" src="'+ _uploadImageUrl + image[i].itemVal +'"></a>\n';
+			}
+			
+			html += '                	</div>\n';
 		}
+		html += '            </div>\n';
+		html += '        </div>\n';
+		html += '        <div class="swiper-button-prev"></div>\n';
+		html += '        <div class="swiper-button-next"></div>\n';
+		html += '        <div class="swiper-pagination"></div>\n';
+		html += '    </div>\n';
+		html += '</div>\n';
 		
-		html += '                	</div>\n';
+		$("#G082_30").append(html);
 	}
-	html += '            </div>\n';
-	html += '        </div>\n';
-	html += '        <div class="swiper-button-prev"></div>\n';
-	html += '        <div class="swiper-button-next"></div>\n';
-	html += '        <div class="swiper-pagination"></div>\n';
-	html += '    </div>\n';
-	html += '</div>\n';
-	
-	
-	$("#G082_30").append(html);
 }
 
 if(goods1.length>0){
@@ -502,7 +521,6 @@ if(goods1.length>0){
 		if(template[j].tmplType == 'G082_50'){
 			array.push(template[j].planContSq);
 		}
-		
 	}	
 	
 	for (var i = 0; i < template.length; i++) {
@@ -529,6 +547,11 @@ if(goods1.length>0){
 			html += '        <ul>\n';
 		$.each(goods1, function(idx, item)  {
 			if (item.planContSq == template[i].planContSq) {
+				if (item.goodsCd == null && item.goodsCd == '') {
+					$("#G082_50" +array[0]).hide();
+				}else{
+					$("#G082_50" +array[0]).show();
+				}
 				html += '            <li>\n';
 				html += '                <div class="dp_listItems">\n';
 				html += '                    <div class="dp_listItems_img">\n';
@@ -599,6 +622,11 @@ if(goods2.length>0){
 			html += '            <div class="swiper-wrapper">\n';
 			$.each(goods2, function(idx, item) {
 				if (item.planContSq == template[i].planContSq) {
+					if (item.goodsCd == null && item.goodsCd == '') {
+						$("#G082_51" +array[0]).hide();
+					}else{
+						$("#G082_51" +array[0]).show();
+					}
 					html += '                <div class="swiper-slide">\n';
 					html += '                    <div class="item_prod">\n';
 					html += '                        <div class="item_state">\n';
@@ -671,6 +699,11 @@ if(goods4.length>0){
 			html += '            <div class="swiper-wrapper">\n';
 			$.each(goods4, function(idx, item) {
 				if (item.planContSq == template[i].planContSq) {
+					if (item.goodsCd == null && item.goodsCd == '') {
+						$("#G082_52" +array[0]).hide();
+					}else{
+						$("#G082_52" +array[0]).show();
+					}
 					html += '                <div class="swiper-slide">\n';
 					html += '                    <div class="item_prod">\n';
 					html += '                        <div class="item_state">\n';
@@ -711,12 +744,13 @@ if(goods4.length>0){
 	}
 }
 
-if(coupon.length>0){
+if(coupon.length>0 || (couponContent[0].title != '' && couponContent[0].title != null) || (couponContent[0].cpnNote0 != '' && couponContent[0].cpnNote0 != null)){
+	$("#G082_20").show();
 	var html = '';
 	 
 	html += '<div class="cont_head">\n';
 	html += '	<div>\n';
-	html += '		<h4>'+coupon[0].title+'</h4>\n';
+	html += '		<h4>'+couponContent[0].title+'</h4>\n';
 	html += '	</div>\n';
 	html += '</div>\n';
 	html += '<div class="cont_body">\n';
@@ -753,7 +787,7 @@ if(coupon.length>0){
 	html += '		</ul>\n';
 	html += '	</div>\n';
 	html += '</div>\n';
-	if(coupon[0].cpnNote0 != null && coupon[0].cpnNote0 != ''){
+	if(couponContent[0].cpnNote0 != null && couponContent[0].cpnNote0 != ''){
 		html += '<div class="content dp_announce line">\n                                                 ';
 		html += '    <div class="cont_head">\n                                                       ';
 		html += '        <div>\n                                                                     ';
@@ -768,25 +802,25 @@ if(coupon.length>0){
 		html += '            </div>\n                                                                ';
 		html += '            <div class="announce_list">\n                                           ';
 		html += '               <ul>\n';
-		html += '                  <li>' + coupon[0].cpnNote0 +'</li>\n';
-		if(coupon[0].cpnNote1 != null && coupon[0].cpnNote1 != '')
-			html += '                  <li>' + coupon[0].cpnNote1 +'</li>\n';
-		if(coupon[0].cpnNote2 != null && coupon[0].cpnNote2 != '')
-			html += '                  <li>' + coupon[0].cpnNote2 +'</li>\n';
-		if(coupon[0].cpnNote3 != null && coupon[0].cpnNote3 != '')
-			html += '                  <li>' + coupon[0].cpnNote3 +'</li>\n';	
-		if(coupon[0].cpnNote4 != null && coupon[0].cpnNote4 != '')
-			html += '                  <li>' + coupon[0].cpnNote4 +'</li>\n';
-		if(coupon[0].cpnNote5 != null && coupon[0].cpnNote5 != '')
-			html += '                  <li>' + coupon[0].cpnNote5 +'</li>\n';
-		if(coupon[0].cpnNote6 != null && coupon[0].cpnNote6 != '')
-			html += '                  <li>' + coupon[0].cpnNote6 +'</li>\n';
-		if(coupon[0].cpnNote7 != null && coupon[0].cpnNote7 != '')
-			html += '                  <li>' + coupon[0].cpnNote7 +'</li>\n';
-		if(coupon[0].cpnNote8 != null && coupon[0].cpnNote8 != '')
-			html += '                  <li>' + coupon[0].cpnNote8 +'</li>\n';
-		if(coupon[0].cpnNote9 != null && coupon[0].cpnNote9 != '')
-			html += '                  <li>' + coupon[0].cpnNote9 +'</li>\n';
+		html += '                  <li>' + couponContent[0].cpnNote0 +'</li>\n';
+		if(couponContent[0].cpnNote1 != null && couponContent[0].cpnNote1 != '')
+			html += '                  <li>' + couponContent[0].cpnNote1 +'</li>\n';
+		if(couponContent[0].cpnNote2 != null && couponContent[0].cpnNote2 != '')
+			html += '                  <li>' + couponContent[0].cpnNote2 +'</li>\n';
+		if(couponContent[0].cpnNote3 != null && couponContent[0].cpnNote3 != '')
+			html += '                  <li>' + couponContent[0].cpnNote3 +'</li>\n';	
+		if(couponContent[0].cpnNote4 != null && couponContent[0].cpnNote4 != '')
+			html += '                  <li>' + couponContent[0].cpnNote4 +'</li>\n';
+		if(couponContent[0].cpnNote5 != null && couponContent[0].cpnNote5 != '')
+			html += '                  <li>' + couponContent[0].cpnNote5 +'</li>\n';
+		if(couponContent[0].cpnNote6 != null && couponContent[0].cpnNote6 != '')
+			html += '                  <li>' + couponContent[0].cpnNote6 +'</li>\n';
+		if(couponContent[0].cpnNote7 != null && couponContent[0].cpnNote7 != '')
+			html += '                  <li>' + couponContent[0].cpnNote7 +'</li>\n';
+		if(couponContent[0].cpnNote8 != null && couponContent[0].cpnNote8 != '')
+			html += '                  <li>' + couponContent[0].cpnNote8 +'</li>\n';
+		if(couponContent[0].cpnNote9 != null && couponContent[0].cpnNote9 != '')
+			html += '                  <li>' + couponContent[0].cpnNote9 +'</li>\n';
 		html += '               </ul>\n';
 		html += '            </div>                                                                '; 
 		html += '        </div>                                                                    ';