Browse Source

생월 추가

jsshin 4 năm trước cách đây
mục cha
commit
8527391a1b

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

@@ -180,16 +180,6 @@ public interface TsfCustomerDao {
 	 */
 	CustGrade getCustGradeOrderInfo(CustGrade custGrade);
 
-	/**
-	 * 고객 생년월일 저장
-	 *
-	 * @param customer - 고객번호, 생년월일
-	 * @return int - 결과
-	 * @author jsshin
-	 * @since 2021. 05. 10
-	 */
-	int saveBatchBirth(Customer customer);
-
 	/**
 	 * SMS수신거부 처리
 	 * @param custNo - 고객번호

+ 18 - 4
src/main/java/com/style24/front/biz/service/TsfCustomerService.java

@@ -261,6 +261,11 @@ public class TsfCustomerService {
 	@Transactional("shopTxnManager")
 	public boolean saveJoinCustomer(Customer customer) {
 		boolean isJoin = true;
+
+		if (customer.getBirthYmd().length() == 8) {
+			String birthMm = customer.getBirthYmd().substring(4, 6);
+			customer.setBirthMm(birthMm);
+		}
 		customer.setHypenCellPhone();
 		customer.encryptData();
 		customer.setEncodedPasswd(passwordEncoder.encodeSha256(customer.getPasswd()));
@@ -270,7 +275,6 @@ public class TsfCustomerService {
 		customer.setCustGrade(TscConstants.CustGrade.WELCOME.value());
 		
 		int custCnt = customerDao.createCustomer(customer);
-		customerDao.saveBatchBirth(customer);
 
 		if (custCnt > 0) {
 			saveJoinPostProcessing(customer);
@@ -311,6 +315,10 @@ public class TsfCustomerService {
 	@Transactional("shopTxnManager")
 	public boolean saveJoinCustomerSns(Customer customer) {
 		boolean isJoin = true;
+		if (customer.getBirthYmd().length() == 8) {
+			String birthMm = customer.getBirthYmd().substring(4, 6);
+			customer.setBirthMm(birthMm);
+		}
 		String snsId = customer.getSnsType().equals(TscConstants.SnsType.YES24.value()) ? customer.getMemNo() : customer.getSnsId();
 		customer.setEncodedPasswd(" ");
 		customer.setCustId(customer.getSnsType() + "_" + snsId);
@@ -325,7 +333,6 @@ public class TsfCustomerService {
 
 		int custCnt = customerDao.createCustomer(customer);
 		customerDao.createCustomerSns(customer);
-		customerDao.saveBatchBirth(customer);
 
 		if (custCnt > 0) {
 			saveJoinPostProcessing(customer);
@@ -737,11 +744,16 @@ public class TsfCustomerService {
 	@Transactional("shopTxnManager")
 	public GagaMap saveCertification(Customer customer) {
 		GagaMap resultMap = new GagaMap();
+		if (customer.getBirthYmd().length() == 8) {
+			String birthMm = customer.getBirthYmd().substring(4, 6);
+			customer.setBirthMm(birthMm);
+		}
 		customer.setRegNo(customer.getCustNo());
 		customer.setUpdNo(customer.getCustNo());
 		customer.setHypenCellPhone();
 		customer.encryptData();
 		boolean isSuccess = false;
+
 		// CI 유효성 체크
 		Customer custInfo = getCustomerFindByCi(customer.getCi());
 		if (custInfo != null) {
@@ -754,7 +766,6 @@ public class TsfCustomerService {
 		coreCustomerService.createCustomerHistory(customer);
 		// 2.CI 업데이트
 		int resultCnt = customerDao.updateCustomerCi(customer);
-		customerDao.saveBatchBirth(customer);
 
 		if (resultCnt > 0) {
 			isSuccess = true;
@@ -826,6 +837,10 @@ public class TsfCustomerService {
 	@Transactional("shopTxnManager")
 	public GagaMap updateCustomerAuth(Customer customer) {
 		GagaMap result = new GagaMap();
+		if (customer.getBirthYmd().length() == 8) {
+			String birthMm = customer.getBirthYmd().substring(4, 6);
+			customer.setBirthMm(birthMm);
+		}
 		customer.setRegNo(customer.getCustNo());
 		customer.setUpdNo(customer.getCustNo());
 		customer.setHypenCellPhone();
@@ -835,7 +850,6 @@ public class TsfCustomerService {
 
 		// 2. 이름, 휴대전화 번호, 생년월일 저장
 		int updateCnt = customerDao.updateCustomerAuth(customer);
-		customerDao.saveBatchBirth(customer);
 
 		boolean isSuccess = updateCnt > 0; // 변경 성공시 true
 

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

@@ -206,6 +206,7 @@
 		     , SECEDE_RSN
 		     , SECEDE_DTL_RSN
 		     , SECEDE_DT
+		     , BIRTH_MM
 		     , REG_NO
 		     , REG_DT
 		     , UPD_NO
@@ -264,6 +265,7 @@
 		     , #{secedeRsn}                        AS SECEDE_RSN
 		     , #{secedeDtlRsn}                     AS SECEDE_DTL_RSN
 		     , #{secedeDt}                         AS SECEDE_DT
+		     , #{encodedBirthMm}                   AS BIRTH_MM
 		     , 0                                   AS REG_NO
 		     , NOW()                               AS REG_DT
 		     , 0                                   AS UPD_NO
@@ -528,6 +530,7 @@
 		     , CELL_PHNNO = #{encodedCellPhnno}
 		     , SEX_GB = #{encodedSexGb}
 		     , BIRTH_YMD = #{encodedBirthYmd}
+		     , BIRTH_MM = #{encodedBirthMm}
 		     , AUTH_DT = NOW()
 		     , UPD_NO = #{updNo}
 		     , UPD_DT = NOW()
@@ -552,6 +555,7 @@
 		     , CELL_PHNNO = #{encodedCellPhnno}
 		     , SEX_GB = #{encodedSexGb}
 		     , BIRTH_YMD = #{encodedBirthYmd}
+		     , BIRTH_MM = #{encodedBirthMm}
 		     , UPD_DT = NOW()
 		     , UPD_NO = #{updNo}
 		WHERE  CUST_NO = #{custNo}
@@ -656,30 +660,6 @@
 		) A
 	</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>
-	
 	<!-- SMS수신거부 처리 -->
 	<update id="updateSmsReceptionRefuse" parameterType="Integer">
 		/* TsfCustomer.updateSmsReceptionRefuse */