소스 검색

Merge remote-tracking branch 'origin/ST24PRJ-426(회원CI오류)' into develop

card007 4 년 전
부모
커밋
795803ffcf

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

@@ -38,6 +38,15 @@ public interface TsfCustomerDao {
 	 * @since 2021. 02. 18
 	 */
 	Customer getCustomerInfo(Customer customer);
+	
+	/**
+	 * 활동, 탈퇴, 휴면 테이블 조회
+	 * @param customer - ci, 휴대폰
+	 * @return 임시비밀번호
+	 * @author jsshin
+	 * @since 2021. 02. 18
+	 */
+	Customer getCustomerInfoCI(Customer customer);
 
 	/**
 	 * 고객 데이터 생성

+ 50 - 6
src/main/java/com/style24/front/biz/service/TsfCustomerService.java

@@ -101,11 +101,31 @@ public class TsfCustomerService {
 	public Customer getCustomerFindByCustNo(Integer custNo) {
 		Customer customer = new Customer();
 		customer.setCustNo(custNo);
+		
 		customer.setCustStat(TscConstants.CustStat.ACTIVE.value());
 		customer.setSiteCd(TscConstants.Site.STYLE24.value());
 		customer.encryptData();
 		return coreCustomerService.getCustomerInfo(customer);
 	}
+	
+	/**
+	 * 고객정보찾기 (휴면회원 비밀번호변경)
+	 *
+	 * @param custNo - 고객번호
+	 * @return Customer 고객정보
+	 * @author jsshin
+	 * @since 2021. 02. 24
+	 */
+	public Customer getCustomerFindByCustNoDormant(Integer custNo) {
+		Customer customer = new Customer();
+		customer.setCustNo(custNo);
+		
+		// 2022.01.22 휴면계정 비밀번호 변경시 처리
+		// customer.setCustStat(TscConstants.CustStat.ACTIVE.value());
+		customer.setSiteCd(TscConstants.Site.STYLE24.value());
+		customer.encryptData();
+		return coreCustomerService.getCustomerInfo(customer);
+	}
 
 	/**
 	 * 휴면고객 정보 찾기
@@ -219,9 +239,9 @@ public class TsfCustomerService {
 
 		return result > 0;
 	}
-
+	
 	/**
-	 * 해당 CI로 가입된 이력이 있는지 확인
+	 * 해당 CI로 가입된 이력이 있는지 확인 (회원가입, 휴대폰중복체크)
 	 * @param ci - 연계정보
 	 * @return boolean - 있으면 TRUE/ 없으면 FALSE
 	 * @author jsshin
@@ -237,6 +257,24 @@ public class TsfCustomerService {
 		return customerDao.getCustomerInfo(customer);
 	}
 
+	/**
+	 * 해당 CI로 가입된 이력이 있는지 확인 (TB_CUSTOMER.CI NULL)
+	 * @param ci - 연계정보
+	 * @return boolean - 있으면 TRUE/ 없으면 FALSE
+	 * @author jsshin
+	 * @since 2021. 02. 15
+	 */
+	public Customer getCustomerFindByCiCustomer(String ci) {
+		TscSession.setAttribute("maskingYn", "Y");
+		Customer customer = new Customer();
+		customer.setCi(ci);
+		customer.setSiteCd(TscConstants.Site.STYLE24.value());
+		customer.encryptData();
+		
+		// 2022.01.10 본인인증시 휴면회원, 탈퇴회원은 CI 중복체크 안함
+		return customerDao.getCustomerInfoCI(customer);
+	}
+
 	/**
 	 * 해당 휴대폰 번호로 가입된 이력이 있는지 확인
 	 * @param cellPhnno - 휴대전화번호
@@ -707,9 +745,14 @@ public class TsfCustomerService {
 		Customer custInfo = getDormantCustomerFindByCustNo(customer.getCustNo());
 
 		if (!customer.getCi().equals(custInfo.getCi())) {
-			result.setBoolean("isRelase", false);
-			result.setString("errorType", "DIFFERENT_CI"); // 계정이 등록된 CI랑 인증한 CI가 다를떄
-			return result;
+			// 2022.01.10 TB_CUSTOMER.CI 값이 없을때 TB_CUSTOMER CI UPDATE 
+			if (StringUtils.isBlank(custInfo.getCi())) {
+				// CI가 없으면 로그인시 본인인증을 한번더 하게끔 처리 로직으로 변경
+			} else {
+				result.setBoolean("isRelase", false);
+				result.setString("errorType", "DIFFERENT_CI"); // 계정이 등록된 CI랑 인증한 CI가 다를떄
+				return result;
+			}
 		}
 
 		customer.setRegNo(customer.getCustNo());
@@ -738,7 +781,7 @@ public class TsfCustomerService {
 		boolean isSuccess = false;
 
 		// CI 유효성 체크
-		Customer custInfo = getCustomerFindByCi(customer.getCi());
+		Customer custInfo = getCustomerFindByCiCustomer(customer.getCi());
 		if (custInfo != null) {
 			TsfSession.setAttribute("maskingCustId", custInfo.getMaskingCustId());
 			resultMap.setBoolean("isSuccess", isSuccess);
@@ -747,6 +790,7 @@ public class TsfCustomerService {
 
 		// 1.이력 쌓고
 		coreCustomerService.createCustomerHistory(customer);
+		
 		// 2.CI 업데이트
 		int resultCnt = customerDao.updateCustomerCi(customer);
 

+ 2 - 1
src/main/java/com/style24/front/biz/web/TsfCustomerController.java

@@ -300,7 +300,8 @@ public class TsfCustomerController extends TsfBaseController {
 		}
 
 		// 고객정보 찾기
-		Customer custInfo = customerService.getCustomerFindByCustNo(Integer.valueOf(custNo));
+		// 2022.01.22 휴면계정 비밀번호 변경시 처리
+		Customer custInfo = customerService.getCustomerFindByCustNoDormant(Integer.valueOf(custNo));
 
 		if (custInfo != null) {
 			customer.setTempPasswdYn("N"); // 임시비밀번호여부

+ 9 - 5
src/main/java/com/style24/front/support/security/TsfAuthenticationProvider.java

@@ -111,12 +111,16 @@ public class TsfAuthenticationProvider implements AuthenticationProvider {
 		if (TscConstants.CustStat.SECEDE.value().equals(loginInfo.getCustStat())) {
 			throw new TsfSecedeAccountException(message.getMessage("LOGN_0007"));
 		}
+		
 		// 활동회원 중 본인인증이 필요한 회원
-//		2021.10.26 김유중 : ci 없는 회원이 본인 인증 시 실패가 많아서 로그인 처리로 변경(정지혜과장,전석훈차장 협의)
-//		if (TscConstants.CustStat.ACTIVE.value().equals(loginInfo.getCustStat()) && StringUtils.isBlank(loginInfo.getCi())) {
-//			TsfSession.setAttribute("custNo", String.valueOf(loginInfo.getCustNo()));
-//			throw new TsfNonCertificationAccountException(message.getMessage("LOGN_0009"));
-//		}
+		// 2021.10.26 김유중 : ci 없는 회원이 본인 인증 시 실패가 많아서 로그인 처리로 변경(정지혜과장,전석훈차장 협의)
+		if (TscConstants.CustStat.ACTIVE.value().equals(loginInfo.getCustStat()) && StringUtils.isBlank(loginInfo.getCi())) {
+			
+			log.info("loginInfo.getCustNo()) ::: {}", loginInfo.getCustNo());
+			
+			TsfSession.setAttribute("custNo", String.valueOf(loginInfo.getCustNo()));
+			throw new TsfNonCertificationAccountException(message.getMessage("LOGN_0009"));
+		}
 
 		// 권한 설정
 		List<SimpleGrantedAuthority> authorities = new ArrayList<>();

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

@@ -163,6 +163,35 @@
 		      </if>
 		     ) A
 	</select>
+	
+	<!-- 활동, 탈퇴, 휴면 테이블 조회(2022.01.10 본인인증시 휴면회원, 탈퇴회원은 CI 중복체크 안함) -->
+	<select id="getCustomerInfoCI" parameterType="Customer" resultType="Customer">
+		/* TsfCustomer.getCustomerInfoCI */
+		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>
+		     ) A
+	</select>
 
 	<!--고객정보 생성-->
 	<insert id="createCustomer" parameterType="Customer" keyProperty="custNo">