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

생년월일 관련 수정 중

jsshin 5 лет назад
Родитель
Сommit
703b9ebe8a

+ 10 - 0
src/main/java/com/style24/front/biz/dao/TsfCustomerDao.java

@@ -169,5 +169,15 @@ public interface TsfCustomerDao {
 	 */
 	CustGrade getExpectedCustGrde(CustGrade custGrade);
 
+	/**
+	 * 고객 생년월일 저장
+	 *
+	 * @param customer - 고객번호, 생년월일
+	 * @return int - 결과
+	 * @author jsshin
+	 * @since 2021. 05. 10
+	 */
+	int saveBatchBirth(Customer customer);
+
 
 }

+ 6 - 1
src/main/java/com/style24/front/biz/service/TsfCustomerService.java

@@ -267,6 +267,7 @@ public class TsfCustomerService {
 		customer.setCustGrade(TscConstants.CustGrade.WELCOME.value());
 
 		int custCnt = customerDao.createCustomer(customer);
+		customerDao.saveBatchBirth(customer);
 
 		if (custCnt > 0) {
 			saveJoinPostProcessing(customer);
@@ -302,6 +303,7 @@ public class TsfCustomerService {
 
 		int custCnt = customerDao.createCustomer(customer);
 		customerDao.createCustomerSns(customer);
+		customerDao.saveBatchBirth(customer);
 
 		if (custCnt > 0) {
 			saveJoinPostProcessing(customer);
@@ -707,6 +709,8 @@ public class TsfCustomerService {
 		coreCustomerService.createCustomerHistory(customer);
 		// 2.CI 업데이트
 		int resultCnt = customerDao.updateCustomerCi(customer);
+		customerDao.saveBatchBirth(customer);
+
 		if (resultCnt > 0) {
 			isSuccess = true;
 		}
@@ -784,8 +788,9 @@ public class TsfCustomerService {
 		// 1. 이력쌓고
 		coreCustomerService.createCustomerHistory(customer);
 
-		// 2. 이름, 휴대전화 번호 저장
+		// 2. 이름, 휴대전화 번호, 생년월일 저장
 		int updateCnt = customerDao.updateCustomerAuth(customer);
+		customerDao.saveBatchBirth(customer);
 
 		boolean isSuccess = updateCnt > 0; // 변경 성공시 true
 

+ 24 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsfCustomer.xml

@@ -631,4 +631,28 @@
 		OR    B.SUM_REAL_ORD_AMT >= #{minBuyAmt}
 	</select>
 
+	<!--배치 생년월일 -->
+	<insert id="saveBatchBirth" parameterType="Customer">
+		/*TsfCustomer.saveBatchBirth*/
+		INSERT INTO TB_BATCH_BIRTH (
+		       CUST_NO
+		     , BIRTH_YMD
+		     , REG_DT
+		     , REG_NO
+		     , UPD_DT
+		     , UPD_NO
+		) VALUES (
+		       #{custNo}
+		     , #{birthYmd}
+		     , NOW()
+		     , #{custNo}
+		     , NOW()
+		     , #{custNo}
+		)
+		ON DUPLICATE KEY UPDATE
+		       BIRTH_YMD = #{birthYmd}
+		    ,  UPD_DT = NOW()
+		    ,  UPD_NO = #{updNo}
+	</insert>
+
 </mapper>