Pārlūkot izejas kodu

개인정보 이용 내역, 마케팅 정보 수신동의 내역 안내 기능 추가

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

+ 2 - 0
src/main/java/com/style24/batch/biz/job/customer/TsbMarketingAgreementNoticeJob.java

@@ -9,6 +9,7 @@ import com.style24.core.support.env.TscConstants;
 import com.style24.persistence.domain.Customer;
 import com.style24.persistence.domain.CustomerSearch;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 /**
@@ -21,6 +22,7 @@ import org.springframework.stereotype.Component;
 @Slf4j
 public class TsbMarketingAgreementNoticeJob extends TsbAbstractJob<Collection<Customer>, GagaMap, GagaMap> {
 
+	@Autowired
 	TsbCustomerService customerService;
 
 	private int succCnt = 0;

+ 3 - 1
src/main/java/com/style24/batch/biz/job/customer/TsbPrivacyPolicyNoticeJob.java

@@ -7,6 +7,7 @@ import com.style24.core.support.env.TscConstants;
 import com.style24.persistence.domain.Customer;
 import com.style24.persistence.domain.CustomerSearch;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.Collection;
@@ -21,6 +22,7 @@ import java.util.Collection;
 @Slf4j
 public class TsbPrivacyPolicyNoticeJob extends TsbAbstractJob<Collection<Customer>, GagaMap, GagaMap> {
 
+	@Autowired
 	TsbCustomerService customerService;
 
 	private int succCnt = 0;
@@ -28,7 +30,7 @@ public class TsbPrivacyPolicyNoticeJob extends TsbAbstractJob<Collection<Custome
 
 	@Override
 	public Collection<Customer> read() throws Exception {
-		CustomerSearch  customerSearch = new CustomerSearch();
+		CustomerSearch customerSearch = new CustomerSearch();
 		customerSearch.setSiteCd(TscConstants.Site.STYLE24.value());
 		return customerService.getPrivacyPolicyNoticeTargetList(customerSearch);
 	}

+ 5 - 1
src/main/java/com/style24/batch/biz/service/TsbCustomerService.java

@@ -49,7 +49,7 @@ public class TsbCustomerService {
 	}
 
 	/**
-	 * 휴면전환예정 메일 발송 대상
+	 * 휴면전환예정 안내 메일 발송 대상
 	 *
 	 * @param customerCollection - 대상
 	 * @return int - 성공여부
@@ -76,6 +76,7 @@ public class TsbCustomerService {
 				CustContactHst custContactHst = new CustContactHst();
 				custContactHst.setContactType(TscConstants.ContactType.DORMANT_EXPECTED.value());
 				custContactHst.setContactMethod(TscConstants.ContactMethod.KAKAOTALK.value());
+				custContactHst.setContactContents("휴면전환예정 안내");
 				custContactHst.setSenderNo(TsbConstants.REG_NO);
 				custContactHst.setReceiverNo(customer.getCustNo());
 				custContactHst.setRegNo(TsbConstants.REG_NO);
@@ -212,6 +213,7 @@ public class TsbCustomerService {
 				CustContactHst custContactHst = new CustContactHst();
 				custContactHst.setContactType(TscConstants.ContactType.PRIVACY_POLICY.value());
 				custContactHst.setContactMethod(TscConstants.ContactMethod.EMAIL.value());
+				custContactHst.setContactContents("개인정보 이용내역 안내 발송");
 				custContactHst.setSenderNo(TsbConstants.REG_NO);
 				custContactHst.setReceiverNo(customer.getCustNo());
 				custContactHst.setRegNo(TsbConstants.REG_NO);
@@ -221,6 +223,7 @@ public class TsbCustomerService {
 				succCnt++;
 
 			} catch (Exception e) {
+				log.error(e.getMessage());
 				failCnt++;
 			}
 		}
@@ -264,6 +267,7 @@ public class TsbCustomerService {
 				CustContactHst custContactHst = new CustContactHst();
 				custContactHst.setContactType(TscConstants.ContactType.MARKETING_AGREE.value());
 				custContactHst.setContactMethod(TscConstants.ContactMethod.EMAIL.value());
+				custContactHst.setContactContents("마케팅 정보 수신동의 내역 안내");
 				custContactHst.setSenderNo(TsbConstants.REG_NO);
 				custContactHst.setReceiverNo(customer.getCustNo());
 				custContactHst.setRegNo(TsbConstants.REG_NO);

+ 38 - 0
src/main/java/com/style24/batch/biz/task/TsbCustomerTask.java

@@ -3,10 +3,13 @@ package com.style24.batch.biz.task;
 
 import com.style24.batch.biz.job.customer.TsbDormantTransformJob;
 import com.style24.batch.biz.job.customer.TsbDormantScheduleJob;
+import com.style24.batch.biz.job.customer.TsbMarketingAgreementNoticeJob;
+import com.style24.batch.biz.job.customer.TsbPrivacyPolicyNoticeJob;
 import com.style24.batch.biz.job.customer.TsbSecedeProcessJob;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Async;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
 
@@ -28,8 +31,15 @@ public class TsbCustomerTask {
 	@Autowired
 	TsbSecedeProcessJob secedeProcessJob;
 
+	@Autowired
+	TsbPrivacyPolicyNoticeJob privacyPolicyNoticeJob;
+
+	@Autowired
+	TsbMarketingAgreementNoticeJob marketingAgreementNoticeJob;
+
 	/**
 	 * 휴면전환 예정 대상 메일 발송
+	 *
 	 * @throws Exception - 예외처리
 	 * @author jsshin
 	 * @since 2021. 03. 08
@@ -43,6 +53,7 @@ public class TsbCustomerTask {
 
 	/**
 	 * 휴면전환
+	 *
 	 * @throws Exception - 예외처리
 	 * @author jsshin
 	 * @since 2021. 03. 08
@@ -56,6 +67,7 @@ public class TsbCustomerTask {
 
 	/**
 	 * 탈퇴회원 처리
+	 *
 	 * @throws Exception - 예외처리
 	 * @author jsshin
 	 * @since 2021. 03. 08
@@ -67,5 +79,31 @@ public class TsbCustomerTask {
 		secedeProcessJob.runById("cron.customer.secede.process");
 	}
 
+	/**
+	 * 개인정보 이용내역 안내 발송
+	 *
+	 * @throws Exception - 예외처리
+	 * @author jsshin
+	 * @since 2021. 05. 06
+	 */
+	//@Scheduled(cron = "${cron.customer.privacy.policy.notice}")
+//	@Scheduled(fixedDelay=360000)
+	@Async
+	public void privacyPolicyNoticeJob() throws Exception {
+		privacyPolicyNoticeJob.runById("cron.customer.privacy.policy.notice");
+	}
 
+	/**
+	 * 마케팅 정보 수신동의 내역 안내 발송
+	 *
+	 * @throws Exception - 예외처리
+	 * @author jsshin
+	 * @since 2021. 05. 06
+	 */
+	//@Scheduled(cron = "${cron.customer.marketing.agreement.notice}")
+//	@Scheduled(fixedDelay=360000)
+	@Async
+	public void marketingAgreementNoticeJob() throws Exception {
+		marketingAgreementNoticeJob.runById("cron.customer.marketing.agreement.notice");
+	}
 }