瀏覽代碼

Merge branch 'develop' of http://112.172.147.34:4936/style24/style24.front.git into develop

tsit05 4 年之前
父節點
當前提交
465f2fd421

+ 11 - 2
src/main/java/com/style24/front/biz/dao/TsfCounselDao.java

@@ -93,7 +93,16 @@ public interface TsfCounselDao {
 	 * @since 2021. 06. 214
 	 */
 	Collection<Counsel> getOneToOneImgList(Counsel counsel);
-	
+
+	/**
+	 * 1:1문의용 답변템플릿 조회
+	 * @param counselClsf - 문의유형
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 9. 28
+	 */
+	String getOnetooneQnaAnswerTemplate(String counselClsf);
+
 	/**
 	 * 상품문의 생성
 	 * @param counsel - 상담정보
@@ -128,7 +137,7 @@ public interface TsfCounselDao {
 	 * @since 2020. 12. 28
 	 */
 	Collection<Counsel> getGoodsQnaList(Counsel counsel);
-	
+
 	/**
 	 * 상품문의 목록 - 상품상세용
 	 * @param counsel -상담정보

+ 11 - 0
src/main/java/com/style24/front/biz/service/TsfCounselService.java

@@ -202,6 +202,17 @@ public class TsfCounselService {
 		return counselDao.getOneToOneImgList(counsel);
 	}
 
+	/**
+	 * 1:1문의용 답변템플릿 조회
+	 * @param counselClsf - 문의유형
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 9. 28
+	 */
+	public String getOnetooneQnaAnswerTemplate(String counselClsf) {
+		return counselDao.getOnetooneQnaAnswerTemplate(counselClsf);
+	}
+
 	/**
 	 * 상품문의 생성
 	 * @param counsel -상담정보

+ 13 - 0
src/main/java/com/style24/front/biz/web/TsfCallcenterController.java

@@ -341,6 +341,19 @@ public class TsfCallcenterController extends TsfBaseController {
 		return mav;
 	}
 
+	/**
+	 * 1:1문의용 답변템플릿 조회
+	 * @param counselClsf - 문의유형
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 9. 28
+	 */
+	@GetMapping("/onetoone/qna/answer/template/{counselClsf}")
+	@ResponseBody
+	public String getOnetooneQnaAnswerTemplate(@PathVariable String counselClsf) {
+		return counselService.getOnetooneQnaAnswerTemplate(counselClsf);
+	}
+
 	/**
 	 * 상품문의 등록 처리
 	 * @param counsel -상담정보

+ 9 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsfCounsel.xml

@@ -217,6 +217,15 @@
 		)Z     
 	</select>
 	
+	<!-- 1:1문의용 답변 템플릿 조회 -->
+	<select id="getOnetooneQnaAnswerTemplate" parameterType="String" resultType="String">
+		/* TsfCounsel.getOnetooneQnaAnswerTemplate */
+		SELECT CD_DESC
+		FROM   TB_COMMON_CODE
+		WHERE  CD_GB = 'G059'
+		AND    CD = #{counselClsf}
+	</select>
+	
 	<!-- 상품문의 생성 -->
 	<insert id="createGoodsQna" parameterType="Counsel">
 		/* TsfCounsel.createGoodsQna */

+ 18 - 4
src/main/webapp/WEB-INF/views/mob/callcenter/OneToOneQnaFormMob.html

@@ -125,10 +125,6 @@
 														<option th:if="${counselClsfList}" th:each="oneData, status : ${counselClsfList}" th:value="${oneData.cd}" th:text="${oneData.cdNm}"></option>
 													</select>
 													<!-- <div class="select_dress">문의 유형을 선택해 주세요 (필수)<span></span></div> -->
-													<ul class="select_options">
-														<li rel="">문의 유형을 선택해 주세요 (필수)</li>
-														<li th:if="${counselClsfList}" th:each="oneData, status : ${counselClsfList}" th:rel="${oneData.cd}" th:text="${oneData.cdNm}"></li>
-													</ul>
 												</div>
 											</div>
 										</div>
@@ -279,6 +275,7 @@
 					$dressSelect.text($(this).text()).removeClass('active');
 					$this.val($(this).attr('rel'));
 					$selList.hide();
+					fnChangeCounselClsf($(this).attr('rel'));
 				}
 			});
 			
