Explorar o código

알림톡 core에 추가

jsshin %!s(int64=5) %!d(string=hai) anos
pai
achega
86a2f36fd7

+ 102 - 8
src/main/java/com/style24/core/biz/service/TscKakaotalkService.java

@@ -136,29 +136,123 @@ public class TscKakaotalkService {
 		}
 	}
 
+	/**
+	 * 생일축하 안내 알림톡
+	 *
+	 * @param custCoupon - 고객 정보, 쿠폰 정보
+	 * @param senderNo - 발송자번호(userNo, custNo)
+	 * @author jsshin
+	 * @since 2021. 05. 31
+	 */
+	@Transactional("shopTxnManager")
+	public void sendBirthDayCouponNotice(CustCoupon custCoupon, Integer senderNo) {
+		SsgDirectMessage dm = new SsgDirectMessage();
+		dm.setFuserid(String.valueOf(senderNo)); // 발송자NO
+		dm.setFdestine(custCoupon.getCellPhnno());
+		dm.setFkkoresendtype("LMS");
+
+
+		GagaMap replaceInfo = new GagaMap();
+		replaceInfo.setString("siteNm", siteNm);
+		replaceInfo.setString("custNm", custCoupon.getCustNm());
+		replaceInfo.setInt("dcVal", custCoupon.getDcVal());
+		replaceInfo.setString("dcWay", custCoupon.getDcWay());
+
+		replaceInfo.set("custNo", custCoupon.getCustNo());
+		kakaoSender.send(SsgKakaoSender.KakaoAnswerSq.BIRTH_COUPON_NOTICE.value(), dm, replaceInfo);
+
+		try {
+			// 고객접촉이력 정보
+			CustContactHst custContactHst = new CustContactHst();
+			custContactHst.setContactType(TscConstants.ContactType.BIRTH_COUPON_NOTICE.value()); // 접촉유형:임시비밀번호발급(공통코드G054)
+			custContactHst.setContactMethod(TscConstants.ContactMethod.KAKAOTALK.value()); // 접촉방법:알림톡+문자(공통코드G055)
+			custContactHst.setContactContents("생일축하안내");
+			custContactHst.setReceiverNo(custCoupon.getCustNo());
+			custContactHst.setSenderNo(senderNo);
+			custContactHst.setRegNo(senderNo);
+			coreCustomerService.createCustomerContactHistory(custContactHst);
+		} catch (Exception e) {
+			log.error("error", e);
+			// Do nothing
+		}
+	}
+
+	/**
+	 * 기본 LMS 발송
+	 *
+	 * @param customer - LMS 정보
+	 * @author jsshin
+	 * @since 2021. 01. 21
+	 */
+	@Transactional("shopTxnManager")
+	public void sendCustomerBasicLms(Customer customer, Integer senderNo) {
+		SsgDirectMessage dm = new SsgDirectMessage();
+		dm.setFuserid(String.valueOf(senderNo)); // 발송자NO
+		dm.setFdestine(customer.getCellPhnno());
+
+		GagaMap replaceInfo = new GagaMap();
+		replaceInfo.setString("siteNm", siteNm);
+		replaceInfo.setString("custNm", customer.getCustNm());
+		replaceInfo.setString("content", customer.getContent());
+		replaceInfo.setString("callcenterTelNo", TscConstants.CALLCENTER_TEL_NO);
+		kakaoSender.sendLms(SsgKakaoSender.KakaoAnswerSq.BASIC_LMS.value(), dm, replaceInfo);
+
+		try {
+			// 고객접촉이력 정보
+			CustContactHst custContactHst = new CustContactHst();
+			custContactHst.setContactType(TscConstants.ContactType.BASIC_LMS.value()); // 접촉유형:회원-기본LMS안내발송
+			custContactHst.setContactMethod(TscConstants.ContactMethod.LMS.value()); // 접촉방법:LMS(공통코드G055)
+			custContactHst.setContactContents("기본LMS안내발송");
+			custContactHst.setReceiverNo(customer.getCustNo());
+			custContactHst.setSenderNo(senderNo);
+			custContactHst.setRegNo(senderNo);
+			custContactHst.setUpdNo(senderNo);
+			coreCustomerService.createCustomerContactHistory(custContactHst);
+		} catch (Exception e) {
+			log.error("error", e);
+			// Do nothing
+		}
+	}
 
 	/**
 	 * 인증번호발송
-	 * @param customer - 고객 정보
-	 * @param senderNo - 발송자번호(고객, 사용자)
+	 *
+	 * @param customer - 인증번호 발송
 	 * @author jsshin
-	 * @since 2020. 4. 8
+	 * @since 2021. 01. 25
 	 */
-	public void sendCustomerCertNo(Customer customer, Integer senderNo) throws Exception {
+	@Transactional("shopTxnManager")
+	public void sendCustomerCertNo(Customer customer, Integer senderNo) {
 		SsgDirectMessage dm = new SsgDirectMessage();
 		dm.setFuserid(String.valueOf(senderNo)); // 발송자NO
 		dm.setFdestine(customer.getCellPhnno());
-//		dm.setFkkoresendtype("LMS");
+		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);
+		kakaoSender.send(SsgKakaoSender.KakaoAnswerSq.CERT_NO_SEND.value(), dm, replaceInfo);
+
+		try {
+			// 고객접촉이력 정보
+			CustContactHst custContactHst = new CustContactHst();
+			custContactHst.setContactType(TscConstants.ContactType.CERT_NO_SEND.value()); // 접촉유형:회원-휴대전화인증(공통코드G054)
+			custContactHst.setContactMethod(TscConstants.ContactMethod.KAKAOTALK.value()); // 접촉방법:알림톡+문자(공통코드G055)
+			custContactHst.setContactContents("인증번호");
+			custContactHst.setReceiverNo(customer.getCustNo());
+			custContactHst.setSenderNo(senderNo);
+			custContactHst.setRegNo(senderNo);
+			custContactHst.setUpdNo(senderNo);
+			coreCustomerService.createCustomerContactHistory(custContactHst);
+		} catch (Exception e) {
+			log.error("error", e);
+			// Do nothing
+		}
 	}
-	
+
+
 	/**
 	 * 상품권 기간만료 알림톡(30일)
 	 * @param giftcard - 상품권 정보