فهرست منبع

Merge remote-tracking branch 'TSIT/gagamel_onetoone' into style

card007 4 سال پیش
والد
کامیت
26047fd082

+ 2 - 4
src/main/java/com/style24/front/biz/service/TsfCounselService.java

@@ -138,8 +138,7 @@ public class TsfCounselService {
 		counsel.setUpdNo(TsfSession.getInfo().getCustNo());
 		int result = counselDao.deleteOneToOneQna(counsel);
 		if (result == 0) {
-//			throw new IllegalStateException("답변이 완료되어 삭제할 수 없습니다.");
-			throw new IllegalStateException("답변이 완료되지 않아 삭제할 수 없습니다.");
+			throw new IllegalStateException("답변이 완료되어 삭제할 수 없습니다.");
 		}
 	}
 
@@ -186,8 +185,7 @@ public class TsfCounselService {
 		counsel.setUpdNo(TsfSession.getInfo().getCustNo());
 		int result = counselDao.deleteOneToOneQnaImage(counsel);
 		if (result == 0) {
-//			throw new IllegalStateException("답변이 완료되어 삭제할 수 없습니다.");
-			throw new IllegalStateException("답변이 완료되지 않아 삭제할 수 없습니다.");
+			throw new IllegalStateException("답변이 완료되어 삭제할 수 없습니다.");
 		}
 	}
 

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

@@ -179,9 +179,6 @@ public class TsfCallcenterController extends TsfBaseController {
 	public ModelAndView oneToOneQnaForm(Device device) {
 		ModelAndView mav = new ModelAndView();
 
-		// 1:1문의 건수 정보
-		mav.addObject("qnaCountInfo", counselService.getOneToOneQnaCountInfo());
-
 		if (device.isMobile() || device.isTablet()) { // 모바일이면
 			// 문의유형
 			mav.addObject("counselClsfList", rendererService.getCommonCodeList("G059", "Y"));

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

@@ -64,7 +64,7 @@
 		     , #{sysFileNm1}
 		     , #{orgFileNm2}
 		     , #{sysFileNm2}
-		     , 'G060_10' /*답변상태:처리중*/
+		     , 'G060_00' /*답변상태:대기중*/
 		     , 'N'
 		     , #{regNo}
 		     , NOW()
@@ -136,7 +136,7 @@
 		     , UPD_DT = NOW()
 		WHERE  COUNSEL_SQ = #{counselSq}
 		AND    CUST_NO = #{custNo}
-		AND    ANS_STAT = 'G060_20' /*답변상태:답변완료*/
+		AND    ANS_STAT != 'G060_20' /*답변완료 상태가 아닐 때*/
 	</update>
 
 	<!-- 1:1문의 상세 -->
@@ -181,7 +181,7 @@
 		     , UPD_DT = NOW()
 		WHERE  COUNSEL_SQ = #{counselSq}
 		AND    CUST_NO = #{custNo}
-		AND    ANS_STAT = 'G060_10' /*답변상태:처리중*/
+		AND    ANS_STAT = 'G060_00' /*답변상태:대기중*/
 	</insert>
 	
 	<!-- 1:1문의 이미지 삭제 -->
@@ -196,7 +196,7 @@
 		     , UPD_DT = NOW()
 		WHERE  COUNSEL_SQ = #{counselSq}
 		AND    CUST_NO = #{custNo}
-		AND    ANS_STAT = 'G060_20' /*답변상태:답변완료*/
+		AND    ANS_STAT != 'G060_20' /*답변완료 상태가 아닐 때*/
 	</update>
 	
 	<select id="getOneToOneImgList" parameterType="Counsel"  resultType="Counsel">

+ 23 - 17
src/main/webapp/WEB-INF/views/mob/callcenter/OneToOneQnaFormMob.html

@@ -32,15 +32,15 @@
 				<!-- 게시판info -->
 				<ul class="inquiry_box">
 					<li>
-						<p th:text="${qnaCountInfo.totCnt}" id="qnaTotCnt">999</p>
+						<p id="qnaTotCnt"></p>
 						<p>총 문의</p>
 					</li>
 					<li>
-						<p th:text="${qnaCountInfo.ansCnt}" id="qnaAnsCnt">456</p>
+						<p id="qnaAnsCnt"></p>
 						<p>답변완료</p>
 					</li>
 					<li>
-						<p th:text="${qnaCountInfo.ingCnt}" id="qnaIngCnt">690</p>
+						<p id="qnaIngCnt"></p>
 						<p>처리 중</p>
 					</li>
 				</ul>
@@ -291,10 +291,12 @@
 		// 고객센터 GNB 설정
 		fnSetCallcenterGnb(2);
 		
+		fnGetOneToOneQnaCountInfo();
+		
 		$('#btnQnaMore').trigger('click');
 		
 		$('#qnaRegisterForm textarea[name=questContent]').bind('input paste', function() {
-			  $(this).trigger('keyup');
+			$(this).trigger('keyup');
 		});
 	});
 	
@@ -347,6 +349,12 @@
 					tag += '		</p>\n';
 				}
 				
