Kaynağa Gözat

Merge remote-tracking branch 'origin/develop' into xodud1202

xodud lee 5 yıl önce
ebeveyn
işleme
c46cfdb8fc

+ 64 - 2
src/main/java/com/style24/core/biz/service/TscMailService.java

@@ -3,12 +3,12 @@ package com.style24.core.biz.service;
 import com.gagaframework.web.parameter.GagaMap;
 import com.style24.core.biz.thirdparty.NaverShortUrl;
 import com.style24.core.biz.thirdparty.NetpathyMailSender;
-import com.style24.core.biz.thirdparty.SsgKakaoSender;
 import com.style24.core.support.env.TscConstants;
+import com.style24.persistence.domain.Coupon;
 import com.style24.persistence.domain.CustContactHst;
 import com.style24.persistence.domain.Customer;
-import com.style24.persistence.domain.SsgDirectMessage;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Service;
@@ -71,6 +71,68 @@ public class TscMailService {
 			// Do nothing
 		}
 	}
+	/**
+	 * 회원가입 완료
+	 *
+	 * @param customer - 고객 정보
+	 * @param coupon - 쿠폰정보
+	 * @author jsshin
+	 * @since 2021. 06. 02
+	 */
+	@Transactional("shopTxnManager")
+	public void sendJoinCongrat(Customer customer, Coupon coupon, Integer senderNo) {
+		String emailAgreeYn = "Y".equals(customer.getEmailAgreeYn()) ? "수신":"수신거부";
+		String smsAgreeYn = "Y".equals(customer.getSmsAgreeYn()) ? "수신":"수신거부";
+
+		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();
+		replaceInfo.setString("custId", custId);
+		replaceInfo.setString("custNm", customer.getCustNm());
+		replaceInfo.setInt("custNo", customer.getCustNo());
+		replaceInfo.setString("emailAgreeYn", emailAgreeYn);
+		replaceInfo.setString("smsAgreeYn", smsAgreeYn);
+		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.JOIN_CONGRATS.value(), customer.getEmail(), replaceInfo);
+
+		try {
+			// 고객접촉이력 정보
+			CustContactHst custContactHst = new CustContactHst();
+			custContactHst.setContactType(TscConstants.ContactType.JOIN_CONGRATS.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
+		}
+	}
 
 
 }