瀏覽代碼

Merge branch 'develop' of http://112.172.147.34:4936/style24/style24.front.git into develop

gagamel 5 年之前
父節點
當前提交
b8e215dce5

+ 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);
 }

+ 127 - 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,129 @@ 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;
+	}
+
+	/**
+	 * 회원가입
+	 * @param customer - 일반가입, SNS 가입
+	 * @author jsshin
+	 * @since 2021. 02. 19
+	 */
+	@Transactional("shopTxnManager")
+	public void saveJoinCustomer(Customer customer) {
+		//
+	}
 
 }

+ 66 - 0
src/main/java/com/style24/front/biz/service/TsfKakaoService.java

@@ -0,0 +1,66 @@
+package com.style24.front.biz.service;
+
+import com.gagaframework.web.parameter.GagaMap;
+import com.style24.core.biz.service.TscCustomerService;
+import com.style24.core.biz.thirdparty.SsgKakaoSender;
+import com.style24.core.support.env.TscConstants;
+import com.style24.persistence.domain.CustContactHst;
+import com.style24.persistence.domain.Customer;
+import com.style24.persistence.domain.SsgDirectMessage;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+
+/**
+ * 카카오알림톡 Service. 모든 카카오알림톡 발송은 여기에서 처리한다.
+ *
+ * @author gagamel
+ * @since 2021. 02. 19
+ */
+@Service
+@Slf4j
+public class TsfKakaoService {
+
+	@Autowired
+	private SsgKakaoSender kakaoSender;
+
+	@Autowired
+	private TscCustomerService coreCustomerService;
+
+
+	/**
+	 * 가입축하 알림톡
+	 *
+	 * @param customer - 고객 정보
+	 * @author jsshin
+	 * @since 2021. 02. 19
+	 */
+	@Transactional("shopTxnManager")
+	public void sendJoinCongrat(Customer customer) {
+		SsgDirectMessage dm = new SsgDirectMessage();
+		dm.setFdestine(customer.getCellPhnno());
+		dm.setFkkoresendtype("LMS");
+
+		GagaMap replaceInfo = new GagaMap();
+		replaceInfo.setString("siteNm", TscConstants.Style24Infomation.SITE_NAME.value());
+		replaceInfo.setString("custNm", customer.getCustNm());
+		kakaoSender.send(SsgKakaoSender.KakaoAnswerSq.JoinCongrat.value(), dm, replaceInfo);
+
+		try {
+			// 고객접촉이력 정보
+			CustContactHst custContactHst = new CustContactHst();
+			custContactHst.setContactType(TscConstants.ContactType.CONGRATULATIONS.value());
+			custContactHst.setContactMethod(TscConstants.ContactMethod.KAKAOTALK.value()); // 접촉방법:알림톡+문자(공통코드G055)
+			custContactHst.setReceiverNo(customer.getCustNo());
+			custContactHst.setContactContents("회원가입축하");
+			coreCustomerService.createCustomerContactHistory(custContactHst);
+		} catch (Exception e) {
+			log.error("error", e);
+			// Do nothing
+		}
+	}
+
+
+}

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

@@ -2,9 +2,10 @@ 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.biz.service.TscClauseService;
 import com.style24.core.support.env.TscConstants;
 import com.style24.core.support.session.TscSession;
+import com.style24.front.biz.service.TsfKakaoService;
 import com.style24.front.biz.thirdparty.NiceCertify;
 import com.style24.front.support.security.session.TsfSession;
 import com.style24.persistence.domain.Customer;
