| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234 |
- 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
- // }
- // }
- }
|