Bladeren bron

Merge branch 'jsshin' into develop

jsshin 5 jaren geleden
bovenliggende
commit
d6b6a0c203

+ 7 - 1
src/main/java/com/style24/front/biz/dao/TsfCustomerDao.java

@@ -58,6 +58,12 @@ public interface TsfCustomerDao {
 	 */
 	Customer getCusomterActiveAndDormant(Customer customer);
 
-
+	/**
+	 * SNS 정보로 고객 테이블 조회
+	 * @param custSnsInfo - 고객정보
+	 * @return 고객정보
+	 * @author jsshin
+	 * @since 2021. 02. 24
+	 */
 	Customer getCusomterSnsFind(CustSnsInfo custSnsInfo);
 }

+ 108 - 21
src/main/java/com/style24/front/biz/service/TsfCustomerService.java

@@ -118,7 +118,7 @@ public class TsfCustomerService {
 	 * @author jsshin
 	 * @since 2021. 02. 15
 	 */
-	public boolean getCustomerFindByCustId(String custId) {
+	public boolean getCustomerFindByCustIdCount(String custId) {
 		Customer customer = new Customer();
 		customer.setCustId(custId);
 		customer.setSiteCd(TscConstants.Site.STYLE24.value());
@@ -136,7 +136,7 @@ public class TsfCustomerService {
 	 * @author jsshin
 	 * @since 2021. 02. 15
 	 */
-	public boolean getCustomerFindByEmail(String email) {
+	public boolean getCustomerFindByEmailCount(String email) {
 		Customer customer = new Customer();
 		customer.setEmail(email);
 		customer.setSiteCd(TscConstants.Site.STYLE24.value());
@@ -160,6 +160,26 @@ public class TsfCustomerService {
 		customer.setHypenCellPhone(); // 010-0000-0000
 		customer.setSiteCd(TscConstants.Site.STYLE24.value());
 		customer.encryptData();
+
+		int result = customerDao.getCustomerInfoCount(customer);
+
+		return result > 0;
+	}
+
+	/**
+	 * 해당 CI로 가입된 이력이 있는지 확인
+	 * @param ci - 연계정보
+	 * @return boolean - 있으면 TRUE/ 없으면 FALSE
+	 * @author jsshin
+	 * @since 2021. 02. 15
+	 */
+	public boolean getCustomerFindByCiCount(String ci) {
+		TscSession.setAttribute("maskingYn","Y");
+		Customer customer = new Customer();
+		customer.setCi(ci);
+		customer.setSiteCd(TscConstants.Site.STYLE24.value());
+		customer.encryptData();
+
 		int result = customerDao.getCustomerInfoCount(customer);
 
 		return result > 0;
@@ -284,11 +304,10 @@ public class TsfCustomerService {
 		boolean isJoin = true;
 		customer.setEncodedPasswd(" ");
 		customer.setCustId(customer.getSnsType()+"_"+customer.getSnsId());
-		customer.setEncodedPasswd(passwordEncoder.encode(customer.getPasswd()));
-		customer.encryptData();
-
 		String gender = "G007_"+customer.getSexGb();
 		customer.setSexGb(gender);
+		customer.encryptData();
+
 		customer.setSiteCd(TscConstants.Site.STYLE24.value());
 		customer.setFrontGb(TsfSession.getFrontGb());
 		customer.setAfLinkCd(TsfSession.getAttribute("afLinkCd"));
@@ -296,11 +315,13 @@ public class TsfCustomerService {
 		customer.setCustGb(TscConstants.CustGb.NORMAL.value());
 		customer.setCustGrade(TscConstants.CustGrade.WELCOME.value());
 
+
 		int custCnt = customerDao.createCustomer(customer);
 		customerDao.createCustomerSns(customer);
 
 		if (custCnt > 0) {
 			saveJoinPostProcessing(customer);
+			TsfSession.setAttribute("custNo", String.valueOf(customer.getCustNo()));
 		} else {
 			isJoin = false;
 		}
@@ -330,7 +351,8 @@ public class TsfCustomerService {
 
 	/**
 	 * Sns 정보에대한 상태 처리
-	 * @param custSnsInfo
+	 *
+	 * @param custSnsInfo - SNS 고객 정보
 	 * @author jsshin
 	 * @since 2021. 02. 19
 	 */
@@ -346,21 +368,27 @@ public class TsfCustomerService {
 			return resultMap;
 		}
 
-		// 2. CI(연계정보)로 가입 되어져 있는 고객이 있는지 ?
+		if (StringUtils.isBlank(custSnsInfo.getCi())) {
+			throw new IllegalStateException("연계정보 값이 없습니다. 고객센터에 문의하시기 바랍니다.");
+		}
+
+		// 2. CI(연계정보)로 가입 되어져 있는 고객이 확인
 		custInfo = getCustomerFindByCi(custSnsInfo.getCi());
 
 		if (custInfo != null) { // 2-1. 고객정보 있는경우
+
 			if (TscConstants.CustStat.SECEDE.value().equals(custInfo.getCustStat())) {
 				resultMap.setString("custStat", "SECEDE_CUST"); // 탈퇴 회원
 				return resultMap;
 			}
+
 			if (TscConstants.CustStat.DORMANT.value().equals(custInfo.getCustStat())) {
 				resultMap.setString("custStat", "DORMANT_CUST"); // 휴면 회원
 				return resultMap;
 			}
-			if (TscConstants.CustStat.ACTIVE.value().equals(custInfo.getCustStat())) {
 
-				if (StringUtils.isBlank(custSnsInfo.getCellPhnno())) {
+			if (TscConstants.CustStat.ACTIVE.value().equals(custInfo.getCustStat())) {
+				if (StringUtils.isBlank(custSnsInfo.getCellPhnno())) { // 휴대폰 정보가 없음 - 회원가입 페이지 이동(ID/PW 제외)
 					resultMap.setString("custStat", "EMPTY_PHONE_CUST");
 					return resultMap;
 				}
@@ -370,6 +398,7 @@ public class TsfCustomerService {
 				resultMap.setString("custStat", "SUCC_CUST");
 				return resultMap;
 			}
+
 		} else { // 2-2. 고객정보 없는 경우
 
 			if (StringUtils.isBlank(custSnsInfo.getCellPhnno())) { // 휴대전화번호가 없는 경우
@@ -377,24 +406,24 @@ public class TsfCustomerService {
 				return resultMap;
 			}
 
-			boolean isFindByPhone =getCustomerFindByCellPhnnoCount(custSnsInfo.getCellPhnno().replace("-",""));
+			boolean isFindByPhone = getCustomerFindByCellPhnnoCount(custSnsInfo.getCellPhnno().replace("-",""));
 			if (isFindByPhone) {
-				resultMap.setString("custStat", "DUP_PHONE_CUST");
+				resultMap.setString("custStat", "DUP_PHONE_CUST"); // 휴대폰 중복
 				return resultMap;
 			}
 
-			boolean isFindByEmail = getCustomerFindByEmail(custSnsInfo.getEmail());
+			boolean isFindByEmail = getCustomerFindByEmailCount(custSnsInfo.getEmail());
 			if (isFindByEmail) {
 				resultMap.setString("custStat", "DUP_EMAIL_CUST"); // 이메일 중복
 				return resultMap;
 			}
 
 			Customer customer = objectMapper.convertValue(custSnsInfo, Customer.class);
-
 			boolean isJoin = saveJoinCustomerSns(customer);
 
 			if (isJoin) {
-				resultMap.setString("custStat", "SUCC_CUST");
+				resultMap.setString("custNo", String.valueOf(customer.getCustNo()));
+				resultMap.setString("custStat", "NEW_CUST");
 			} else {
 				resultMap.setString("custStat", "FAIL_CUST");
 			}
@@ -404,21 +433,19 @@ public class TsfCustomerService {
 		return resultMap;
 	}
 
-
 	/**
 	 * 로그인 처리
-	 * @param custId - 고객아이디
+	 * @param custNo- 고객번호
 	 * @param request - 요청
 	 * @author jsshin
 	 * @since 2021. 02. 18
 	 */
-	public void getLogin(String custId, HttpServletRequest request) {
-		if (StringUtils.isBlank(custId)) {
-			throw new IllegalStateException("고객 아이디가 없습니다. 로그인 다시 해보시기 바랍니다.");
+	public void getLogin(Integer custNo, HttpServletRequest request) {
+		if (custNo == null) {
+			throw new IllegalStateException("고객번호가 없습니다.");
 		}
-
 		Login loginParam = new Login();
-		loginParam.setCustId(custId);
+		loginParam.setCustNo(custNo);
 		Login loginInfo = loginService.getLoginCheckInfo(loginParam);
 
 		// 권한 설정
@@ -439,8 +466,11 @@ public class TsfCustomerService {
 
 	/**
 	 * Session 생성
+	 *
 	 * @param request - HttpServletRequest
 	 * @param loginDetails - 로그인 상세 정보
+	 * @author jsshin
+	 * @since 2021. 02. 18
 	 */
 	private void createSession(HttpServletRequest request, TsfLoginDetails loginDetails) {
 		HttpSession session = request.getSession(true);
@@ -448,4 +478,61 @@ public class TsfCustomerService {
 		session.setAttribute("session", loginDetails);
 	}
 
+
+	/**
+	 * 일반고객 정보 유효성
+	 *
+	 * @param customer - 고객정보
+	 * @return GagaMap - 유효성 결과 값
+	 * @author jsshin
+	 * @since 2021. 02. 18
+	 */
+	public GagaMap generalCustomerValidation (Customer customer) {
+		GagaMap resultMap = new GagaMap();
+
+		// 1. 아이디 확인
+		boolean boolCustId = getCustomerFindByCustIdCount(customer.getCustId());
+		if (!boolCustId) {
+			resultMap.setString("custStat", "DUP_ID_CUST");
+			return resultMap;
+		}
+
+		// 2. 이메일 확인
+		boolean boolEmail = getCustomerFindByEmailCount(customer.getEmail());
+		if (!boolEmail) {
+			resultMap.setString("custStat", "DUP_EMAIL_CUST");
+			return resultMap;
+		}
+
+		// 3. 휴대전화
+		boolean boolPhone = getCustomerFindByCellPhnnoCount(customer.getCellPhnno());
+		if (!boolPhone) {
+			resultMap.setString("custStat", "DUP_PHONE_CUST");
+			return resultMap;
+		}
+
+		// 4. CI
+		boolean boolCi = getCustomerFindByCiCount(customer.getCi());
+		if (!boolCi) {
+			resultMap.setString("custStat", "DUP_CI_CUST");
+			return resultMap;
+		}
+
+		resultMap.setString("custStat", "PASS_CUST");
+
+		return resultMap;
+	}
+
+	/**
+	 * SNS 정보로 고객 테이블 조회
+	 * @param custSnsInfo - 고객정보
+	 * @return 고객정보
+	 * @author jsshin
+	 * @since 2021. 02. 26
+	 */
+	Customer getCusomterSnsFind(CustSnsInfo custSnsInfo) {
+		return customerDao.getCusomterSnsFind(custSnsInfo);
+	}
+
+
 }

+ 19 - 6
src/main/java/com/style24/front/biz/thirdparty/KaKaoLogin.java

@@ -25,6 +25,7 @@ import org.springframework.web.client.RestTemplate;
 import javax.annotation.PostConstruct;
 import java.net.URI;
 import java.util.Locale;
+import java.util.UUID;
 
 
 /**
@@ -162,7 +163,7 @@ public class KaKaoLogin {
 			HttpHeaders headers = new HttpHeaders();
 			headers.set("Authorization", "Bearer " + accessToken);
 			headers.add("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
-			HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<MultiValueMap<String, String>>(params, headers);
+			HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(params, headers);
 			URI url = URI.create(userInfoUrl);
 
 			// POST방식으로 호출
@@ -180,8 +181,12 @@ public class KaKaoLogin {
 			GagaMap kakaoAccount = gson.fromJson(obj.get("kakao_account"), GagaMap.class);
 
 			Locale locale = Locale.KOREA;
-			String cellPhnno = getPhoneNumber(kakaoAccount.getString("phone_number"), locale.getCountry());
+
+			String snsId = obj.get("id").toString();
+			String custNm = properties.getString("nickname");
+			String email = kakaoAccount.getString("email");
 			String birthYmd = kakaoAccount.getString("birthyear") + kakaoAccount.getString("birthday");
+			String cellPhnno = getPhoneNumber(kakaoAccount.getString("phone_number"), locale.getCountry());
 
 			String sexGb = "";
 			if (StringUtils.isNotBlank(kakaoAccount.getString("gender"))) {
@@ -193,10 +198,17 @@ public class KaKaoLogin {
 				birthSm = kakaoAccount.getString("birthday_type").equals("SOLAR") ? "S":"L";
 			}
 
-			resultMap.setString("snsId", obj.get("id").toString());
-			resultMap.setString("custNm", properties.getString("nickname"));
-			resultMap.setString("email", kakaoAccount.getString("email"));
-			resultMap.setString("ci", kakaoAccount.getString("ci"));
+			// TODO: 정식 카카오 로그인 정식 서비스되면 해당 내용 삭제 해야 함 2021.02.25 jsshin
+			String ci = kakaoAccount.getString("ci");
+			if (StringUtils.isBlank(ci)) {
+				ci = "LU9VuATNfK86YTDEsHvOGO5hOhgfHYlaj6rWKGZXPGJtBK4IHlFx/+tbBFrbYMjYUSzI9RCQHygvBwaqKS/tNA=="; // jsshin6246 CI값
+				//ci = UUID.randomUUID().toString().replaceAll("-","");
+			}
+
+			resultMap.setString("snsId", snsId);
+			resultMap.setString("custNm", custNm);
+			resultMap.setString("email", email);
+			resultMap.setString("ci", ci);
 			resultMap.setString("cellPhnno", cellPhnno);
 			resultMap.setString("birthYmd", birthYmd);
 			resultMap.setString("birthSm", birthSm);
@@ -302,4 +314,5 @@ public class KaKaoLogin {
 
 		return result;
 	}
+
 }

+ 77 - 4
src/main/java/com/style24/front/biz/thirdparty/NaverLogin.java

@@ -155,10 +155,25 @@ public class NaverLogin {
 
 			Gson gson = new GsonBuilder().create();
 			JsonObject obj = gson.fromJson(jsonResult, JsonObject.class);
-			JsonObject response = gson.fromJson(obj.get("response"), JsonObject.class);
-
-			resultMap.setString("snsId", response.get("id").toString());
-			resultMap.setString("email", response.get("email").toString());
+			GagaMap response = gson.fromJson(obj.get("response"), GagaMap.class);
+
+			String snsId = response.getString("id");
+			String custNm = this.uniCodeDeCode(response.getString("name"));
+			String email = response.getString("email");
+			// TODO: 네이버 로그인 셋팅 시 휴대폰 필수로 셋팅 한다고 함 jsshin 2021-02-26
+			String cellphnno = response.getString("mobile").equals("") ? "010-2590-6246" : response.getString("mobile");
+			// TODO: 출생년도도 필수 값으로 셋팅 해야 할것 같음 jsshin 2021-02-26
+			String birthYmd = (response.getString("birthyear").equals("") ? "1990" : response.getString("birthyear")) + response.getString("birthday").replaceAll("-","");
+			String sexGb = response.getString("gender");
+			String ci = this.requestReplace(response.getString("ci"),"encodeData");
+
+			resultMap.setString("snsId", snsId);
+			resultMap.setString("custNm", custNm);
+			resultMap.setString("email", email);
+			resultMap.setString("ci", ci);
+			resultMap.setString("cellPhnno", cellphnno);
+			resultMap.setString("birthYmd", birthYmd);
+			resultMap.setString("sexGb", sexGb);
 
 		} catch (Exception e) {
 			log.error(e.getMessage());
@@ -236,4 +251,62 @@ public class NaverLogin {
 		return resultMap;
 	}
 
+	public String requestReplace (String paramValue, String gubun) {
+
+		String result = "";
+
+		if (paramValue != null) {
+
+			paramValue = paramValue.replaceAll("<", "&lt;").replaceAll(">", "&gt;");
+
+			paramValue = paramValue.replaceAll("\\*", "");
+			paramValue = paramValue.replaceAll("\\?", "");
+			paramValue = paramValue.replaceAll("\\[", "");
+			paramValue = paramValue.replaceAll("\\{", "");
+			paramValue = paramValue.replaceAll("\\(", "");
+			paramValue = paramValue.replaceAll("\\)", "");
+			paramValue = paramValue.replaceAll("\\^", "");
+			paramValue = paramValue.replaceAll("\\$", "");
+			paramValue = paramValue.replaceAll("'", "");
+			paramValue = paramValue.replaceAll("@", "");
+			paramValue = paramValue.replaceAll("%", "");
+			paramValue = paramValue.replaceAll(";", "");
+			paramValue = paramValue.replaceAll(":", "");
+			paramValue = paramValue.replaceAll("-", "");
+			paramValue = paramValue.replaceAll("#", "");
+			paramValue = paramValue.replaceAll("--", "");
+			paramValue = paramValue.replaceAll("-", "");
+			paramValue = paramValue.replaceAll(",", "");
+
+			if(!"encodeData".equals(gubun)){
+				paramValue = paramValue.replaceAll("\\+", "");
+				paramValue = paramValue.replaceAll("/", "");
+				paramValue = paramValue.replaceAll("=", "");
+			}
+
+			result = paramValue;
+
+		}
+		return result;
+	}
+
+	public String uniCodeDeCode(String unicode) {
+		if (StringUtils.isBlank(unicode)) {
+			return "";
+		}
+
+		StringBuffer str = new StringBuffer();
+		char ch = 0;
+		for( int i= unicode.indexOf("\\u"); i > -1; i = unicode.indexOf("\\u") ){
+			ch = (char)Integer.parseInt( unicode.substring( i + 2, i + 6 ) ,16);
+			str.append( unicode.substring(0, i) );
+			str.append( String.valueOf(ch) );
+			unicode = unicode.substring(i + 6);
+		}
+		str.append(unicode);
+
+		return str.toString();
+	}
+
+
 }

+ 3 - 8
src/main/java/com/style24/front/biz/web/TsfCustomerController.java

@@ -475,7 +475,7 @@ public class TsfCustomerController extends TsfBaseController {
 			throw new IllegalStateException("확인 할 아이디가 없습니다.");
 		}
 
-		boolean isFind  = customerService.getCustomerFindByCustId(customer.getCustId());
+		boolean isFind  = customerService.getCustomerFindByCustIdCount(customer.getCustId());
 
 		result.setBoolean("isFind", isFind);
 		return result;
@@ -498,7 +498,7 @@ public class TsfCustomerController extends TsfBaseController {
 			throw new IllegalStateException("확인 할 이메일이 없습니다.");
 		}
 
-		boolean isFind = customerService.getCustomerFindByEmail(customer.getEmail());
+		boolean isFind = customerService.getCustomerFindByEmailCount(customer.getEmail());
 
 		result.setBoolean("isFind", isFind);
 
@@ -602,7 +602,6 @@ public class TsfCustomerController extends TsfBaseController {
 		// 3.고객정보 생성 및 혜택 처리
 		boolean isJoin = customerService.saveJoinCustomer(customer);
 
-
 		if (isJoin) {
 			// 4.알림톡 발송
 			try {
@@ -621,10 +620,7 @@ public class TsfCustomerController extends TsfBaseController {
 			} catch (Exception e) {
 				log.error("error", e);
 			}
-
-			// 6. 가입성공시 로그인 처리 실패시
-			customerService.getLogin(customer.getCustId(), request);
-
+			customerService.getLogin(customer.getCustNo(), request);
 		} else {
 			TsfSession.setAttribute("maskingCustId",customer.getMaskingCustId());
 		}
@@ -655,5 +651,4 @@ public class TsfCustomerController extends TsfBaseController {
 	}
 
 
-
 }

+ 18 - 5
src/main/java/com/style24/front/biz/web/TsfIndexController.java

@@ -164,7 +164,8 @@ public class TsfIndexController extends TsfBaseController {
 	 * @since 2021. 02. 23
 	 */
 	@GetMapping("/signin/kakologin")
-	public String signinKaKaoLogin(@RequestParam(value = "rememberMe", required = false) String rememberMe, @RequestParam(value = "requestGb", required = false) String requestGb) {
+	public String signinKaKaoLogin(@RequestParam(value = "rememberMe", required = false) String rememberMe
+			, @RequestParam(value = "requestGb", required = false) String requestGb) {
 
 		if (StringUtils.isNotBlank(rememberMe)) {
 			// RememberMe 세션 저장
@@ -189,7 +190,8 @@ public class TsfIndexController extends TsfBaseController {
 	 * @since 2020. 5. 25
 	 */
 	@GetMapping("/signin/naverlogin")
-	public String signinNaverLogin(@RequestParam(value = "rememberMe", required = false) String rememberMe, @RequestParam(value = "requestGb", required = false) String requestGb) {
+	public String signinNaverLogin(@RequestParam(value = "rememberMe", required = false) String rememberMe
+			, @RequestParam(value = "requestGb", required = false) String requestGb) {
 
 		if (StringUtils.isNotBlank(rememberMe)) {
 			// RememberMe 세션 저장
@@ -219,7 +221,7 @@ public class TsfIndexController extends TsfBaseController {
 	@RequestMapping("/signin/snsLoginCallback")
 	public ModelAndView signinSnsLoginCallback(@RequestParam(value = "snsType", required = false) String snsType, HttpSession session
 			, @RequestParam(value = "code", required = false) String code, @RequestParam(value = "state", required = false) String state
-			, @RequestParam(value = "error", required = false) boolean isError) {
+			, @RequestParam(value = "error", required = false) boolean isError, HttpServletRequest request) {
 
 		ModelAndView mav = new ModelAndView();
 
@@ -263,9 +265,22 @@ public class TsfIndexController extends TsfBaseController {
 		GagaMap resultMap = new GagaMap();
 		if (isSnsLoing) {
 			CustSnsInfo custSnsInfo = objectMapper.convertValue(userInfo, CustSnsInfo.class);
+			log.info("custSnsInfo ==> {}", custSnsInfo.toString());
 			//상태 체크
 			resultMap = customerService.customerSnsProcessing(custSnsInfo);
+			resultMap.setString("snsId", custSnsInfo.getSnsId());
+			resultMap.setString("snsType", custSnsInfo.getSnsType());
+			String custStat = resultMap.getString("custStat");
 
+			// 신규가입 이면 바로 로그인 처리
+			if ("NEW_CUST".equals(custStat)) {
+				customerService.getLogin(Integer.parseInt(resultMap.getString("custNo")), request);
+			}
+
+			// 가입 폼으로 이동
+			if ("EMPTY_PHONE_CUST".equals(custStat)) {
+				session.setAttribute("custSnsInfo", custSnsInfo);
+			}
 		}
 
 		// RememberMe 값이 있고 true이면
@@ -274,8 +289,6 @@ public class TsfIndexController extends TsfBaseController {
 		}
 
 		mav.addObject("resultMap", resultMap);
-		mav.addObject("snsId", userInfo.getString("snsId"));
-		mav.addObject("snsType", snsType);
 
 		mav.setViewName(super.getDeviceViewName("SnsCallBackForm"));
 

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

@@ -60,9 +60,8 @@ public class TsfAuthenticationProvider implements AuthenticationProvider {
 
 		// SNS로그인이면
 		if (loginId.startsWith(TsfConstants.SNSLOGIN_PREFIX)) {
-			loginParam.setCustId(GagaStringUtil.replace(loginId, TsfConstants.SNSLOGIN_PREFIX, ""));
-			loginParam.setSnsType(loginId.substring(loginId.indexOf("-", 0) + 1, loginId.lastIndexOf("-") - 1));
-			loginParam.setEmail(passwd); // SNS로그인이면 이메일 정보
+			loginParam.setSnsId(GagaStringUtil.replace(loginId, TsfConstants.SNSLOGIN_PREFIX, ""));
+			loginParam.setSnsType(passwd);
 		} else { // 일반로그인
 			loginParam.setCustId(loginId);
 		}
@@ -90,12 +89,6 @@ public class TsfAuthenticationProvider implements AuthenticationProvider {
 			if (!isMatch) {
 				throw new BadCredentialsException(message.getMessage("LOGN_0002"));
 			}
-		} else {
-			// SNS로그인 시 로그인ID 값은 이메일로 처리했으므로
-			// loginId 값과 회원정보의 이메일 값을 비교해서 동일하면
-			if (StringUtils.isBlank(loginInfo.getSnsType()) && passwd.equals(loginInfo.getEmail())) {
-				throw new TsfEmailDuplicationException(message.getMessage("LOGN_0008"));
-			}
 		}
 
 		if (loginInfo.getCustStat().equals("20")) { // 휴면회원

+ 4 - 4
src/main/java/com/style24/front/support/security/filter/TsfAuthenticationFilter.java

@@ -32,10 +32,10 @@ public class TsfAuthenticationFilter extends UsernamePasswordAuthenticationFilte
 
 		if (StringUtils.isNotBlank(loginParams.getString("snsType"))) { // SNS로그인
 			// SNS로그인일 때는
-			// 로그인ID: SNS_TYPE-SNS_JOIN_ID
-			// 비밀번호: 이메일
-			loginParams.setString("loginId", loginParams.getString("snsType") + "-" + loginParams.getString("snsJoinId"));
-			loginParams.setString("passwd", loginParams.getString("email")); // SNS로그인 시 이메일체크를 위해 추가
+			// 로그인ID: SNSLOGIN_PREFIX-SNS_ID
+			// 패스워드 : SNS 타입
+			loginParams.setString("loginId", loginParams.getString("snsId"));
+			loginParams.setString("passwd", loginParams.getString("snsType"));
 		} else { // 일반로그인
 			if (StringUtils.isNotBlank(loginParams.getString("loginId"))) {
 				loginParams.setString("loginId", loginParams.getString("loginId").trim());

+ 1 - 1
src/main/java/com/style24/persistence/domain/Login.java

@@ -32,7 +32,7 @@ public class Login extends TscBaseDomain {
 	private String custStat;		// 고객상태
 	private String email;			// 이메일
 	private String snsType;			// SNS유형
-	private String snsJoinId;		// SNS가입ID
+	private String snsId;			// SNS가입ID
 	private int loginFailCnt;		// 로그인실패건수
 	private int blockSecs;			// 로그인블락시간(초)
 	private String siteCd;			// 가입사이트코드(공통코드G000)

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

@@ -224,7 +224,7 @@
 		     , #{custGb}                           AS CUST_GB
 		     , #{custGrade}                        AS CUST_GRADE
 		     , NOW()                               AS JOIN_DT
-		     , #{foreignerYn}                      AS FOREIGNER_YN
+		     , IFNULL(#{foreignerYn}, 'N')         AS FOREIGNER_YN
 		     , #{custStat}                         AS CUST_STAT
 		     , #{passwdChgDt}                      AS PASSWD_CHG_DT
 		     , 'N'                                 AS TEMP_PASSWD_YN

+ 10 - 5
src/main/java/com/style24/persistence/mybatis/shop/TsfLogin.xml

@@ -14,7 +14,7 @@
 		     , CUST_STAT                                        /*회원상태*/
 		     , EMAIL                                            /*이메일*/
 		     , #{snsType}                     AS SNS_TYPE       /*SNS유형*/
-		     , ''                             AS JOIN_ID         /*SNS가입ID*/
+		     , #{snsId}                       AS SNS_ID         /*SNS가입ID*/
 		     , IFNULL((SELECT LOGIN_FAIL_CNT
 		               FROM   TB_LOGIN_FAIL
 		               WHERE  CUST_ID = #{custId}
@@ -24,11 +24,16 @@
 		FROM   TB_CUSTOMER A
 		WHERE  1 = 1
 		<choose>
-		    <when test="snsType == 'NV'"> <!-- SNS로그인:네이버 -->
+		    <when test="snsType != null and snsType != ''"> <!-- SNS 로그인  -->
+		AND    CUST_NO = (
+		               SELECT CUST_NO
+		               FROM TB_CUSTOMER_SNS
+		               WHERE SNS_TYPE = #{snsType}
+		               AND   SNS_ID = #{snsId}
+		               )
 		    </when>
-		    <when test="snsType == 'KK'"> <!-- SNS로그인:카카오 -->
-		    </when>
-		    <when test="snsType == 'YS'"> <!-- SNS로그인:YES24 -->
+		    <when test="custNo != null and custNo != ''">
+		AND    CUST_NO = #{custNo}
 		    </when>
 		    <otherwise> <!-- 일반로그인 -->
 		AND    CUST_ID = #{custId}

+ 42 - 10
src/main/webapp/WEB-INF/views/web/SigninFormWeb.html

@@ -233,16 +233,48 @@
 
 	// SNS 로그인 콜백함수
 	var fnSnsSigninCallback = function(userInfo) {
-		console.log('userInfo', userInfo);
-		let params = {};
-		params.snsType = userInfo.snsType;
-		params.snsJoinId = [[${snsLoginPrefix}]] + userInfo.snsId;
-		// $.post(_frontUrl + '/login'
-		// 	, $.param(params)
-		// 	, function(result) {
-		// 		fnReloadAfterLogin(result);
-		// 	}
-		// 	, "json");
+		// Ci이 조회 시 없음
+		if (userInfo.custStat === 'DUP_PHONE_CUST') {
+			mcxDialog.alert("이미 사용 중인 휴대전화번호 입니다.");
+			return;
+		}
+		if (userInfo.custStat === 'DUP_EMAIL_CUST') {
+			mcxDialog.alert("이미 사용 중인 이메일 입니다.");
+			return;
+		}
+		if (userInfo.custStat === 'EMPTY_PHONE_CUST') {
+			cfnGoToPage(_PAGE_CUSTOMER_SNS_JOIN);
+		}
+		// Ci이 조회 시 있음
+		if (userInfo.custStat === 'SECEDE_CUST') {
+			mcxDialog.alert("탈퇴 회원 입니다.");
+			return;
+		}
+		if (userInfo.custStat === 'DORMANT_CUST') {
+			cfnGoToPage(_PAGE_CUSTOMER_DORMANT);
+		}
+		if (userInfo.custStat === 'FAIL_CUST') {
+			mcxDialog.alert("회원가입에 실패 했습니다.<br> 고객센터에 문의 하시기 바랍니다.");
+			return;
+		}
+		if (userInfo.custStat === 'NEW_CUST') {
+			cfnGoToPage(_PAGE_CUSTOMER_JOIN_COMPLETE);
+		}
+
+
+		if (userInfo.custStat === 'SUCC_CUST') {
+			let params = {};
+			params.snsType = userInfo.snsType;
+			params.snsId = [[${snsLoginPrefix}]] + userInfo.snsId;
+			$.post(_frontUrl + '/login'
+				, $.param(params)
+				, function(result) {
+					fnReloadAfterLogin(result);
+				}
+				, "json");
+		}
+
+
 	};
 
 	var fnReloadAfterLogin = function(result) {

+ 13 - 15
src/main/webapp/WEB-INF/views/web/SnsCallBackFormWeb.html

@@ -22,21 +22,19 @@
 
 <script th:inline="javascript">
 /*<![CDATA[*/
-	const snsType = [[${snsType}]];
-	const snsId = [[${snsId}]];
-
-	if (snsType === 'KK') {
-		if (gagajf.isNull(snsId)){
-			mcxDialog.alertC("인증에 실패하였습니다.<br> 로그인 정보를 확인해주시기 바랍니다.", {
-				sureBtnText: "확인",
-				sureBtnClick: function() {
-					self.close();
-				}
-			});
-		} else {
-			opener.fnSnsSigninCallback(snsId);
-			self.close();
-		}
+	const resultMap = [[${resultMap}]];
+
+
+	if (gagajf.isNull(resultMap.snsId) && gagajf.isNull(resultMap.snsType)){
+		mcxDialog.alertC("인증에 실패하였습니다.<br> 로그인 정보를 확인해주시기 바랍니다.", {
+			sureBtnText: "확인",
+			sureBtnClick: function() {
+				self.close();
+			}
+		});
+	} else {
+		opener.fnSnsSigninCallback(resultMap);
+		self.close();
 	}