|
|
@@ -19,6 +19,7 @@ import com.style24.persistence.domain.CustCoupon;
|
|
|
import com.style24.persistence.domain.Customer;
|
|
|
import com.style24.persistence.domain.GiftCard;
|
|
|
import com.style24.persistence.domain.Order;
|
|
|
+import com.style24.persistence.domain.OrderChange;
|
|
|
import com.style24.persistence.domain.Point;
|
|
|
import com.style24.persistence.domain.SsgDirectMessage;
|
|
|
|
|
|
@@ -825,4 +826,89 @@ public class TscKakaotalkService {
|
|
|
}
|
|
|
|
|
|
//----------------------------
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 주문취소 알림톡
|
|
|
+ *
|
|
|
+ * @param OrderChange
|
|
|
+ * @param senderNo
|
|
|
+ * @author card007
|
|
|
+ * @since 2021. 06. 07
|
|
|
+ */
|
|
|
+ @Transactional("shopTxnManager")
|
|
|
+ public void sendOrderCancelComplete(OrderChange orderChange, Integer senderNo) throws Exception {
|
|
|
+ SsgDirectMessage dm = new SsgDirectMessage();
|
|
|
+ dm.setFuserid(String.valueOf(senderNo));
|
|
|
+ dm.setFdestine(orderChange.getOrdPhnno());
|
|
|
+ dm.setFkkoresendtype("LMS");
|
|
|
+ dm.setButtonNm("주문 취소 확인");
|
|
|
+
|
|
|
+ DecimalFormat dc = new DecimalFormat("###,###,###,###");
|
|
|
+ String refundAmt = dc.format(orderChange.getRefundAmt());
|
|
|
+
|
|
|
+ GagaMap replaceInfo = new GagaMap();
|
|
|
+ replaceInfo.setString("siteNm" , siteNm);
|
|
|
+ replaceInfo.setString("ordNm" , orderChange.getOrdNm());
|
|
|
+ replaceInfo.setInt("ordNo" , orderChange.getOrdNo());
|
|
|
+ replaceInfo.setString("goodsNm" , orderChange.getGoodsNm());
|
|
|
+ replaceInfo.setInt("goodsCnt" , orderChange.getGoodsCnt());
|
|
|
+ replaceInfo.setString("payMeansNm" , orderChange.getPayMeansNm());
|
|
|
+ replaceInfo.setString("refundAmt" , refundAmt);
|
|
|
+
|
|
|
+ if (orderChange.getIsCustomer()) {
|
|
|
+ replaceInfo.setString("url", "/mypage/cre/list/form");
|
|
|
+ } else {
|
|
|
+ replaceInfo.setString("url", "/customer/noncust/order/confirm/form");
|
|
|
+ }
|
|
|
+
|
|
|
+ Integer ansSq = 0;
|
|
|
+ String pgGb = orderChange.getPgGb();
|
|
|
+ String payMeans = orderChange.getPayMeans();
|
|
|
+ if (TscConstants.PgGb.KCP.value().equals(pgGb)) {
|
|
|
+ if (TscConstants.PayMeans.CREDIT_CARD.value().equals(payMeans)) {
|
|
|
+ ansSq = SsgKakaoSender.KakaoAnswerSq.CARD_CANCEL_REFUND.value();
|
|
|
+ } else if (TscConstants.PayMeans.CELL_PHONE.value().equals(payMeans)) {
|
|
|
+ ansSq = SsgKakaoSender.KakaoAnswerSq.NA_CANCEL_REFUND.value();
|
|
|
+ } else if (TscConstants.PayMeans.ACCOUNT_TRANSFER.value().equals(payMeans)) {
|
|
|
+ ansSq = SsgKakaoSender.KakaoAnswerSq.AT_CANCEL_REFUND.value();
|
|
|
+ } else if (TscConstants.PayMeans.BANK_DEPOSIT.value().equals(payMeans)) {
|
|
|
+ ansSq = SsgKakaoSender.KakaoAnswerSq.VA_CANCEL_REFUND.value();
|
|
|
+ }
|
|
|
+ } else if (TscConstants.PgGb.PAYCO.value().equals(pgGb)) {
|
|
|
+ // TODO
|
|
|
+ // PAYCO 취소 알림톡 처리
|
|
|
+ } else if (TscConstants.PgGb.KAKAO.value().equals(pgGb)) {
|
|
|
+ // TODO
|
|
|
+ // 카카오페이 취소 알림톡 처리
|
|
|
+ } else if (TscConstants.PgGb.NAVER.value().equals(pgGb)) {
|
|
|
+ // TODO
|
|
|
+ // 네이버페이 취소 알림톡 처리
|
|
|
+ } else if (TscConstants.PgGb.ISTYLE.value().equals(pgGb)) {
|
|
|
+ // TODO
|
|
|
+ // 상품권 전체 결제 취소 알림톡 처리
|
|
|
+ }
|
|
|
+
|
|
|
+ if (ansSq > 0) {
|
|
|
+ // 테스트중
|
|
|
+ if ("전석훈".equals(orderChange.getOrdNm()) || "이태영".equals(orderChange.getOrdNm()) || "김지철".equals(orderChange.getOrdNm()) || "신주승".equals(orderChange.getOrdNm())) {
|
|
|
+ kakaoSender.send(ansSq, dm, replaceInfo);
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ // 고객접촉이력 정보
|
|
|
+ CustContactHst custContactHst = new CustContactHst();
|
|
|
+ custContactHst.setContactType(TscConstants.ContactType.CANCEL_INFO.value()); // 접촉유형:주문-취소안내(공통코드G054)
|
|
|
+ custContactHst.setContactMethod(TscConstants.ContactMethod.KAKAOTALK.value()); // 접촉방법:알림톡+문자(공통코드G055)
|
|
|
+ custContactHst.setContactContents("주문-취소안내");
|
|
|
+ custContactHst.setReceiverNo(orderChange.getCustNo());
|
|
|
+ custContactHst.setSenderNo(senderNo);
|
|
|
+ custContactHst.setRegNo(senderNo);
|
|
|
+ coreCustomerService.createCustomerContactHistory(custContactHst);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("error", e);
|
|
|
+ // Do nothing
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|