فهرست منبع

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

jsshin 5 سال پیش
والد
کامیت
8d6d325668

+ 19 - 3
src/main/java/com/style24/front/biz/service/TsfCounselService.java

@@ -13,6 +13,8 @@ import com.style24.persistence.domain.Counsel;
 
 import lombok.extern.slf4j.Slf4j;
 
+import com.gagaframework.web.util.GagaStringUtil;
+
 /**
  * 상담(1:1문의) Service
  *
@@ -37,6 +39,7 @@ public class TsfCounselService {
 	public void createOneToOneQna(Counsel counsel) {
 		counsel.setSiteCd(TscConstants.Site.STYLE24.value());
 		counsel.setCustNo(TsfSession.getInfo().getCustNo());
+		counsel.setCellPhnno(TsfSession.getInfo().getCellPhnno());
 		counsel.setEmail(TsfSession.getInfo().getEmail());
 		counsel.setRegNo(TsfSession.getInfo().getCustNo());
 		counsel.setUpdNo(TsfSession.getInfo().getCustNo());
@@ -75,7 +78,13 @@ public class TsfCounselService {
 	 * @since 2020. 12. 28
 	 */
 	public Collection<Counsel> getOneToOneQnaList(Counsel counsel) {
-		return counselDao.getOneToOneQnaList(counsel);
+		Collection<Counsel> counselList = counselDao.getOneToOneQnaList(counsel);
+		for (Counsel item : counselList) {
+			item.setQuestContent(GagaStringUtil.replace(item.getQuestContent(), "\r\n", "<br/>"));
+			item.setAnsContent(GagaStringUtil.replace(item.getAnsContent(), "\r\n", "<br/>"));
+		}
+
+		return counselList;
 	}
 
 	/**
@@ -152,6 +161,7 @@ public class TsfCounselService {
 	public void createGoodsQna(Counsel counsel) {
 		counsel.setSiteCd(TscConstants.Site.STYLE24.value());
 		counsel.setCustNo(TsfSession.getInfo().getCustNo());
+		counsel.setCellPhnno(TsfSession.getInfo().getCellPhnno());
 		counsel.setEmail(TsfSession.getInfo().getEmail());
 		counsel.setRegNo(TsfSession.getInfo().getCustNo());
 		counsel.setUpdNo(TsfSession.getInfo().getCustNo());
@@ -190,7 +200,13 @@ public class TsfCounselService {
 	 * @since 2020. 12. 24
 	 */
 	public Collection<Counsel> getGoodsQnaList(Counsel counsel) {
-		return counselDao.getGoodsQnaList(counsel);
+		Collection<Counsel> counselList = counselDao.getGoodsQnaList(counsel);
+		for (Counsel item : counselList) {
+			item.setQuestContent(GagaStringUtil.replace(item.getQuestContent(), "\r\n", "<br/>"));
+			item.setAnsContent(GagaStringUtil.replace(item.getAnsContent(), "\r\n", "<br/>"));
+		}
+
+		return counselList;
 	}
 
 	/**
@@ -203,7 +219,7 @@ public class TsfCounselService {
 	public Collection<Counsel> getGoodsQnaListForGoods(Counsel counsel) {
 		return counselDao.getGoodsQnaListForGoods(counsel);
 	}
-	
+
 	/**
 	 * 상품문의 삭제
 	 * @param counsel - 상담정보

+ 19 - 0
src/main/java/com/style24/persistence/domain/Login.java

@@ -2,6 +2,7 @@ package com.style24.persistence.domain;
 
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.style24.core.support.util.CryptoUtils;
 import com.style24.persistence.TscBaseDomain;
 
 import lombok.Data;
@@ -30,6 +31,7 @@ public class Login extends TscBaseDomain {
 	private String custGb;			// 고객구분
 	private String custGbNm;		// 고객구분명
 	private String custStat;		// 고객상태
+	private String cellPhnno;		// 휴대전화번호
 	private String email;			// 이메일
 	private String snsType;			// SNS유형
 	private String snsId;			// SNS가입ID
@@ -42,4 +44,21 @@ public class Login extends TscBaseDomain {
 	private String loginFailYn;		// 로그인실패여부
 	private String custGrade;		// 고객등급
 
+	// 암호화 대상 복호화 처리 =================================================
+	public String getCustNm() {
+		this.custNm = CryptoUtils.decryptAES(this.custNm);
+		return this.custNm;
+	}
+
+	public String getCellPhnno() {
+		this.cellPhnno = CryptoUtils.decryptAES(this.cellPhnno);
+		return this.cellPhnno;
+	}
+
+	public String getEmail() {
+		this.email = CryptoUtils.decryptAES(this.email);
+		return this.email;
+	}
+	// 암호화 대상 복호화 처리 =================================================
+
 }

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

@@ -242,7 +242,7 @@
 		     , CONCAT('[',#{relGoodsCd},'] 상품문의')
 		     , #{questContent}
 		     , NOW()
-		     , ifNull(#{secretYn},'N')
+		     , IFNULL(#{secretYn},'N')
 		     , 'G060_10' /*답변상태:처리중*/
 		     , 'N'
 		     , #{regNo}