@@ -494,6 +491,23 @@
 			}
 		});
 	});
+	
+	// 문의유형 선택 시
+	var fnChangeCounselClsf = function(counselClsf) {
+		console.log('a2-------------');
+		var actionUrl = '/callcenter/onetoone/qna/answer/template/' + counselClsf;
+		$.get(actionUrl
+			, function(data) {
+				if (!gagajf.isNull(data)) {
+					$('textarea[name=questContent]').val(data);
+					$('.doc_contactus').trigger('keyup');
+				} else {
+					// 초기화
+					$('textarea[name=questContent]').val('');
+					$('.doc_contactus').trigger('keyup');
+				}
+			});
+	}
 /*]]>*/
 </script>
 

+ 44 - 6
src/main/webapp/WEB-INF/views/web/callcenter/OneToOneQnaRegisterFormWeb.html

@@ -42,14 +42,26 @@
 								<div class="t_info blt_dot mb15 light">문의를 남겨 주시면 24시간 이내(토/일/공휴일 제외)에 답변 드릴 수 있도록 최선을 다 하겠습니다.</div>
 								
 								<form class="form_wrap" role="form" name="qnaForm" id="qnaForm" th:action="@{'/callcenter/onetoone/qna/create'}" method="post">
+<!-- 									<div class="form_field"> -->
+<!-- 										<label class="ui_col_2 input_label">문의 유형</label> -->
+<!-- 										<div class="ui_col_10 form_full"> -->
+<!-- 											<div class="input_wrap"> -->
+<!-- 												<select name="counselClsf" required="required" data-valid-name="문의유형"> -->
+<!-- 													<option value="">유형을 선택해 주세요</option> -->
+<!-- 													<option th:if="${counselClsfList}" th:each="oneData, status : ${counselClsfList}" th:value="${oneData.cd}" th:text="${oneData.cdNm}"></option> -->
+<!-- 												</select> -->
+<!-- 											</div> -->
+<!-- 										</div> -->
+<!-- 									</div> -->
 									<div class="form_field">
 										<label class="ui_col_2 input_label">문의 유형</label>
-										<div class="ui_col_10 form_full">
-											<div class="input_wrap">
-												<select name="counselClsf" required="required" data-valid-name="문의유형">
-													<option value="">유형을 선택해 주세요</option>
-													<option th:if="${counselClsfList}" th:each="oneData, status : ${counselClsfList}" th:value="${oneData.cd}" th:text="${oneData.cdNm}"></option>
-												</select>
+										<div class="ui_col_4 form_full"><!-- 210415 변경 : 필드 클래스 (ui_col_10 → ui_col_4) 변경  -->
+											<div class="select_custom">
+												<div class="combo"><!-- 210415 추가 : 텍스트 '필수' -->
+													<div class="select">유형을 선택해 주세요 (필수)</div>
+													<ul class="list" id="ulCounselClsf">
+													</ul>
+												</div>
 											</div>
 										</div>
 									</div>
@@ -135,8 +147,34 @@
 	$(document).ready(function() {
 		// 고객센터 LNB 설정
 		fnSetCallcenterLnb(2);
+		
+		var counselClsfList = [[${counselClsfList}]];
+		var tag = '';
+		$.each(counselClsfList, function(idx, item) {
+			tag += '<li onclick="fnChangeCounselClsf(\'' + item.cd + '\');">' + item.cdNm + '</li>\n';
+		});
+		$('#ulCounselClsf').html(tag);
+	
+		// 문의유형
+		var cs_selecter01 = new sCombo('.cs .contactUs_my .select_custom');
 	});
 	
+	// 문의유형 선택 시
+	var fnChangeCounselClsf = function(counselClsf) {
+		var actionUrl = '/callcenter/onetoone/qna/answer/template/' + counselClsf;
+		$.get(actionUrl
+			, function(data) {
+				if (!gagajf.isNull(data)) {
+					$('textarea[name=questContent]').val(data);
+					$('.doc_contactus').trigger('keyup');
+				} else {
+					// 초기화
+					$('textarea[name=questContent]').val('');
+					$('.doc_contactus').trigger('keyup');
+				}
+			});
+	}
+	
 	// text_area
 	$('.doc_contactus').keyup(function (e) {
 		var content = $(this).val();