Преглед изворни кода

회원관련 전박적으로 수정 중

jsshin пре 5 година
родитељ
комит
e8c3c8f57a

+ 17 - 0
src/main/java/com/style24/front/biz/dao/TsfCustomerDao.java

@@ -1,6 +1,7 @@
 package com.style24.front.biz.dao;
 
 import com.style24.core.support.annotation.ShopDs;
+import com.style24.persistence.domain.Customer;
 
 /**
  * 고객(회원) Dao
@@ -11,5 +12,21 @@ import com.style24.core.support.annotation.ShopDs;
 @ShopDs
 public interface TsfCustomerDao {
 
+	/**
+	 * 가입된 회원이 있는지 확인
+	 * @param customer - 아이디, 이메일, 휴대폰
+	 * @return 임시비밀번호
+	 * @author jsshin
+	 * @since 2021. 02. 18
+	 */
+	int getCustomerInfoCount(Customer customer);
 
+	/**
+	 * 활동, 탈퇴, 휴면 테이블 조회
+	 * @param customer - ci, 휴대폰
+	 * @return 임시비밀번호
+	 * @author jsshin
+	 * @since 2021. 02. 18
+	 */
+	Customer getCustomerInfo(Customer customer);
 }

+ 116 - 1
src/main/java/com/style24/front/biz/service/TsfCustomerService.java

@@ -1,9 +1,11 @@
 package com.style24.front.biz.service;
 
+import com.gagaframework.web.parameter.GagaMap;
 import com.style24.core.biz.service.TscCustomerService;
 import com.style24.core.support.env.TscConstants;
 import com.style24.core.support.session.TscSession;
 import com.style24.persistence.domain.Customer;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -56,7 +58,7 @@ public class TsfCustomerService {
 	}
 
 	/**
-	 * 회원 비밀번호 수정
+	 * 고객 비밀번호 수정
 	 * @param customer - 고객정보
 	 * @author jsshin
 	 * @since 2021. 02. 15
@@ -66,5 +68,118 @@ public class TsfCustomerService {
 		coreCustomerService.saveCustomerPassword(customer);
 	}
 
+	/**
+	 * 해당 아이디로 가입된 이력이 있는지 확인
+	 * @param custId - 아이디
+	 * @return boolean - 있으면 TRUE/ 없으면 FALSE
+	 * @author jsshin
+	 * @since 2021. 02. 15
+	 */
+	public boolean getCustomerFindByCustId(String custId) {
+		Customer customer = new Customer();
+		customer.setCustId(custId);
+		customer.setSiteCd(TscConstants.Site.STYLE24.value());
+		customer.encryptData();
+
+		int result = customerDao.getCustomerInfoCount(customer);
+
+		return result > 0;
+	}
+
+	/**
+	 * 해당 이메일로 가입된 이력이 있는지 확인
+	 * @param email - 이메일
+	 * @return boolean - 있으면 TRUE/ 없으면 FALSE
+	 * @author jsshin
+	 * @since 2021. 02. 15
+	 */
+	public boolean getCustomerFindByEmail(String email) {
+		Customer customer = new Customer();
+		customer.setEmail(email);
+		customer.setSiteCd(TscConstants.Site.STYLE24.value());
+		customer.encryptData();
+
+		int result = customerDao.getCustomerInfoCount(customer);
+
+		return result > 0;
+	}
+
+	/**
+	 * 해당 CI로 가입된 이력이 있는지 확인
+	 * @param ci - ci
+	 * @return boolean - 있으면 TRUE/ 없으면 FALSE
+	 * @author jsshin
+	 * @since 2021. 02. 15
+	 */
+	public Customer getCustomerFindByCi(String ci) {
+		Customer customer = new Customer();
+		customer.setCi(ci);
+		customer.setSiteCd(TscConstants.Site.STYLE24.value());
+		customer.encryptData();
+
+		return customerDao.getCustomerInfo(customer);
+	}
+
+	/**
+	 * 해당 휴대폰 번호로 가입된 이력이 있는지 확인
+	 * @param cellPhnno - 휴대전화번호
+	 * @return boolean - 있으면 TRUE/ 없으면 FALSE
+	 * @author jsshin
+	 * @since 2021. 02. 15
+	 */
+	public Customer getCustomerFindByCellPhnno(String cellPhnno) {
+		Customer customer = new Customer();
+		customer.setCellPhnno(cellPhnno);
+		customer.setHypenCellPhone(); // 010-0000-0000
+		customer.setSiteCd(TscConstants.Site.STYLE24.value());
+		customer.encryptData();
+
+		return customerDao.getCustomerInfo(customer);
+	}
+
+	/**
+	 * 고객 가입 확인
+	 * @param customer - ci, 휴대폰
+	 * @return 가입 수
+	 * @author jsshin
+	 * @since 2021. 02. 18
+	 */
+	public GagaMap getJoinCustomerValidation(Customer customer) {
+		GagaMap result = new GagaMap();
+		TscSession.setAttribute("maskingYn","Y");
+		boolean isFind = false; //가입된 고객이 있으면 true 아니면 false
+		Customer custInfo;
+
+		if (StringUtils.isBlank(customer.getCi())) {
+			throw new IllegalStateException("안심본인인증을 사용할 수 없습니다. 다시 시도해주세요(CI 데이터 없음)");
+		}
+
+		if (StringUtils.isBlank(customer.getCellPhnno())) {
+			throw new IllegalStateException("안심본인인증을 사용할 수 없습니다. 다시 시도해주세요(휴대폰 번호 없음)");
+		}
+
+		// CI로 가입된 고객 있는지 확인
+		custInfo = getCustomerFindByCi(customer.getCi());
+
+		if (custInfo != null) {
+			isFind = true;
+			result.setBoolean("isFind", isFind);
+			result.setString("maskingCustId", custInfo.getMaskingCustId());
+			return result;
+		}
+
+		// 휴대폰 번호로 가입된 고객 있는지 확인
+		custInfo = getCustomerFindByCellPhnno(customer.getCellPhnno());
+
+		if (custInfo != null) {
+			isFind = true;
+			result.setBoolean("isFind", isFind);
+			result.setString("maskingCustId",custInfo.getMaskingCustId());
+			return result;
+		}
+
+		result.setBoolean("isFind", isFind);
+		return result;
+	}
 
 }