+ 1 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsfLogin.xml

@@ -12,6 +12,7 @@
 		     , CUST_GB                                          /*고객구분*/
 		     , FN_GET_CODE_NM('G100',CUST_GB) AS CUST_GB_NM     /*고객구분명*/
 		     , CUST_STAT                                        /*회원상태*/
+		     , CELL_PHNNO                                       /*휴대전화번호*/
 		     , EMAIL                                            /*이메일*/
 		     , #{snsType}                     AS SNS_TYPE       /*SNS유형*/
 		     , #{snsId}                       AS SNS_ID         /*SNS가입ID*/

+ 26 - 36
src/main/webapp/WEB-INF/views/web/callcenter/OneToOneQnaRegisterFormWeb.html

@@ -41,7 +41,7 @@
 							<div class="sec_body">
 								<div class="t_info blt_dot mb15 light">문의를 남겨 주시면 24시간 이내(토/일/공휴일 제외)에 답변 드릴 수 있도록 최선을 다 하겠습니다.</div>
 								
-								<form class="form_wrap" role="form" name="qnaForm" id="qnaForm" th:action="@{'/onetoone/qna/create'}" method="post">
+								<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">
@@ -82,14 +82,14 @@
 												<!-- 이미지첨부 -->
 												<div class="form_field">
 													<div class="imgUpload">
-														<label for="fileAdd" class="fileAdd">업로드</label>
+														<label for="fileAdd" class="fileAdd">첫번째업로드</label>
 														<input type="file" id="fileAdd" name="file1"/>
 														<input type="hidden" name="fileAddOrgFileNm"/>
 														<input type="hidden" name="fileAddSysFileNm"/>
 													</div>
 													<div class="imgUpload">
-														<label for="fileAdd" class="fileAdd">업로드</label>
-														<input type="file" id="file2" name="file2"/>
+														<label for="fileAdds" class="fileAdd">두번째업로드</label>
+														<input type="file" id="fileAdds" name="file2"/>
 														<input type="hidden" name="file2OrgFileNm"/>
 														<input type="hidden" name="file2SysFileNm"/>
 													</div>
@@ -106,20 +106,16 @@
 										</div>
 									</div>
 									<div class="form_field">
-										<label class="ui_col_2 input_label">휴대폰</label>
-										<div class="ui_col_10 cellphone">
+										<label class="ui_col_2 input_label">알림톡 수신 여부</label>
+										<div class="ui_col_10 push_agree">
 											<div class="input_wrap">
