|
@@ -7,6 +7,7 @@ import java.util.List;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpSession;
|
|
import javax.servlet.http.HttpSession;
|
|
|
|
|
|
|
|
|
|
+import com.style24.core.biz.service.TscEnvsetService;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
|
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
|
@@ -57,6 +58,9 @@ public class TsfCustomerService {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private TsfCouponService couponService;
|
|
private TsfCouponService couponService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ TscEnvsetService coreEnvsetService;
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ObjectMapper objectMapper;
|
|
private ObjectMapper objectMapper;
|
|
|
|
|
|
|
@@ -142,9 +146,13 @@ public class TsfCustomerService {
|
|
|
* @since 2021. 02. 15
|
|
* @since 2021. 02. 15
|
|
|
*/
|
|
*/
|
|
|
public boolean getCustomerFindByCustIdCount(String custId) {
|
|
public boolean getCustomerFindByCustIdCount(String custId) {
|
|
|
|
|
+ // 재가입불가일
|
|
|
|
|
+ int rejoinRejectDay = coreEnvsetService.getRejoinRejectDays(TscConstants.Site.STYLE24.value());
|
|
|
|
|
+
|
|
|
Customer customer = new Customer();
|
|
Customer customer = new Customer();
|
|
|
customer.setCustId(custId);
|
|
customer.setCustId(custId);
|
|
|
customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
|
|
|
+ customer.setRejoinRejectDay(rejoinRejectDay);
|
|
|
customer.encryptData();
|
|
customer.encryptData();
|
|
|
|
|
|
|
|
int result = customerDao.getCustomerInfoCount(customer);
|
|
int result = customerDao.getCustomerInfoCount(customer);
|
|
@@ -160,9 +168,13 @@ public class TsfCustomerService {
|
|
|
* @since 2021. 02. 15
|
|
* @since 2021. 02. 15
|
|
|
*/
|
|
*/
|
|
|
public boolean getCustomerFindByEmailCount(String email) {
|
|
public boolean getCustomerFindByEmailCount(String email) {
|
|
|
|
|
+
|
|
|
|
|
+ int rejoinRejectDay = coreEnvsetService.getRejoinRejectDays(TscConstants.Site.STYLE24.value());
|
|
|
|
|
+
|
|
|
Customer customer = new Customer();
|
|
Customer customer = new Customer();
|
|
|
customer.setEmail(email);
|
|
customer.setEmail(email);
|
|
|
customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
|
|
|
+ customer.setRejoinRejectDay(rejoinRejectDay);
|
|
|
customer.encryptData();
|
|
customer.encryptData();
|
|
|
|
|
|
|
|
int result = customerDao.getCustomerInfoCount(customer);
|
|
int result = customerDao.getCustomerInfoCount(customer);
|
|
@@ -178,10 +190,14 @@ public class TsfCustomerService {
|
|
|
* @since 2021. 02. 15
|
|
* @since 2021. 02. 15
|
|
|
*/
|
|
*/
|
|
|
public boolean getCustomerFindByCellPhnnoCount(String cellPhnno) {
|
|
public boolean getCustomerFindByCellPhnnoCount(String cellPhnno) {
|
|
|
|
|
+ // 재가입불가일
|
|
|
|
|
+ int rejoinRejectDay = coreEnvsetService.getRejoinRejectDays(TscConstants.Site.STYLE24.value());
|
|
|
|
|
+
|
|
|
Customer customer = new Customer();
|
|
Customer customer = new Customer();
|
|
|
customer.setCellPhnno(cellPhnno);
|
|
customer.setCellPhnno(cellPhnno);
|
|
|
customer.setHypenCellPhone(); // 010-0000-0000
|
|
customer.setHypenCellPhone(); // 010-0000-0000
|
|
|
customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
|
|
|
+ customer.setRejoinRejectDay(rejoinRejectDay);
|
|
|
customer.encryptData();
|
|
customer.encryptData();
|
|
|
|
|
|
|
|
int result = customerDao.getCustomerInfoCount(customer);
|
|
int result = customerDao.getCustomerInfoCount(customer);
|
|
@@ -197,10 +213,13 @@ public class TsfCustomerService {
|
|
|
* @since 2021. 02. 15
|
|
* @since 2021. 02. 15
|
|
|
*/
|
|
*/
|
|
|
public boolean getCustomerFindByCiCount(String ci) {
|
|
public boolean getCustomerFindByCiCount(String ci) {
|
|
|
- TscSession.setAttribute("maskingYn","Y");
|
|
|
|
|
|
|
+ // 재가입불가일
|
|
|
|
|
+ int rejoinRejectDay = coreEnvsetService.getRejoinRejectDays(TscConstants.Site.STYLE24.value());
|
|
|
|
|
+
|
|
|
Customer customer = new Customer();
|
|
Customer customer = new Customer();
|
|
|
customer.setCi(ci);
|
|
customer.setCi(ci);
|
|
|
customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
|
|
|
+ customer.setRejoinRejectDay(rejoinRejectDay);
|
|
|
customer.encryptData();
|
|
customer.encryptData();
|
|
|
|
|
|
|
|
int result = customerDao.getCustomerInfoCount(customer);
|
|
int result = customerDao.getCustomerInfoCount(customer);
|
|
@@ -216,11 +235,16 @@ public class TsfCustomerService {
|
|
|
* @since 2021. 02. 15
|
|
* @since 2021. 02. 15
|
|
|
*/
|
|
*/
|
|
|
public Customer getCustomerFindByCi(String ci) {
|
|
public Customer getCustomerFindByCi(String ci) {
|
|
|
|
|
+ // 재가입불가일
|
|
|
|
|
+ int rejoinRejectDay = coreEnvsetService.getRejoinRejectDays(TscConstants.Site.STYLE24.value());
|
|
|
|
|
+
|
|
|
TscSession.setAttribute("maskingYn","Y");
|
|
TscSession.setAttribute("maskingYn","Y");
|
|
|
Customer customer = new Customer();
|
|
Customer customer = new Customer();
|
|
|
customer.setCi(ci);
|
|
customer.setCi(ci);
|
|
|
customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
|
|
|
+ customer.setRejoinRejectDay(rejoinRejectDay);
|
|
|
customer.encryptData();
|
|
customer.encryptData();
|
|
|
|
|
+
|
|
|
return customerDao.getCustomerInfo(customer);
|
|
return customerDao.getCustomerInfo(customer);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -232,58 +256,18 @@ public class TsfCustomerService {
|
|
|
* @since 2021. 02. 15
|
|
* @since 2021. 02. 15
|
|
|
*/
|
|
*/
|
|
|
public Customer getCustomerFindByCellPhnno(String cellPhnno) {
|
|
public Customer getCustomerFindByCellPhnno(String cellPhnno) {
|
|
|
|
|
+ // 재가입불가일
|
|
|
|
|
+ int rejoinRejectDay = coreEnvsetService.getRejoinRejectDays(TscConstants.Site.STYLE24.value());
|
|
|
|
|
+
|
|
|
TscSession.setAttribute("maskingYn","Y");
|
|
TscSession.setAttribute("maskingYn","Y");
|
|
|
Customer customer = new Customer();
|
|
Customer customer = new Customer();
|
|
|
customer.setCellPhnno(cellPhnno);
|
|
customer.setCellPhnno(cellPhnno);
|
|
|
customer.setHypenCellPhone(); // 010-0000-0000
|
|
customer.setHypenCellPhone(); // 010-0000-0000
|
|
|
customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
|
|
|
+ customer.setRejoinRejectDay(rejoinRejectDay);
|
|
|
customer.encryptData();
|
|
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;
|
|
|
|
|
|
|
+ return customerDao.getCustomerInfo(customer);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -296,7 +280,6 @@ public class TsfCustomerService {
|
|
|
@Transactional("shopTxnManager")
|
|
@Transactional("shopTxnManager")
|
|
|
public boolean saveJoinCustomer(Customer customer) {
|
|
public boolean saveJoinCustomer(Customer customer) {
|
|
|
boolean isJoin = true;
|
|
boolean isJoin = true;
|
|
|
- // 1. validation
|
|
|
|
|
customer.setHypenCellPhone();
|
|
customer.setHypenCellPhone();
|
|
|
customer.encryptData();
|
|
customer.encryptData();
|
|
|
customer.setEncodedPasswd(passwordEncoder.encodeSha256(customer.getPasswd()));
|
|
customer.setEncodedPasswd(passwordEncoder.encodeSha256(customer.getPasswd()));
|
|
@@ -574,11 +557,17 @@ public class TsfCustomerService {
|
|
|
* @since 2021. 03. 02
|
|
* @since 2021. 03. 02
|
|
|
*/
|
|
*/
|
|
|
String getMaxCustIdById(String custId) {
|
|
String getMaxCustIdById(String custId) {
|
|
|
|
|
+
|
|
|
|
|
+ int rejoinRejectDay = coreEnvsetService.getRejoinRejectDays(TscConstants.Site.STYLE24.value());
|
|
|
|
|
+
|
|
|
Customer customer = new Customer();
|
|
Customer customer = new Customer();
|
|
|
customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
|
customer.setCustId(custId);
|
|
customer.setCustId(custId);
|
|
|
|
|
+ customer.setRejoinRejectDay(rejoinRejectDay);
|
|
|
String maskingCustId = customerDao.getCustomerMaxCustId(customer);
|
|
String maskingCustId = customerDao.getCustomerMaxCustId(customer);
|
|
|
|
|
+
|
|
|
maskingCustId = MaskingUtils.id(maskingCustId);
|
|
maskingCustId = MaskingUtils.id(maskingCustId);
|
|
|
|
|
+
|
|
|
return maskingCustId;
|
|
return maskingCustId;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -590,12 +579,18 @@ public class TsfCustomerService {
|
|
|
* @since 2021. 03. 02
|
|
* @since 2021. 03. 02
|
|
|
*/
|
|
*/
|
|
|
String getMaxCustIdByEmail(String email) {
|
|
String getMaxCustIdByEmail(String email) {
|
|
|
|
|
+
|
|
|
|
|
+ int rejoinRejectDay = coreEnvsetService.getRejoinRejectDays(TscConstants.Site.STYLE24.value());
|
|
|
|
|
+
|
|
|
Customer customer = new Customer();
|
|
Customer customer = new Customer();
|
|
|
customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
|
customer.setEmail(email);
|
|
customer.setEmail(email);
|
|
|
|
|
+ customer.setRejoinRejectDay(rejoinRejectDay);
|
|
|
customer.encryptData();
|
|
customer.encryptData();
|
|
|
String maskingCustId = customerDao.getCustomerMaxCustId(customer);
|
|
String maskingCustId = customerDao.getCustomerMaxCustId(customer);
|
|
|
|
|
+
|
|
|
maskingCustId = MaskingUtils.id(maskingCustId);
|
|
maskingCustId = MaskingUtils.id(maskingCustId);
|
|
|
|
|
+
|
|
|
return maskingCustId;
|
|
return maskingCustId;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -607,12 +602,19 @@ public class TsfCustomerService {
|
|
|
* @since 2021. 03. 02
|
|
* @since 2021. 03. 02
|
|
|
*/
|
|
*/
|
|
|
String getMaxCustIdByCellPhnno(String cellPhnno) {
|
|
String getMaxCustIdByCellPhnno(String cellPhnno) {
|
|
|
|
|
+
|
|
|
|
|
+ int rejoinRejectDay = coreEnvsetService.getRejoinRejectDays(TscConstants.Site.STYLE24.value());
|
|
|
|
|
+
|
|
|
Customer customer = new Customer();
|
|
Customer customer = new Customer();
|
|
|
customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
|
customer.setCellPhnno(cellPhnno);
|
|
customer.setCellPhnno(cellPhnno);
|
|
|
|
|
+ customer.setRejoinRejectDay(rejoinRejectDay);
|
|
|
customer.encryptData();
|
|
customer.encryptData();
|
|
|
|
|
+
|
|
|
String maskingCustId = customerDao.getCustomerMaxCustId(customer);
|
|
String maskingCustId = customerDao.getCustomerMaxCustId(customer);
|
|
|
|
|
+
|
|
|
maskingCustId = MaskingUtils.id(maskingCustId);
|
|
maskingCustId = MaskingUtils.id(maskingCustId);
|
|
|
|
|
+
|
|
|
return maskingCustId;
|
|
return maskingCustId;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -624,12 +626,19 @@ public class TsfCustomerService {
|
|
|
* @since 2021. 03. 02
|
|
* @since 2021. 03. 02
|
|
|
*/
|
|
*/
|
|
|
String getMaxCustIdByCi(String ci) {
|
|
String getMaxCustIdByCi(String ci) {
|
|
|
|
|
+
|
|
|
|
|
+ int rejoinRejectDay = coreEnvsetService.getRejoinRejectDays(TscConstants.Site.STYLE24.value());
|
|
|
|
|
+
|
|
|
Customer customer = new Customer();
|
|
Customer customer = new Customer();
|
|
|
customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
|
customer.setCi(ci);
|
|
customer.setCi(ci);
|
|
|
|
|
+ customer.setRejoinRejectDay(rejoinRejectDay);
|
|
|
customer.encryptData();
|
|
customer.encryptData();
|
|
|
|
|
+
|
|
|
String maskingCustId = customerDao.getCustomerMaxCustId(customer);
|
|
String maskingCustId = customerDao.getCustomerMaxCustId(customer);
|
|
|
|
|
+
|
|
|
maskingCustId = MaskingUtils.id(maskingCustId);
|
|
maskingCustId = MaskingUtils.id(maskingCustId);
|
|
|
|
|
+
|
|
|
return maskingCustId;
|
|
return maskingCustId;
|
|
|
}
|
|
}
|
|
|
|
|
|