Bladeren bron

Merge branch 'develop' into bin2107

bin2107 5 jaren geleden
bovenliggende
commit
b3d4457093

+ 10 - 0
src/main/java/com/style24/core/biz/dao/TscCustomerDao.java

@@ -97,4 +97,14 @@ public interface TscCustomerDao {
 	 * @since 2021. 02. 15
 	 */
 	String getTemporaryPassword(int length);
+
+	/**
+	 * 휴면해제 처리
+	 *
+	 * @param customer - 고객정보
+	 * @return int - 처리결과
+	 * @author jsshin
+	 * @since 2021. 03. 08
+	 */
+	int updateDormantCustomerRelease(Customer customer);
 }

+ 16 - 0
src/main/java/com/style24/core/biz/service/TscCustomerService.java

@@ -154,4 +154,20 @@ public class TscCustomerService {
 	}
 
 
+	/**
+	 * 휴면해제 처리
+	 *
+	 * @param customer - 고객정보
+	 * @return int - 처리결과
+	 * @author jsshin
+	 * @since 2021. 03. 08
+	 */
+	public void saveDormantCustomerRelease(Customer customer) {
+		// 1. 고객정보 이력 생성
+		customerDao.createCustomerHistory(customer);
+		// 2. 휴면해제처리
+		customerDao.updateDormantCustomerRelease(customer);
+	}
+
+
 }

+ 17 - 0
src/main/java/com/style24/core/support/util/MaskingUtils.java

@@ -4,6 +4,8 @@ import java.util.Arrays;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import org.apache.commons.lang3.StringUtils;
+
 import lombok.extern.slf4j.Slf4j;
 
 /**
@@ -26,6 +28,9 @@ public class MaskingUtils {
 	 * @return
 	 */
 	public static String id(String str) {
+		if (StringUtils.isBlank(str))
+			return "";
+
 		String replaceString = str;
 
 		Matcher matcher = Pattern.compile("^(...)(.*)$").matcher(str);
@@ -62,6 +67,9 @@ public class MaskingUtils {
 	 * @return
 	 */
 	public static String name(String str) {
+		if (StringUtils.isBlank(str))
+			return "";
+
 		String regex = "^(.)(.+)(.)$";
 		if (str.length() == 2) {
 			regex = "^(.)(.+)$";
@@ -103,6 +111,9 @@ public class MaskingUtils {
 	 * @return
 	 */
 	public static String phoneNo(String str) {
+		if (StringUtils.isBlank(str))
+			return "";
+
 		Matcher matcher = Pattern.compile("^(\\d{3})-?(\\d{3,4})-?(\\d{4})$").matcher(str);
 
 		if (matcher.find()) {
@@ -124,6 +135,9 @@ public class MaskingUtils {
 	 * @return
 	 */
 	public static String email(String str) {
+		if (StringUtils.isBlank(str))
+			return "";
+
 		Matcher matcher = Pattern.compile("^(...)(.*)([@]{1})(.*)$").matcher(str);
 
 		if (matcher.find()) {
@@ -159,6 +173,9 @@ public class MaskingUtils {
 	 * @return
 	 */
 	public static String all(String str) {
+		if (StringUtils.isBlank(str))
+			return "";
+
 		Matcher matcher = Pattern.compile("^(.*)$").matcher(str);
 
 		if (matcher.find()) {

+ 26 - 6
src/main/java/com/style24/persistence/mybatis/shop/TscCustomer.xml

@@ -10,7 +10,6 @@
 		     , C.CUST_NM
 		     , C.PASSWD
 		     , C.BIRTH_YMD
-		     , C.BIRTH_SM
 		     , C.SEX_GB
 		     , C.CELL_PHNNO
 		     , C.APP_AGREE_YN
@@ -124,7 +123,6 @@
 		     , CUST_NM
 		     , PASSWD
 		     , BIRTH_YMD
-		     , BIRTH_SM
 		     , SEX_GB
 		     , CELL_PHNNO
 		     , APP_AGREE_YN
@@ -166,7 +164,6 @@
 		     , CUST_NM
 		     , PASSWD
 		     , BIRTH_YMD
-		     , BIRTH_SM
 		     , SEX_GB
 		     , CELL_PHNNO
 		     , APP_AGREE_YN
@@ -227,7 +224,6 @@
 		     , CUST_NM
 		     , PASSWD
 		     , BIRTH_YMD
-		     , BIRTH_SM
 		     , SEX_GB
 		     , CELL_PHNNO
 		     , APP_AGREE_YN
@@ -269,7 +265,6 @@
 		     , CUST_NM
 		     , PASSWD
 		     , BIRTH_YMD
-		     , BIRTH_SM
 		     , SEX_GB
 		     , CELL_PHNNO
 		     , APP_AGREE_YN
@@ -319,7 +314,6 @@
 		     , SECEDE_DTL_RSN = #{secedeDtlRsn}
 		     , SECEDE_DT = NOW()
 		     , BIRTH_YMD = NULL
-		     , BIRTH_SM = NULL
 		     , SEX_GB = NULL
 		     , CELL_PHNNO = NULL
 		     , EMAIL = NULL
@@ -365,4 +359,30 @@
 		SELECT CONVERT(TRUNCATE(RAND() * CAST(CONCAT(1,LPAD(0,(#{length} - 1),'0')) AS UNSIGNED),0),CHAR) AS PASSWD FROM DUAL
 	</select>
 
+	<!--휴면 해제처리-->
+	<insert id="updateDormantCustomerRelease" parameterType="Customer">
+		/* TscCustomer.updateDormantCustomerRelease */
+		UPDATE TB_CUSTOMER C
+		INNER JOIN
+		       TB_DORMANT_CUST DC
+		ON     C.CUST_NO = DC.CUST_NO
+		AND    DC.CUST_NO = #{custNo}
+		SET    C.CUST_NM = DC.CUST_NM
+		     , C.BIRTH_YMD = DC.BIRTH_YMD
+		     , C.SEX_GB = DC.SEX_GB
+		     , C.CELL_PHNNO = DC.CELL_PHNNO
+		     , C.SMS_AGREE_YN = DC.SMS_AGREE_YN
+		     , C.SMS_AGREE_DT= DC.SMS_AGREE_DT
+		     , C.EMAIL = DC.EMAIL
+		     , C.EMAIL_AGREE_YN = DC.EMAIL_AGREE_YN
+		     , C.EMAIL_AGREE_DT = DC.EMAIL_AGREE_DT
+		     , C.APP_AGREE_YN = DC.APP_AGREE_YN
+		     , C.APP_AGREE_DT = DC.APP_AGREE_DT
+		     , C.HOME_ZIPCODE = DC.HOME_ZIPCODE
+		     , C.HOME_BASE_ADDR = DC.HOME_BASE_ADDR
+		     , C.HOME_DTL_ADDR = DC.HOME_DTL_ADDR
+		     , C.CUST_STAT = 'G104_10'
+		     , C.UPD_NO = NOW()
+		     , C.UPD_NO = #{updNo}
+	</insert>
 </mapper>