|
|
@@ -5,6 +5,7 @@ import java.util.Collection;
|
|
|
import java.util.List;
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+
|
|
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
|
import com.style24.core.support.util.CryptoUtils;
|
|
|
import com.style24.persistence.TscBaseDomain;
|
|
|
@@ -686,10 +687,10 @@ public class ExtmallOrder extends TscBaseDomain {
|
|
|
public void setHypenCellPhone() {
|
|
|
if (StringUtils.isNotBlank(this.cellPhnno)) {
|
|
|
String tempCellPhone = this.cellPhnno.replaceAll("-","");
|
|
|
- if (tempCellPhone.length() > 10) {
|
|
|
- this.cellPhnno = tempCellPhone.substring(0, 3) + "-" + tempCellPhone.substring(3, 7) + "-" + tempCellPhone.substring(7, 11);
|
|
|
+ if (tempCellPhone.length() == 12) {
|
|
|
+ this.cellPhnno = tempCellPhone.replaceFirst("(^[0-9]{4})([0-9]{4})([0-9]{4})$", "$1-$2-$3");
|
|
|
} else {
|
|
|
- this.cellPhnno = tempCellPhone.substring(0, 3) + "-" + tempCellPhone.substring(3, 6) + "-" + tempCellPhone.substring(6, 10);
|
|
|
+ this.cellPhnno = tempCellPhone.replaceFirst("(^02|[0-9]{3})([0-9]{3,4})([0-9]{4})$", "$1-$2-$3");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -698,10 +699,10 @@ public class ExtmallOrder extends TscBaseDomain {
|
|
|
public void setHypenRecipPhone() {
|
|
|
if (StringUtils.isNotBlank(this.cellPhnno)) {
|
|
|
String tempRecipPhone = this.cellPhnno.replaceAll("-","");
|
|
|
- if (tempRecipPhone.length() > 10) {
|
|
|
- this.cellPhnno = tempRecipPhone.substring(0, 3) + "-" + tempRecipPhone.substring(3, 7) + "-" + tempRecipPhone.substring(7, 11);
|
|
|
+ if (tempRecipPhone.length() == 12) {
|
|
|
+ this.recipPhnno = tempRecipPhone.replaceFirst("(^[0-9]{4})([0-9]{4})([0-9]{4})$", "$1-$2-$3");
|
|
|
} else {
|
|
|
- this.cellPhnno = tempRecipPhone.substring(0, 3) + "-" + tempRecipPhone.substring(3, 6) + "-" + tempRecipPhone.substring(6, 10);
|
|
|
+ this.recipPhnno = tempRecipPhone.replaceFirst("(^02|[0-9]{3})([0-9]{3,4})([0-9]{4})$", "$1-$2-$3");
|
|
|
}
|
|
|
}
|
|
|
}
|