Pārlūkot izejas kodu

Merge branch 'jsshin' into develop

jsshin 5 gadi atpakaļ
vecāks
revīzija
e1d3c5932f

+ 2 - 0
src/main/java/com/style24/core/biz/dao/NetpathyMailDao.java

@@ -2,6 +2,7 @@ package com.style24.core.biz.dao;
 
 import com.style24.core.support.annotation.ShopDs;
 import com.style24.persistence.domain.Netpathy;
+import org.springframework.stereotype.Repository;
 
 /**
  * 넷퍼시메일 Dao
@@ -10,6 +11,7 @@ import com.style24.persistence.domain.Netpathy;
  * @since 2021. 5. 10
  */
 @ShopDs
+@Repository
 public interface NetpathyMailDao {
 
 	/**

+ 77 - 0
src/main/java/com/style24/core/biz/service/TscMailService.java

@@ -0,0 +1,77 @@
+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.CustContactHst;
+import com.style24.persistence.domain.Customer;
+import com.style24.persistence.domain.SsgDirectMessage;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 메일 서비스
+ *
+ * @author jsshin
+ * @since 2021. 6. 2
+ */
+@Service
+@Slf4j
+public class TscMailService {
+	private static final String siteNm = "STYLE24";
+
+	@Autowired
+	private Environment env;
+
+	@Autowired
+	private NetpathyMailSender netpathyMailSender;
+
+	@Autowired
+	private NaverShortUrl shortUrl;
+
+	@Autowired
+	private TscCustomerService coreCustomerService;
+
+	@Autowired
+	private TscMailTemplateService mailTemplateService;
+
+
+
+	/**
+	 * 고객 임시비밀번호 이메일 발송
+	 * @param customer - 고객 정보
+	 * @author jsshin
+	 * @since 2021. 06. 02
+	 */
+	@Transactional("shopTxnManager")
+	public void sendCustomerTempPassword(Customer customer, Integer senderNo) {
+		GagaMap replaceInfo = new GagaMap();
+		replaceInfo.setString("siteNm", siteNm);
+		replaceInfo.setString("custNm", customer.getCustNm());
+		replaceInfo.setString("passwd", customer.getPasswd());
+
+		netpathyMailSender.send(SsgKakaoSender.KakaoAnswerSq.TEMP_PASSWD.value(), customer.getEmail(), replaceInfo);
+
+		try {
+			// 고객접촉이력 정보
+			CustContactHst custContactHst = new CustContactHst();
+			custContactHst.setContactType(TscConstants.ContactType.TEMP_PASSWD.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
+		}
+	}
+
+
+}

+ 35 - 0
src/main/java/com/style24/core/biz/thirdparty/NetpathyMailSender.java

@@ -45,6 +45,41 @@ public class NetpathyMailSender {
 	@Autowired
 	private TscMailTemplateService mailTemplateService;
 
+
+		// 알림톡 답변일련번호
+	public enum MailAnswerSq {
+		JOIN_CONGRATS(1010),				// 회원가입축하 안내
+		TEMP_PASSWD(1011),				// 임시비밀번호발급 안내
+		SECEDE_CUST(1012),				// 회원탈퇴 안내
+		DORMANT_EXPECT(1013),			// 휴면계정전환예정 안내
+		PRIVACY_POLICY(1014),			// 개인정보 이용내역 안내
+		MARKETING_AGREE(1015),			// 마케팅 수신동의 안내
+		BIRTH_COUPON_NOTICE(1016),		// 생일 축하 안내
+		DORMANT_EXPECT_COMBACK(1017),	// 휴면/미접속자방어쿠폰안내
+		POINT_EXTNC_EXPECT(1018),		// 포인트 소멸 예정안내
+
+		ORDER_COMPLETE(1019),			// 주문완료 안내
+		VA_DEPOSIT_REQUEST(1020),		// 무통장 입금 요청
+		CANCEL_REFUND(1021),				// 주문취소 및 환불 안내
+
+		EXCHANGE_REQUEST(1023),			// 교환 접수 안내
+		RETURN_REQUEST(1024),			// 반품 접수 안내
+		MARKETING_MAIL_1(1025),			// 마케팅메일 1단
+		MARKETING_MAIL_2(1026),			// 마케팅메일 2단
+		MARKETING_MAIL_3(1027),			// 마케팅메일 3단
+		MARKETING_MAIL_MIX(1028);		// 마케팅메일 혼합
+
+		private Integer value;
+
+		MailAnswerSq(Integer value) {
+			this.value = value;
+		}
+
+		public Integer value() {
+			return value;
+		}
+	}
+
 	@PostConstruct
 	public void init() {
 //		domainUrl = env.getProperty("domain.front");