|
@@ -4,6 +4,8 @@ import java.text.DecimalFormat;
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
|
|
+import com.style24.core.biz.dao.TscOrderChangeDao;
|
|
|
|
|
+import com.style24.persistence.domain.*;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.core.env.Environment;
|
|
import org.springframework.core.env.Environment;
|
|
@@ -14,6 +16,7 @@ import com.gagaframework.web.parameter.GagaMap;
|
|
|
import com.style24.core.biz.thirdparty.NaverShortUrl;
|
|
import com.style24.core.biz.thirdparty.NaverShortUrl;
|
|
|
import com.style24.core.biz.thirdparty.SsgKakaoSender;
|
|
import com.style24.core.biz.thirdparty.SsgKakaoSender;
|
|
|
import com.style24.core.support.env.TscConstants;
|
|
import com.style24.core.support.env.TscConstants;
|
|
|
|
|
+import com.style24.persistence.domain.Counsel;
|
|
|
import com.style24.persistence.domain.Coupon;
|
|
import com.style24.persistence.domain.Coupon;
|
|
|
import com.style24.persistence.domain.CustContactHst;
|
|
import com.style24.persistence.domain.CustContactHst;
|
|
|
import com.style24.persistence.domain.CustCoupon;
|
|
import com.style24.persistence.domain.CustCoupon;
|
|
@@ -50,6 +53,9 @@ public class TscKakaotalkService {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private NaverShortUrl shortUrl;
|
|
private NaverShortUrl shortUrl;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private TscOrderChangeDao orderChangeDao;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 고객 임시비밀번호 알림톡 발송
|
|
* 고객 임시비밀번호 알림톡 발송
|
|
|
* @param customer - 고객 정보
|
|
* @param customer - 고객 정보
|
|
@@ -684,6 +690,14 @@ public class TscKakaotalkService {
|
|
|
*/
|
|
*/
|
|
|
@Transactional("shopTxnManager")
|
|
@Transactional("shopTxnManager")
|
|
|
public void sendDeliveryStart(Order order, Integer senderNo) throws Exception {
|
|
public void sendDeliveryStart(Order order, Integer senderNo) throws Exception {
|
|
|
|
|
+ Payment payment = new Payment();
|
|
|
|
|
+ payment.setOrdNo(order.getOrdNo());
|
|
|
|
|
+ payment = orderChangeDao.getPaymentInfo(payment);
|
|
|
|
|
+ // 네이버페이 주문형 데이터는 알림톡 송부X
|
|
|
|
|
+ if(TscConstants.PgGb.NAVER_ORDER.value().equals(payment.getPgGb())) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
SsgDirectMessage dm = new SsgDirectMessage();
|
|
SsgDirectMessage dm = new SsgDirectMessage();
|
|
|
dm.setFuserid(String.valueOf(senderNo)); // 발송자NO
|
|
dm.setFuserid(String.valueOf(senderNo)); // 발송자NO
|
|
|
dm.setFdestine(order.getOrdPhnno());
|
|
dm.setFdestine(order.getOrdPhnno());
|
|
@@ -935,6 +949,14 @@ public class TscKakaotalkService {
|
|
|
*/
|
|
*/
|
|
|
@Transactional("shopTxnManager")
|
|
@Transactional("shopTxnManager")
|
|
|
public void sendOrderCancelComplete(OrderChange orderChange, Integer senderNo) throws Exception {
|
|
public void sendOrderCancelComplete(OrderChange orderChange, Integer senderNo) throws Exception {
|
|
|
|
|
+ Payment payment = new Payment();
|
|
|
|
|
+ payment.setOrdNo(orderChange.getOrdNo());
|
|
|
|
|
+ payment = orderChangeDao.getPaymentInfo(payment);
|
|
|
|
|
+ // 네이버페이 주문형 데이터는 알림톡 송부X
|
|
|
|
|
+ if(TscConstants.PgGb.NAVER_ORDER.value().equals(payment.getPgGb())) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
SsgDirectMessage dm = new SsgDirectMessage();
|
|
SsgDirectMessage dm = new SsgDirectMessage();
|
|
|
dm.setFuserid(String.valueOf(senderNo));
|
|
dm.setFuserid(String.valueOf(senderNo));
|
|
|
dm.setFdestine(orderChange.getOrdPhnno());
|
|
dm.setFdestine(orderChange.getOrdPhnno());
|
|
@@ -1205,4 +1227,75 @@ public class TscKakaotalkService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 1:1문의 알림톡
|
|
|
|
|
+ * @param counsel
|
|
|
|
|
+ * @param senderNo - 발송자번호(고객번호)
|
|
|
|
|
+ * @author sowon
|
|
|
|
|
+ * @since 2021. 6. 21
|
|
|
|
|
+ */
|
|
|
|
|
+ @Transactional("shopTxnManager")
|
|
|
|
|
+ public void sendOneToOneAnswerNotify(Counsel counsel, Integer senderNo) {
|
|
|
|
|
+ SsgDirectMessage dm = new SsgDirectMessage();
|
|
|
|
|
+ dm.setFuserid(String.valueOf(senderNo)); // 발송자NO
|
|
|
|
|
+ dm.setFdestine(counsel.getCellPhnno());
|
|
|
|
|
+ dm.setFkkoresendtype("LMS");
|
|
|
|
|
+
|
|
|
|
|
+ GagaMap replaceInfo = new GagaMap();
|
|
|
|
|
+ replaceInfo.setString("siteNm", siteNm);
|
|
|
|
|
+ replaceInfo.setString("custNm", counsel.getCustNm());
|
|
|
|
|
+ kakaoSender.send(SsgKakaoSender.KakaoAnswerSq.ONE_TO_ONE_ANSWER.value(), dm, replaceInfo);
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 고객접촉이력 정보
|
|
|
|
|
+ CustContactHst custContactHst = new CustContactHst();
|
|
|
|
|
+ custContactHst.setContactType(TscConstants.ContactType.ONE_TO_ONE_ANSWER.value()); // 접촉유형:임시비밀번호발급(공통코드G054)
|
|
|
|
|
+ custContactHst.setContactMethod(TscConstants.ContactMethod.KAKAOTALK.value()); // 접촉방법:알림톡+문자(공통코드G055)
|
|
|
|
|
+ custContactHst.setContactContents("1:1문의답변");
|
|
|
|
|
+ custContactHst.setReceiverNo(counsel.getCustNo());
|
|
|
|
|
+ custContactHst.setSenderNo(senderNo);
|
|
|
|
|
+ custContactHst.setRegNo(senderNo);
|
|
|
|
|
+ coreCustomerService.createCustomerContactHistory(custContactHst);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("error", e);
|
|
|
|
|
+ // Do nothing
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 상품문의 알림톡
|
|
|
|
|
+ * @param counsel
|
|
|
|
|
+ * @param senderNo - 발송자번호(고객번호)
|
|
|
|
|
+ * @author sowon
|
|
|
|
|
+ * @since 2021. 6. 21
|
|
|
|
|
+ */
|
|
|
|
|
+ @Transactional("shopTxnManager")
|
|
|
|
|
+ public void sendGoodsAskNotify(Counsel counsel, Integer senderNo) {
|
|
|
|
|
+ SsgDirectMessage dm = new SsgDirectMessage();
|
|
|
|
|
+ dm.setFuserid(String.valueOf(senderNo)); // 발송자NO
|
|
|
|
|
+ dm.setFdestine(counsel.getCellPhnno());
|
|
|
|
|
+ dm.setFkkoresendtype("LMS");
|
|
|
|
|
+
|
|
|
|
|
+ GagaMap replaceInfo = new GagaMap();
|
|
|
|
|
+ replaceInfo.setString("siteNm", siteNm);
|
|
|
|
|
+ replaceInfo.setString("custNm", counsel.getCustNm());
|
|
|
|
|
+ replaceInfo.setString("goodsNm", counsel.getGoodsNm());
|
|
|
|
|
+ kakaoSender.send(SsgKakaoSender.KakaoAnswerSq.GOODS_ASK_ANSWER.value(), dm, replaceInfo);
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 고객접촉이력 정보
|
|
|
|
|
+ CustContactHst custContactHst = new CustContactHst();
|
|
|
|
|
+ custContactHst.setContactType(TscConstants.ContactType.GOODS_ASK_ANSWER.value()); // 접촉유형:임시비밀번호발급(공통코드G054)
|
|
|
|
|
+ custContactHst.setContactMethod(TscConstants.ContactMethod.KAKAOTALK.value()); // 접촉방법:알림톡+문자(공통코드G055)
|
|
|
|
|
+ custContactHst.setContactContents("상품문의답변");
|
|
|
|
|
+ custContactHst.setReceiverNo(counsel.getCustNo());
|
|
|
|
|
+ custContactHst.setSenderNo(senderNo);
|
|
|
|
|
+ custContactHst.setRegNo(senderNo);
|
|
|
|
|
+ coreCustomerService.createCustomerContactHistory(custContactHst);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("error", e);
|
|
|
|
|
+ // Do nothing
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|