-												<input type="text" class="form_control" name="cellPhnno" maxlength="13" placeholder="휴대폰 번호를 입력해 주세요." required="required" data-valid-type="cellPhone" data-valid-name="휴대폰번호"/> <!-- 잘못 입력시 클래스명 : err 추가  -->
-												<!-- 알림 신청 체크박스(선택 _ 기본값) -->
-												<div class="ck_box">
-													<input type="hidden" name="smsReqYn"/>
-													<input type="checkbox" name="chkSmsReqYn" value="Y" checked="checked"/>
-													<label for="chkSmsReqYn"><span>알림 신청</span></label>
+												<div>
+													<input type="radio" name="smsReqYn" id="smsReqYn1" value="Y" checked="checked"><label for="smsReqYn1"><span>수신</span></label>
+												</div>
+												<div>
+													<input type="radio" name="smsReqYn" id="smsReqYn2" value="N"><label for="smsReqYn2"><span>미수신</span></label>
 												</div>
 											</div> 
-											<div class="help_block" style="display: none;" id="divCellPhnno">
-												<p class="t_err">휴대폰 번호를 형식에 맞게 정확히 입력해주세요.</p>
-											</div>
 										</div>
 									</div>
 								</form>
@@ -157,7 +153,7 @@
 	
 	// 파일첨부 선택 시
 	$('#fileAdd').on('change', function() { fnChooseFile(this); });
-	$('#file2').on('change', function() { fnChooseFile(this); });
+	$('#fileAdds').on('change', function() { fnChooseFile(this); });
 	
 	var fnChooseFile = function(obj) {
 		// multiple 속성이 있으면 files에는 다수의 객체가 할당됨
@@ -166,16 +162,26 @@
 		if (!gagajf.isNull(file.name)) {
 			var extension = "\.(jpg|jpeg|png)$";
 			if (!(new RegExp(extension, "i")).test(file.name)) {
-				mcxDialog.alert('이미지는 [jpg, jpeg, png] 파일만 가능합니다.');
+				mcxDialog.alertC('이미지는 [jpg, jpeg, png] 파일만 가능합니다.', {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						$(obj).parent('.imgUpload').find('.removes').trigger('click');
+					}
+				});
 				return false;
 			}
 		}
 		
 		if (!gagajf.isNull(file.size) && Number(file.size) > 20 * 1000000) {
-			mcxDialog.alert('이미지는 최대 20MB 이하 파일만 가능합니다.');
+			mcxDialog.alertC('이미지는 최대 20MB 이하 파일만 가능합니다.', {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					$(obj).parent('.imgUpload').find('.removes').trigger('click');
+				}
+			});
 			return false;
 		}
-
+		
 		// 파일 업로드
 		gagajf.ajaxFileUpload('/common/file/upload?subDir=/counsel'
 				, file
@@ -193,28 +199,12 @@
 		if (!gagajf.validation('#qnaForm'))
 			return false;
 
-		if (!gagajf.isNull($('#qnaForm input[name=cellPhnno]').val())) {
-			let regexp = /^(01(?:0|1|[6-9])-(?:\d{3}|\d{4})-\d{4})$/;
-			if (!regexp.test($('#qnaForm input[name=cellPhnno]').val())) {
-				$('#qnaForm input[name=cellPhnno]').addClass('err');
-				$('#divCellPhnno').show();
-				$('#qnaForm input[name=cellPhnno]').select();
-				$('#qnaForm input[name=cellPhnno]').focus();
-				return false;
-			}
-		}
-		
-		$('#qnaForm input[name=cellPhnno]').removeClass('err');
-		$('#divCellPhnno').hide();
-		
-		$('#qnaForm input[name=smsReqYn]').val($('#qnaForm input:checkbox[name=chkSmsReqYn]').is(":checked") ? 'Y' : 'N');
-
 		mcxDialog.confirm("저장하시겠습니까?", {
 			cancelBtnText: "취소",
 			sureBtnText: "확인",
 			sureBtnClick: function() {
 				gagajf.ajaxFormSubmit($('#qnaForm').prop('action')
-						, $('#qnaForm')
+						, '#qnaForm'
 						, function() {
 							cfnGoToPage(_PAGE_ONETOONE_QNA);
 						}