Browse Source

Merge branch 'sowon' into develop

sowon4187 5 years ago
parent
commit
b513a2c4f2

+ 65 - 41
src/main/java/com/style24/front/biz/web/TsfPlanningController.java

@@ -421,58 +421,82 @@ public class TsfPlanningController extends TsfBaseController {
 	 * @author sowon
 	 * @since 2021. 4. 2
 	 */
-	@PostMapping("/event/poll/form")
+	@GetMapping("/event/poll/form")
 	public ModelAndView planningEventPollSave(Plan plan) {
 		ModelAndView mav = new ModelAndView();
 		Poll poll = new Poll();
 		plan.setSiteCd(TscConstants.Site.STYLE24.value());
+		plan.setCustNo(TsfSession.getInfo().getCustNo());
 		plan.setFrontGb(TsfSession.getFrontGb());
-		poll.setCustNo(TsfSession.getInfo().getCustNo());
+		poll = planningService.getPollQuestionInfo(plan);                 
+		String partYn = poll.getDupPartiYn();                             
+		String comYn = poll.getFstComYn();                                
+		int partiCnt = poll.getPartiCnt();   
+		// 중복참여가 아닌경우                                                     
+		if(partYn.equals("N")) {                                          
+			int count = planningService.getCustAnswerCount(plan);
+			if (count>0) {                                                
+				mav.addObject("inaccessibleMsg", "이미 응모하셨습니다.");
+				mav.setViewName(super.getDeviceViewName("error/Inaccess"));
+				return mav;
+			}                                                             
+		}                                                                 
+		if (comYn.equals("Y")) {                                     
+			int count = planningService.getCustAnswerPartiCount(poll);   
+			if (count>=partiCnt) {                                        
+				mav.addObject("inaccessibleMsg", "선착순 응모가 마감되었습니다.");
+				mav.setViewName(super.getDeviceViewName("error/Inaccess"));
+				return mav;                                 
+			}                                                             
+		}                                                                 
+		
 		mav.addObject("pollInfo", planningService.getPollQuestionInfo(plan));
 		mav.addObject("pollList", planningService.getPollQuestionList(plan));
 		mav.setViewName(super.getDeviceViewName("planning/PlanningEventPollForm"));
 		return mav;
 	}
 	
-	/**
-	 * 이벤트 설문조사 접근확인
-	 * @param 
-	 * @return
-	 * @author sowon
-	 * @since 2021. 4. 3
-	 */
-	@PostMapping("/event/poll/access")
-	@ResponseBody
-	public GagaMap planningEventPollAccess(@RequestBody Plan plan) {
-		
-		GagaMap result = new GagaMap();
-		Poll poll = new Poll();
-		plan.setSiteCd(TscConstants.Site.STYLE24.value());
-		plan.setFrontGb(TsfSession.getFrontGb());
-		plan.setCustNo(TsfSession.getInfo().getCustNo());
-		
-		poll = planningService.getPollQuestionInfo(plan);
-		String partYn = poll.getDupPartiYn(); 
-		String comYn = poll.getFstComYn();
-		int partiCnt = poll.getPartiCnt();
-		// 중복참여가 아닌경우
-		if(partYn.equals("N")) {
-			int count = planningService.getCustAnswerCount(plan);
-			if (count>0) {
-				result.set("msg","이미 응모하셨습니다.");
-				result.set("status","1");
-			}
-		}
-		else if (comYn.equals("Y")) {
-			int count = planningService.getCustAnswerPartiCount(poll);
-			if (count>=partiCnt) {
-				result.set("msg","선착순 응모가 마감되었습니다.");
-				result.set("status","2");
-			}
-			
-		}
-		return result;
-	}
+//	/**
+//	 * 이벤트 설문조사 접근확인
+//	 * @param 
+//	 * @return
+//	 * @author sowon
+//	 * @since 2021. 4. 3
+//	 */
+//	@PostMapping("/event/poll/access")
+//	@ResponseBody
+//	public GagaMap planningEventPollAccess(@RequestBody Plan plan) {
+//		
+//		GagaMap result = new GagaMap();
+//		Poll poll = new Poll();
+//		plan.setSiteCd(TscConstants.Site.STYLE24.value());
+//		plan.setFrontGb(TsfSession.getFrontGb());
+//		plan.setCustNo(TsfSession.getInfo().getCustNo());
+//		
+//		poll = planningService.getPollQuestionInfo(plan);
+//		String partYn = poll.getDupPartiYn(); 
+//		String comYn = poll.getFstComYn();
+//		int partiCnt = poll.getPartiCnt();
+//		// 중복참여가 아닌경우
+//		if(partYn.equals("N")) {
+//			int count = planningService.getCustAnswerCount(plan);
+//			if (count>0) {
+//				result.set("msg","이미 응모하셨습니다.");
+//				result.set("status","1");
+//			}
+//		}
+//		else if (comYn.equals("Y")) {
+//			int count = planningService.getCustAnswerPartiCount(poll);
+//			if (count>=partiCnt) {
+//				result.set("msg","선착순 응모가 마감되었습니다.");
+//				result.set("status","2");
+//			}
+//			
+//		}
+//		return result;
+//	}
+	
+
 	
 	/**
 	 * 이벤트 설문조사 저장

+ 7 - 3
src/main/java/com/style24/persistence/mybatis/shop/TsfPlanning.xml

@@ -1179,10 +1179,14 @@
 	<!-- 설문자 선착순 카운트 -->
 	<select id="getCustAnswerPartiCount" parameterType="Poll" resultType="int">
 		/* TsfPlanning.getCustAnswerPartiCount */
-		SELECT DISTINCT count(*) AS COUNT
+		SELECT DISTINCT (COUNT(*)) AS COUNT
 		FROM TB_POLL_ANSWER A INNER JOIN TB_POLL_QUESTION B ON A.POLL_QSQ = B.POLL_QSQ 
-		WHERE B.POLL_SQ = #{pollSq}
-		GROUP BY b.POLL_QSQ, B.POLL_SQ			
+		WHERE B.POLL_SQ =  #{pollSq}
+		GROUP BY b.POLL_QSQ, B.POLL_SQ
+		UNION 
+		SELECT 0 AS COUNT
+		FROM DUAL
+		ORDER BY COUNT DESC LIMIT 1		
 	</select>
 	
 	<!-- 총알배송 배송지 목록  -->

+ 8 - 8
src/main/java/com/style24/persistence/mybatis/shop/TsfPoint.xml

@@ -40,8 +40,8 @@
 		SELECT IFNULL(SUM(RM_PNT_AMT),0) AS EXPECTED_EXPIRE_PNT_AMT
 		FROM   TB_CUST_POINT
 		WHERE  CUST_NO = #{custNo}
-		AND    EXP_CMP_DT > NOW()
-		AND    EXP_BE_DT <![CDATA[<]]> DATE_ADD(NOW(),INTERVAL 31 DAY)
+		AND    EXP_BE_DT > NOW()
+		AND    EXP_BE_DT <![CDATA[<]]> DATE_ADD(NOW(),INTERVAL 30 DAY)
 	</select>
 	
 	<!-- 적립내역 조회-->
@@ -49,7 +49,7 @@
 	/* TsfPoint.getAccumulatePointList */
 		SELECT CASE TCHP.OCCUR_GB
 		            WHEN 'G069_12' THEN '상품 구매'
-		            WHEN 'G069_20' THEN '리뷰'
+		            WHEN 'G069_20' THEN '상품평'
 		            WHEN 'G069_30' THEN '이벤트'
 		            WHEN 'G069_31' THEN '회원가입'
 		            WHEN 'G069_32' THEN '생일축하'
@@ -89,9 +89,9 @@
 		LEFT JOIN TB_GOODS TG
 		ON (TG.GOODS_CD = TOD.GOODS_CD OR TG.GOODS_CD = TR.GOODS_CD)
 		WHERE TCHP.CUST_NO = #{custNo}
-		AND CASE WHEN NULLIF(TCHP.REVIEW_SQ, 0) IS NULL THEN 1
+		<!-- AND CASE WHEN NULLIF(TCHP.REVIEW_SQ, 0) IS NULL THEN 1
 		         WHEN NULLIF(TCHP.REVIEW_SQ, 0) IS NOT NULL AND NULLIF(TR.REVIEW_SQ, 0) IS NOT NULL THEN 1 /* 상품평조건 */
-		    END > 0
+		    END > 0 -->
 		AND TCHP.OCCUR_GB IN ('G069_12','G069_20','G069_30','G069_31','G069_32','G069_35','G069_36','G069_37','G069_90')
 		AND TCHP.PNT_UPLOAD_STAT = 'G070_30'														/* 공통코드 : 반영완료 */
 		AND TCHP.PNT_AMT <![CDATA[>]]> 0
@@ -144,7 +144,7 @@
 		CASE   TCHP.OCCUR_GB
 		WHEN   'G069_12' THEN '상품 구매'
 		WHEN   'G069_13' THEN '구매 취소'
-		WHEN   'G069_20' THEN '리뷰'	
+		WHEN   'G069_20' THEN '상품평'	
 		WHEN   'G069_30' THEN '이벤트'
 		WHEN   'G069_31' THEN '회원가입'
 		WHEN   'G069_32' THEN '생일축하'
@@ -193,10 +193,10 @@
 		LEFT JOIN TB_GOODS TG 
 		ON (TG.GOODS_CD = TOD.GOODS_CD OR TG.GOODS_CD = TR.GOODS_CD)
 		WHERE TCHP.CUST_NO = #{custNo}
-		AND CASE
+		<!-- AND CASE
 			WHEN NULLIF(TCHP.REVIEW_SQ, 0) IS NULL THEN 1
 			WHEN NULLIF(TCHP.REVIEW_SQ, 0) IS NOT NULL AND NULLIF(TR.REVIEW_SQ, 0) IS NOT NULL THEN 1
-		END <![CDATA[>]]> 0		
+		END <![CDATA[>]]> 0		 -->
 		AND TCHP.OCCUR_GB IN  ('G069_12','G069_13','G069_20','G069_30','G069_31','G069_32','G069_35','G069_36','G069_37','G069_40','G069_42','G069_90','G069_99')
 		AND TCHP.PNT_UPLOAD_STAT = 'G070_30'
 		AND DATE_FORMAT(TCHP.UPD_DT,'%Y%m') = #{searchDt}

+ 2 - 2
src/main/webapp/WEB-INF/views/web/mypage/MypageReviewFormWeb.html

@@ -163,7 +163,7 @@
 				html += '			<div class="order_desc">                                                                                      ';
 				html += '				<div class="goods_box">                                                                                   ';
 				html += '					<div class="gd_item">	                                                                              ';
-				html += '						<a href="">                                                                                       ';
+				html += '						<a href="javascript:void(0)" onclick="cfnGoToGoodsDetail(\'' + item.goodsCd + '\')">                                                                                       ';
 				html += '							<span class="thumb">                                                                          ';
 				html += '								<img src="' + imageUrl + '/' + item.sysImgNm + '"  width="100%" alt="">  ';
 				html += '							</span>                                                                                       ';
@@ -227,7 +227,7 @@
 				html+='				<div class="order_desc">';
 				html+='					<div class="goods_box">';
 				html+='						<div class="gd_item">	';
-				html+='							<a href="">';
+				html+='							<a href="javascript:void(0)" onclick="cfnGoToGoodsDetail(\'' + item.goodsCd + '\')" >';
 				html+='								<span class="thumb">';
 				html+='									<img src="' + imageUrl + '/' + item.sysImgNm + '" width="100%" alt="">';
 				html+='								</span>';

+ 4 - 29
src/main/webapp/WEB-INF/views/web/planning/PlanningDetailFormWeb.html

@@ -243,9 +243,9 @@
 			</div>
 		</div>
 </div>
-<form id="pollListForm" name="pollListForm" th:action="@{'/planning/event/poll/form'}" th:method="post">
+<!-- <form id="pollListForm" name="pollListForm" th:action="@{'/planning/event/poll/form'}" th:method="post">
 	<input type="hidden" name="planSq" th:value="${planInfo.planSq}"/>
-</form>
+</form> -->
 <form id="searchForm" name="searchForm" th:action="@{/planning/reply/list}" th:method="post">
 	<input type="hidden" name="pageNo" value="1" />
 	<input type="hidden" name="planSq" th:value="${planInfo.planSq}" />
@@ -736,34 +736,8 @@ var fnJoinConfirm = function () {
 		mcxDialog.alert("로그인 후 참여 가능합니다.");
 		return false;
 	}
-	
-	var data = {planSq : planSq};
-
-
-	var jsonData = JSON.stringify(data);
+	cfnGoToPollDetail(planSq);
 
-	/* gagajf.ajaxJsonSubmit('/planning/event/poll/access', jsonData , function () {
-		document.pollListForm.submit();
-	});
-	 */
-	$.ajax({
-		type : "POST",
-		data : jsonData,
-		url : '/planning/event/poll/access',
-		contentType : 'application/json',
-		dataType : 'json',
-		success : function(result) {
-			if (result.status == "1") {
-				mcxDialog.alert(result.msg);
-				return;
-			}
-			if (result.status == "2") {
-				mcxDialog.alert(result.msg);
-				return;
-			}
-			document.pollListForm.submit();
-		}
-	})
 }
 
 // 댓글 입력 확인
