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

+ 19 - 13
src/main/java/com/style24/admin/biz/web/TsaCustomerController.java

@@ -166,19 +166,25 @@ public class TsaCustomerController extends TsaBaseController {
 
 		counselService.updateQnaAnswer(counsel);
 
-		// 일대일문의상세 조회
-		Counsel tCounsel = counselService.getOneToOneQna(counsel.getCounselSq());
-
-//		// TODO. 고객이 SMS답변수신을 요청했을 때
-//		if (counsel.getSmsReqYn().equals("Y")) {
-//			try {
-//				// 문의답변완료안내 카카오알림톡 발송
-//				kakaoService.sendQnaAnswer(tCounsel);
-//			} catch (Exception e) {
-//				// Do nothing
-//			}
-//		}
-
+		// TODO. 고객이 SMS답변수신을 요청했을 때
+		if (counsel.getSmsReqYn().equals("Y")) {
+			try {
+				if (counsel.getCounselType().equals("C")) {
+					// 일대일문의상세 조회
+					Counsel tCounsel = counselService.getOneToOneQna(counsel.getCounselSq());
+					// 1:1문의답변완료안내 카카오알림톡 발송
+					kakaotalkService.sendOneToOneAnswerNotify(tCounsel,tCounsel.getCustNo());
+				}else if (counsel.getCounselType().equals("G")) {
+					// 상품문의상세 조회
+					Counsel tCounsel = counselService.getGoodsQna(counsel.getCounselSq());
+					// 상품문의답변완료안내 카카오알림톡 발송
+					kakaotalkService.sendGoodsAskNotify(tCounsel,tCounsel.getCustNo());					
+				}
+				
+			} catch (Exception e) {
+				// Do nothing
+			}
+		}
 		return super.ok(message.getMessage("SUCC_0001"));
 	}
 

+ 1 - 0
src/main/webapp/WEB-INF/views/customer/GoodsQnaDetailForm.html

@@ -28,6 +28,7 @@
 			<form id="qnaDetailForm" name="qnaDetailForm" action="#" th:action="@{'/customer/qna/answer/save'}" th:method="post" th:object="${counselInfo}">
 				<input type="hidden" name="counselSq" th:value="*{counselSq}"/>
 				<input type="hidden" name="smsReqYn" th:value="*{smsReqYn}"/>
+				<input type="hidden" name="counselType" value="G"/>
 				
 				<h4>상담정보</h4>
 				<table class="tableStyle" aria-describedby="상담정보">

+ 1 - 0
src/main/webapp/WEB-INF/views/customer/OneToOneQnaDetailForm.html

@@ -28,6 +28,7 @@
 			<form id="qnaDetailForm" name="qnaDetailForm" action="#" th:action="@{'/customer/qna/answer/save'}" th:method="post" th:object="${counselInfo}">
 				<input type="hidden" name="counselSq" th:value="*{counselSq}"/>
 				<input type="hidden" name="smsReqYn" th:value="*{smsReqYn}"/>
+				<input type="hidden" name="counselType" value="C"/>
 				
 				<h4>상담정보</h4>
 				<table class="tableStyle" aria-describedby="상담정보">