@@ -42,6 +43,12 @@ public class TsfCustomerController extends TsfBaseController {
 	@Autowired
 	private TsfCustomerService customerService;
 
+	@Autowired
+	TscClauseService clauseService;
+
+	@Autowired
+	TsfKakaoService kakaoService;
+
 	@Autowired
 	private NiceCertify niceCertify;
 
@@ -158,7 +165,6 @@ public class TsfCustomerController extends TsfBaseController {
 		return result;
 	}
 
-
 	/**
 	 * 비밀번호 찾기 - 고객정보 찾기
 	 * @param customer - 고객정보
@@ -315,6 +321,48 @@ 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();
+
+		return mav;
+	}
+
+	/**
+	 * 개인정보취급방침 화면
+	 *
+	 * @return ModelAndView
+	 * @author jsshin
+	 * @since 2021. 02. 19
+	 */
+	@GetMapping("/privacy/layer/form")
+	public ModelAndView getPrivacyLayerForm() {
+		ModelAndView mav = new ModelAndView();
+
+		return mav;
+	}
+
+	/**
+	 * 마케팅 동의 화면
+	 *
+	 * @return ModelAndView
+	 * @author jsshin
+	 * @since 2021. 02. 19
+	 */
+	@GetMapping("/marketing/layer/form")
+	public ModelAndView getMarketingLayerForm() {
+		ModelAndView mav = new ModelAndView();
+		
+
+		return mav;
+	}
 
 	/**
 	 * 회원정보 입력 화면
@@ -380,7 +428,7 @@ public class TsfCustomerController extends TsfBaseController {
 	/**
 	 * 나이스 인증 콜백
 	 * @param encodeData - 휴대폰인증에서 전달받은 인증결과 암호화 데이터 취득
-	 * @param encData - ipin_process에서 전달받은 인증결과 암호화 데이터 취득
+	 * @param encData - 아이핀에서 전달받은 인증결과 암호화 데이터 취득
 	 * @return ModelAndView
 	 * @author jsshin
 	 * @since 2021. 02. 09
@@ -391,7 +439,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 +457,140 @@ 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 - cellphnno
+	 * @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 - 인증정보
+	 * @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 saveJoinCustomer(@RequestBody Customer customer) {
+		String encData = TscSession.getAttribute("encData");
+		customer.setEncData(encData);
+		GagaMap authInfo = niceCertify.getCertifyCellPhoneResultInfo(customer);
+		customer.setCi(authInfo.getString("sCi"));
+
+		// 1.입력 받은 데이터 검증
+
+		// 2.고객정보 생성 및 혜택 처리
+
+		// 3.알림톡 및 메일 발송
+		try {
+
+		} catch (Exception e) {
+			log.error("error", e);
+		}
+
+		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>

+ 2 - 2
src/main/java/com/style24/persistence/mybatis/shop/TsfGoods.xml

@@ -183,8 +183,8 @@
 		         , IFNULL(B.CURR_APRICE, C.CURR_PRICE) AS CURR_PRICE
 		         , IFNULL(B.DC_ARATE, C.DC_RATE) AS DC_RATE
 		         , (CASE WHEN #{frontGb} = 'P' THEN IFNULL(B.PNT_APRATE, C.PNT_PRATE) ELSE IFNULL(B.PNT_AMRATE,C.PNT_MRATE) END ) AS PNT_RATE
-		         , DATE_FORMAT(A.SOCIAL_STDT, '%Y-%m-%d %H:%i:%S')  AS SOCIAL_STDT
-		         , DATE_FORMAT(A.SOCIAL_EDDT, '%Y-%m-%d %H:%i:%S')  AS SOCIAL_EDDT
+		         , DATE_FORMAT(A.SOCIAL_STDT, '%Y%m%d%H%i%S')  AS SOCIAL_STDT
+		         , DATE_FORMAT(A.SOCIAL_EDDT, '%Y%m%d%H%i%S')  AS SOCIAL_EDDT
 		    FROM TB_SOCIAL A
 		    INNER JOIN TB_SOCIAL_GOODS B ON A.SOCIAL_SQ = B.SOCIAL_SQ
 		                                 AND B.GOODS_CD = #{goodsCd}

+ 3 - 3
src/main/webapp/WEB-INF/views/web/customer/IdFindFormWeb.html

@@ -219,7 +219,7 @@
 	</div>
 </div>
 
-<script th:src="@{'/ux/customer/customer.js?v=' + ${#calendars.format(#calendars.createNow(), 'yyyyMMddHHmmss')}}" src="/ux/customer/customer.js"></script>
+<script th:src="@{'/biz/customer.js?v=' + ${#calendars.format(#calendars.createNow(), 'yyyyMMddHHmmss')}}" src="/biz/customer.js"></script>
 <script th:inline="javascript">
 /*<![CDATA[*/
 
@@ -245,7 +245,7 @@
 
 		let jsonData = JSON.stringify(custInfo);
 		//console.log('jsonData', jsonData);
-		ajaxJsonSubmit('/customer/id/find', jsonData, fnInfoConfirmCallBack);
+		gagajf.ajaxJsonSubmit('/customer/id/find', jsonData, fnInfoConfirmCallBack);
 	});
 
 	// 휴대폰 인증
@@ -265,7 +265,7 @@
 			custInfo.encData = encData;
 			custInfo.authMethod = authMethod;
 			let jsonData = JSON.stringify(custInfo);
-			ajaxJsonSubmit('/customer/id/find', jsonData, fnInfoConfirmCallBack)
+			gagajf.ajaxJsonSubmit('/customer/id/find', jsonData, fnInfoConfirmCallBack)
 		}
 	};
 

+ 272 - 39
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>
@@ -163,44 +165,275 @@
 	</div>
 </div>
 
-<script th:src="@{'/ux/customer/customer.js?v=' + ${#calendars.format(#calendars.createNow(), 'yyyyMMddHHmmss')}}" src="/ux/customer/customer.js"></script>
+<script th:src="@{'/biz/customer.js?v=' + ${#calendars.format(#calendars.createNow(), 'yyyyMMddHHmmss')}}" src="/biz/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);
+				gagajf.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);
+				gagajf.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);
+				gagajf.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);
+			gagajf.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>
 

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