@@ -907,6 +881,7 @@ var fnReplySave = function() {
 	if(yokList.indexOf(content)>=0){
 		mcxDialog.alert("입력 불가한 내용을 포함하고 있습니다.");
 		$('#replyText').val('');
+		$('#cmt_cnt').text(0);
 		return;
 	}
 	

+ 2 - 2
src/main/webapp/WEB-INF/views/web/planning/PlanningEventAttendFormWeb.html

@@ -77,7 +77,7 @@
 								<div class="my_attend_day">
 									<p>나의 출석 일수는?</p>
 									<span class="day">
-										<span id="day"></span>일
+										<span id="day">0</span>일
 									</span>
 								</div>
 								<div class="tbl">
@@ -172,7 +172,7 @@
                  	</div>
 				</div>
 			</div>
-			<div class="content dp_announce">
+			<div class="content dp_announce" th:if="${fsrcInfoTop != null}">
 				<div class="cont_head">
 					<div>
 						<h4>유의사항</h4>

+ 16 - 0
src/main/webapp/ux/style24_link.js

@@ -1139,6 +1139,22 @@ var cfnGoToPlanDetail = function (planSq , brandGroupNo) {
     cfnGoToPage(_PAGE_PLANNING_DETAIL + params);
 }
 
+/**
+ * @type   : function
+ * @access : public
+ * @desc   : 폴상세로 이동
+ * <pre>
+ *        cfnGoToPollDetail(251);
+ * </pre>
+ * @param  : planSq - 기획전 번호. 필수
+ * @since  : 2021/03/29
+ * @author : sowon
+ */
+var cfnGoToPollDetail = function (planSq) {
+	var params = '?planSq='+planSq;
+    cfnGoToPage(_PAGE_EVENT_POLL + params);
+}
+
 /**
  * @type   : function
  * @access : public