Quellcode durchsuchen

Merge branch 'sowon' into develop

sowon4187 vor 5 Jahren
Ursprung
Commit
17b68f58ef

+ 4 - 1
src/main/java/com/style24/front/biz/service/TsfPlanningService.java

@@ -227,7 +227,10 @@ public class TsfPlanningService {
 	 * @since 2021. 3. 22
 	 */
 	public Collection<Plan> getPlanCouponInfo(Coupon coupon) {
-		coupon.setCustNo(TsfSession.getInfo().getCustNo());
+		if (TsfSession.isLogin()) {
+			coupon.setCustNo(TsfSession.getInfo().getCustNo());
+		}
+		
 		return planningDao.getPlanCouponInfo(coupon);
 	}
 

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

@@ -589,8 +589,10 @@
 	<select id="getPlanCouponInfo" parameterType="Coupon" resultType="Coupon">
 		/* TsfPlanning.templateDispOrdInfo*/
 		SELECT F.*
+		<if test="planSq != null and planSq != ''">
 		      ,(CASE F.CPN_ID WHEN (SELECT CPN_ID FROM TB_CUST_COUPON C WHERE C.CPN_ID = F.CPN_ID AND CUST_NO = #{custNo})THEN '받기완료'
 		        ELSE '쿠폰받기' END ) AS COUPON_STAT
+		</if>
 		FROM
 		(
 			SELECT  PC.PLAN_CONT_SQ 
@@ -637,7 +639,9 @@
 			FROM TB_PLAN_CONTENTS PC INNER JOIN TB_PLAN_CONTENTS_ITEM PCI ON PC.PLAN_CONT_SQ = PCI.PLAN_CONT_SQ 
 			  						 INNER JOIN TB_COUPON TC ON PCI.ITEM_VAL = TC.CPN_ID 
 			WHERE 1=1 
+			<if test="planSq != null and planSq != ''">
 				AND PC.PLAN_SQ = #{planSq}
+			</if>
 				AND PC.TMPL_TYPE = 'G082_20'
 				AND PC.DISP_YN ='Y'
 				AND NOW() BETWEEN TC.AVAIL_STDT AND TC.AVAIL_EDDT

+ 2 - 2
src/main/webapp/WEB-INF/views/web/common/layout/DefaultLayoutWeb.html

@@ -15,6 +15,8 @@
 	
 <th:block th:replace="~{web/common/fragments/VariablesWeb :: variables}"></th:block>
 
+<th:block th:replace="~{web/common/fragments/ScriptsWeb :: scripts}"></th:block>
+
 <!-- GNB -->
 <header id="header" th:replace="~{web/common/fragments/GnbWeb :: gnb}"></header>
 <!--// GNB -->
@@ -26,8 +28,6 @@
 <!-- Footer -->
 <footer id="footer" th:replace="~{web/common/fragments/FooterWeb :: footer}"></footer>
 
-<th:block th:replace="~{web/common/fragments/ScriptsWeb :: scripts}"></th:block>
-
 <script th:inline="javascript">
 /*<![CDATA[*/
 	$(document).ready(function() {

+ 22 - 21
src/main/webapp/WEB-INF/views/web/planning/PlanningDetailFormWeb.html

@@ -294,7 +294,7 @@ if(review != null || review != ''){
 		html += '									<img alt="" class="vLHTC pd_img" src="'+ _imgUrl +'/'+item.sysImgNm +'">';
 		html += '								</div>';
 		html += '								<div class="itemName">'+item.goodsNm+'</div>';
-		html += '								<p class="itemPrice">'+comma(item.currPrice)+'원</p>';
+		html += '								<p class="itemPrice">'+item.currPrice.addComma()+'원</p>';
 		html += '							</a>';
 		html += '						</div>';
 		html += '					</div>';
@@ -328,26 +328,34 @@ if(coupon != null || coupon != ''){
 		if (item.dcWay == '할인율') {
 			html += '							<span> <span><em>'+item.dcPval+'%</em></span>';
 		}else{
-			html += '							<span><em>'+comma(item.dcPval)+'</em>원</span>'; 
+			html += '							<span><em>'+item.dcPval.addComma()+'</em>원</span>'; 
 		}
 		html += '						</p>';
-		html += '						<p class="cp_condition">'+comma(item.buyLimitAmt)+'원 이상 구매 시 최대 ' +comma(item.maxDcAmt)+'원 할인';
+		html += '						<p class="cp_condition">'+item.buyLimitAmt.addComma()+'원 이상 구매 시 최대 ' +item.maxDcAmt.addComma()+'원 할인';
+
 		if (item.custPubLimitQty != 0) {
 			html += '								<span>1인 최대 '+item.custPubLimitQty+'장</span>';	
 		}
 		
 		html += '						</p>';
 		html += '					</div>';
-		if (item.couponStat == '쿠폰받기') {
+		if(item.coupontStat != null){
+			if (item.couponStat == '쿠폰받기') {
+				html += '					<button type="button" id="coupon_" class="btn btn_dark btn_block btn_coupon_down" onclick="fnPlanCouponDown('+item.cpnId+')">';  /* btn_coupon_done */
+				html += '						<span>쿠폰받기</span>';								/* 받기완료  */
+				html += '					</button>';			
+			}else{
+				html += '					<button type="button"';
+				html += '						class="btn btn_dark btn_block btn_coupon_done" disabled>';  
+				html += '						<span>받기완료</span>';								
+				html += '					</button>';			
+			}
+		}else{
 			html += '					<button type="button" id="coupon_" class="btn btn_dark btn_block btn_coupon_down" onclick="fnPlanCouponDown('+item.cpnId+')">';  /* btn_coupon_done */
 			html += '						<span>쿠폰받기</span>';								/* 받기완료  */
-			html += '					</button>';			
-		}else{
-			html += '					<button type="button"';
-			html += '						class="btn btn_dark btn_block btn_coupon_done" disabled>';  
-			html += '						<span>받기완료</span>';								
-			html += '					</button>';			
+			html += '					</button>';		
 		}
+		
 		html += '				</div>';
 		html += '				<button type="button" class="btn_underline"	id="btn_cpinfo_pop" onclick="useInfoCoupon('+item.cpnId+')">';
 		html += '					<span>사용안내</span>';
@@ -437,9 +445,9 @@ if(goods1 != null || goods1 != ''){
 					html += '                        <div class="dp_listItems_brand">'+item.brandKnm+'</div>';
 					html += '                        <div class="dp_listItems_name">'+item.goodsNm+'</div>';
 					html += '                        <div class="dp_listItems_price">';
-					html += '                            <span class="price">'+comma(item.currPrice)+'</span>';
+					html += '                            <span class="price">'+item.currPrice.addComma()+'</span>';
 					if (item.currPrice != item.listPrice) {
-						html += '                            <del>'+comma(item.listPrice)+'</del>';
+						html += '                            <del>'+item.listPrice.addComma()+'</del>';
 						html += '                            <span class="percent">'+Math.floor(item.dcRate)+'%</span>';
 					}
 					
@@ -504,9 +512,9 @@ if(goods2 != null || goods2 != ''){
 					html+='                                </div>';
 					html+='                                <p class="itemBrand">'+item.brandKnm+'</p>';
 					html+='                                <div class="itemName">'+item.goodsNm+'</div>';
-					html+='                               <p class="itemPrice">'+comma(item.currPrice);
+					html+='                               <p class="itemPrice">'+item.currPrice.addComma();
 					if (item.currPrice != item.listPrice) {
-						html+='                                    <span class="itemPrice_original">'+comma(item.listPrice)+'</span>';
+						html+='                                    <span class="itemPrice_original">'+item.listPrice.addComma()+'</span>';
 						html+='                                    <span class=" itemPercent">'+Math.floor(item.dcRate)+'%</span>';
 					}
 					
@@ -573,13 +581,6 @@ var useInfoCoupon = function (id) {
 		// 화면 전환 필요		
 	}
 
-	
-//세번째 자리 콤마찍기 (숫자만 포함, 소수점자리 구분)
-function comma(num){
-	return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
-}
-
-
 </script>
 		<script type="text/javascript">
 	    // 컨텐츠 호출