sowon4187 5 лет назад
Родитель
Сommit
da7349ae1f

+ 33 - 39
src/main/java/com/style24/front/biz/dao/TsfPlanningDao.java

@@ -1,10 +1,12 @@
 package com.style24.front.biz.dao;
 
 import java.util.Collection;
+import java.util.Map;
 
 import com.style24.core.support.annotation.ShopDs;
 import com.style24.persistence.domain.Coupon;
 import com.style24.persistence.domain.Plan;
+import com.style24.persistence.domain.Poll;
 import com.style24.persistence.domain.Review;
 
 /**
@@ -98,45 +100,6 @@ public interface TsfPlanningDao {
 	 */
 	String getAfLinkAccessibleYn(Plan plan);
 
-//	/**
-//	 * 기획전 목록 + 상품
-//	 *
-//	 * @param
-//	 * @return
-//	 * @author bin2107
-//	 * @since 2021. 3. 26
-//	 */
-//	Collection<Plan> getPlanningList(Plan plan);
-//
-//	/**
-//	 * 기획전 목록 + 상품
-//	 *
-//	 * @param
-//	 * @return
-//	 * @author bin2107
-//	 * @since 2021. 3. 26
-//	 */
-//	Collection<Plan> getPlanningGoodsList(Plan plan);
-
-//	/**
-//	 * 기획전 목록
-//	 * @param
-//	 * @return
-//	 * @author sowon
-//	 * @date 2021. 3. 8
-//	 */
-//	Collection<Plan> getPlanList(Plan plan);
-//
-//	/**
-//	 * 기획전 상품 목록
-//	 *
-//	 * @param
-//	 * @return
-//	 * @author sowon
-//	 * @date 2021. 3. 8
-//	 */
-//	Collection<Plan> getPlanGoodsList(Plan plan);
-
 	/**
 	 * 기획전 접근 가능 등급 고객
 	 *
@@ -267,4 +230,35 @@ public interface TsfPlanningDao {
 	 * @date 2021. 3. 30
 	 */
 	Plan getShotDeliveryHtml(Plan plan);
+	
+	/**
+	 * 설문조사 정보
+	 *
+	 * @param plan
+	 * @return poll
+	 * @author sowon
+	 * @date 2021. 4. 3
+	 */
+	Poll getPollQuestionInfo(Plan plan);
+	
+	/**
+	 * 설문조사 질문내용
+	 *
+	 * @param plan
+	 * @return poll
+	 * @author sowon
+	 * @date 2021. 4. 3
+	 */
+	Collection<Poll> getPollQuestionList(Plan plan);
+	
+	/**
+	 * 설문조사 등록
+	 *
+	 * @param poll
+	 * @return 
+	 * @author sowon
+	 * @date 2021. 4. 3
+	 */
+	void savePollCustAnswer(Map<Object,Object> param);
+	
 }

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

@@ -1,6 +1,8 @@
 package com.style24.front.biz.service;
 
 import java.util.Collection;
+import java.util.Iterator;
+import java.util.Map;
 
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -12,6 +14,7 @@ import com.style24.front.biz.dao.TsfPlanningDao;
 import com.style24.front.support.security.session.TsfSession;
 import com.style24.persistence.domain.Coupon;
 import com.style24.persistence.domain.Plan;
+import com.style24.persistence.domain.Poll;
 import com.style24.persistence.domain.Review;
 
 import lombok.extern.slf4j.Slf4j;
@@ -303,5 +306,53 @@ public class TsfPlanningService {
 	public Plan getShotDeliveryHtml(Plan plan) {
 		return planningDao.getShotDeliveryHtml(plan);
 	}
+	
+	/**
+	 * 설문조사 정보
+	 *
+	 * @param plan
+	 * @return poll
+	 * @author sowon
+	 * @date 2021. 4. 3
+	 */
+	public Poll getPollQuestionInfo(Plan plan) {
+		return planningDao.getPollQuestionInfo(plan);
+	}
+	
+	/**
+	 * 설문조사 질문내용
+	 *
+	 * @param plan
+	 * @return poll
+	 * @author sowon
+	 * @date 2021. 4. 3
+	 */
+	public Collection<Poll> getPollQuestionList(Plan plan) {
+		return planningDao.getPollQuestionList(plan);
+	}
+	
+	/**
+	 * 설문조사 등록
+	 *
+	 * @param poll
+	 * @return 
+	 * @author sowon
+	 * @date 2021. 4. 3
+	 */
+	public void savePollCustAnswer(Map<Object, Object> param) {
+		Poll poll = new Poll();
+		poll.setCustNo(TsfSession.getInfo().getCustNo());
+		 Iterator<Object> mapIter = param.keySet().iterator();
+		 
+	        while(mapIter.hasNext()){
+	 
+	            Object key = mapIter.next();
+	            String value = (String) param.get(key);
+	 
+	            System.out.println(key+" : "+value);
+	 
+	        }
+		
+	}
 
 }

+ 28 - 4
src/main/java/com/style24/front/biz/web/TsfPlanningController.java

