Просмотр исходного кода

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

tsit14 5 лет назад
Родитель
Сommit
ecc6b2e67c

+ 9 - 0
src/main/java/com/style24/core/biz/dao/TscCustomerDao.java

@@ -246,5 +246,14 @@ public interface TscCustomerDao {
 	 */
 	 */
 	int deleteCustDeliveryAddr(CustDeliveryAddr custDeliveryAddr);
 	int deleteCustDeliveryAddr(CustDeliveryAddr custDeliveryAddr);
 
 
+	/**
+	 * 탈퇴일시
+	 *
+	 * @param custNo - 고객번호
+	 * @author jsshin
+	 * @since 2021. 06. 07
+	 */
+	Customer getSecedeDt(Integer custNo);
+
 	void createException();
 	void createException();
 }
 }

+ 8 - 0
src/main/java/com/style24/core/biz/service/TscCustomerService.java

@@ -37,6 +37,9 @@ public class TscCustomerService {
 	@Autowired
 	@Autowired
 	private TscOrderService coreOrderService;
 	private TscOrderService coreOrderService;
 
 
+	@Autowired
+	private TscEnvsetService envsetService;
+
 	@Autowired
 	@Autowired
 	private Environment env;
 	private Environment env;
 
 
@@ -139,6 +142,11 @@ public class TscCustomerService {
 		customerDao.deleteCustomerCart(customer.getCustNo());
 		customerDao.deleteCustomerCart(customer.getCustNo());
 
 
 		if (custSecedeCnt > 0) {
 		if (custSecedeCnt > 0) {
+			int rejoinRejectDay = envsetService.getRejoinRejectDays(TscConstants.Site.STYLE24.value());
+			Customer custSecede = customerDao.getSecedeDt(customer.getCustNo());
+			result.setInt("rejoinRejectDay", rejoinRejectDay);
+			result.setString("secedeDt", custSecede.getSecedeDt());
+			result.setString("snsType", custSecede.getSnsType());
 			result.setBoolean("isSuccess", true);
 			result.setBoolean("isSuccess", true);
 		} else {
 		} else {
 			result.setBoolean("isSuccess", false);
 			result.setBoolean("isSuccess", false);

+ 232 - 1
src/main/java/com/style24/core/biz/service/TscMailService.java

@@ -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
+		}
+	}
+
+
 
 
 }
 }

+ 2 - 0
src/main/java/com/style24/persistence/domain/CustCoupon.java

@@ -50,6 +50,8 @@ public class CustCoupon extends TscBaseDomain {
     private String custGrade;
     private String custGrade;
     private String useCondition;
     private String useCondition;
     private String tgtCondition;
     private String tgtCondition;
+    private String availStdtTime;
+    private String availEddtTime;
 
 
 
 
     public String getCustNm() {
     public String getCustNm() {

+ 7 - 0
src/main/java/com/style24/persistence/mybatis/shop/TscCustomer.xml

@@ -685,4 +685,11 @@
 		VALUES (NULL)
 		VALUES (NULL)
 	</insert>
 	</insert>
 
 
+	<select id="getSecedeDt" parameterType="Integer" resultType="Customer">
+		SELECT DATE_FORMAT(SECEDE_DT, '%Y.%m.%d %H:%i') AS SECEDE_DT
+		     , SNS_TYPE
+		FROM   TB_SECEDE_CUST
+		WHERE  CUST_NO = #{custNo}
+	</select>
+
 </mapper>
 </mapper>