|
|
@@ -7,6 +7,7 @@ import com.style24.core.biz.service.TscCustomerService;
|
|
|
import com.style24.core.support.env.TscConstants;
|
|
|
import com.style24.core.support.session.TscSession;
|
|
|
import com.style24.core.support.util.CryptoUtils;
|
|
|
+import com.style24.core.support.util.MaskingUtils;
|
|
|
import com.style24.front.support.security.TsfLoginDetails;
|
|
|
import com.style24.front.support.security.session.TsfSession;
|
|
|
import com.style24.persistence.domain.Coupon;
|
|
|
@@ -489,36 +490,45 @@ public class TsfCustomerService {
|
|
|
*/
|
|
|
public GagaMap generalCustomerValidation (Customer customer) {
|
|
|
GagaMap resultMap = new GagaMap();
|
|
|
+ String maskingCustId;
|
|
|
|
|
|
// 1. 아이디 확인
|
|
|
boolean boolCustId = getCustomerFindByCustIdCount(customer.getCustId());
|
|
|
- if (!boolCustId) {
|
|
|
- resultMap.setString("custStat", "DUP_ID_CUST");
|
|
|
+ if (boolCustId) {
|
|
|
+ maskingCustId = getMaxCustIdById(customer.getCustId());
|
|
|
+ resultMap.setBoolean("isPossibe", false);
|
|
|
+ resultMap.setString("maskingCustId", maskingCustId);
|
|
|
return resultMap;
|
|
|
}
|
|
|
|
|
|
// 2. 이메일 확인
|
|
|
boolean boolEmail = getCustomerFindByEmailCount(customer.getEmail());
|
|
|
- if (!boolEmail) {
|
|
|
- resultMap.setString("custStat", "DUP_EMAIL_CUST");
|
|
|
+ if (boolEmail) {
|
|
|
+ maskingCustId = getMaxCustIdByEmail(customer.getEmail());
|
|
|
+ resultMap.setBoolean("isPossibe", false);
|
|
|
+ resultMap.setString("maskingCustId", maskingCustId);
|
|
|
return resultMap;
|
|
|
}
|
|
|
|
|
|
// 3. 휴대전화
|
|
|
boolean boolPhone = getCustomerFindByCellPhnnoCount(customer.getCellPhnno());
|
|
|
- if (!boolPhone) {
|
|
|
- resultMap.setString("custStat", "DUP_PHONE_CUST");
|
|
|
+ if (boolPhone) {
|
|
|
+ maskingCustId = getMaxCustIdByCellPhnno(customer.getCellPhnno());
|
|
|
+ resultMap.setBoolean("isPossibe", false);
|
|
|
+ resultMap.setString("maskingCustId", maskingCustId);
|
|
|
return resultMap;
|
|
|
}
|
|
|
|
|
|
- // 4. CI
|
|
|
+ // 4. CI(연계정보)
|
|
|
boolean boolCi = getCustomerFindByCiCount(customer.getCi());
|
|
|
- if (!boolCi) {
|
|
|
- resultMap.setString("custStat", "DUP_CI_CUST");
|
|
|
+ if (boolCi) {
|
|
|
+ maskingCustId = getMaxCustIdByCi(customer.getCi());
|
|
|
+ resultMap.setBoolean("isPossibe", false);
|
|
|
+ resultMap.setString("maskingCustId", maskingCustId);
|
|
|
return resultMap;
|
|
|
}
|
|
|
|
|
|
- resultMap.setString("custStat", "PASS_CUST");
|
|
|
+ resultMap.setBoolean("isPossibe", true);
|
|
|
|
|
|
return resultMap;
|
|
|
}
|
|
|
@@ -535,4 +545,74 @@ public class TsfCustomerService {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 가입된 아이디 가져오기
|
|
|
+ * @param custId - 고객아이디
|
|
|
+ * @return String - 가입된 고객 아이디
|
|
|
+ * @author jsshin
|
|
|
+ * @since 2021. 03. 02
|
|
|
+ */
|
|
|
+ String getMaxCustIdById(String custId) {
|
|
|
+ Customer customer = new Customer();
|
|
|
+ customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
|
+ customer.setCustId(custId);
|
|
|
+ String maskingCustId = customerDao.getCustomerMaxCustId(customer);
|
|
|
+ maskingCustId = MaskingUtils.id(maskingCustId);
|
|
|
+ return maskingCustId;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 가입된 아이디 가져오기
|
|
|
+ * @param email - 이메일
|
|
|
+ * @return String - 가입된 고객 아이디
|
|
|
+ * @author jsshin
|
|
|
+ * @since 2021. 03. 02
|
|
|
+ */
|
|
|
+ String getMaxCustIdByEmail(String email) {
|
|
|
+ Customer customer = new Customer();
|
|
|
+ customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
|
+ customer.setEmail(email);
|
|
|
+ customer.encryptData();
|
|
|
+ String maskingCustId = customerDao.getCustomerMaxCustId(customer);
|
|
|
+ maskingCustId = MaskingUtils.id(maskingCustId);
|
|
|
+ return maskingCustId;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 가입된 아이디 가져오기
|
|
|
+ * @param cellPhnno - 전화번호
|
|
|
+ * @return String - 가입된 고객 아이디
|
|
|
+ * @author jsshin
|
|
|
+ * @since 2021. 03. 02
|
|
|
+ */
|
|
|
+ String getMaxCustIdByCellPhnno(String cellPhnno) {
|
|
|
+ Customer customer = new Customer();
|
|
|
+ customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
|
+ customer.setCellPhnno(cellPhnno);
|
|
|
+ customer.encryptData();
|
|
|
+ String maskingCustId = customerDao.getCustomerMaxCustId(customer);
|
|
|
+ maskingCustId = MaskingUtils.id(maskingCustId);
|
|
|
+ return maskingCustId;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 가입된 아이디 가져오기
|
|
|
+ * @param ci - 연계정보
|
|
|
+ * @return String - 가입된 고객 아이디
|
|
|
+ * @author jsshin
|
|
|
+ * @since 2021. 03. 02
|
|
|
+ */
|
|
|
+ String getMaxCustIdByCi(String ci) {
|
|
|
+ Customer customer = new Customer();
|
|
|
+ customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
|
+ customer.setCi(ci);
|
|
|
+ customer.encryptData();
|
|
|
+ String maskingCustId = customerDao.getCustomerMaxCustId(customer);
|
|
|
+ maskingCustId = MaskingUtils.id(maskingCustId);
|
|
|
+ return maskingCustId;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|