@@ -1,6 +1,7 @@
 package com.style24.front.biz.web;
 
 import java.util.Collection;
+import java.util.Map;
 
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -25,10 +26,12 @@ import com.style24.front.support.security.session.TsfSession;
 import com.style24.persistence.domain.Coupon;
 import com.style24.persistence.domain.Customer;
 import com.style24.persistence.domain.Plan;
+import com.style24.persistence.domain.Poll;
 import com.style24.persistence.domain.Review;
 
 import lombok.extern.slf4j.Slf4j;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.gagaframework.web.parameter.GagaMap;
 import com.gagaframework.web.rest.server.GagaResponseStatus;
 
@@ -323,13 +326,34 @@ public class TsfPlanningController extends TsfBaseController {
 	 * @author sowon
 	 * @since 2021. 4. 2
 	 */
-	@GetMapping("/event/poll/form")
-	public ModelAndView planningEventPollForm() {
-		ModelAndView mav = new ModelAndView(super.getDeviceViewName("planning/PlanningEventPollForm"));
-
+	@PostMapping("/event/poll/form")
+	public ModelAndView planningEventPollSave(Plan plan) {
+		ModelAndView mav = new ModelAndView();
+		plan.setSiteCd(TscConstants.Site.STYLE24.value());
+		plan.setFrontGb(TsfSession.getFrontGb());
+		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. 2
+	 */
+	@PostMapping("/event/poll/save")
+	@ResponseBody
+	public GagaMap planningEventPollForm(@RequestBody Poll poll) {
+		GagaMap result = new GagaMap();
+		System.out.println("==============" + poll);
+		//planningService.savePollCustAnswer(map);
+		//result.set("giftcardOwnList", giftcardService.getGiftcardOwnList(giftcard));
+		return result;
+	}
+	
 	
 	/**
 	 * 총알배송 메인 화면

+ 85 - 0
src/main/java/com/style24/persistence/domain/Poll.java

@@ -0,0 +1,85 @@
+package com.style24.persistence.domain;
+
+
+import java.util.List;
+import java.util.Map;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.style24.persistence.TscBaseDomain;
+
+import lombok.Data;
+
+/**
+ * poll관리 Domain
+ *
+ * @author sowon
+ * @since 2021. 02. 19
+ */
+
+@SuppressWarnings("serial")
+@Data
+public class Poll extends TscBaseDomain{
+	
+	// poll
+	private Integer pollSq;			// 투표일련번호
+	private Integer pollSqTemp;		// 신규투표일련번호
+	private String siteCd;			// 사이트 코드
+	private String pollTitle;		// 투표제목
+	private String pollContent;		// 투표내용
+	private String pollStdt;		// 투표시작일시
+	private String pollEddt;		// 투표종료일시
+	private String delYn;			// 삭제여부
+	private String dupPartiYn;		// 중복참여 여부
+	private String fstComYn;		// 선착순 여부
+    private int partiCnt;			// 선착순참여 여부
+	
+	// poll_question
+	private Integer pollQsq;		// 투표문항일련번호
+	private String pollQtitle;		// 투표문항제목
+	private String pollQtype;		// 문제유형 구분
+	private String pollQval1;		// 투표문항참고값1
+	private String pollQval2;		// 투표문항참고값2
+	private String pollQval3;		// 투표문항참고값3
+	private String pollQval4;		// 투표문항참고값4
+	private String pollQval5;		// 투표문항참고값5
+	private String pollQval6;		// 투표문항참고값6
+	private String pollQval7;		// 투표문항참고값7
+	private String pollQval8;		// 투표문항참고값8
+	private String pollQval9;		// 투표문항참고값9
+	private String pollQval10;		// 투표문항참고값10
+	private int dispOrd;		// 표시 순서
+	private String pollQtypeNm;	// 문제유형 이름
+	private String planNm;			// 이벤트명
+	//poll_answer
+	private String ansCustNo;		// 투표회원번호
+	private String dummy;			// 임시 (고객 답변)
+
+	// 검색
+	private String stDate;			// 시작일시
+	private String edDate;			// 종료일시
+
+	
+	private int voteCnt;		// 투표수
+	private int voteRate;		// 투표율
+	private int numbers;		// 투표율 구하기위한 변수선언 
+	private String name;			// 투표율 구하기위한 변수선언 
+	private String voterNm;			// 투표자명
+	private String voteDt;			// 투표일시
+	
+	private Integer custNo;			//고객번호
+	
+	
+	
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] pollQsq_10;
+    @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+    private String[] pollQsq_20; 
+    @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+    private String[] pollQsq_30; 
+    @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+    private String[] pollQsq_40;
+    @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+    private String[] pollQsqList;
+	
+
+}

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

@@ -930,4 +930,97 @@
 		  AND PF.DISP_YN ='Y'
 		  AND P.SITE_CD = #{siteCd}
 	</select>
+	
+	
+	<!-- 설문조사 정보 -->
+	<select id="getPollQuestionInfo" parameterType="Plan" resultType="Poll">
+		/* TsfPlanning.getPollQuestionList */
+		 SELECT P.PLAN_SQ 
+		      ,P.PLAN_NM 
+		      ,P.PLAN_GB 
+		      ,P.POLL_SQ 
+		      ,TP.POLL_TITLE 
+		      ,DATE_FORMAT(TP.POLL_STDT,'%Y-%m-%d') AS POLL_STDT
+		      ,DATE_FORMAT(TP.POLL_EDDT,'%Y-%m-%d') AS POLL_EDDT
+		      ,TP.DUP_PARTI_YN 
+		      ,TP.FST_COM_YN 
+		      ,TP.PARTI_CNT 
+		      ,TP.POLL_CONTENT 
+		FROM TB_PLAN P INNER JOIN TB_POLL TP ON P.POLL_SQ = TP.POLL_SQ 
+		WHERE 1=1
+		  AND P.PLAN_SQ = 18
+		  AND P.SITE_CD = #{siteCd}
+		  AND P.OPEN_YN ='Y'
+		  AND P.DEL_YN ='N'
+		  AND TP.DEL_YN = 'N'
+		  AND NOW() BETWEEN P.DISP_STDT AND P.DISP_EDDT 
+		  AND NOW() BETWEEN TP.POLL_STDT AND TP.POLL_EDDT 
+		 <if test="frontGb != null and frontGb != ''">
+		  AND    P.FRONT_GB LIKE CONCAT('%',#{frontGb},'%')
+		</if>
+	</select>
+	
+	<!-- 설문조사 질문내용 -->
+	<select id="getPollQuestionList" parameterType="Plan" resultType="Poll">
+		/* TsfPlanning.getPollQuestionList */
+		SELECT  P.PLAN_SQ 
+		      ,P.PLAN_NM 
+		      ,P.POLL_SQ 
+		      ,TP.POLL_TITLE 
+		      ,TP.POLL_STDT 
+		      ,TP.POLL_EDDT 
+		      ,TP.DUP_PARTI_YN 
+		      ,TP.FST_COM_YN 
+		      ,TP.PARTI_CNT 
+		      ,TP.POLL_CONTENT 
+		      ,PQ.POLL_QSQ 
+			  ,PQ.POLL_QTITLE 
+			  ,PQ.POLL_QTYPE 
+			  ,PQ.POLL_QVAL1 
+			  ,PQ.POLL_QVAL2
+			  ,PQ.POLL_QVAL3 
+			  ,PQ.POLL_QVAL4 
+			  ,PQ.POLL_QVAL5 
+			  ,PQ.POLL_QVAL6 
+			  ,PQ.POLL_QVAL7 
+			  ,PQ.POLL_QVAL8 
+			  ,PQ.POLL_QVAL9
+			  ,PQ.POLL_QVAL10
+		FROM TB_PLAN P INNER JOIN TB_POLL TP ON P.POLL_SQ = TP.POLL_SQ AND P.POLL_SQ = TP.POLL_SQ
+		 		       INNER JOIN TB_POLL_QUESTION PQ ON TP.POLL_SQ = PQ.POLL_SQ AND TP.POLL_SQ = PQ.POLL_SQ
+		WHERE 1=1
+		 AND P.PLAN_SQ = #{planSq}
+		 AND P.SITE_CD =  #{siteCd}
+		 AND P.OPEN_YN ='Y'
+		 AND P.DEL_YN ='N'
+		 AND PQ.DEL_YN = 'N'
+		 AND TP.DEL_YN = 'N'
+		 AND NOW() BETWEEN P.DISP_STDT AND P.DISP_EDDT 
+		 AND NOW() BETWEEN TP.POLL_STDT AND TP.POLL_EDDT
+		 <if test="frontGb != null and frontGb != ''">
+		  AND    P.FRONT_GB LIKE CONCAT('%',#{frontGb},'%')
+		</if>
+		ORDER BY PQ.POLL_QSQ 	
+	</select>
+	
+	<!-- 고객설문조사 등록 -->
+	<insert id="savePollCustAnswer" parameterType="Poll">
+		/* TsfPlanning.savePollCustAnswer */
+		INSERT INTO TB_POLL_ANSWER
+		       (POLL_QSQ
+		       , ANS_CUST_NO
+		       , POLL_QTYPE
+		       , DUMMY
+		       , REG_NO
+		       , REG_DT
+		       )
+		VALUES
+		       (#{pollQsq}
+		       , #{custNo}
+		       , #{pollQtype}
+		       , #{dummy}
+		       , #{custNo}
+		       , CURRENT_TIMESTAMP
+		       )	
+	</insert>
 </mapper>

+ 15 - 1
src/main/webapp/WEB-INF/views/web/planning/PlanningDetailFormWeb.html

@@ -199,6 +199,9 @@
             </div>
             <!-- //다른 기획전 보기 -->
         </div>
+        <form id="pollListForm" name="pollListForm" th:action="@{'/planning/event/poll/form'}" th:method="post">
+				<input type="hidden" name="planSq" th:value="${planInfo.planSq}"/>
+		</form>
 <div class="modal fade couponInfo_pop" id="couponInfoPop" tabindex="-1" role="dialog" aria-labelledby="couponInfoLabel" aria-hidden="true">
 
 </div>
@@ -613,7 +616,18 @@ var fnPlanCouponCallBack = function(result){
 	// 화면 전환 필요		
 }
 
-// 설문조사
+// 설문조사 참여 버튼 클릭
+var fnJoinConfirm = function () {
+	let planSq = plan.planSq;
+	// 로그인 확인
+	if (!cfCheckLogin()) {
+		mcxDialog.alert("로그인 후 참여 가능합니다.");
+		return false;
+	}
+	
+	
+	document.pollListForm.submit();
+}
 
 
 

+ 263 - 110
src/main/webapp/WEB-INF/views/web/planning/PlanningEventPollFormWeb.html

@@ -22,22 +22,22 @@
 	<div id="container" class="container ev">
 		<div class="breadcrumb">
 			<ul>
-				<li class="bread_home"><a href="index.html">홈</a></li>
-				<li class="bread_2depth">이벤트/혜택</li>
-				<li class="bread_2depth">스타일24 사이트 리뉴얼 설문조사 이벤트</li>
+				<li class="bread_home"><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_MAIN);">홈</a></li>
+				<li class="bread_2depth"><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_EVENT_MAIN);">이벤트/혜택</a></li>
+				<li class="bread_2depth" th:text="${pollInfo.planNm}"></li>
 			</ul>
 		</div>
 		<div class="wrap">
 			<div class="content wide survey">
 				<div class="cont_head">
 					<div>
-						<h3>스타일24 사이트 리뉴얼 설문조사 이벤트</h3>
+						<h3 th:text="${pollInfo.pollTitle}"></h3>
 						<div class="period">
-							<span>2020.12.10</span> ~ <span>2020.12.25</span>
+							<span th:text="${pollInfo.pollStdt}"></span> ~ <span th:text="${pollInfo.pollEddt}"></span>
 						</div>
-						<div class="shareSet">
+						<!-- <div class="shareSet">
                             <button class="btn_share" data-name="openShare">공유하기</button>
-                            <!-- toggle contents -->
+                            toggle contents
                             <div class="shareWrap">
                                 <div id="layerShare" class="setShare open">
                                     <span>
@@ -48,119 +48,167 @@
                                     </span>
                                 </div>
                             </div>
-                        </div>
+                        </div> -->
 					</div>
 				</div>
 				<div class="cont_body">
 					<div class="survey_wrap">
 						<div class="survey_con">
-							<form class="form_wrap">
-								<div class="survey_row">
-									<h4><span class="question">Q1.</span>스타일24 사이트에서 많이 이용하는 메뉴는 무엇인가요?</h4>
-									<div class="answer">
-										<div class="form_field">
-											<ul class="clear">
-												<li>
-													<input type="radio" name="radio" id="rdi-1" value="1"><label for="rdi-1"><span>상품 카테고리</span></label>
-												</li>
-												<li>
-													<input type="radio" name="radio" id="rdi-2" value="2"><label for="rdi-2"><span>베스트</span></label>
-												</li>
-												<li>
-													<input type="radio" name="radio" id="rdi-3" value="3"><label for="rdi-3"><span>기획전</span></label>
-												</li>
-												<li>
-													<input type="radio" name="radio" id="rdi-4" value="4"><label for="rdi-4"><span>이벤트</span></label>
-												</li>
-												<li>
-													<input type="radio" name="radio" id="rdi-6" value="6"><label for="rdi-6"><span>핫딜</span></label>
-												</li>
-												<li>
-													<input type="radio" name="radio" id="rdi-7" value="7"><label for="rdi-7"><span>브랜드 사이트</span></label>
-												</li>
-												<li>
-													<input type="radio" name="radio" id="rdi-8" value="8"><label for="rdi-8"><span>통합검색</span></label>
-												</li>
-												<li>
-													<input type="radio" name="radio" id="rdi-9" value="9"><label for="rdi-9"><span>나의 쿠폰</span></label>
-												</li>
-												<li>
-													<input type="radio" name="radio" id="rdi-10" value="10"><label for="rdi-10"><span>없음</span></label>
-												</li>
-												<li>
-													<input type="radio" name="radio" id="rdi-11" value="11" class="etc_radio"><label for="rdi-11"><span>기타</span></label>
-													<input type="text" name="" id="" class="etc_input" disabled/>
-												</li>
-											</ul>
-										</div>
-									</div>
-								</div>
-								<div class="survey_row">
-									<h4><span class="question">Q2.</span>상품을 구매할 때, 가장 많이 고려하는 점은 무엇인가요?</h4>
-									<div class="answer">
-										<div class="form_field">
-											<ul class="clear">
-												<li>
-													<input type="checkbox" id="chk-1"><label for="chk-1"><span>높은 할인율</span></label>
-												</li>
-												<li>
-													<input type="checkbox" id="chk-2"><label for="chk-2"><span>저렴한 가격</span></label>
-												</li>
-												<li>
-													<input type="checkbox" id="chk-3"><label for="chk-3"><span>상세한 상품 정보</span></label>
-												</li>
-												<li>
-													<input type="checkbox" id="chk-4"><label for="chk-4"><span>편리한 결제</span></label>
-												</li>
-												<li>
-													<input type="checkbox" id="chk-5"><label for="chk-5"><span>많은 리뷰 수</span></label>
-												</li>
-												<li>
-													<input type="checkbox" id="chk-6"><label for="chk-6"><span>포토 리뷰</span></label>
-												</li>
-												<li>
-													<input type="checkbox" id="chk-7"><label for="chk-7"><span>사은품 증정 여부</span></label>
-												</li>
-												<li>
-													<input type="checkbox" id="chk-8"><label for="chk-8"><span>다양한 컬러</span></label>
-												</li>
-												<li>
-													<input type="checkbox" id="chk-9"><label for="chk-9"><span>쿠폰 적용 여부</span></label>
-												</li>
-												<li>
-													<input type="checkbox" id="chk-10"><label for="chk-10"><span>당일 배송 상품 유무</span></label>
-												</li>
-											</ul>
-										</div>
-									</div>
-								</div>
-								<div class="survey_row">
-									<h4><span class="question">Q3.</span>달라진 스타일24 홈페이지에 대한 고객님의 생각을 적어주세요. 마음에 드는 점 또는 불편한 점 등 자유롭게 기재해주시면 됩니다.</h4>
-									<div class="answer">
-										<div class="form_field">
-											<div class="input_wrap">
-												<textarea class="doc_ans" name="" id="" placeholder="1,000자 이내로 입력해 주세요." style="resize: none;"></textarea>
-												<p class="txt_cnt">
-													<span id="ans_cnt" class="ans_cnt">(<em class="c_primary">0</em>/1000자)</span>
-												</p>
-											</div> 
-										</div>
-									</div>
-								</div>
-								<div class="survey_row q4">
-									<h4><span class="question">Q4.</span>스타일24에서 가장 유용한 서비스는 무엇인가요? 마음에 드는 점 또는 불편한 점 등 자유롭게 기재해주시면 됩니다.</h4>
-									<div class="answer">
-										<div class="form_field">
-											<div class="input_wrap">
-												<input type="text" class="form_control" name="" id="" />
+							<!-- <form class="form_wrap" name="pollListForm" th:action="@{'/planning/event/poll/save'}" th:method="post"> -->
+								<th:block th:each="pollData, pollStat : ${pollList}">
+									<div class="survey_row" th:classappend="${pollData.pollQtype == '30'? 'q4': ''}">
+										<h4><span class="question" th:text="'Q'+${pollStat.index+1}+'.'"></span>[[${pollData.pollQtitle}]]</h4>
+										<div class="answer">
+											<div class="form_field">
+												<th:block th:if="${pollData.pollQtype == '10'}">
+													<ul class="clear" th:id="${pollData.pollQsq+'_'+(pollStat.index+1)}">
+														<li th:if="${pollData.pollQval1 != null && pollData.pollQval1 != ''}">
+															<th:block th:if="${pollData.pollQval1 != '기타'}">
+																<input type="radio" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'rdi-1-'+${pollData.pollQsq}" th:value="${pollData.pollQval1}" ><label th:for="'rdi-1-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval1}"></span></label>
+															</th:block>
+															<th:block th:unless="${pollData.pollQval1 != '기타'}">
+																<input type="radio" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'rdi-1-'+${pollData.pollQsq}" th:value="${pollData.pollQval1}" class="etc_radio"><label th:for="'rdi-1-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval1}"></span></label>
+																<input type="text" th:name="'etc_input_'+${pollData.pollQsq}" class="etc_input" disabled/>
+															</th:block>
+														</li>
+														<li th:if="${pollData.pollQval2 != null && pollData.pollQval2 != ''}">
+															<th:block th:if="${pollData.pollQval2 != '기타'}">
+																<input type="radio" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'rdi-2-'+${pollData.pollQsq}" th:value="${pollData.pollQval2}" ><label th:for="'rdi-2-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval2}"></span></label>
+															</th:block>
+															<th:block th:unless="${pollData.pollQval2 != '기타'}">
+																<input type="radio" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'rdi-2-'+${pollData.pollQsq}" th:value="${pollData.pollQval2}" class="etc_radio"><label th:for="'rdi-2-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval2}"></span></label>
+																<input type="text" th:name="'etc_input_'+${pollData.pollQsq}" class="etc_input" disabled/>
+															</th:block>
+														</li>
+														<li th:if="${pollData.pollQval3 != null && pollData.pollQval3 != ''}">
+															<th:block th:if="${pollData.pollQval3 != '기타'}">
+																<input type="radio" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'rdi-3-'+${pollData.pollQsq}" th:value="${pollData.pollQval3}" ><label th:for="'rdi-3-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval3}"></span></label>
+															</th:block>
+															<th:block th:unless="${pollData.pollQval3 != '기타'}">
+																<input type="radio" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'rdi-3-'+${pollData.pollQsq}" th:value="${pollData.pollQval3}" class="etc_radio"><label th:for="'rdi-3-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval3}"></span></label>
+																<input type="text" th:name="'etc_input_'+${pollData.pollQsq}" class="etc_input" disabled/>
+															</th:block>
+														</li>
+														<li th:if="${pollData.pollQval4 != null && pollData.pollQval4 != ''}">
+															<th:block th:if="${pollData.pollQval4 != '기타'}">
+																<input type="radio" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'rdi-4-'+${pollData.pollQsq}" th:value="${pollData.pollQval4}" ><label th:for="'rdi-4-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval4}"></span></label>
+															</th:block>
+															<th:block th:unless="${pollData.pollQval4 != '기타'}">
+																<input type="radio" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'rdi-4-'+${pollData.pollQsq}" th:value="${pollData.pollQval4}" class="etc_radio"><label th:for="'rdi-4-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval4}"></span></label>
+																<input type="text" th:name="'etc_input_'+${pollData.pollQsq}" class="etc_input" disabled/>
+															</th:block>
+														</li>
+														<li th:if="${pollData.pollQval5 != null && pollData.pollQval5 != ''}">
+															<th:block th:if="${pollData.pollQval5 != '기타'}">
+																<input type="radio" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'rdi-5-'+${pollData.pollQsq}" th:value="${pollData.pollQval5}" ><label th:for="'rdi-5-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval5}"></span></label>
+															</th:block>
+															<th:block th:unless="${pollData.pollQval5 != '기타'}">
+																<input type="radio" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'rdi-5-'+${pollData.pollQsq}" th:value="${pollData.pollQval5}" class="etc_radio"><label th:for="'rdi-5-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval5}"></span></label>
+																<input type="text" th:name="'etc_input_'+${pollData.pollQsq}" class="etc_input" disabled/>
+															</th:block>
+														</li>
+														<li th:if="${pollData.pollQval6 != null && pollData.pollQval6 != ''}">
+															<th:block th:if="${pollData.pollQval6 != '기타'}">
+																<input type="radio" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'rdi-6-'+${pollData.pollQsq}" th:value="${pollData.pollQval6}"><label th:for="'rdi-6-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval6}"></span></label>
+															</th:block>
+															<th:block th:unless="${pollData.pollQval6 != '기타'}">
+																<input type="radio" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'rdi-6-'+${pollData.pollQsq}" th:value="${pollData.pollQval6}" class="etc_radio"><label th:for="'rdi-6-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval6}"></span></label>
+																<input type="text" th:name="'etc_input_'+${pollData.pollQsq}" class="etc_input" disabled/>
+															</th:block>
+														</li>
+														<li th:if="${pollData.pollQval7 != null && pollData.pollQval7 != ''}">
+															<th:block th:if="${pollData.pollQval7 != '기타'}">
+																<input type="radio" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'rdi-7-'+${pollData.pollQsq}" th:value="${pollData.pollQval7}" ><label th:for="'rdi-7-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval7}"></span></label>
+															</th:block>
+															<th:block th:unless="${pollData.pollQval7 != '기타'}">
+																<input type="radio" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'rdi-7-'+${pollData.pollQsq}" th:value="${pollData.pollQval7}" class="etc_radio"><label th:for="'rdi-7-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval7}"></span></label>
+																<input type="text" th:name="'etc_input_'+${pollData.pollQsq}" class="etc_input" disabled/>
+															</th:block>
+														</li>
+														<li th:if="${pollData.pollQval8 != null && pollData.pollQval8 != ''}">
+															<th:block th:if="${pollData.pollQval8 != '기타'}">
+																<input type="radio" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'rdi-8-'+${pollData.pollQsq}" th:value="${pollData.pollQval8}"><label th:for="'rdi-8-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval8}"></span></label>
+															</th:block>
+															<th:block th:unless="${pollData.pollQval8 != '기타'}">
+																<input type="radio" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'rdi-8-'+${pollData.pollQsq}" th:value="${pollData.pollQval8}" class="etc_radio"><label th:for="'rdi-8-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval8}"></span></label>
+																<input type="text" th:name="'etc_input_'+${pollData.pollQsq}" class="etc_input" disabled/>
+															</th:block>
+														</li>
+														<li th:if="${pollData.pollQval9 != null && pollData.pollQval9 != ''}">
+															<th:block th:if="${pollData.pollQval9 != '기타'}">
+																<input type="radio" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'rdi-9-'+${pollData.pollQsq}" th:value="${pollData.pollQval9}" ><label th:for="'rdi-9-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval9}"></span></label>
+															</th:block>
+															<th:block th:unless="${pollData.pollQval9 != '기타'}">
+																<input type="radio" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'rdi-9-'+${pollData.pollQsq}" th:value="${pollData.pollQval9}"class="etc_radio"><label th:for="'rdi-9-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval9}"></span></label>
+																<input type="text" th:name="'etc_input_'+${pollData.pollQsq}" class="etc_input" disabled/>
+															</th:block>
+														</li>
+														<li th:if="${pollData.pollQval10 != null && pollData.pollQval10 != ''}">
+															<th:block th:if="${pollData.pollQval10 != '기타'}">
+																<input type="radio" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'rdi-10-'+${pollData.pollQsq}" th:value="${pollData.pollQval10}"><label th:for="'rdi-10-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval10}"></span></label>
+															</th:block>
+															<th:block th:unless="${pollData.pollQval10 != '기타'}">
+																<input type="radio" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'rdi-10-'+${pollData.pollQsq}" th:value="${pollData.pollQval10}" class="etc_radio"><label th:for="'rdi-10-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval10}"></span></label>
+																<input type="text" th:name="'etc_input_'+${pollData.pollQsq}" class="etc_input" disabled/>
+															</th:block>
+														</li>
+													</ul>
+												</th:block>
+												<th:block th:if="${pollData.pollQtype == '20'}">
+													<ul class="clear" th:id="${pollData.pollQsq+'_'+(pollStat.index+1)}">
+														<li th:if="${pollData.pollQval1 != null && pollData.pollQval1 != ''}">
+															<input type="checkbox" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'chk-1-'+${pollData.pollQsq}" th:value="${pollData.pollQval1}"><label th:for="'chk-1-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval1}"></span></label>
+														</li>
+														<li th:if="${pollData.pollQval2 != null && pollData.pollQval2 != ''}">
+																<input type="checkbox" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'chk-2-'+${pollData.pollQsq}" th:value="${pollData.pollQval2}"><label th:for="'chk-2-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval2}"></span></label>
+														</li>
+														<li th:if="${pollData.pollQval3 != null && pollData.pollQval3 != ''}">
+																<input type="checkbox"  th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'chk-3-'+${pollData.pollQsq}" th:value="${pollData.pollQval3}"><label th:for="'chk-3-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval3}"></span></label>
+														</li>
+														<li th:if="${pollData.pollQval4 != null && pollData.pollQval4 != ''}">
+																<input type="checkbox" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'chk-4-'+${pollData.pollQsq}" th:value="${pollData.pollQval4}"><label th:for="'chk-4-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval4}"></span></label>
+														</li>
+														<li th:if="${pollData.pollQval5 != null && pollData.pollQval5 != ''}">
+																<input type="checkbox" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'chk-5-'+${pollData.pollQsq}" th:value="${pollData.pollQval5}"><label th:for="'chk-5-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval5}"></span></label>
+														</li>
+														<li th:if="${pollData.pollQval6 != null && pollData.pollQval6 != ''}">
+																<input type="checkbox" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'chk-6-'+${pollData.pollQsq}" th:value="${pollData.pollQval6}"><label th:for="'chk-6-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval6}"></span></label>
+														</li>
+														<li th:if="${pollData.pollQval7 != null && pollData.pollQval7 != ''}">
+																<input type="checkbox" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'chk-7-'+${pollData.pollQsq}" th:value="${pollData.pollQval7}"><label th:for="'chk-7-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval7}"></span></label>
+														</li>
+														<li th:if="${pollData.pollQval8 != null && pollData.pollQval8 != ''}">
+																<input type="checkbox" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'chk-8-'+${pollData.pollQsq}" th:value="${pollData.pollQval8}"><label th:for="'chk-8-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval8}"></span></label>
+														</li>
+														<li th:if="${pollData.pollQval9 != null && pollData.pollQval9 != ''}">
+																<input type="checkbox" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'chk-9-'+${pollData.pollQsq}" th:value="${pollData.pollQval9}"><label th:for="'chk-9-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval9}"></span></label>
+														</li>
+														<li th:if="${pollData.pollQval10 != null && pollData.pollQval10 != ''}">
+																<input type="checkbox" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="'chk-10-'+${pollData.pollQsq}" th:value="${pollData.pollQval10}"><label th:for="'chk-10-'+${pollData.pollQsq}"><span th:text="${pollData.pollQval10}"></span></label>
+														</li>
+													</ul>
+												</th:block>
+												<th:block th:if="${pollData.pollQtype == '30'}">
+													<div class="input_wrap">
+														<input type="text" class="form_control" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="${pollData.pollQsq+'_'+(pollStat.index+1)}" />
+													</div>
+												</th:block>
+												<th:block th:if="${pollData.pollQtype == '40'}">
+													<div class="input_wrap">
+														<textarea class="doc_ans" th:name="${pollData.pollQsq+'_'+(pollStat.index+1)}" th:id="${pollData.pollQsq+'_'+(pollStat.index+1)}" placeholder="1,000자 이내로 입력해 주세요." style="resize: none;"></textarea>
+														<p class="txt_cnt">
+															<span id="ans_cnt" class="ans_cnt">(<em class="c_primary">0</em>/1000자)</span>
+														</p>
+													</div> 
+												</th:block>
 											</div>
 										</div>
 									</div>
-								</div>
+								</th:block>
 								<div class="btn_wrap">
-									<button type="submit" class="btn btn_dark">응답 완료</button>
+									<button type="submit" class="btn btn_dark" onclick="fnSubmitPoll()">응답 완료</button>
 								</div>
-							</form>
+							<!-- </form> -->
 						</div>
 					</div>
 				</div>
@@ -170,6 +218,111 @@
 	<!-- // container -->	
 
 <script th:inline="javascript">
+let pollList = [[${pollList}]];
+
+var fnSubmitPoll = function () {
+	var max1 = new Map();
+	//let max2 = new Map();
+	//let max3 = new Map();
+	//let max4 = new Map();
+	let pollQsq_10 = new Array();
+	let pollQsq_20 = new Array();
+	
+	
+	// 유효성검사
+	for (let i = 0; i < pollList.length; i++) {
+		let type = pollList[i].pollQtype;
+		let pollQsq = pollList[i].pollQsq;
+		
+		
+		if(type == "10"){
+			if($('input:radio[name='+pollQsq+'_'+(i+1)+']').is(':checked')== false){
+				mcxDialog.alert("Q"+(i+1)+"항목은 필수항목입니다.");
+				return;
+			}
+			if ($('input:radio[name='+pollQsq+'_'+(i+1)+']:checked').val() == '기타') {
+				pollQsq_10.push("("+pollQsq);
+				pollQsq_10.push($('input:text[name=etc_input_'+pollQsq+']').val()+")");
+				//max1.set(pollQsq,$('input:text[name=etc_input_'+pollQsq+']').val());
+				//max1.set("pollQsq",pollQsq);
+				//max1.set("dummy",$('input:text[name=etc_input_'+pollQsq+']').val());
+				//max1.set("pollQtype",type);
+			}else{
+				pollQsq_10.push(pollQsq+"/"+$('input:radio[name='+pollQsq+'_'+(i+1)+']:checked').val());
+				//pollQsq_10.push($('input:radio[name='+pollQsq+'_'+(i+1)+']:checked').val()+")");
+				//max1.set(pollQsq,$('input:radio[name='+pollQsq+'_'+(i+1)+']:checked').val());
+				//max1.set("pollQsq",pollQsq);
+				//max1.set("pollQtype",type);
+				//max1.set("dummy",$('input:radio[name='+pollQsq+'_'+(i+1)+']:checked').val());
+			}
+		}
+		if(type == "20"){
+			if($('input:checkbox[name='+pollQsq+'_'+(i+1)+']').is(':checked')== false){
+				mcxDialog.alert("Q"+(i+1)+"항목은 필수항목입니다.");
+				return;
+			}else{
+				let chk = $('input:checkbox[name='+pollQsq+'_'+(i+1)+']:checked');
+				pollQsq_20.push(pollQsq);
+				for(let i=0; i< chk.length; i++){
+					pollQsq_20.push(chk.eq(i).val());
+					//max1.set(pollQsq,pollQsq_20);
+					//max2.set("pollQsq",pollQsq);
+					//max2.set("pollQtype",type);
+					//max2.set("dummy",pollQsq_20);
+
+				}
+			}
+		}
+		if(type == "30"){
+			if($('input:text[name='+pollQsq+'_'+(i+1)+']').val() == ''){
+				mcxDialog.alert("Q"+(i+1)+"항목은 필수항목입니다.");
+				return;
+			}else{
+				//max3.set("pollQsq",pollQsq);
+				//max3.set("pollQtype",type);
+				//max3.set("dummy",$('input:text[name='+pollQsq+'_'+(i+1)+']').val());
+				max1.set(pollQsq,$('input:text[name='+pollQsq+'_'+(i+1)+']').val());
+			}
+		}
+		if(type == "40"){
+			if($('textarea[name='+pollQsq+'_'+(i+1)+']').val() == ''){
+				mcxDialog.alert("Q"+(i+1)+"항목은 필수항목입니다.");
+				return;
+			}else{
+				//max4.set("pollQsq",pollQsq);
+				//max4.set("pollQtype",type);
+				//max4.set("dummy",$('textarea[name='+pollQsq+'_'+(i+1)+']').val());
+				max1.set(pollQsq,$('textarea[name='+pollQsq+'_'+(i+1)+']').val());
+			}
+		}
+	}
+	
+	console.log(pollQsq_10);
+	console.log(pollQsq_20);
+	//console.log(max2);
+	//console.log(max3);
+	//console.log(max4);
+	
+	//var data = {max : max1};
+	
+
+	var jsonData = JSON.stringify(max1);
+	//jQuery.ajaxSettings.traditional = true;
+
+
+	$.ajax({
+		type : "POST",
+		data : jsonData,
+		url : '/planning/event/poll/save',
+		contentType : 'application/json',
+		dataType : 'json',
+		success : function(result) {
+		}
+	})
+	
+
+	
+}
 $(document).ready( function() {
 	
 	//SNS 공유 버튼 토글