+				if (item.ansStat != 'G060_20') { // 답변완료가 아닐 때
+					tag += '		<div class="answer_foot">\n';
+					tag += '			<button type="button" class="btn_delete" onclick="fnDeleteQna(' + item.counselSq + ');"><span>삭제</span></button>\n';
+					tag += '		</div>\n';
+				}
+				
 				tag += '		</div>\n';
 				
 				if (item.ansStat == 'G060_20') { // 답변완료 상태일 때
@@ -355,11 +363,6 @@
 					tag += '			<div class="answer_body">' + item.ansContent.replace(/(\r\n)/g, '<br/>') + '</div>\n';
 					tag += '			<div class="answer_foot">\n';
 					tag += '				<span class="data">' + item.ansDt + '</span>\n';
-					
-					if (item.ansStat == 'G060_20') { // 답변완료일 때
-						tag += '				<button type="button" class="btn_delete" onclick="fnDeleteQna(' + item.counselSq + ');"><span>삭제</span></button>\n';
-					}
-					
 					tag += '			</div>\n';
 					tag += '		</div>\n';
 					tag += '	</div>\n';
@@ -402,13 +405,7 @@
 							$('#ulQna').html('');
 							$('#btnQnaMore').trigger('click');
 							
-							$.get('/callcenter/onetoone/qna/count/info'
-									, function(result) {
-										$('#qnaTotCnt').html(result.totCnt);
-										$('#qnaAnsCnt').html(result.ansCnt);
-										$('#qnaIngCnt').html(result.ingCnt);
-									}
-								);
+							fnGetOneToOneQnaCountInfo();
 						});
 			}
 		});
@@ -494,7 +491,6 @@
 	
 	// 문의유형 선택 시
 	var fnChangeCounselClsf = function(counselClsf) {
-		console.log('a2-------------');
 		var actionUrl = '/callcenter/onetoone/qna/answer/template/' + counselClsf;
 		$.get(actionUrl
 			, function(data) {
@@ -508,6 +504,16 @@
 				}
 			});
 	}
+	
+	let fnGetOneToOneQnaCountInfo = function() {
+		$.get('/callcenter/onetoone/qna/count/info'
+				, function(result) {
+					$('#qnaTotCnt').html(result.totCnt);
+					$('#qnaAnsCnt').html(result.ansCnt);
+					$('#qnaIngCnt').html(result.ingCnt);
+				}
+			);
+	}
 /*]]>*/
 </script>
 

+ 19 - 12
src/main/webapp/WEB-INF/views/web/callcenter/OneToOneQnaFormWeb.html

@@ -44,15 +44,15 @@
 										<ul>
 											<li>
 												<span>총 문의</span>
-												<a href="javascript:void(0);" onclick="" th:text="${qnaCountInfo.totCnt}" id="qnaTotCnt">12</a>
+												<a href="javascript:void(0);" onclick="" id="qnaTotCnt"></a>
 											</li>
 											<li>
 												<span>답변 완료</span>
-												<a href="javascript:void(0);" onclick="" th:text="${qnaCountInfo.ansCnt}" id="qnaAnsCnt">8</a>
+												<a href="javascript:void(0);" onclick="" id="qnaAnsCnt"></a>
 											</li>
 											<li>
 												<span>처리 중</span>
-												<a href="javascript:void(0);" onclick="" th:text="${qnaCountInfo.ingCnt}" class="doing" id="qnaIngCnt">0</a>
+												<a href="javascript:void(0);" onclick="" class="doing" id="qnaIngCnt"></a>
 											</li>
 										</ul>
 									</div>
@@ -159,6 +159,8 @@
 		// 고객센터 LNB 설정
 		fnSetCallcenterLnb(2);
 		
+		fnGetOneToOneQnaCountInfo();
+		
 		fnGetList();
 	});
 	
@@ -177,6 +179,8 @@
 		// 목록
 		if (result.dataList != null && result.dataList.length > 0) {
 			$.each(result.dataList, function(idx, item) {
+				console.log(item);
+				
 				let tag = '<li>\n';
 				tag += '	<div class="fold_head">\n';
 				tag += '		<a href="javascript:void(0)">\n';
@@ -215,7 +219,7 @@
 				
 				tag += '			</div>\n';
 				
-				if (item.ansStat == 'G060_20') { // 답변완료일
+				if (item.ansStat != 'G060_20') { // 답변완료가 아닐
 					tag += '			<button type="button" class="btn btn_default btn_del" onclick="fnDeleteQna(' + item.counselSq + ');"><span><i class="ico ico_trash"></i>삭제</span></button>\n';
 				}
 				
@@ -264,18 +268,21 @@
 						, jsonData
 						, function() {
 							fnGetList();
-							
-							$.get('/callcenter/onetoone/qna/count/info'
-								, function(result) {
-									$('#qnaTotCnt').html(result.totCnt);
-									$('#qnaAnsCnt').html(result.ansCnt);
-									$('#qnaIngCnt').html(result.ingCnt);
-								}
-							);
+							fnGetOneToOneQnaCountInfo();
 						});
 			}
 		});
 	}
+	
+	let fnGetOneToOneQnaCountInfo = function() {
+		$.get('/callcenter/onetoone/qna/count/info'
+				, function(result) {
+					$('#qnaTotCnt').html(result.totCnt);
+					$('#qnaAnsCnt').html(result.ansCnt);
+					$('#qnaIngCnt').html(result.ingCnt);
+				}
+			);
+	}
 /*]]>*/
 </script>