Parcourir la source

생월 관련 추가

jsshin il y a 4 ans
Parent
commit
c5acf33c49

+ 0 - 11
src/main/java/com/style24/admin/biz/dao/TsaCustomerDao.java

@@ -216,16 +216,5 @@ public interface TsaCustomerDao {
 	 */
 	int getCustomerFindByCellPhone(CustomerSearch customerSearch);
 
-	/**
-	 * 고객 생년월일 저장
-	 *
-	 * @param customer - 고객번호, 생년월일
-	 * @return int - 결과
-	 * @author jsshin
-	 * @since 2021. 05. 10
-	 */
-	int saveBatchBirth(Customer customer);
-
-
 
 }

+ 6 - 3
src/main/java/com/style24/admin/biz/service/TsaCustomerService.java

@@ -102,13 +102,18 @@ public class TsaCustomerService {
 
 		// 이메일 변경시 유효성 체크
 		if ("Y".equals(customer.getEmailModifyYn())) {
-			isDupEmail =  getCustomerByEmail(customer.getCustNo(), customer.getEmail());
+			isDupEmail = getCustomerByEmail(customer.getCustNo(), customer.getEmail());
 		}
 
 		if (isDupEmail) {
 			throw new IllegalStateException("이미 사용중인 이메일 입니다.");
 		}
 
+		if (customer.getBirthYmd().length() == 8) {
+			String birthMm = customer.getBirthYmd().substring(4, 6);
+			customer.setBirthMm(birthMm);
+		}
+
 		Integer userNo = TsaSession.getInfo().getUserNo();
 		customer.setRegNo(userNo);
 		customer.setUpdNo(userNo);
@@ -124,8 +129,6 @@ public class TsaCustomerService {
 
 		// 3.고객정보 수정
 		customerDao.updateCustomerInfo(customer);
-		// 4.생년월일 수정
-		customerDao.saveBatchBirth(customer);
 
 	}
 

+ 1 - 24
src/main/java/com/style24/persistence/mybatis/shop/TsaCustomer.xml

@@ -287,6 +287,7 @@
 		    , MANAGED_DTL_RSN =  NULL
 		    , MANAGED_DT = NULL
 		    </if>
+		    , BIRTH_MM = #{encodedBirthMm}
 		    , UPD_NO = #{updNo}
 		    , UPD_DT = NOW()
 		WHERE CUST_NO = #{custNo}
@@ -903,28 +904,4 @@
 		WHERE NUMB = 1
 	</select>
 
-	<!--배치 생년월일 -->
-	<insert id="saveBatchBirth" parameterType="Customer">
-		/*TsaCustomer.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>