sowon4187 4 лет назад
Родитель
Сommit
b7dd2bd650

+ 72 - 0
src/main/java/com/style24/core/biz/service/TscKakaotalkService.java

@@ -14,6 +14,7 @@ import com.gagaframework.web.parameter.GagaMap;
 import com.style24.core.biz.thirdparty.NaverShortUrl;
 import com.style24.core.biz.thirdparty.SsgKakaoSender;
 import com.style24.core.support.env.TscConstants;
+import com.style24.persistence.domain.Counsel;
 import com.style24.persistence.domain.Coupon;
 import com.style24.persistence.domain.CustContactHst;
 import com.style24.persistence.domain.CustCoupon;
@@ -1205,4 +1206,75 @@ public class TscKakaotalkService {
 			}
 		}
 	}
+	
+	/**
+	 *  1:1문의 알림톡
+	 * @param counsel
+	 * @param senderNo - 발송자번호(고객번호)
+	 * @author sowon
+	 * @since 2021. 6. 21
+	 */
+	@Transactional("shopTxnManager")
+	public void sendOneToOneAnswerNotify(Counsel counsel, Integer senderNo) {
+		SsgDirectMessage dm = new SsgDirectMessage();
+		dm.setFuserid(String.valueOf(senderNo)); // 발송자NO
+		dm.setFdestine(counsel.getCellPhnno());
+		dm.setFkkoresendtype("LMS");
+
+		GagaMap replaceInfo = new GagaMap();
+		replaceInfo.setString("siteNm", siteNm);
+		replaceInfo.setString("custNm", counsel.getCustNm());
+		kakaoSender.send(SsgKakaoSender.KakaoAnswerSq.ONE_TO_ONE_ANSWER.value(), dm, replaceInfo);
+		
+		try {
+			// 고객접촉이력 정보
+			CustContactHst custContactHst = new CustContactHst();
+			custContactHst.setContactType(TscConstants.ContactType.ONE_TO_ONE_ANSWER.value()); // 접촉유형:임시비밀번호발급(공통코드G054)
+			custContactHst.setContactMethod(TscConstants.ContactMethod.KAKAOTALK.value()); 		// 접촉방법:알림톡+문자(공통코드G055)
+			custContactHst.setContactContents("1:1문의답변");
+			custContactHst.setReceiverNo(counsel.getCustNo());
+			custContactHst.setSenderNo(senderNo);
+			custContactHst.setRegNo(senderNo);
+			coreCustomerService.createCustomerContactHistory(custContactHst);
+		} catch (Exception e) {
+			log.error("error", e);
+			// Do nothing
+		}
+	}
+	
+	/**
+	 *  상품문의 알림톡
+	 * @param counsel
+	 * @param senderNo - 발송자번호(고객번호)
+	 * @author sowon
+	 * @since 2021. 6. 21
+	 */
+	@Transactional("shopTxnManager")
+	public void sendGoodsAskNotify(Counsel counsel, Integer senderNo) {
+		SsgDirectMessage dm = new SsgDirectMessage();
+		dm.setFuserid(String.valueOf(senderNo)); // 발송자NO
+		dm.setFdestine(counsel.getCellPhnno());
+		dm.setFkkoresendtype("LMS");
+
+		GagaMap replaceInfo = new GagaMap();
+		replaceInfo.setString("siteNm", siteNm);
+		replaceInfo.setString("custNm", counsel.getCustNm());
+		replaceInfo.setString("goodsNm", counsel.getGoodsNm());
+		kakaoSender.send(SsgKakaoSender.KakaoAnswerSq.GOODS_ASK_ANSWER.value(), dm, replaceInfo);
+		
+		try {
+			// 고객접촉이력 정보
+			CustContactHst custContactHst = new CustContactHst();
+			custContactHst.setContactType(TscConstants.ContactType.GOODS_ASK_ANSWER.value()); // 접촉유형:임시비밀번호발급(공통코드G054)
+			custContactHst.setContactMethod(TscConstants.ContactMethod.KAKAOTALK.value()); 		// 접촉방법:알림톡+문자(공통코드G055)
+			custContactHst.setContactContents("상품문의답변");
+			custContactHst.setReceiverNo(counsel.getCustNo());
+			custContactHst.setSenderNo(senderNo);
+			custContactHst.setRegNo(senderNo);
+			coreCustomerService.createCustomerContactHistory(custContactHst);
+		} catch (Exception e) {
+			log.error("error", e);
+			// Do nothing
+		}
+	}
 }

+ 1 - 0
src/main/java/com/style24/core/support/env/TscConstants.java

