|
@@ -0,0 +1,234 @@
|
|
|
|
|
+package com.style24.admin.biz.service;
|
|
|
|
|
+
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
|
+
|
|
|
|
|
+import com.style24.core.biz.thirdparty.SsgKakaoSender;
|
|
|
|
|
+
|
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * 카카오알림톡 Service. 모든 카카오알림톡 발송은 여기에서 처리한다.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @author gagamel
|
|
|
|
|
+ * @since 2020. 11. 9
|
|
|
|
|
+ */
|
|
|
|
|
+@Service
|
|
|
|
|
+@Slf4j
|
|
|
|
|
+public class TsaKakaoService {
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private SsgKakaoSender kakaoSender;
|
|
|
|
|
+
|
|
|
|
|
+// /**
|
|
|
|
|
+// * 고객 임시비밀번호 알림톡 발송
|
|
|
|
|
+// * @param counsel - 상담 정보
|
|
|
|
|
+// * @author gagamel
|
|
|
|
|
+// * @since 2020. 11. 9
|
|
|
|
|
+// */
|
|
|
|
|
+// @Transactional("shopTxnManager")
|
|
|
|
|
+// public void sendCustomerTempPassword(AdmCustomer customer) {
|
|
|
|
|
+// SsgDirectMessage dm = new SsgDirectMessage();
|
|
|
|
|
+// dm.setFuserid(String.valueOf(TsaSession.getInfo().getUserNo())); // 발송자ID
|
|
|
|
|
+// dm.setFdestine(customer.getCellPhnno());
|
|
|
|
|
+// dm.setFkkoresendtype("LMS");
|
|
|
|
|
+//
|
|
|
|
|
+// GagaMap replaceInfo = new GagaMap();
|
|
|
|
|
+// replaceInfo.setString("siteNm", customer.getSiteNm());
|
|
|
|
|
+// replaceInfo.setString("custNm", customer.getCustNm());
|
|
|
|
|
+// replaceInfo.setString("passwd", customer.getPasswd());
|
|
|
|
|
+//
|
|
|
|
|
+// kakaoSender.send(SsgKakaoSender.KakaoAnswerSq.TempPasswd.value(), dm, replaceInfo);
|
|
|
|
|
+//
|
|
|
|
|
+// try {
|
|
|
|
|
+// // 고객접촉이력 정보
|
|
|
|
|
+// customer.setContactType("203"); // 접촉유형:임시비밀번호발급(공통코드G054)
|
|
|
|
|
+// customer.setContactMethod(TscConstants.ContactMethod.KAKAOTALK.value()); // 접촉방법:알림톡+문자(공통코드G055)
|
|
|
|
|
+// customer.setContactContents("고객 임시비밀번호 발송");
|
|
|
|
|
+// customer.setReceiverId(customer.getCustNo());
|
|
|
|
|
+// customerService.createCustomerContactHistory(customer);
|
|
|
|
|
+// } catch (Exception e) {
|
|
|
|
|
+// log.error("error", e);
|
|
|
|
|
+// // Do nothing
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// /**
|
|
|
|
|
+// * 일대일문의 답변 알림톡 발송
|
|
|
|
|
+// * @param counsel - 상담 정보
|
|
|
|
|
+// * @author gagamel
|
|
|
|
|
+// * @since 2020. 4. 6
|
|
|
|
|
+// */
|
|
|
|
|
+// @Transactional("shopTxnManager")
|
|
|
|
|
+// public void sendOnetoOneAnswer(AdmCounsel counsel) {
|
|
|
|
|
+// SsgDirectMessage dm = new SsgDirectMessage();
|
|
|
|
|
+// dm.setFdestine(counsel.getCellPhnno());
|
|
|
|
|
+// dm.setFkkoresendtype("LMS");
|
|
|
|
|
+// dm.setButtonNm("마이페이지 > 1:1문의");
|
|
|
|
|
+// dm.setButtonUrl("/mypage/counsel/detail/form/" + counsel.getCounselSq());
|
|
|
|
|
+//
|
|
|
|
|
+// GagaMap replaceInfo = new GagaMap();
|
|
|
|
|
+// replaceInfo.setString("siteNm", systemService.getSiteName(AdmConstants.SITE_CD));
|
|
|
|
|
+// replaceInfo.setString("custNm", counsel.getCustNm());
|
|
|
|
|
+//
|
|
|
|
|
+// kakaoSender.send(SsgKakaoSender.KakaoAnswerSq.OtoAnswer.value(), dm, replaceInfo);
|
|
|
|
|
+//
|
|
|
|
|
+// try {
|
|
|
|
|
+// // 고객접촉이력 정보
|
|
|
|
|
+// AdmCustomer customer = new AdmCustomer();
|
|
|
|
|
+// customer.setContactType("204"); // 접촉유형:1:1문의답변(공통코드G054)
|
|
|
|
|
+// customer.setContactMethod(TscConstants.ContactMethod.KAKAOTALK.value()); // 접촉방법:알림톡+문자(공통코드G055)
|
|
|
|
|
+// customer.setContactContents("1:1 문의 답변 발송");
|
|
|
|
|
+// customer.setReceiverId(counsel.getCustNo());
|
|
|
|
|
+// customerService.createCustomerContactHistory(customer);
|
|
|
|
|
+// } catch (Exception e) {
|
|
|
|
|
+// log.error("error", e);
|
|
|
|
|
+// // Do nothing
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// /**
|
|
|
|
|
+// * 인증번호발송
|
|
|
|
|
+// * @param customer - 인증번호 발송
|
|
|
|
|
+// * @author jsshin
|
|
|
|
|
+// * @since 2020. 4. 8
|
|
|
|
|
+// */
|
|
|
|
|
+// public void sendCustomerCertNo(AdmCustomer customer) {
|
|
|
|
|
+// SsgDirectMessage dm = new SsgDirectMessage();
|
|
|
|
|
+// dm.setFdestine(customer.getCellPhnno());
|
|
|
|
|
+// dm.setFkkoresendtype("LMS");
|
|
|
|
|
+//
|
|
|
|
|
+// GagaMap replaceInfo = new GagaMap();
|
|
|
|
|
+// replaceInfo.setString("siteNm", customer.getSiteNm());
|
|
|
|
|
+// replaceInfo.setString("custNm", customer.getCustNm());
|
|
|
|
|
+// replaceInfo.setString("certNo", customer.getCertNo());
|
|
|
|
|
+//
|
|
|
|
|
+// kakaoSender.send(SsgKakaoSender.KakaoAnswerSq.CertNoSend.value(), dm, replaceInfo);
|
|
|
|
|
+//
|
|
|
|
|
+// try {
|
|
|
|
|
+// // 고객접촉이력 정보
|
|
|
|
|
+// customer.setContactType("209"); // 접촉유형:1:1문의답변(공통코드G054)
|
|
|
|
|
+// customer.setContactMethod(TscConstants.ContactMethod.KAKAOTALK.value()); // 접촉방법:알림톡+문자(공통코드G055)
|
|
|
|
|
+// customer.setContactContents("인증번호");
|
|
|
|
|
+// customer.setReceiverId(customer.getCustNo());
|
|
|
|
|
+// customerService.createCustomerContactHistory(customer);
|
|
|
|
|
+// } catch (Exception e) {
|
|
|
|
|
+// log.error("error", e);
|
|
|
|
|
+// // Do nothing
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// /**
|
|
|
|
|
+// * 품절에의한 주문취소 안내
|
|
|
|
|
+// * @param delivery
|
|
|
|
|
+// * @author yujung
|
|
|
|
|
+// * @since 2020. 4. 23
|
|
|
|
|
+// */
|
|
|
|
|
+// public void sendCancelBySoldout(String payMeans, AdmDelivery delivery) {
|
|
|
|
|
+// SsgDirectMessage dm = new SsgDirectMessage();
|
|
|
|
|
+// dm.setFdestine(delivery.getOrderPhnno());
|
|
|
|
|
+// dm.setFkkoresendtype("LMS");
|
|
|
|
|
+//
|
|
|
|
|
+// GagaMap replaceInfo = new GagaMap();
|
|
|
|
|
+// replaceInfo.setString("siteNm", systemService.getSiteName(AdmConstants.SITE_CD));
|
|
|
|
|
+// replaceInfo.setString("custNm", delivery.getOrderNm());
|
|
|
|
|
+// replaceInfo.setString("goodsNm", delivery.getGoodsNm());
|
|
|
|
|
+// replaceInfo.setString("callcenterTelNo", TscConstants.CALLCENTER_TEL_NO);
|
|
|
|
|
+//
|
|
|
|
|
+// Integer KakaoAnswerSq = null;
|
|
|
|
|
+// if (payMeans.equals(TscConstants.PayMeans.CREDIT_CARD.value())) { // 신용카드
|
|
|
|
|
+// KakaoAnswerSq = SsgKakaoSender.KakaoAnswerSq.CardCancelBySoldout.value();
|
|
|
|
|
+// } else if (payMeans.equals(TscConstants.PayMeans.ACCOUNT_TRANSFER.value())) { // 실시간계좌이체
|
|
|
|
|
+// KakaoAnswerSq = SsgKakaoSender.KakaoAnswerSq.AtCancelBySoldout.value();
|
|
|
|
|
+// } else if (payMeans.equals(TscConstants.PayMeans.BANK_DEPOSIT.value())) { // 무통장입금
|
|
|
|
|
+// KakaoAnswerSq = SsgKakaoSender.KakaoAnswerSq.VaCancelBySoldout.value();
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// kakaoSender.send(KakaoAnswerSq, dm, replaceInfo);
|
|
|
|
|
+//
|
|
|
|
|
+// try {
|
|
|
|
|
+// // 고객접촉이력 정보
|
|
|
|
|
+// AdmCustomer customer = new AdmCustomer();
|
|
|
|
|
+// customer.setContactType("304"); // 접촉유형 : 주문-품절안내(공통코드G054)
|
|
|
|
|
+// customer.setContactMethod(TscConstants.ContactMethod.KAKAOTALK.value()); // 접촉방법 : 알림톡+문자(공통코드G055)
|
|
|
|
|
+// customer.setContactContents("품절에의한 주문취소 안내");
|
|
|
|
|
+// customer.setReceiverId(delivery.getCustNo());
|
|
|
|
|
+// customerService.createCustomerContactHistory(customer);
|
|
|
|
|
+// } catch (Exception e) {
|
|
|
|
|
+// log.error("error", e);
|
|
|
|
|
+// // Do nothing
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// /**
|
|
|
|
|
+// * 주문취소안내 알림톡
|
|
|
|
|
+// * @param customer - 고객 정보
|
|
|
|
|
+// * @author gagamel
|
|
|
|
|
+// * @since 2020. 11. 9
|
|
|
|
|
+// */
|
|
|
|
|
+// @Transactional("shopTxnManager")
|
|
|
|
|
+// public void sendOrderCancel(AdmCustomer customer, AdmOrder order) {
|
|
|
|
|
+// SsgDirectMessage dm = new SsgDirectMessage();
|
|
|
|
|
+// dm.setFdestine(customer.getCellPhnno());
|
|
|
|
|
+// dm.setFkkoresendtype("LMS");
|
|
|
|
|
+//
|
|
|
|
|
+// dm.setButtonNm("마이페이지 > 주문내역");
|
|
|
|
|
+// dm.setButtonUrl("/mypage/order/list/form");
|
|
|
|
|
+//
|
|
|
|
|
+// GagaMap replaceInfo = new GagaMap();
|
|
|
|
|
+// replaceInfo.setString("siteNm", systemService.getSiteName(AdmConstants.SITE_CD));
|
|
|
|
|
+// replaceInfo.setString("custNm", customer.getCustNm());
|
|
|
|
|
+//
|
|
|
|
|
+// if (order.getPayMeans().equals(TscConstants.PayMeans.CREDIT_CARD.value())) { // 신용카드
|
|
|
|
|
+// kakaoSender.send(SsgKakaoSender.KakaoAnswerSq.CardCancelRefund.value(), dm, replaceInfo);
|
|
|
|
|
+// } else if (order.getPayMeans().equals(TscConstants.PayMeans.ACCOUNT_TRANSFER.value())) { // 실시간계좌이체
|
|
|
|
|
+// kakaoSender.send(SsgKakaoSender.KakaoAnswerSq.AtCancelRefund.value(), dm, replaceInfo);
|
|
|
|
|
+// } else if (order.getPayMeans().equals(TscConstants.PayMeans.BANK_DEPOSIT.value())) { // 무통장입금
|
|
|
|
|
+// kakaoSender.send(SsgKakaoSender.KakaoAnswerSq.VaCancelRefund.value(), dm, replaceInfo);
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// try {
|
|
|
|
|
+// // 고객접촉이력 정보
|
|
|
|
|
+// customer.setContactType("305"); // 접촉유형:주문안내(공통코드G054)
|
|
|
|
|
+// customer.setContactMethod(TscConstants.ContactMethod.KAKAOTALK.value()); // 접촉방법:알림톡+문자(공통코드G055)
|
|
|
|
|
+// customer.setContactContents("주문-취소안내");
|
|
|
|
|
+// customer.setReceiverId(customer.getCustNo());
|
|
|
|
|
+// customerService.createCustomerContactHistory(customer);
|
|
|
|
|
+// } catch (Exception e) {
|
|
|
|
|
+// log.error("error", e);
|
|
|
|
|
+// // Do nothing
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// /**
|
|
|
|
|
+// * 기본 LMS 발송
|
|
|
|
|
+// * @param customer - LMS 정보
|
|
|
|
|
+// * @author gagamel
|
|
|
|
|
+// * @since 2020. 11. 9
|
|
|
|
|
+// */
|
|
|
|
|
+// @Transactional("shopTxnManager")
|
|
|
|
|
+// public void sendCustomerBasicLms(AdmCustomer customer) {
|
|
|
|
|
+// SsgDirectMessage dm = new SsgDirectMessage();
|
|
|
|
|
+// dm.setFdestine(customer.getCellPhnno());
|
|
|
|
|
+//
|
|
|
|
|
+// GagaMap replaceInfo = new GagaMap();
|
|
|
|
|
+// replaceInfo.setString("siteNm", customer.getSiteNm());
|
|
|
|
|
+// replaceInfo.setString("custNm", customer.getCustNm());
|
|
|
|
|
+// replaceInfo.setString("content", customer.getContent());
|
|
|
|
|
+// replaceInfo.setString("callcenterTelNo", TscConstants.CALLCENTER_TEL_NO);
|
|
|
|
|
+// kakaoSender.sendLms(SsgKakaoSender.KakaoAnswerSq.BasicLms.value(), dm, replaceInfo);
|
|
|
|
|
+//
|
|
|
|
|
+// try {
|
|
|
|
|
+// // 고객접촉이력 정보
|
|
|
|
|
+// customer.setContactType("207"); // 접촉유형:회원-기본LMS안내발송
|
|
|
|
|
+// customer.setContactMethod(TscConstants.ContactMethod.LMS.value()); // 접촉방법:LMS(공통코드G055)
|
|
|
|
|
+// customer.setContactContents("기본LMS안내발송");
|
|
|
|
|
+// customer.setReceiverId(customer.getCustNo());
|
|
|
|
|
+// customerService.createCustomerContactHistory(customer);
|
|
|
|
|
+// } catch (Exception e) {
|
|
|
|
|
+// log.error("error", e);
|
|
|
|
|
+// // Do nothing
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+}
|