sowon4187 5 éve
szülő
commit
9e1feba5b5

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

@@ -12,6 +12,7 @@ import com.style24.core.biz.thirdparty.SsgKakaoSender;
 import com.style24.core.support.env.TscConstants;
 import com.style24.persistence.domain.CustContactHst;
 import com.style24.persistence.domain.Customer;
+import com.style24.persistence.domain.GiftCard;
 import com.style24.persistence.domain.SsgDirectMessage;
 
 import lombok.extern.slf4j.Slf4j;
@@ -126,6 +127,53 @@ public class TscKakaotalkService {
 		}
 	}
 
+
+	/**
+	 * 인증번호발송
+	 * @param customer - 고객 정보
+	 * @param senderNo - 발송자번호(고객, 사용자)
+	 * @author jsshin
+	 * @since 2020. 4. 8
+	 */
+	public void sendCustomerCertNo(Customer customer, Integer senderNo) throws Exception {
+		SsgDirectMessage dm = new SsgDirectMessage();
+		dm.setFuserid(String.valueOf(senderNo)); // 발송자NO
+		dm.setFdestine(customer.getCellPhnno());
+//		dm.setFkkoresendtype("LMS");
+
+		GagaMap replaceInfo = new GagaMap();
+		replaceInfo.setString("siteNm", siteNm);
+		replaceInfo.setString("custNm", customer.getCustNm());
+		replaceInfo.setString("certNo", customer.getCertNo());
+
+		// SMS로 발송
+		kakaoSender.sendSms(SsgKakaoSender.KakaoAnswerSq.CERT_NO_SEND.value(), dm, replaceInfo);
+	}
+	
+	/**
+	 * 상품권 기간만료 알림톡(30일)
+	 * @param giftcard - 상품권 정보
+	 * @param senderNo - 발송자번호(고객번호)
+	 * @author sowon
+	 * @since 2021. 5. 27
+	 */
+	@Transactional("shopTxnManager")
+	public void sendGiftcardExpect(GiftCard giftcard, Integer senderNo) {
+		SsgDirectMessage dm = new SsgDirectMessage();
+		dm.setFuserid(String.valueOf(senderNo)); // 발송자NO
+		dm.setFdestine(giftcard.getCellPhnno());
+		dm.setFkkoresendtype("LMS");
+
+		GagaMap replaceInfo = new GagaMap();
+		replaceInfo.setString("siteNm", siteNm);
+		replaceInfo.setString("custNm", giftcard.getCustNm());
+		replaceInfo.setInt("rmGfcdAmt", giftcard.getRmGfcdAmt());
+		replaceInfo.setString("useExpDate", giftcard.getUseExpDate());
+		kakaoSender.send(SsgKakaoSender.KakaoAnswerSq.GIFTCARD_EXTNC_EXPECT.value(), dm, replaceInfo);
+
+	}
+
+
 //	/**
 //	 * 결제완료 알림톡
 //	 * @param customer - 고객 정보

+ 14 - 0
src/main/java/com/style24/persistence/domain/GiftCard.java

@@ -1,6 +1,7 @@
 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;
 
@@ -19,6 +20,8 @@ public class GiftCard extends TscBaseDomain {
 
 	private Integer custGfcdSq;		// 고객상품권일련번호
 	private Integer custNo;			// 고객번호
+	private String custNm;			// 고객이름
+	private String cellPhnno;		// 휴대전화번호(탈퇴 시 NULL로 처리)
 	private String gfcdNo;			// 상품권번호
 	private String gfcdNm;			// 상품권명
 	private int chgGfcdAmt;			// 전환금액
@@ -82,4 +85,15 @@ public class GiftCard extends TscBaseDomain {
 	public String getMaskingCustId() {
 		return TscSession.getAttribute("maskingYn").equals("Y") ? MaskingUtils.id(this.custId) : this.custId;
 	}
+	
+	// 암호화 대상 복호화 처리
+	public String getCustNm() {
+		this.custNm = CryptoUtils.decryptAES(this.custNm);
+		return this.custNm;
+	}
+	public String getCellPhnno() {
+		this.cellPhnno = CryptoUtils.decryptAES(this.cellPhnno);
+		return this.cellPhnno;
+	}
+
 }