@@ -80,6 +80,7 @@ public class TscConstants {
 		GIFTCARD_EXTNC_EXPECT("G054_213"),		// 회원/마케팅 - 상품권 소멸 예정 안내
 		COUPON_EXTNC_EXPECT("G054_214"),		// 회원/마케팅 - 쿠폰 소멸 예정안내
 		POINT_EXTNC_EXPECT("G054_215"),			// 회원/마케팅 - 포인트 소멸 예정안내
+		GOODS_ASK_ANSWER("G054_216"),			// 회원/마케팅 - 상품문의답변
 		ORDER_INFO("G054_301"),					// 주문-주문안내
 		BANK_DEPOSIT_INFO("G054_302"),			// 주문-무통장입금안내
 		SOLDOUT_EXPECTED_INFO("G054_303"),		// 주문-결품예정안내

+ 113 - 0
src/main/java/com/style24/persistence/domain/Counsel.java

@@ -0,0 +1,113 @@
+package com.style24.persistence.domain;
+
+import com.style24.core.support.session.TscSession;
+import com.style24.core.support.util.CryptoUtils;
+import com.style24.core.support.util.MaskingUtils;
+import com.style24.persistence.TscBaseDomain;
+
+import lombok.Data;
+
+/**
+ * 상담(1:1문의) Domain
+ *
+ * @author gagamel
+ * @since 2020. 12. 24
+ */
+@SuppressWarnings("serial")
+@Data
+public class Counsel extends TscBaseDomain {
+
+	private Integer counselSq;		// 상담일련번호
+	private String counselType;		// 상담유형(C-1:1문의, G-상품문의)
+	private String siteCd;			// 사이트코드(공통코드G000)
+	private String siteNm;			// 사이트명
+	private String counselClsf;		// 상담분류(공통코드G059)
+	private String counselClsfNm;	// 상담분류명
+	private String counselDclsf;	// 상담분류상세(공통코드G591~G599)
+	private String counselDclsfNm;	// 상담분류상세명
+	private Integer custNo;			// 고객번호
+	private String custId;			// 고객ID
+	private String custNm;			// 고객명
+	private String cellPhnno;		// 휴대전화번호
+	private String smsReqYn;		// SMS(알림톡)요청여부
+	private String smsSendYn;		// SMS(알림톡)발송여부
+	private String email;			// 이메일
+//	private String emailReqYn;		// 이메일요청여부
+//	private String emailSendYn;		// 이메일발송여부
+	private String relOrdNo;		// 관련상품 주문번호
+	private String relGoodsCd;		// 관련상품코드(상품문의에서만 사용)
+	private String goodsNm;			// 상품명(상품문의에서만 사용)
+	private String goodsImg;		// 상품이미지
+	private String selfGoodsYn;		// 자사상품여부(상품문의에서만 사용)
+	private String questTitle;		// 문의제목
+	private String questContent;	// 문의내용
+	private String questDt;			// 문의일시
+	private String orgFileNm1;		// 원본파일명1
+	private String sysFileNm1;		// 시스템파일명1
+	private String orgFileNm2;		// 원본파일명2
+	private String sysFileNm2;		// 시스템파일명2
+	private String ansStat;			// 답변상태(공통코드G060)
+	private String ansStatNm;		// 답변상태명
+	private String ansTransYn;		// 답변의뢰여부(상품문의에서만 사용)
+	private String ansCompCd;		// 답변업체코드(상품문의에서만 사용)
+	private String ansCompNm;		// 답변업체명(상품문의에서만 사용)
+	private Integer ansTransNo;		// 답변의뢰자번호(상품문의에서만 사용)
+	private String ansTransNm;		// 답변의뢰자명(상품문의에서만 사용)
+	private String ansTransDt;		// 답변의뢰일시(상품문의에서만 사용)
+	private Integer assignedCsNo;	// 할당된CS담당자번호
+	private String assignedCsNm;	// 할당된CS담당자명
+	private String assignedYmd;		// 할당된연월일
+	private String assignedHms;		// 할당된시분초
+	private String ansTitle;		// 답변제목
+	private String ansContent;		// 답변내용
+	private Integer ansNo;			// 답변자번호
+	private String ansNm;			// 답변자명
+	private String ansDt;			// 답변일시
+	private String secretYn;		// 비밀글여부(상품문의에서만 사용)
+	private String delYn;			// 삭제여부
+
+	private Integer ansSq;
+	private String ansClsf;
+
+	// 검색조건
+	private String condition;		// 검색어
+	private String custGb;			// 회원구분
+	private String termGb;			// 기간구분
+	private String termStdt;		// 검색시작날짜
+	private String termEddt;		// 검색끝날짜
+
+	// 암호화 대상 복호화 처리
+	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;
+	}
+
+	// Masking
+	public String getMaskingCustId() {
+		return TscSession.getAttribute("maskingYn").equals("Y") ? MaskingUtils.id(this.custId) : this.custId;
+	}
+
+	public String getMaskingCustNm() {
+		return TscSession.getAttribute("maskingYn").equals("Y") ? MaskingUtils.name(getCustNm()) : getCustNm();
+
+	}
+
+	public String getMaskingCellPhnno() {
+		return TscSession.getAttribute("maskingYn").equals("Y") ? MaskingUtils.phoneNo(getCellPhnno()) : getCellPhnno();
+	}
+
+	public String getMaskingEmail() {
+		return TscSession.getAttribute("maskingYn").equals("Y") ? MaskingUtils.email(getEmail()) : getEmail();
+	}
+
+}