@@ -104,7 +104,7 @@
 	</div>
 </div>
 
-<script th:src="@{'/ux/customer/customer.js?v=' + ${#calendars.format(#calendars.createNow(), 'yyyyMMddHHmmss')}}" src="/ux/customer/customer.js"></script>
+<script th:src="@{'/biz/customer.js?v=' + ${#calendars.format(#calendars.createNow(), 'yyyyMMddHHmmss')}}" src="/biz/customer.js"></script>
 <script th:inline="javascript">
 /*<![CDATA[*/
 
@@ -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();
@@ -221,7 +221,7 @@
 		fnCheckPassword();
 		fnCheckConfirmPassword();
 		let jsonData = JSON.stringify(resetPasswordForm);
-		ajaxJsonSubmit('/customer/password/reset', jsonData, fnSavePasswordCallback);
+		gagajf.ajaxJsonSubmit('/customer/password/reset', jsonData, fnSavePasswordCallback);
 	});
 
 	var fnSavePasswordCallback = function (result) {

+ 4 - 4
src/main/webapp/WEB-INF/views/web/customer/PasswordFindFormWeb.html

@@ -189,7 +189,7 @@
 	</div>
 </div>
 
-<script th:src="@{'/ux/customer/customer.js?v=' + ${#calendars.format(#calendars.createNow(), 'yyyyMMddHHmmss')}}" src="/ux/customer/customer.js"></script>
+<script th:src="@{'/biz/customer.js?v=' + ${#calendars.format(#calendars.createNow(), 'yyyyMMddHHmmss')}}" src="/biz/customer.js"></script>
 <script th:inline="javascript">
 /*<![CDATA[*/
 	let custIdCheck = false;
@@ -204,7 +204,7 @@
 		let custInfo = {};
 		custInfo.custId = custId;
 		let jsonData = JSON.stringify(custInfo);
-		ajaxJsonSubmit('/customer/id/check', jsonData, fnIdConfirmCallBack)
+		gagajf.ajaxJsonSubmit('/customer/id/check', jsonData, fnIdConfirmCallBack)
 	});
 
 	var fnIdConfirmCallBack = function (result) {
@@ -244,7 +244,7 @@
 		custInfo.authMethod = 'custInfo';
 		let jsonData = JSON.stringify(custInfo);
 		//console.log('jsonData', jsonData);
-		ajaxJsonSubmit('/customer/password/find/custinfo', jsonData, fnInfoConfirmCallBack);
+		gagajf.ajaxJsonSubmit('/customer/password/find/custinfo', jsonData, fnInfoConfirmCallBack);
 	});
 
 	// 휴대폰 인증
@@ -294,7 +294,7 @@
 			custInfo.encData = encData;
 			custInfo.authMethod = authMethod;
 			let jsonData = JSON.stringify(custInfo);
-			ajaxJsonSubmit('/customer/password/find/certify', jsonData, fnInfoConfirmCallBack)
+			gagajf.ajaxJsonSubmit('/customer/password/find/certify', jsonData, fnInfoConfirmCallBack)
 		}
 	};
 

+ 2 - 47
src/main/webapp/ux/customer/customer.js → src/main/webapp/biz/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 {
@@ -180,49 +181,3 @@ var fnValidationPwdSameConfirmPwd = function (password, confirmPassword) {
 	}
 	return result;
 };
-
-
-
-/*
-* 임시사용
-*
-* */
-var ajaxJsonSubmit = function (url, json, callback) {
-	$.ajax({
-		type : "POST",
-		url : url,
-		dataType : 'json',
-		data : json,
-		beforeSend : function(xhr, opts) { // 통신 전
-			// when validation is false
-			// AJAX call
-			xhr.setRequestHeader('AJAX', 'true');
-			// dataType: "json"일 때
-			xhr.setRequestHeader('Accept', 'application/json');
-			xhr.setRequestHeader('Content-Type', 'application/json');
-		},
-		success : function(result) {
-			if (typeof(result.status) == 'undefined' || result.status === 200) { // 성공
-				if (!gagajf.isNull(result.message)) {
-					if (mcxDialog.alert(result.message)) {
-						if (typeof(callback) === 'function') {
-							callback.call(this, result);
-						}
-					}
-				} else {
-					if (typeof(callback) == "function") {
-						callback.call(this, result);
-					}
-				}
-			} else { // 실패
-				if (!gagajf.isNull(result.error.message)) {
-					mcxDialog(result.error.message);
-				}
-			}
-		},
-		error : function() {
-			// error code
-			mcxDialog.alert('오류로 인해 처리되지 않았습니다.');
-		}
-	});
-}