TsaKakaoService.java 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. package com.style24.admin.biz.service;
  2. import org.springframework.beans.factory.annotation.Autowired;
  3. import org.springframework.stereotype.Service;
  4. import com.style24.core.biz.thirdparty.SsgKakaoSender;
  5. import lombok.extern.slf4j.Slf4j;
  6. /**
  7. * 카카오알림톡 Service. 모든 카카오알림톡 발송은 여기에서 처리한다.
  8. *
  9. * @author gagamel
  10. * @since 2020. 11. 9
  11. */
  12. @Service
  13. @Slf4j
  14. public class TsaKakaoService {
  15. @Autowired
  16. private SsgKakaoSender kakaoSender;
  17. // /**
  18. // * 고객 임시비밀번호 알림톡 발송
  19. // * @param counsel - 상담 정보
  20. // * @author gagamel
  21. // * @since 2020. 11. 9
  22. // */
  23. // @Transactional("shopTxnManager")
  24. // public void sendCustomerTempPassword(AdmCustomer customer) {
  25. // SsgDirectMessage dm = new SsgDirectMessage();
  26. // dm.setFuserid(String.valueOf(TsaSession.getInfo().getUserNo())); // 발송자ID
  27. // dm.setFdestine(customer.getCellPhnno());
  28. // dm.setFkkoresendtype("LMS");
  29. //
  30. // GagaMap replaceInfo = new GagaMap();
  31. // replaceInfo.setString("siteNm", customer.getSiteNm());
  32. // replaceInfo.setString("custNm", customer.getCustNm());
  33. // replaceInfo.setString("passwd", customer.getPasswd());
  34. //
  35. // kakaoSender.send(SsgKakaoSender.KakaoAnswerSq.TempPasswd.value(), dm, replaceInfo);
  36. //
  37. // try {
  38. // // 고객접촉이력 정보
  39. // customer.setContactType("203"); // 접촉유형:임시비밀번호발급(공통코드G054)
  40. // customer.setContactMethod(TscConstants.ContactMethod.KAKAOTALK.value()); // 접촉방법:알림톡+문자(공통코드G055)
  41. // customer.setContactContents("고객 임시비밀번호 발송");
  42. // customer.setReceiverId(customer.getCustNo());
  43. // customerService.createCustomerContactHistory(customer);
  44. // } catch (Exception e) {
  45. // log.error("error", e);
  46. // // Do nothing
  47. // }
  48. // }
  49. //
  50. // /**
  51. // * 일대일문의 답변 알림톡 발송
  52. // * @param counsel - 상담 정보
  53. // * @author gagamel
  54. // * @since 2020. 4. 6
  55. // */
  56. // @Transactional("shopTxnManager")
  57. // public void sendOnetoOneAnswer(AdmCounsel counsel) {
  58. // SsgDirectMessage dm = new SsgDirectMessage();
  59. // dm.setFdestine(counsel.getCellPhnno());
  60. // dm.setFkkoresendtype("LMS");
  61. // dm.setButtonNm("마이페이지 > 1:1문의");
  62. // dm.setButtonUrl("/mypage/counsel/detail/form/" + counsel.getCounselSq());
  63. //
  64. // GagaMap replaceInfo = new GagaMap();
  65. // replaceInfo.setString("siteNm", systemService.getSiteName(AdmConstants.SITE_CD));
  66. // replaceInfo.setString("custNm", counsel.getCustNm());
  67. //
  68. // kakaoSender.send(SsgKakaoSender.KakaoAnswerSq.OtoAnswer.value(), dm, replaceInfo);
  69. //
  70. // try {
  71. // // 고객접촉이력 정보
  72. // AdmCustomer customer = new AdmCustomer();
  73. // customer.setContactType("204"); // 접촉유형:1:1문의답변(공통코드G054)
  74. // customer.setContactMethod(TscConstants.ContactMethod.KAKAOTALK.value()); // 접촉방법:알림톡+문자(공통코드G055)
  75. // customer.setContactContents("1:1 문의 답변 발송");
  76. // customer.setReceiverId(counsel.getCustNo());
  77. // customerService.createCustomerContactHistory(customer);
  78. // } catch (Exception e) {
  79. // log.error("error", e);
  80. // // Do nothing
  81. // }
  82. // }
  83. //
  84. // /**
  85. // * 인증번호발송
  86. // * @param customer - 인증번호 발송
  87. // * @author jsshin
  88. // * @since 2020. 4. 8
  89. // */
  90. // public void sendCustomerCertNo(AdmCustomer customer) {
  91. // SsgDirectMessage dm = new SsgDirectMessage();
  92. // dm.setFdestine(customer.getCellPhnno());
  93. // dm.setFkkoresendtype("LMS");
  94. //
  95. // GagaMap replaceInfo = new GagaMap();
  96. // replaceInfo.setString("siteNm", customer.getSiteNm());
  97. // replaceInfo.setString("custNm", customer.getCustNm());
  98. // replaceInfo.setString("certNo", customer.getCertNo());
  99. //
  100. // kakaoSender.send(SsgKakaoSender.KakaoAnswerSq.CertNoSend.value(), dm, replaceInfo);
  101. //
  102. // try {
  103. // // 고객접촉이력 정보
  104. // customer.setContactType("209"); // 접촉유형:1:1문의답변(공통코드G054)
  105. // customer.setContactMethod(TscConstants.ContactMethod.KAKAOTALK.value()); // 접촉방법:알림톡+문자(공통코드G055)
  106. // customer.setContactContents("인증번호");
  107. // customer.setReceiverId(customer.getCustNo());
  108. // customerService.createCustomerContactHistory(customer);
  109. // } catch (Exception e) {
  110. // log.error("error", e);
  111. // // Do nothing
  112. // }
  113. // }
  114. //
  115. // /**
  116. // * 품절에의한 주문취소 안내
  117. // * @param delivery
  118. // * @author yujung
  119. // * @since 2020. 4. 23
  120. // */
  121. // public void sendCancelBySoldout(String payMeans, AdmDelivery delivery) {
  122. // SsgDirectMessage dm = new SsgDirectMessage();
  123. // dm.setFdestine(delivery.getOrderPhnno());
  124. // dm.setFkkoresendtype("LMS");
  125. //
  126. // GagaMap replaceInfo = new GagaMap();
  127. // replaceInfo.setString("siteNm", systemService.getSiteName(AdmConstants.SITE_CD));
  128. // replaceInfo.setString("custNm", delivery.getOrderNm());
  129. // replaceInfo.setString("goodsNm", delivery.getGoodsNm());
  130. // replaceInfo.setString("callcenterTelNo", TscConstants.CALLCENTER_TEL_NO);
  131. //
  132. // Integer KakaoAnswerSq = null;
  133. // if (payMeans.equals(TscConstants.PayMeans.CREDIT_CARD.value())) { // 신용카드
  134. // KakaoAnswerSq = SsgKakaoSender.KakaoAnswerSq.CardCancelBySoldout.value();
  135. // } else if (payMeans.equals(TscConstants.PayMeans.ACCOUNT_TRANSFER.value())) { // 실시간계좌이체
  136. // KakaoAnswerSq = SsgKakaoSender.KakaoAnswerSq.AtCancelBySoldout.value();
  137. // } else if (payMeans.equals(TscConstants.PayMeans.BANK_DEPOSIT.value())) { // 무통장입금
  138. // KakaoAnswerSq = SsgKakaoSender.KakaoAnswerSq.VaCancelBySoldout.value();
  139. // }
  140. //
  141. // kakaoSender.send(KakaoAnswerSq, dm, replaceInfo);
  142. //
  143. // try {
  144. // // 고객접촉이력 정보
  145. // AdmCustomer customer = new AdmCustomer();
  146. // customer.setContactType("304"); // 접촉유형 : 주문-품절안내(공통코드G054)
  147. // customer.setContactMethod(TscConstants.ContactMethod.KAKAOTALK.value()); // 접촉방법 : 알림톡+문자(공통코드G055)
  148. // customer.setContactContents("품절에의한 주문취소 안내");
  149. // customer.setReceiverId(delivery.getCustNo());
  150. // customerService.createCustomerContactHistory(customer);
  151. // } catch (Exception e) {
  152. // log.error("error", e);
  153. // // Do nothing
  154. // }
  155. // }
  156. //
  157. // /**
  158. // * 주문취소안내 알림톡
  159. // * @param customer - 고객 정보
  160. // * @author gagamel
  161. // * @since 2020. 11. 9
  162. // */
  163. // @Transactional("shopTxnManager")
  164. // public void sendOrderCancel(AdmCustomer customer, AdmOrder order) {
  165. // SsgDirectMessage dm = new SsgDirectMessage();
  166. // dm.setFdestine(customer.getCellPhnno());
  167. // dm.setFkkoresendtype("LMS");
  168. //
  169. // dm.setButtonNm("마이페이지 > 주문내역");
  170. // dm.setButtonUrl("/mypage/order/list/form");
  171. //
  172. // GagaMap replaceInfo = new GagaMap();
  173. // replaceInfo.setString("siteNm", systemService.getSiteName(AdmConstants.SITE_CD));
  174. // replaceInfo.setString("custNm", customer.getCustNm());
  175. //
  176. // if (order.getPayMeans().equals(TscConstants.PayMeans.CREDIT_CARD.value())) { // 신용카드
  177. // kakaoSender.send(SsgKakaoSender.KakaoAnswerSq.CardCancelRefund.value(), dm, replaceInfo);
  178. // } else if (order.getPayMeans().equals(TscConstants.PayMeans.ACCOUNT_TRANSFER.value())) { // 실시간계좌이체
  179. // kakaoSender.send(SsgKakaoSender.KakaoAnswerSq.AtCancelRefund.value(), dm, replaceInfo);
  180. // } else if (order.getPayMeans().equals(TscConstants.PayMeans.BANK_DEPOSIT.value())) { // 무통장입금
  181. // kakaoSender.send(SsgKakaoSender.KakaoAnswerSq.VaCancelRefund.value(), dm, replaceInfo);
  182. // }
  183. //
  184. // try {
  185. // // 고객접촉이력 정보
  186. // customer.setContactType("305"); // 접촉유형:주문안내(공통코드G054)
  187. // customer.setContactMethod(TscConstants.ContactMethod.KAKAOTALK.value()); // 접촉방법:알림톡+문자(공통코드G055)
  188. // customer.setContactContents("주문-취소안내");
  189. // customer.setReceiverId(customer.getCustNo());
  190. // customerService.createCustomerContactHistory(customer);
  191. // } catch (Exception e) {
  192. // log.error("error", e);
  193. // // Do nothing
  194. // }
  195. // }
  196. //
  197. // /**
  198. // * 기본 LMS 발송
  199. // * @param customer - LMS 정보
  200. // * @author gagamel
  201. // * @since 2020. 11. 9
  202. // */
  203. // @Transactional("shopTxnManager")
  204. // public void sendCustomerBasicLms(AdmCustomer customer) {
  205. // SsgDirectMessage dm = new SsgDirectMessage();
  206. // dm.setFdestine(customer.getCellPhnno());
  207. //
  208. // GagaMap replaceInfo = new GagaMap();
  209. // replaceInfo.setString("siteNm", customer.getSiteNm());
  210. // replaceInfo.setString("custNm", customer.getCustNm());
  211. // replaceInfo.setString("content", customer.getContent());
  212. // replaceInfo.setString("callcenterTelNo", TscConstants.CALLCENTER_TEL_NO);
  213. // kakaoSender.sendLms(SsgKakaoSender.KakaoAnswerSq.BasicLms.value(), dm, replaceInfo);
  214. //
  215. // try {
  216. // // 고객접촉이력 정보
  217. // customer.setContactType("207"); // 접촉유형:회원-기본LMS안내발송
  218. // customer.setContactMethod(TscConstants.ContactMethod.LMS.value()); // 접촉방법:LMS(공통코드G055)
  219. // customer.setContactContents("기본LMS안내발송");
  220. // customer.setReceiverId(customer.getCustNo());
  221. // customerService.createCustomerContactHistory(customer);
  222. // } catch (Exception e) {
  223. // log.error("error", e);
  224. // // Do nothing
  225. // }
  226. // }
  227. }