jsh77b 5 년 전
부모
커밋
b73f2995be
2개의 변경된 파일19개의 추가작업 그리고 7개의 파일을 삭제
  1. 13 0
      src/main/java/com/style24/persistence/domain/Order.java
  2. 6 7
      src/main/java/com/style24/persistence/mybatis/shop/TscOrder.xml

+ 13 - 0
src/main/java/com/style24/persistence/domain/Order.java

@@ -3,6 +3,8 @@ package com.style24.persistence.domain;
 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;
@@ -602,4 +604,15 @@ public class Order extends TscBaseDomain {
 	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
 	private String[] payTypeArr;
 	
+	// 휴대폰 번호 대쉬 붙이기
+	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);
+			} else {
+				this.cellPhnno = this.cellPhnno.substring(0, 3) + "-" + this.cellPhnno.substring(3, 6) + "-" + this.cellPhnno.substring(6, 10);
+			}
+		}
+	}
+	
 }

+ 6 - 7
src/main/java/com/style24/persistence/mybatis/shop/TscOrder.xml

@@ -2437,11 +2437,11 @@
 		    , REG_DT
 		    , UPD_NO
 		    , UPD_DT
-		) 
-		SELECT 'G011_10'
+		) VALUES (
+		     'G011_10'
 		     , NOW()
 		     , NOW()
-		     , CUST_NO
+		     , #{custNo}
 		     , #{custNm}
 		     , #{recipPhnno}
 		     , #{recipTelno}
@@ -2449,12 +2449,11 @@
 		     , 'G000_10'
 		     , #{npayOrdNo}
 		     , #{frontGb}
-		     , CUST_NO
+		     , #{custNo}
 		     , NOW()
-		     , CUST_NO
+		     , #{custNo}
 		     , NOW()
-		FROM   TB_CUSTOMER
-		WHERE  CUST_NO = #{custNo}
+		)
 	</insert>
 	
 	<!-- 2. 주문배송주소정보등록-->