yujung 4 лет назад
Родитель
Сommit
72c3069afc

+ 4 - 3
src/main/java/com/style24/persistence/domain/Customer.java

@@ -201,10 +201,11 @@ public class Customer extends TscBaseDomain {
 		if (StringUtils.isBlank(this.cellPhnno)) {
 			return;
 		}
-		if (this.cellPhnno.length() > 10) {
-			this.cellPhnno = this.cellPhnno.substring(0, 3) + "-" + this.cellPhnno.substring(3, 7) + "-" + this.cellPhnno.substring(7, 11);
+		String tempCellPhone = this.cellPhnno.replaceAll("-", "");
+		if (tempCellPhone.length() > 10) {
+			this.cellPhnno = tempCellPhone.substring(0, 3) + "-" + tempCellPhone.substring(3, 7) + "-" + tempCellPhone.substring(7, 11);
 		} else {
-			this.cellPhnno = this.cellPhnno.substring(0, 3) + "-" + this.cellPhnno.substring(3, 6) + "-" + this.cellPhnno.substring(6, 10);
+			this.cellPhnno = tempCellPhone.substring(0, 3) + "-" + tempCellPhone.substring(3, 6) + "-" + tempCellPhone.substring(6, 10);
 		}
 	}
 

+ 8 - 6
src/main/java/com/style24/persistence/domain/ExtmallOrder.java

@@ -685,10 +685,11 @@ public class ExtmallOrder extends TscBaseDomain {
 	// 휴대폰 번호 대쉬 붙이기
 	public void setHypenCellPhone() {
 		if (StringUtils.isNotBlank(this.cellPhnno)) {
-			if (this.cellPhnno.length() > 10) {
-				this.cellPhnno = this.cellPhnno.substring(0, 3) + "-" + this.cellPhnno.substring(3, 7) + "-" + this.cellPhnno.substring(7, 11);
+			String tempCellPhone = this.cellPhnno.replaceAll("-","");
+			if (tempCellPhone.length() > 10) {
+				this.cellPhnno = tempCellPhone.substring(0, 3) + "-" + tempCellPhone.substring(3, 7) + "-" + tempCellPhone.substring(7, 11);
 			} else {
-				this.cellPhnno = this.cellPhnno.substring(0, 3) + "-" + this.cellPhnno.substring(3, 6) + "-" + this.cellPhnno.substring(6, 10);
+				this.cellPhnno = tempCellPhone.substring(0, 3) + "-" + tempCellPhone.substring(3, 6) + "-" + tempCellPhone.substring(6, 10);
 			}
 		}
 	}
@@ -696,10 +697,11 @@ public class ExtmallOrder extends TscBaseDomain {
 	// 휴대폰 번호 대쉬 붙이기
 	public void setHypenRecipPhone() {
 		if (StringUtils.isNotBlank(this.cellPhnno)) {
-			if (this.recipPhnno.length() > 10) {
-				this.recipPhnno = this.recipPhnno.substring(0, 3) + "-" + this.recipPhnno.substring(3, 7) + "-" + this.recipPhnno.substring(7, 11);
+			String tempRecipPhone = this.cellPhnno.replaceAll("-","");
+			if (tempCellPhone.length() > 10) {
+				this.cellPhnno = tempCellPhone.substring(0, 3) + "-" + tempCellPhone.substring(3, 7) + "-" + tempCellPhone.substring(7, 11);
 			} else {
-				this.recipPhnno = this.recipPhnno.substring(0, 3) + "-" + this.recipPhnno.substring(3, 6) + "-" + this.recipPhnno.substring(6, 10);
+				this.cellPhnno = tempCellPhone.substring(0, 3) + "-" + tempCellPhone.substring(3, 6) + "-" + tempCellPhone.substring(6, 10);
 			}
 		}
 	}

+ 8 - 6
src/main/java/com/style24/persistence/domain/Order.java

@@ -680,10 +680,11 @@ public class Order extends TscBaseDomain {
 	// 휴대폰 번호 대쉬 붙이기
 	public void setHypenCellPhone() {
 		if (StringUtils.isNotBlank(this.cellPhnno)) {
-			if (this.cellPhnno.length() > 10) {
-				this.cellPhnno = this.cellPhnno.substring(0, 3) + "-" + this.cellPhnno.substring(3, 7) + "-" + this.cellPhnno.substring(7, 11);
+			String tempCellPhone = this.cellPhnno.replaceAll("-", "");
+			if (tempCellPhone.length() > 10) {
+				this.cellPhnno = tempCellPhone.substring(0, 3) + "-" + tempCellPhone.substring(3, 7) + "-" + tempCellPhone.substring(7, 11);
 			} else {
-				this.cellPhnno = this.cellPhnno.substring(0, 3) + "-" + this.cellPhnno.substring(3, 6) + "-" + this.cellPhnno.substring(6, 10);
+				this.cellPhnno = tempCellPhone.substring(0, 3) + "-" + tempCellPhone.substring(3, 6) + "-" + tempCellPhone.substring(6, 10);
 			}
 		}
 	}
@@ -691,10 +692,11 @@ public class Order extends TscBaseDomain {
 	// 휴대폰 번호 대쉬 붙이기
 	public void setHypenRecipPhone() {
 		if (StringUtils.isNotBlank(this.recipPhnno)) {
-			if (this.recipPhnno.length() > 10) {
-				this.recipPhnno = this.recipPhnno.substring(0, 3) + "-" + this.recipPhnno.substring(3, 7) + "-" + this.recipPhnno.substring(7, 11);
+			String tempRecipPhone = this.recipPhnno.replaceAll("-", "");
+			if (tempRecipPhone.length() > 10) {
+				this.recipPhnno = tempRecipPhone.substring(0, 3) + "-" + tempRecipPhone.substring(3, 7) + "-" + tempRecipPhone.substring(7, 11);
 			} else {
-				this.recipPhnno = this.recipPhnno.substring(0, 3) + "-" + this.recipPhnno.substring(3, 6) + "-" + this.recipPhnno.substring(6, 10);
+				this.recipPhnno = tempRecipPhone.substring(0, 3) + "-" + tempRecipPhone.substring(3, 6) + "-" + tempRecipPhone.substring(6, 10);
 			}
 		}
 	}

+ 10 - 8
src/main/java/com/style24/persistence/domain/OrderChange.java

@@ -284,21 +284,23 @@ public class OrderChange extends TscBaseDomain {
 
 	// 휴대폰 번호 대쉬 붙이기
 	public void setHypenRecipPhone() {
-		if (StringUtils.isNotBlank(this.recipPhnno) && !this.recipPhnno.contains("-")) {
-			if (this.recipPhnno.length() > 10) {
-				this.recipPhnno = this.recipPhnno.substring(0, 3) + "-" + this.recipPhnno.substring(3, 7) + "-" + this.recipPhnno.substring(7, 11);
+		if (StringUtils.isNotBlank(this.recipPhnno)) {
+			String tempRecipPhone = this.recipPhnno.replaceAll("-", "");
+			if (tempRecipPhone.length() > 10) {
+				this.recipPhnno = tempRecipPhone.substring(0, 3) + "-" + tempRecipPhone.substring(3, 7) + "-" + tempRecipPhone.substring(7, 11);
 			} else {
-				this.recipPhnno = this.recipPhnno.substring(0, 3) + "-" + this.recipPhnno.substring(3, 6) + "-" + this.recipPhnno.substring(6, 10);
+				this.recipPhnno = tempRecipPhone.substring(0, 3) + "-" + tempRecipPhone.substring(3, 6) + "-" + tempRecipPhone.substring(6, 10);
 			}
 		}
 	}
 
 	public void setHypenChgerPhone() {
-		if (StringUtils.isNotBlank(this.chgerPhnno) && !this.chgerPhnno.contains("-")) {
-			if (this.chgerPhnno.length() > 10) {
-				this.chgerPhnno = this.chgerPhnno.substring(0, 3) + "-" + this.chgerPhnno.substring(3, 7) + "-" + this.chgerPhnno.substring(7, 11);
+		if (StringUtils.isNotBlank(this.chgerPhnno)) {
+			String tempChgerPhone = this.chgerPhnno.replaceAll("-", "");
+			if (tempChgerPhone.length() > 10) {
+				this.chgerPhnno = tempChgerPhone.substring(0, 3) + "-" + tempChgerPhone.substring(3, 7) + "-" + tempChgerPhone.substring(7, 11);
 			} else {
-				this.chgerPhnno = this.chgerPhnno.substring(0, 3) + "-" + this.chgerPhnno.substring(3, 6) + "-" + this.chgerPhnno.substring(6, 10);
+				this.chgerPhnno = tempChgerPhone.substring(0, 3) + "-" + tempChgerPhone.substring(3, 6) + "-" + tempChgerPhone.substring(6, 10);
 			}
 		}
 	}