+ 179 - 5
src/main/java/com/style24/front/biz/web/TsfCustomerController.java

@@ -2,7 +2,6 @@ package com.style24.front.biz.web;
 
 import com.gagaframework.web.parameter.GagaMap;
 import com.gagaframework.web.security.GagaPasswordEncoder;
-import com.gagaframework.web.util.GagaStringUtil;
 import com.style24.core.support.env.TscConstants;
 import com.style24.core.support.session.TscSession;
 import com.style24.front.biz.thirdparty.NiceCertify;
@@ -158,7 +157,6 @@ public class TsfCustomerController extends TsfBaseController {
 		return result;
 	}
 
-
 	/**
 	 * 비밀번호 찾기 - 고객정보 찾기
 	 * @param customer - 고객정보
@@ -315,6 +313,58 @@ public class TsfCustomerController extends TsfBaseController {
 		return result;
 	}
 
+	/**
+	 * 이용약관 화면
+	 *
+	 * @return ModelAndView
+	 * @author jsshin
+	 * @since 2021. 02. 19
+	 */
+	@GetMapping("/licensing/layer/form")
+	public ModelAndView getLicensingLayerForm() {
+		ModelAndView mav = new ModelAndView();
+		// 이용약관
+//		mav.addObject("clause10", customerService.getClauseOne("10"));
+
+//		mav.setViewName(super.getDeviceViewName("customer/LicensingLayerForm"));
+
+		return mav;
+	}
+
+	/**
+	 * 개인정보취급방침 화면
+	 *
+	 * @return ModelAndView
+	 * @author jsshin
+	 * @since 2021. 02. 19
+	 */
+	@GetMapping("/privacy/layer/form")
+	public ModelAndView getPrivacyLayerForm() {
+		ModelAndView mav = new ModelAndView();
+
+		// 개인정보취급방침
+//		mav.addObject("clause11", customerService.getClauseOne("11"));
+//		mav.setViewName(super.getDeviceViewName("customer/PrivacyLayerForm"));
+		return mav;
+	}
+
+	/**
+	 * 마케팅 동의 화면
+	 *
+	 * @return ModelAndView
+	 * @author jsshin
+	 * @since 2021. 02. 19
+	 */
+	@GetMapping("/marketing/layer/form")
+	public ModelAndView getMarketingLayerForm() {
+		ModelAndView mav = new ModelAndView();
+
+		// 마케팅 동의
+//		mav.addObject("clause18", customerService.getClauseOne("18"));
+//		mav.setViewName(super.getDeviceViewName("customer/MarketingLayerForm"));
+
+		return mav;
+	}
 
 	/**
 	 * 회원정보 입력 화면
@@ -380,7 +430,7 @@ public class TsfCustomerController extends TsfBaseController {
 	/**
 	 * 나이스 인증 콜백
 	 * @param encodeData - 휴대폰인증에서 전달받은 인증결과 암호화 데이터 취득
-	 * @param encData - ipin_process에서 전달받은 인증결과 암호화 데이터 취득
+	 * @param encData - 아이핀에서 전달받은 인증결과 암호화 데이터 취득
 	 * @return ModelAndView
 	 * @author jsshin
 	 * @since 2021. 02. 09
@@ -391,7 +441,7 @@ public class TsfCustomerController extends TsfBaseController {
 			, @RequestParam(value = "enc_data", required = false) String encData
 			, @RequestParam(value = "param_r1", required = false) String redirectUrl) {
 
-		ModelAndView mav = new ModelAndView(super.getDeviceViewName("customer/NiceCallbackForm"));
+		ModelAndView mav = new ModelAndView();
 		String sEncData = "";
 		String authMethod = "";
 		if (StringUtils.isNotBlank(encodeData)) {
@@ -409,9 +459,133 @@ public class TsfCustomerController extends TsfBaseController {
 
 		mav.addObject("sEncData", sEncData);
 		mav.addObject("authMethod", authMethod);
-
+		mav.setViewName(super.getDeviceViewName("customer/NiceCallbackForm"));
 		return mav;
 	}
 
+	/**
+	 * 가입화면 - 아이디 확인
+	 *
+	 * @param customer - email
+	 * @return GagaMap - 결과정보
+	 * @author jsshin
+	 * @since 2021. 02. 18
+	 */
+	@PostMapping("/join/id/check")
+	@ResponseBody
+	public GagaMap getJoinIdCheck(@RequestBody Customer customer) {
+		GagaMap result = new GagaMap();
+
+		if (StringUtils.isBlank(customer.getCustId())) {
+			throw new IllegalStateException("확인 할 아이디가 없습니다.");
+		}
+
+		boolean isFind  = customerService.getCustomerFindByCustId(customer.getCustId());
+
+		result.setBoolean("isFind", isFind);
+		return result;
+	}
+
+	/**
+	 * 가입화면 - 이메일 확인
+	 *
+	 * @param customer - email
+	 * @return GagaMap - 결과정보
+	 * @author jsshin
+	 * @since 2021. 02. 18
+	 */
+	@PostMapping("/email/check")
+	@ResponseBody
+	public GagaMap getEmailCheck(@RequestBody Customer customer) {
+		GagaMap result = new GagaMap();
+
+		if (StringUtils.isBlank(customer.getEmail())) {
+			throw new IllegalStateException("확인 할 이메일이 없습니다.");
+		}
+
+		boolean isFind = customerService.getCustomerFindByEmail(customer.getEmail());
+
+		result.setBoolean("isFind", isFind);
+
+		return result;
+	}
+
+	/**
+	 * 가입화면 - 휴대포 확인
+	 *
+	 * @param customer - email
+	 * @return GagaMap - 결과정보
+	 * @author jsshin
+	 * @since 2021. 02. 18
+	 */
+	@PostMapping("/cellphnno/check")
+	@ResponseBody
+	public GagaMap getCellphnnoCheck(@RequestBody Customer customer) {
+		GagaMap result = new GagaMap();
+
+		if (StringUtils.isBlank(customer.getCellPhnno())) {
+			throw new IllegalStateException("확인 할 이메일이 없습니다.");
+		}
+
+		Customer custInfo = customerService.getCustomerFindByCellPhnno(customer.getCellPhnno());
+
+		if (custInfo != null) {
+			result.setBoolean("isFind", true);
+		} else {
+			result.setBoolean("isFind", false);
+		}
+
+		return result;
+	}
+
+
+	/**
+	 * 가입화면 - 휴대폰 인증
+	 *
+	 * @param customer - cellPhnno
+	 * @return GagaMap - 결과정보
+	 * @author jsshin
+	 * @since 2021. 02. 18
+	 */
+	@PostMapping("/authentication/check")
+	@ResponseBody
+	public GagaMap getAuthenticationCheck(@RequestBody Customer customer) {
+		GagaMap result = new GagaMap();
+
+		GagaMap authInfo = niceCertify.getCertifyCellPhoneResultInfo(customer);
+		customer.setCi(authInfo.getString("sCi"));
+		//customer.setCellPhnno(authInfo.getString("sMobileNo"));
+		//customer.setCellPhnno("01025906246");
+
+		if ("N".equals(authInfo.getString("adult"))) {
+			throw new IllegalStateException("만14세 이상만 회원가입이 가능합니다.");
+		}
+
+		Customer custInfo = customerService.getCustomerFindByCi(customer.getCi());
+		if (custInfo != null) {
+			result.setBoolean("isFind", true);
+		} else {
+			result.setBoolean("isFind", false);
+			TscSession.setAttribute("encData",customer.getEncData());
+		}
+
+		return result;
+	}
+
+
+	@PostMapping("/join/save")
+	@ResponseBody
+	public GagaMap saveCustomerJoin(@RequestBody Customer customer) {
+		String encData = TscSession.getAttribute("encData");
+		customer.setEncData(encData);
+		GagaMap authInfo = niceCertify.getCertifyCellPhoneResultInfo(customer);
+		customer.setCi(authInfo.getString("sCi"));
+
+		// validation
+
+
+
+		return new GagaMap();
+	}
 
 }

