|
@@ -6,6 +6,7 @@ import com.style24.core.biz.thirdparty.NetpathyMailSender;
|
|
|
import com.style24.core.support.env.TscConstants;
|
|
import com.style24.core.support.env.TscConstants;
|
|
|
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.Customer;
|
|
import com.style24.persistence.domain.Customer;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -144,9 +145,19 @@ public class TscMailService {
|
|
|
*/
|
|
*/
|
|
|
@Transactional("shopTxnManager")
|
|
@Transactional("shopTxnManager")
|
|
|
public void sendSecedComplete(Customer customer, Integer senderNo) {
|
|
public void sendSecedComplete(Customer customer, Integer senderNo) {
|
|
|
|
|
+
|
|
|
|
|
+ String custId = customer.getCustId();
|
|
|
|
|
+ if (TscConstants.SnsType.NAVER.value().equals(customer.getSnsType())) {
|
|
|
|
|
+ custId = "네이버 간편가입회원";
|
|
|
|
|
+ } else if (TscConstants.SnsType.KAKAO.value().equals(customer.getSnsType())) {
|
|
|
|
|
+ custId = "카카오 간편가입회원";
|
|
|
|
|
+ } else if (TscConstants.SnsType.YES24.value().equals(customer.getSnsType())) {
|
|
|
|
|
+ custId = "YES24 간편가입회원";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
GagaMap replaceInfo = new GagaMap();
|
|
GagaMap replaceInfo = new GagaMap();
|
|
|
replaceInfo.setInt("custNo", customer.getCustNo());
|
|
replaceInfo.setInt("custNo", customer.getCustNo());
|
|
|
- replaceInfo.setString("custId", customer.getCustId());
|
|
|
|
|
|
|
+ replaceInfo.setString("custId", custId);
|
|
|
replaceInfo.setString("custNm", customer.getCustNm());
|
|
replaceInfo.setString("custNm", customer.getCustNm());
|
|
|
replaceInfo.setString("secedeDt", customer.getSecedeDt());
|
|
replaceInfo.setString("secedeDt", customer.getSecedeDt());
|
|
|
replaceInfo.setInt("rejoinRejectDay", customer.getRejoinRejectDay());
|
|
replaceInfo.setInt("rejoinRejectDay", customer.getRejoinRejectDay());
|
|
@@ -169,5 +180,225 @@ public class TscMailService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 휴면계정전환 안내
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param customer - 고객 정보
|
|
|
|
|
+ * @param senderNo - 보낸
|
|
|
|
|
+ * @author jsshin
|
|
|
|
|
+ * @since 2021. 06. 07
|
|
|
|
|
+ */
|
|
|
|
|
+ @Transactional("shopTxnManager")
|
|
|
|
|
+ public void sendExpectedDormentCustomer(Customer customer, Integer senderNo) {
|
|
|
|
|
+ String year = "";
|
|
|
|
|
+ String month = "";
|
|
|
|
|
+ String day = "";
|
|
|
|
|
+ if (StringUtils.isNotBlank(customer.getFewDt()) && customer.getFewDt().length() > 7) {
|
|
|
|
|
+ String fewDt = customer.getFewDt();
|
|
|
|
|
+ year = fewDt.substring(0, 4);
|
|
|
|
|
+ month = fewDt.substring(4, 6);
|
|
|
|
|
+ day = fewDt.substring(6, 8);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ GagaMap replaceInfo = new GagaMap();
|
|
|
|
|
+ replaceInfo.setInt("custNo", customer.getCustNo());
|
|
|
|
|
+ replaceInfo.setString("custId", customer.getCustId());
|
|
|
|
|
+ replaceInfo.setString("custNm", customer.getCustNm());
|
|
|
|
|
+ replaceInfo.setString("dormantDt", customer.getDormantDt());
|
|
|
|
|
+ replaceInfo.setString("year", year);
|
|
|
|
|
+ replaceInfo.setString("month", month);
|
|
|
|
|
+ replaceInfo.setString("day", day);
|
|
|
|
|
+
|
|
|
|
|
+ netpathyMailSender.send(NetpathyMailSender.MailAnswerSq.DORMANT_EXPECT.value(), customer.getEmail(), replaceInfo);
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 고객접촉이력 정보
|
|
|
|
|
+ CustContactHst custContactHst = new CustContactHst();
|
|
|
|
|
+ custContactHst.setContactType(TscConstants.ContactType.DORMANT_EXPECTED.value()); // 접촉유형:임시비밀번호발급(공통코드G054)
|
|
|
|
|
+ custContactHst.setContactMethod(TscConstants.ContactMethod.EMAIL.value()); // 접촉방법:알림톡+문자(공통코드G055)
|
|
|
|
|
+ custContactHst.setContactContents("휴면계정전환안내");
|
|
|
|
|
+ custContactHst.setReceiverNo(customer.getCustNo());
|
|
|
|
|
+ custContactHst.setSenderNo(senderNo);
|
|
|
|
|
+ custContactHst.setRegNo(senderNo);
|
|
|
|
|
+ coreCustomerService.createCustomerContactHistory(custContactHst);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("error", e);
|
|
|
|
|
+ // Do nothing
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 개인정보이용내역 안내
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param customer - 고객 정보
|
|
|
|
|
+ * @param senderNo - 보낸
|
|
|
|
|
+ * @author jsshin
|
|
|
|
|
+ * @since 2021. 06. 07
|
|
|
|
|
+ */
|
|
|
|
|
+ @Transactional("shopTxnManager")
|
|
|
|
|
+ public void sendPrivacyPolicyNotice(Customer customer, Integer senderNo) {
|
|
|
|
|
+ GagaMap replaceInfo = new GagaMap();
|
|
|
|
|
+ replaceInfo.setInt("custNo", customer.getCustNo());
|
|
|
|
|
+
|
|
|
|
|
+ netpathyMailSender.send(NetpathyMailSender.MailAnswerSq.PRIVACY_POLICY.value(), customer.getEmail(), replaceInfo);
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 고객접촉이력 정보
|
|
|
|
|
+ CustContactHst custContactHst = new CustContactHst();
|
|
|
|
|
+ custContactHst.setContactType(TscConstants.ContactType.PRIVACY_POLICY.value()); // 접촉유형:임시비밀번호발급(공통코드G054)
|
|
|
|
|
+ custContactHst.setContactMethod(TscConstants.ContactMethod.EMAIL.value()); // 접촉방법:알림톡+문자(공통코드G055)
|
|
|
|
|
+ custContactHst.setContactContents("개인정보이용내역안내");
|
|
|
|
|
+ custContactHst.setReceiverNo(customer.getCustNo());
|
|
|
|
|
+ custContactHst.setSenderNo(senderNo);
|
|
|
|
|
+ custContactHst.setRegNo(senderNo);
|
|
|
|
|
+ coreCustomerService.createCustomerContactHistory(custContactHst);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("error", e);
|
|
|
|
|
+ // Do nothing
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 마케팅정보수신동의내역안내
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param customer - 고객 정보
|
|
|
|
|
+ * @param senderNo - 보낸
|
|
|
|
|
+ * @author jsshin
|
|
|
|
|
+ * @since 2021. 06. 07
|
|
|
|
|
+ */
|
|
|
|
|
+ @Transactional("shopTxnManager")
|
|
|
|
|
+ public void sendMarketingAgreeNotice(Customer customer, Integer senderNo) {
|
|
|
|
|
+
|
|
|
|
|
+ String emailAgreeYn = customer.getEmailAgreeYn().equals("Y") ? "수신동의" : "미동의"; // 이메일수신동의여부
|
|
|
|
|
+ String smsAgreeYn = customer.getSmsAgreeYn().equals("Y") ? "수신동의" : "미동의"; // SMS수신동의여부
|
|
|
|
|
+ String mkAgreeYn = customer.getMkAgreeYn().equals("Y") ? "수신동의" : "미동의"; // 마케팅수신동의여부
|
|
|
|
|
+
|
|
|
|
|
+ String emailAgreeDt = customer.getEmailAgreeYn().equals("Y") ? customer.getEmailAgreeDt() : "";
|
|
|
|
|
+ String smsAgreeDt = customer.getSmsAgreeYn().equals("Y") ? customer.getSmsAgreeDt() : "";
|
|
|
|
|
+ String mkAgreeDt = customer.getMkAgreeYn().equals("Y") ? customer.getMkAgreeDt() : "";
|
|
|
|
|
+
|
|
|
|
|
+ GagaMap replaceInfo = new GagaMap();
|
|
|
|
|
+ replaceInfo.setInt("custNo", customer.getCustNo());
|
|
|
|
|
+ replaceInfo.setString("emailAgreeYn", emailAgreeYn);
|
|
|
|
|
+ replaceInfo.setString("emailAgreeDt", emailAgreeDt);
|
|
|
|
|
+ replaceInfo.setString("smsAgreeYn", smsAgreeYn);
|
|
|
|
|
+ replaceInfo.setString("smsAgreeDt", smsAgreeDt);
|
|
|
|
|
+ replaceInfo.setString("mkAgreeYn", mkAgreeYn);
|
|
|
|
|
+ replaceInfo.setString("mkAgreeDt", mkAgreeDt);
|
|
|
|
|
+
|
|
|
|
|
+ netpathyMailSender.send(NetpathyMailSender.MailAnswerSq.MARKETING_AGREE.value(), customer.getEmail(), replaceInfo);
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 고객접촉이력 정보
|
|
|
|
|
+ CustContactHst custContactHst = new CustContactHst();
|
|
|
|
|
+ custContactHst.setContactType(TscConstants.ContactType.MARKETING_AGREE.value()); // 접촉유형:임시비밀번호발급(공통코드G054)
|
|
|
|
|
+ custContactHst.setContactMethod(TscConstants.ContactMethod.EMAIL.value()); // 접촉방법:알림톡+문자(공통코드G055)
|
|
|
|
|
+ custContactHst.setContactContents("마케팅정보수신동의내역안내");
|
|
|
|
|
+ custContactHst.setReceiverNo(customer.getCustNo());
|
|
|
|
|
+ custContactHst.setSenderNo(senderNo);
|
|
|
|
|
+ custContactHst.setRegNo(senderNo);
|
|
|
|
|
+ coreCustomerService.createCustomerContactHistory(custContactHst);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("error", e);
|
|
|
|
|
+ // Do nothing
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 생일쿠폰다운로드안내
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param customer - 고객 정보
|
|
|
|
|
+ * @param coupon - 쿠폰정보
|
|
|
|
|
+ * @param senderNo - 보낸
|
|
|
|
|
+ * @author jsshin
|
|
|
|
|
+ * @since 2021. 06. 07
|
|
|
|
|
+ */
|
|
|
|
|
+ @Transactional("shopTxnManager")
|
|
|
|
|
+ public void sendBirthDayCouponNotice(Customer customer, CustCoupon coupon, Integer senderNo) {
|
|
|
|
|
+ GagaMap replaceInfo = new GagaMap();
|
|
|
|
|
+ replaceInfo.setInt("custNo", customer.getCustNo());
|
|
|
|
|
+ replaceInfo.setString("custId", customer.getCustId());
|
|
|
|
|
+ replaceInfo.setString("custNm", customer.getCustNm());
|
|
|
|
|
+ replaceInfo.setInt("dcVal", coupon.getDcVal());
|
|
|
|
|
+ replaceInfo.setString("dcWay", coupon.getDcWay());
|
|
|
|
|
+ replaceInfo.setString("availStdtTime", coupon.getAvailStdtTime());
|
|
|
|
|
+ replaceInfo.setString("availEddtTime", coupon.getAvailEddtTime());
|
|
|
|
|
+ if (StringUtils.isNotBlank(coupon.getAvailStdtTime())) {
|
|
|
|
|
+ String[] availStdt = coupon.getAvailStdtTime().split(" ");
|
|
|
|
|
+ replaceInfo.setString("availStdt", availStdt[0]);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtils.isNotBlank(coupon.getAvailEddtTime())) {
|
|
|
|
|
+ String[] availEddt = coupon.getAvailEddtTime().split(" ");
|
|
|
|
|
+ replaceInfo.setString("availEddt", availEddt[0]);
|
|
|
|
|
+ }
|
|
|
|
|
+ replaceInfo.setString("tgtCondition",coupon.getTgtCondition());
|
|
|
|
|
+ replaceInfo.setString("useCondition",coupon.getUseCondition());
|
|
|
|
|
+ netpathyMailSender.send(NetpathyMailSender.MailAnswerSq.BIRTH_COUPON_NOTICE.value(), customer.getEmail(), replaceInfo);
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 고객접촉이력 정보
|
|
|
|
|
+ CustContactHst custContactHst = new CustContactHst();
|
|
|
|
|
+ custContactHst.setContactType(TscConstants.ContactType.BIRTH_COUPON_NOTICE.value()); // 접촉유형:임시비밀번호발급(공통코드G054)
|
|
|
|
|
+ custContactHst.setContactMethod(TscConstants.ContactMethod.EMAIL.value()); // 접촉방법:알림톡+문자(공통코드G055)
|
|
|
|
|
+ custContactHst.setContactContents("생일쿠폰다운로드안내");
|
|
|
|
|
+ custContactHst.setReceiverNo(customer.getCustNo());
|
|
|
|
|
+ custContactHst.setSenderNo(senderNo);
|
|
|
|
|
+ custContactHst.setRegNo(senderNo);
|
|
|
|
|
+ coreCustomerService.createCustomerContactHistory(custContactHst);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("error", e);
|
|
|
|
|
+ // Do nothing
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 생일쿠폰다운로드안내
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param customer - 고객 정보
|
|
|
|
|
+ * @param coupon - 쿠폰정보
|
|
|
|
|
+ * @param senderNo - 보낸
|
|
|
|
|
+ * @author jsshin
|
|
|
|
|
+ * @since 2021. 06. 07
|
|
|
|
|
+ */
|
|
|
|
|
+ @Transactional("shopTxnManager")
|
|
|
|
|
+ public void sendCombackCouponNotice(Customer customer, CustCoupon coupon,Integer senderNo){
|
|
|
|
|
+ GagaMap replaceInfo = new GagaMap();
|
|
|
|
|
+ replaceInfo.setInt("custNo", customer.getCustNo());
|
|
|
|
|
+ replaceInfo.setString("custId", customer.getCustId());
|
|
|
|
|
+ replaceInfo.setString("custNm", customer.getCustNm());
|
|
|
|
|
+ replaceInfo.setInt("dcVal", coupon.getDcVal());
|
|
|
|
|
+ replaceInfo.setString("dcWay", coupon.getDcWay());
|
|
|
|
|
+ replaceInfo.setString("availStdtTime", coupon.getAvailStdtTime());
|
|
|
|
|
+ replaceInfo.setString("availEddtTime", coupon.getAvailEddtTime());
|
|
|
|
|
+ if (StringUtils.isNotBlank(coupon.getAvailStdtTime())) {
|
|
|
|
|
+ String[] availStdt = coupon.getAvailStdtTime().split(" ");
|
|
|
|
|
+ replaceInfo.setString("availStdt", availStdt[0]);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtils.isNotBlank(coupon.getAvailEddtTime())) {
|
|
|
|
|
+ String[] availEddt = coupon.getAvailEddtTime().split(" ");
|
|
|
|
|
+ replaceInfo.setString("availEddt", availEddt[0]);
|
|
|
|
|
+ }
|
|
|
|
|
+ replaceInfo.setString("tgtCondition",coupon.getTgtCondition());
|
|
|
|
|
+ replaceInfo.setString("useCondition",coupon.getUseCondition());
|
|
|
|
|
+
|
|
|
|
|
+ netpathyMailSender.send(NetpathyMailSender.MailAnswerSq.DORMANT_EXPECT_COMBACK.value(), customer.getEmail(), replaceInfo);
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 고객접촉이력 정보
|
|
|
|
|
+ CustContactHst custContactHst = new CustContactHst();
|
|
|
|
|
+ custContactHst.setContactType(TscConstants.ContactType.DORMANT_EXPECT_COMBACK.value()); // 접촉유형:임시비밀번호발급(공통코드G054)
|
|
|
|
|
+ custContactHst.setContactMethod(TscConstants.ContactMethod.EMAIL.value()); // 접촉방법:알림톡+문자(공통코드G055)
|
|
|
|
|
+ custContactHst.setContactContents("휴면/미접속자 방어쿠폰안내");
|
|
|
|
|
+ custContactHst.setReceiverNo(customer.getCustNo());
|
|
|
|
|
+ custContactHst.setSenderNo(senderNo);
|
|
|
|
|
+ custContactHst.setRegNo(senderNo);
|
|
|
|
|
+ coreCustomerService.createCustomerContactHistory(custContactHst);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("error", e);
|
|
|
|
|
+ // Do nothing
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
}
|
|
}
|