ソースを参照

생년월 만드는 매서드 추가

jsshin 4 年 前
コミット
b83018403a

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

@@ -261,11 +261,7 @@ 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.initBirthMm();
 		customer.setHypenCellPhone();
 		customer.encryptData();
 		customer.setEncodedPasswd(passwordEncoder.encodeSha256(customer.getPasswd()));
@@ -315,11 +311,8 @@ 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.initBirthMm();
 		customer.setEncodedPasswd(" ");
 		customer.setCustId(customer.getSnsType() + "_" + snsId);
 		customer.encryptData();
@@ -743,10 +736,7 @@ 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.initBirthMm();
 		customer.setRegNo(customer.getCustNo());
 		customer.setUpdNo(customer.getCustNo());
 		customer.setHypenCellPhone();
@@ -836,10 +826,7 @@ 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.initBirthMm();
 		customer.setRegNo(customer.getCustNo());
 		customer.setUpdNo(customer.getCustNo());
 		customer.setHypenCellPhone();