+ 127 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsfCustomer.xml

@@ -20,4 +20,131 @@
 		SELECT CONVERT(TRUNCATE(RAND() * CAST(CONCAT(1,LPAD(0,(#{length} - 1),'0')) AS UNSIGNED),0),CHAR) AS PASSWD FROM DUAL
 	</select>
 
+	<!-- 가입된 고객이 있는지 확인 -->
+	<select id="getCustomerInfoCount" parameterType="Customer" resultType="int">
+		/* TsfCustomer.getCustomerInfoCount */
+		SELECT B.CNT
+		FROM (
+		      SELECT A.CNT
+		           , ROW_NUMBER() OVER (ORDER BY A.CNT DESC) AS NUMB
+		      FROM (
+		            SELECT COUNT(*) AS CNT
+		            FROM   TB_CUSTOMER
+		            WHERE  CUST_STAT = 'G104_10'   /* 활동회원*/
+		            AND    SITE_CD = #{siteCd}
+		           <if test="encodedEmail != null and encodedEmail != ''">
+		            AND    EMAIL = #{encodedEmail}
+		           </if>
+		           <if test="custId != null and custId !=''">
+		            AND    CUST_ID = #{custId}
+		           </if>
+		           <if test="ci != null and ci != ''">
+		            AND    CI = #{ci}
+		           </if>
+		           <if test="encodedCellPhnno != null and encodedCellPhnno != ''" >
+		            AND    CELL_PHNNO = #{encodedCellPhnno}
+		           </if>
+		            UNION ALL
+		            SELECT COUNT(*) AS CNT
+		            FROM   TB_SECEDE_CUST
+		            WHERE  SITE_CD = #{siteCd}
+		           <if test="encodedEmail != null and encodedEmail != ''">
+		            AND    EMAIL = #{encodedEmail}
+		           </if>
+		           <if test="custId != null and custId !=''">
+		            AND    CUST_ID = #{custId}
+		           </if>
+		           <if test="ci != null and ci != ''">
+		            AND    CI = #{ci}
+		           </if>
+		           <if test="encodedCellPhnno != null and encodedCellPhnno != ''" >
+		            AND    CELL_PHNNO = #{encodedCellPhnno}
+		           </if>
+		            UNION ALL
+		            SELECT COUNT(*) AS CNT
+		            FROM   TB_DORMANT_CUST
+		            WHERE  SITE_CD = #{siteCd}
+		           <if test="encodedEmail != null and encodedEmail != ''">
+		            AND    EMAIL = #{encodedEmail}
+		           </if>
+		           <if test="custId != null and custId !=''">
+		            AND    CUST_ID = #{custId}
+		           </if>
+		           <if test="ci != null and ci != ''">
+		            AND    CI = #{ci}
+		           </if>
+		           <if test="encodedCellPhnno != null and encodedCellPhnno != ''" >
+		            AND    CELL_PHNNO = #{encodedCellPhnno}
+		           </if>
+		           ) A
+		     ) B
+		WHERE NUMB = 1
+	</select>
+
+	<!-- 활동, 탈퇴, 휴면 테이블 조회 -->
+	<select id="getCustomerInfo" parameterType="Customer" resultType="Customer">
+		/* TsfCustomer.getCustomerInfo */
+		SELECT A.CUST_NO
+		     , A.CUST_ID
+		     , A.EMAIL
+		     , A.CELL_PHNNO
+		     , A.CUST_STAT
+		     , A.JOIN_DT
+		     , A.SECEDE_DT
+		     , A.DORMANT_DT
+		FROM (
+		      SELECT CUST_NO
+		           , CUST_ID
+		           , EMAIL
+		           , CELL_PHNNO
+		           , CUST_STAT
+		           , DATE_FORMAT(JOIN_DT, '%Y%m%d%H%i%S')   AS JOIN_DT
+		           , ''                                     AS SECEDE_DT
+		           , ''                                     AS DORMANT_DT
+		      FROM   TB_CUSTOMER
+		      WHERE  CUST_STAT = 'G104_10'   /* 활동회원*/
+		      AND    SITE_CD = #{siteCd}
+		     <if test="ci != null and ci != ''">
+		      AND    CI = #{ci}
+		     </if>
+		     <if test="encodedCellPhnno != null and encodedCellPhnno != ''" >
+		      AND    CELL_PHNNO = #{encodedCellPhnno}
+		     </if>
+		      UNION ALL
+		      SELECT CUST_ID
+		           , CUST_NO
+		           , EMAIL
+		           , CELL_PHNNO
+		           , CUST_STAT
+		           , ''                                     AS JOIN_DT
+		           , DATE_FORMAT(SECEDE_DT, '%Y%m%d%H%i%S') AS SECEDE_DT
+		           , ''                                     AS DORMANT_DT
+		      FROM   TB_SECEDE_CUST
+		      WHERE  SITE_CD = #{siteCd}
+		      <if test="ci != null and ci != ''">
+		      AND    CI = #{ci}
+		      </if>
+		      <if test="encodedCellPhnno != null and encodedCellPhnno != ''" >
+		      AND    CELL_PHNNO = #{encodedCellPhnno}
+		      </if>
+		      UNION ALL
+		      SELECT CUST_ID
+		           , CUST_NO
+		           , EMAIL
+		           , CELL_PHNNO
+		           , CUST_STAT
+		           , ''                                      AS JOIN_DT
+		           , ''                                      AS SECEDE_DT
+		           , DATE_FORMAT(DORMANT_DT, '%Y%m%d%H%i%S') AS DORMANT_DT
+		      FROM   TB_DORMANT_CUST
+		      WHERE  SITE_CD = #{siteCd}
+		      <if test="ci != null and ci != ''">
+		      AND    CI = #{ci}
+		      </if>
+		      <if test="encodedCellPhnno != null and encodedCellPhnno != ''" >
+		      AND    CELL_PHNNO = #{encodedCellPhnno}
+		      </if>
+		     ) A
+	</select>
+
 </mapper>

+ 271 - 38
src/main/webapp/WEB-INF/views/web/customer/JoinFormWeb.html

@@ -38,7 +38,7 @@
 					<div class="form_field">
 						<label class="input_label sr-only">아이디</label>
 						<div class="input_wrap form_full">
-							<input type="text" id="custId" name="custId" placeholder="아이디 (4~12자)" class="form_control" required="required" data-valid-type="alphaNumeric" data-valid-name="아이디" minlength="4" maxlength="12"/>
+							<input type="text" id="custId" name="custId" placeholder="아이디(4~12자)" class="form_control" required="required" data-valid-type="alphaNumeric" data-valid-name="아이디" minlength="4" maxlength="12"/>
 							<span class="usable" style="display:block;"></span><!-- display:block / display:none 으로 control -->
 						</div>
 						<div id="dupCustIdDiv" class="help_block hide">
@@ -55,19 +55,19 @@
 							<div class="help_block">
 								<!-- 사용불가 비밀번호일경우 -->
 								<p class="mt10">
-									<span class="c_black2">
-										<i class="ico ico_check black mr5"></i>영문(대/소문자), 숫자, 특수문자 중 2가지 이상 조합(8~20자)<br>
+									<span id="firstFailed" class="c_gray">
+										<i class="ico ico_check gray mr5"></i>영문(대/소문자), 숫자, 특수문자 중 2가지 이상 조합(8~20자)<br>
 									</span>
-									<span class="c_red2">
-										<i class="ico ico_check red mr5"></i>4개이상 연속되거나 동일한 문자/숫자 제외<br>
+									<span id="secondFailed" class="c_gray">
+										<i class="ico ico_check gray mr5"></i>4개이상 연속되거나 동일한 문자/숫자 제외<br>
 									</span>
-									<span class="c_gray">
+									<span id="thirdFailed" class="c_gray">
 										<i class="ico ico_check gray mr5"></i>아이디 제외
 									</span>
 								</p>
 								<!-- //사용불가 비밀번호일경우 -->
 								<!-- 사용가능한 비밀번호일경우 -->
-								<p class="mt10">
+								<p id="avlPwd" class="mt10 hide">
 									<span class="c_black2">
 										<i class="ico ico_check black mr5"></i>사용 가능한 비밀번호입니다
 									</span>
@@ -85,12 +85,12 @@
 							<!-- case (비밀번호확인 틀렸을경우,비밀번호 일치할경우) -->
 							<div class="help_block">
 								<!-- 비밀번호확인 틀렸을경우 -->
-								<p class="t_err">
+								<p id="misPwd" class="t_err hide">
 									비밀번호가 일치하지 않습니다.
 								</p>
 								<!-- //비밀번호확인 틀렸을경우 -->
 								<!-- 비밀번호 일치할경우 -->
-								<p class="mt10">
+								<p id="avlConPwd" class="mt10 hide">
 									<span class="c_black2"><i class="ico ico_check black mr5"></i>비밀번호가 일치합니다.</span>
 								</p>
 								<!-- //비밀번호 일치할경우 -->
@@ -101,19 +101,19 @@
 					<div class="form_field">
 						<label class="input_label sr-only">이메일</label>
 						<div class="input_wrap form_full">
-							<input type="text" id="email" name="email" placeholder="이메일" class="form_control" maxlength="30"/><!-- 잘못기입된 경우 class "err" 추가 -->
+							<input type="text" id="email" name="email" placeholder="이메일" class="form_control" required="required" data-valid-name="이메일" maxlength="30"/><!-- 잘못기입된 경우 class "err" 추가 -->
 							<!-- case (이메일 형식이 바르지않을경우,이미 가입되어있는 이메일인경우) -->
 							<div class="help_block">
 								<!-- 이메일 형식이 바르지않을경우 -->
-								<p class="t_err">
+								<p id="failEmail" class="t_err hide">
 									이메일 형식이 올바르지 않습니다.
 								</p>
 								<!-- //이메일 형식이 바르지않을경우 -->
 								<!-- 이미 가입되어있는 이메일인경우 -->
-								<p class="t_err">
+								<p id="dupEmail" class="t_err hide">
 									이미 가입된 이메일 주소입니다. 다른 이메일 주소를 입력하여 주세요.
 								</p>
-								<div class="mt20">
+								<div id="dupEmailDiv" class="mt20 hide">
 									<button type="button" class="btn btn_default btn_sm" onclick="cfnGoToPage(_PAGE_LOGIN);">
 										<span>로그인</span>
 									</button>
@@ -129,16 +129,16 @@
 					<div class="form_field">
 						<label class="input_label sr-only">휴대폰번호</label>
 						<div class="input_wrap form_full">
-							<input type="text" id="cellPhnno" name="cellPhnno" placeholder="휴대폰번호" class="form_control"/>
+							<input type="text" id="cellPhnno" name="cellPhnno" placeholder="휴대폰번호" class="form_control" minlength="10" maxlength="11" required="required" data-valid-type="numeric" data-valid-name="휴대폰번호" />
 							<!-- case (휴대폰번호 형식이 맞지 않을경우,이미 가입되어있는 핸드폰번호일경우) -->
 							<div class="help_block">
 								<!-- 휴대폰번호 형식이 맞지 않을경우 -->
-								<p class="t_err">휴대폰번호를 형식에 맞게 정확히 입력해주세요</p>
+								<p id="failPhnno" class="t_err hide">휴대폰번호를 형식에 맞게 정확히 입력해주세요</p>
 								<!-- //휴대폰번호 형식이 맞지 않을경우 -->
 								<!-- 이미 가입되어있는 핸드폰번호일경우 -->
-								<p class="t_err">I***D로 가입된 핸드폰 번호 입니다.</p>
+								<p id="dupPhnno" class="t_err hide">I***D로 가입된 핸드폰 번호 입니다.</p>
 								<div class="mt20">
-									<button type="button" class="btn btn_default btn_sm">
+									<button type="button" id="btnCellPhoneCertify" class="btn btn_default btn_sm">
 										<span>휴대폰 인증</span>
 									</button>
 								</div>
@@ -148,7 +148,9 @@
 						</div>
 					</div>
 					<div class="mt40">
-						<button class="btn btn_primary btn_block"><span>동의하고 가입하기</span></button>
+						<button type="button" id="btnJoin" class="btn btn_primary btn_block" disabled="disabled">
+							<span>동의하고 가입하기</span>
+						</button>
 					</div>
 					<div class="desc_wrap t_c mt20">
 						<p>
@@ -166,41 +168,272 @@
 <script th:src="@{'/ux/customer/customer.js?v=' + ${#calendars.format(#calendars.createNow(), 'yyyyMMddHHmmss')}}" src="/ux/customer/customer.js"></script>
 <script th:inline="javascript">
 /*<![CDATA[*/
-	//	중복된 아이디 확인
+	let custIdCheck = false;
+	let passwdCheck = false;
+	let emailCheck = false;
+	let phoneCheck = false;
+	let authCheck = false;
+
+	// 아이디 확인
 	$('#custId').on('blur', function () {
 		let custId = $(this).val();
 		if(!gagajf.isNull(custId)) {
-			let custInfo = {};
-			custInfo.custId = custId;
-			let jsonData = JSON.stringify(custInfo);
-			ajaxJsonSubmit('/customer/id/check', jsonData, fnIdConfirmCallBack)
+			if (custId.length > 3) {
+				let custInfo = {};
+				custInfo.custId = custId;
+				let jsonData = JSON.stringify(custInfo);
+				ajaxJsonSubmit('/customer/join/id/check', jsonData, fnIdConfirmCallBack);
+			}
 		}
-
 	});
 
+	// 아이디 결과
 	var fnIdConfirmCallBack = function (result) {
+		const $dupCustIdDiv = $('#dupCustIdDiv');
+		const $custId = $('#custId');
+		const $usable = $('.usable');
+
 		if (result.isFind) { // 중복된 아이디가 존재
-			fnDisplayCustIdDiv(false);
+			$custId.addClass('err');
+			$custId.removeClass('usable');
+			$dupCustIdDiv.show();
+			$usable.hide();
+			custIdCheck = false;
 		} else {
-			fnDisplayCustIdDiv(true);
+			$custId.removeClass('err');
+			$custId.addClass('usable');
+			$dupCustIdDiv.hide();
+			$usable.show();
+			custIdCheck = true;
 		}
+
 	};
 
-	var fnDisplayCustIdDiv = function (bool) {
-		let $dupCustIdDiv = $('#dupCustIdDiv');
-		let $custId = $('#custId');
-		if (bool) { // 사용가능
-			$custId.removeClass('err'); //잘못기입된 경우
-			$custId.addClass('usable');
-			$('.usable').show();
-		} else {  // 사용가능 하지 않음
-			$custId.addClass('err'); //잘못기입된 경우
-			$custId.removeClass('usable');
-			$dupCustIdDiv.show();
-			$('.usable').hide();
+	// 비밀번호 입력
+	$('#joinForm input[name=passwd]').on('focusout keyup keydown', function () {
+		fnCheckPassword();
+	});
+
+	// 비밀번호 확인 입력
+	$('#joinForm input[name=confirmPassword]').on('focusout keyup keydown', function () {
+		fnCheckConfirmPassword();
+	});
+
+	// 비밀번호 확인
+	var fnCheckPassword = function () {
+		const $firstFailed = $('#firstFailed');
+		const $secondFailed = $('#secondFailed');
+		const $thirdFailed = $('#thirdFailed');
+		const $avlPwd = $('#avlPwd');
+		const red = 'c_red2';
+		const gray = 'c_gray';
+
+		let custId = $('#joinForm input[name=custId]').val();
+		let password = $('#joinForm input[name=passwd]').val();
+		let confirmPassword = $('#joinForm input[name=confirmPassword]').val();
+		let pwdCheck = true;
+
+
+		// 영문, 숫자, 특수문자 2종 이상 혼용 || 길이
+		if (fnValidtaionPwdMixedWord(password) || fnValidationPwdLength(password)) {
+			pwdCheck = false;
+			$firstFailed.removeClass(gray);
+			$firstFailed.addClass(red);
+		} else {
+			$firstFailed.removeClass(red);
+			$firstFailed.addClass(gray);
+		}
+
+		// 동일한 문자/숫자 4자이상 || 연속된 문자가 4자이상
+		if (fnValidationPwdSameWord(password) || fnValidtaionPwdCntnsWord(password)) {
+			pwdCheck = false;
+			$secondFailed.removeClass(gray);
+			$secondFailed.addClass(red);
+		} else {
+			$secondFailed.removeClass(red);
+			$secondFailed.addClass(gray);
 		}
+
+		// 아이디 포함
+		if (!gagajf.isNull(custId)) {
+			if (fnValidationPwdSameId(password, custId)) {
+				pwdCheck = false;
+				$thirdFailed.removeClass(gray);
+				$thirdFailed.addClass(red);
+			} else {
+				$thirdFailed.removeClass(red);
+				$thirdFailed.addClass(gray);
+			}
+		}
+
+		if (pwdCheck) {
+			$firstFailed.hide();
+			$secondFailed.hide();
+			$thirdFailed.hide();
+			$avlPwd.show();
+		} else {
+			$firstFailed.show();
+			$secondFailed.show();
+			$thirdFailed.show();
+			$avlPwd.hide();
+		}
+
+		if (!gagajf.isNull(confirmPassword)) {
+			fnCheckConfirmPassword();
+		}
+
 	};
 
+	// 비밀번호 확인
+	var fnCheckConfirmPassword = function () {
+		const $misPwd = $('#misPwd');
+		const $avlConPwd = $('#avlConPwd');
+		let password = $('#joinForm input[name=passwd]').val();
+		let confirmPassword = $('#joinForm input[name=confirmPassword]').val();
+		if (!gagajf.isNull(password) && !gagajf.isNull(confirmPassword)) {
+			if (fnValidationPwdSameConfirmPwd(password, confirmPassword)) {
+				$avlConPwd.hide();
+				$misPwd.show();
+				passwdCheck = false;
+			} else {
+				$misPwd.hide();
+				$avlConPwd.show();
+				passwdCheck = true;
+			}
+		}
+	};
+
+	//	이메일 확인
+	$('#email').on('blur', function () {
+		const $failEmail = $('#failEmail');
+		let email = $(this).val();
+		let validation;
+
+		if(!gagajf.isNull(email)) {
+			if (!fnCheckValidationEmail(email)) {
+				$failEmail.show();
+				emailCheck = false;
+				validation = false;
+			} else {
+				validation = true;
+				$failEmail.hide();
+			}
+			if (validation) {
+				let custInfo = {};
+				custInfo.email = email;
+				let jsonData = JSON.stringify(custInfo);
+				ajaxJsonSubmit('/customer/email/check', jsonData, fnEmailConfirmCallBack);
+			}
+		}
+	});
+
+	// 이메일 확인 결과
+	var fnEmailConfirmCallBack = function (result) {
+		const $dupEmail = $('#dupEmail');
+		const $dupEmailDiv = $('#dupEmailDiv');
+		if (result.isFind) { // 중복된 아이디가 존재
+			$dupEmail.show();
+			$dupEmailDiv.show();
+			emailCheck = false;
+		} else {
+			$dupEmail.hide();
+			$dupEmailDiv.hide();
+			emailCheck = true;
+		}
+	};
+
+	//	휴대폰 확인
+	$('#cellPhnno').on('blur', function () {
+		const $failPhnno = $('#failPhnno');
+		let cellPhnno = $(this).val();
+		let validation;
+
+		if (gagajf.isNull(cellPhnno)) {
+			if ( 9 < cellPhnno < 12) {
+				$failPhnno.hide();
+				validation = true;
+			} else {
+				$failPhnno.show();
+				validation = false;
+			}
+			if (validation) {
+				let custInfo = {};
+				custInfo.cellPhnno = cellPhnno;
+				let jsonData = JSON.stringify(custInfo);
+				ajaxJsonSubmit('/customer/cellphnno/check', jsonData, fnPhoneConfirmCallBack);
+			}
+		}
+	});
+
+	// 휴대폰 번호 입력에대한 결과
+	var fnPhoneConfirmCallBack = function (result) {
+		// const $cellPhnno = $('#cellPhnno');
+		const $dupPhnno = $('#dupPhnno');
+		if (result.isFind) { // 가입된 고객 정보가 있으면
+			$dupPhnno.text(result.maskingCustId+'로 가입된 핸드폰 번호 입니다.');
+			$dupPhnno.show();
+			// $cellPhnno.text(result.cellPhnno);
+			// $cellPhnno.show();
+			authCheck = false;
+		} else {
+			$dupPhnno.hide();
+			authCheck = true;
+		}
+	};
+	
+
+	//휴대폰 인증
+	$('#btnCellPhoneCertify').on('click', function () {
+		cfnOpenCellphoneCertify();
+	});
+
+	// 나이스 본인인증 후 콜백
+	var fnNiceCallBack = function(encData) {
+		if (!gagajf.isNull(encData)) {
+			let custInfo = {};
+			custInfo.encData = encData;
+			let jsonData = JSON.stringify(custInfo);
+			ajaxJsonSubmit('/customer/authentication/validation', jsonData, fnInfoConfirmCallBack);
+		}
+	};
+
+	// 본인이증 후 결과
+	var fnInfoConfirmCallBack = function (result) {
+		// const $cellPhnno = $('#cellPhnno');
+		const $dupPhnno = $('#dupPhnno');
+		if (result.isFind) { // 가입된 고객 정보가 있으면
+			$dupPhnno.text(result.maskingCustId+'로 가입된 핸드폰 번호 입니다.');
+			$dupPhnno.show();
+			// $cellPhnno.text(result.cellPhnno);
+			// $cellPhnno.show();
+			authCheck = false;
+		} else {
+			$dupPhnno.hide();
+			authCheck = true;
+		}
+	};
+
+	// 저장
+	$('#btnJoin').on('click', function () {
+
+
+	});
+
+
+	// 가입 가능한지 확인
+	var fnPossibleJoin = function () {
+		const $btnJoin = $('#btnJoin')
+		if (custIdCheck && passwdCheck && emailCheck && phoneCheck && authCheck ) {
+			$btnJoin.attr('disabled', false);
+		} else {
+			$btnJoin.attr('disabled', true);
+		}
+	};
+
+	$(document).ready(function() {
+		fnPossibleJoin();
+	});
+
 /*]]>*/
 </script>
 

+ 9 - 9
src/main/webapp/WEB-INF/views/web/customer/PasswordChangeFormWeb.html

@@ -120,16 +120,16 @@
 
 	// 비밀번호 확인
 	var fnCheckPassword = function () {
+		const $firstFailed = $('#firstFailed');
+		const $secondFailed = $('#secondFailed');
+		const $thirdFailed = $('#thirdFailed');
+		const $avlPwd = $('#avlPwd');
+		const red = 'c_red2';
+		const gray = 'c_gray';
 		let custId = $('#resetPasswordForm input[name=custId]').val();
 		let password = $('#resetPasswordForm input[name=passwd]').val();
 		let confirmPassword = $('#resetPasswordForm input[name=confirmPassword]').val();
-		let $firstFailed = $('#firstFailed');
-		let $secondFailed = $('#secondFailed');
-		let $thirdFailed = $('#thirdFailed');
-		let $avlPwd = $('#avlPwd');
 		let pwdCheck = true;
-		let red = 'c_red2';
-		let gray = 'c_gray';
 
 		// 영문, 숫자, 특수문자 2종 이상 혼용 || 길이
 		if (fnValidtaionPwdMixedWord(password) || fnValidationPwdLength(password)) {
@@ -181,11 +181,11 @@
 
 	// 비밀번호체크
 	var fnCheckConfirmPassword = function () {
+		const $misPwd = $('#misPwd');
+		const $avlConPwd = $('#avlConPwd');
+		const $btnSavePassword = $('#btnSavePassword');
 		let password = $('#resetPasswordForm input[name=passwd]').val();
 		let confirmPassword = $('#resetPasswordForm input[name=confirmPassword]').val();
-		let $misPwd = $('#misPwd');
-		let $avlConPwd = $('#avlConPwd');
-		let $btnSavePassword = $('#btnSavePassword');
 
 		if (fnValidationPwdSameConfirmPwd(password, confirmPassword)) {
 			$avlConPwd.hide();

+ 3 - 2
src/main/webapp/ux/customer/customer.js

@@ -16,7 +16,7 @@
 /**
  * 이메일 유효성 체크
  * @param email - 이메일
- * @return boolean - 통과(true)/실패(fail)
+ * @return boolean - 통과(true)/실패(false)
  * @author jsshin
  * @since 2021. 02. 15
  */
@@ -173,6 +173,7 @@ var fnValidationPwdSameId = function (password, custId) {
  */
 var fnValidationPwdSameConfirmPwd = function (password, confirmPassword) {
 	let result;
+
 	if (password != confirmPassword) {
 		result = true;
 	} else {
@@ -216,7 +217,7 @@ var ajaxJsonSubmit = function (url, json, callback) {
 				}
 			} else { // 실패
 				if (!gagajf.isNull(result.error.message)) {
-					mcxDialog(result.error.message);
+					mcxDialog.alert(result.error.message);
 				}
 			}
 		},