|
@@ -7,8 +7,6 @@ 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.persistence.domain.CustGrade;
|
|
|
|
|
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.core.env.Environment;
|
|
import org.springframework.core.env.Environment;
|
|
@@ -17,8 +15,6 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
-import com.gagaframework.web.parameter.GagaMap;
|
|
|
|
|
-import com.gagaframework.web.security.GagaPasswordEncoder;
|
|
|
|
|
import com.style24.core.biz.service.TscCustomerService;
|
|
import com.style24.core.biz.service.TscCustomerService;
|
|
|
import com.style24.core.support.env.TscConstants;
|
|
import com.style24.core.support.env.TscConstants;
|
|
|
import com.style24.core.support.session.TscSession;
|
|
import com.style24.core.support.session.TscSession;
|
|
@@ -29,6 +25,7 @@ import com.style24.front.support.security.session.TsfSession;
|
|
|
import com.style24.persistence.domain.Coupon;
|
|
import com.style24.persistence.domain.Coupon;
|
|
|
import com.style24.persistence.domain.CustAccount;
|
|
import com.style24.persistence.domain.CustAccount;
|
|
|
import com.style24.persistence.domain.CustDeliveryAddr;
|
|
import com.style24.persistence.domain.CustDeliveryAddr;
|
|
|
|
|
+import com.style24.persistence.domain.CustGrade;
|
|
|
import com.style24.persistence.domain.CustSnsInfo;
|
|
import com.style24.persistence.domain.CustSnsInfo;
|
|
|
import com.style24.persistence.domain.Customer;
|
|
import com.style24.persistence.domain.Customer;
|
|
|
import com.style24.persistence.domain.Login;
|
|
import com.style24.persistence.domain.Login;
|
|
@@ -36,6 +33,9 @@ import com.style24.persistence.domain.WishList;
|
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
|
|
|
|
+import com.gagaframework.web.parameter.GagaMap;
|
|
|
|
|
+import com.gagaframework.web.security.GagaPasswordEncoder;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 고객(회원) Service
|
|
* 고객(회원) Service
|
|
|
*
|
|
*
|
|
@@ -76,7 +76,7 @@ public class TsfCustomerService {
|
|
|
* @since 2021. 02. 08
|
|
* @since 2021. 02. 08
|
|
|
*/
|
|
*/
|
|
|
public Customer getCustomerFindId(Customer customer) {
|
|
public Customer getCustomerFindId(Customer customer) {
|
|
|
- TsfSession.setAttribute("maskingYn","Y");
|
|
|
|
|
|
|
+ TsfSession.setAttribute("maskingYn", "Y");
|
|
|
customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
|
customer.encryptData(); // 데이터 암호하
|
|
customer.encryptData(); // 데이터 암호하
|
|
|
return customerDao.getCusomterActiveAndDormant(customer);
|
|
return customerDao.getCusomterActiveAndDormant(customer);
|
|
@@ -116,7 +116,6 @@ public class TsfCustomerService {
|
|
|
return coreCustomerService.getCustomerInfo(customer);
|
|
return coreCustomerService.getCustomerInfo(customer);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 임시비밀번호 조회
|
|
* 임시비밀번호 조회
|
|
|
* @param length - 비밀번호 자릿수
|
|
* @param length - 비밀번호 자릿수
|
|
@@ -221,7 +220,7 @@ public class TsfCustomerService {
|
|
|
* @since 2021. 02. 15
|
|
* @since 2021. 02. 15
|
|
|
*/
|
|
*/
|
|
|
public Customer getCustomerFindByCi(String ci) {
|
|
public Customer getCustomerFindByCi(String ci) {
|
|
|
- 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());
|
|
@@ -238,7 +237,7 @@ public class TsfCustomerService {
|
|
|
* @since 2021. 02. 15
|
|
* @since 2021. 02. 15
|
|
|
*/
|
|
*/
|
|
|
public Customer getCustomerFindByCellPhnno(String cellPhnno) {
|
|
public Customer getCustomerFindByCellPhnno(String cellPhnno) {
|
|
|
- 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
|
|
@@ -267,6 +266,7 @@ public class TsfCustomerService {
|
|
|
customer.setCustGrade(TscConstants.CustGrade.WELCOME.value());
|
|
customer.setCustGrade(TscConstants.CustGrade.WELCOME.value());
|
|
|
|
|
|
|
|
int custCnt = customerDao.createCustomer(customer);
|
|
int custCnt = customerDao.createCustomer(customer);
|
|
|
|
|
+ customerDao.saveBatchBirth(customer);
|
|
|
|
|
|
|
|
if (custCnt > 0) {
|
|
if (custCnt > 0) {
|
|
|
saveJoinPostProcessing(customer);
|
|
saveJoinPostProcessing(customer);
|
|
@@ -285,11 +285,11 @@ public class TsfCustomerService {
|
|
|
* @since 2021. 02. 19
|
|
* @since 2021. 02. 19
|
|
|
*/
|
|
*/
|
|
|
@Transactional("shopTxnManager")
|
|
@Transactional("shopTxnManager")
|
|
|
- public boolean saveJoinCustomerSns (Customer customer) {
|
|
|
|
|
|
|
+ public boolean saveJoinCustomerSns(Customer customer) {
|
|
|
boolean isJoin = true;
|
|
boolean isJoin = true;
|
|
|
String snsId = customer.getSnsType().equals(TscConstants.SnsType.YES24.value()) ? customer.getMemNo() : customer.getSnsId();
|
|
String snsId = customer.getSnsType().equals(TscConstants.SnsType.YES24.value()) ? customer.getMemNo() : customer.getSnsId();
|
|
|
customer.setEncodedPasswd(" ");
|
|
customer.setEncodedPasswd(" ");
|
|
|
- customer.setCustId(customer.getSnsType()+"_"+snsId);
|
|
|
|
|
|
|
+ customer.setCustId(customer.getSnsType() + "_" + snsId);
|
|
|
customer.encryptData();
|
|
customer.encryptData();
|
|
|
|
|
|
|
|
customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
@@ -299,9 +299,9 @@ public class TsfCustomerService {
|
|
|
customer.setCustGb(TscConstants.CustGb.NORMAL.value());
|
|
customer.setCustGb(TscConstants.CustGb.NORMAL.value());
|
|
|
customer.setCustGrade(TscConstants.CustGrade.WELCOME.value());
|
|
customer.setCustGrade(TscConstants.CustGrade.WELCOME.value());
|
|
|
|
|
|
|
|
-
|
|
|
|
|
int custCnt = customerDao.createCustomer(customer);
|
|
int custCnt = customerDao.createCustomer(customer);
|
|
|
customerDao.createCustomerSns(customer);
|
|
customerDao.createCustomerSns(customer);
|
|
|
|
|
+ customerDao.saveBatchBirth(customer);
|
|
|
|
|
|
|
|
if (custCnt > 0) {
|
|
if (custCnt > 0) {
|
|
|
saveJoinPostProcessing(customer);
|
|
saveJoinPostProcessing(customer);
|
|
@@ -332,7 +332,6 @@ public class TsfCustomerService {
|
|
|
couponService.saveJoinCoupon(coupon);
|
|
couponService.saveJoinCoupon(coupon);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* Sns 정보에대한 상태 처리
|
|
* Sns 정보에대한 상태 처리
|
|
|
*
|
|
*
|
|
@@ -341,7 +340,7 @@ public class TsfCustomerService {
|
|
|
* @since 2021. 02. 19
|
|
* @since 2021. 02. 19
|
|
|
*/
|
|
*/
|
|
|
@Transactional("shopTxnManager")
|
|
@Transactional("shopTxnManager")
|
|
|
- public GagaMap customerSnsProcessing (CustSnsInfo custSnsInfo) {
|
|
|
|
|
|
|
+ public GagaMap customerSnsProcessing(CustSnsInfo custSnsInfo) {
|
|
|
GagaMap resultMap = new GagaMap();
|
|
GagaMap resultMap = new GagaMap();
|
|
|
Customer custInfo;
|
|
Customer custInfo;
|
|
|
|
|
|
|
@@ -390,7 +389,7 @@ public class TsfCustomerService {
|
|
|
return resultMap;
|
|
return resultMap;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- boolean isFindByPhone = getCustomerFindByCellPhnnoCount(custSnsInfo.getCellPhnno().replace("-",""));
|
|
|
|
|
|
|
+ boolean isFindByPhone = getCustomerFindByCellPhnnoCount(custSnsInfo.getCellPhnno().replace("-", ""));
|
|
|
if (isFindByPhone) {
|
|
if (isFindByPhone) {
|
|
|
resultMap.setString("custStat", "DUP_PHONE_CUST"); // 휴대폰 중복
|
|
resultMap.setString("custStat", "DUP_PHONE_CUST"); // 휴대폰 중복
|
|
|
return resultMap;
|
|
return resultMap;
|
|
@@ -445,7 +444,7 @@ public class TsfCustomerService {
|
|
|
loginService.createLoginHistory(loginInfo.getCustNo());
|
|
loginService.createLoginHistory(loginInfo.getCustNo());
|
|
|
|
|
|
|
|
// 세션 생성
|
|
// 세션 생성
|
|
|
- this.createSession(request, loginDetails);
|
|
|
|
|
|
|
+ this.createSession(request, loginDetails);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -462,7 +461,6 @@ public class TsfCustomerService {
|
|
|
session.setAttribute("session", loginDetails);
|
|
session.setAttribute("session", loginDetails);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 일반고객 정보 유효성
|
|
* 일반고객 정보 유효성
|
|
|
*
|
|
*
|
|
@@ -471,7 +469,7 @@ public class TsfCustomerService {
|
|
|
* @author jsshin
|
|
* @author jsshin
|
|
|
* @since 2021. 02. 18
|
|
* @since 2021. 02. 18
|
|
|
*/
|
|
*/
|
|
|
- public GagaMap generalCustomerValidation (Customer customer) {
|
|
|
|
|
|
|
+ public GagaMap generalCustomerValidation(Customer customer) {
|
|
|
GagaMap resultMap = new GagaMap();
|
|
GagaMap resultMap = new GagaMap();
|
|
|
String maskingCustId;
|
|
String maskingCustId;
|
|
|
|
|
|
|
@@ -527,7 +525,6 @@ public class TsfCustomerService {
|
|
|
return customerDao.getCusomterSnsFind(custSnsInfo);
|
|
return customerDao.getCusomterSnsFind(custSnsInfo);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 가입된 아이디 가져오기
|
|
* 가입된 아이디 가져오기
|
|
|
* @param custId - 고객아이디
|
|
* @param custId - 고객아이디
|
|
@@ -623,7 +620,7 @@ public class TsfCustomerService {
|
|
|
wishInfo.setRegNo(TsfSession.getInfo().getCustNo());
|
|
wishInfo.setRegNo(TsfSession.getInfo().getCustNo());
|
|
|
customerDao.createWishList(wishInfo);
|
|
customerDao.createWishList(wishInfo);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 위시상품목록 50개만 남게 처리
|
|
// 위시상품목록 50개만 남게 처리
|
|
|
String goodsCd = customerDao.getDeleteGoodsWish(TsfSession.getInfo().getCustNo());
|
|
String goodsCd = customerDao.getDeleteGoodsWish(TsfSession.getInfo().getCustNo());
|
|
|
WishList delWishInfo = new WishList();
|
|
WishList delWishInfo = new WishList();
|
|
@@ -632,7 +629,7 @@ public class TsfCustomerService {
|
|
|
delWishInfo.setArrGoodsCd(goodsCd.split("\\,"));
|
|
delWishInfo.setArrGoodsCd(goodsCd.split("\\,"));
|
|
|
customerDao.deleteWishList(delWishInfo);
|
|
customerDao.deleteWishList(delWishInfo);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -707,6 +704,8 @@ public class TsfCustomerService {
|
|
|
coreCustomerService.createCustomerHistory(customer);
|
|
coreCustomerService.createCustomerHistory(customer);
|
|
|
// 2.CI 업데이트
|
|
// 2.CI 업데이트
|
|
|
int resultCnt = customerDao.updateCustomerCi(customer);
|
|
int resultCnt = customerDao.updateCustomerCi(customer);
|
|
|
|
|
+ customerDao.saveBatchBirth(customer);
|
|
|
|
|
+
|
|
|
if (resultCnt > 0) {
|
|
if (resultCnt > 0) {
|
|
|
isSuccess = true;
|
|
isSuccess = true;
|
|
|
}
|
|
}
|
|
@@ -784,8 +783,9 @@ public class TsfCustomerService {
|
|
|
// 1. 이력쌓고
|
|
// 1. 이력쌓고
|
|
|
coreCustomerService.createCustomerHistory(customer);
|
|
coreCustomerService.createCustomerHistory(customer);
|
|
|
|
|
|
|
|
- // 2. 이름, 휴대전화 번호 저장
|
|
|
|
|
|
|
+ // 2. 이름, 휴대전화 번호, 생년월일 저장
|
|
|
int updateCnt = customerDao.updateCustomerAuth(customer);
|
|
int updateCnt = customerDao.updateCustomerAuth(customer);
|
|
|
|
|
+ customerDao.saveBatchBirth(customer);
|
|
|
|
|
|
|
|
boolean isSuccess = updateCnt > 0; // 변경 성공시 true
|
|
boolean isSuccess = updateCnt > 0; // 변경 성공시 true
|
|
|
|
|
|
|
@@ -794,7 +794,6 @@ public class TsfCustomerService {
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 고객계좌 정보
|
|
* 고객계좌 정보
|
|
|
*
|
|
*
|
|
@@ -807,7 +806,6 @@ public class TsfCustomerService {
|
|
|
return coreCustomerService.getCustomerAccuontInfo(custNo);
|
|
return coreCustomerService.getCustomerAccuontInfo(custNo);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 고객정보 수정
|
|
* 고객정보 수정
|
|
|
*
|
|
*
|
|
@@ -994,4 +992,55 @@ public class TsfCustomerService {
|
|
|
public Collection<CustGrade> getCustGradePolicy(CustGrade custGrade) {
|
|
public Collection<CustGrade> getCustGradePolicy(CustGrade custGrade) {
|
|
|
return customerDao.getCustGradePolicy(custGrade);
|
|
return customerDao.getCustGradePolicy(custGrade);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * SMS수신거부 처리
|
|
|
|
|
+ * @param custNo - 고객번호
|
|
|
|
|
+ * @author gagamel
|
|
|
|
|
+ * @since 2021. 5. 11
|
|
|
|
|
+ */
|
|
|
|
|
+ @Transactional("shopTxnManager")
|
|
|
|
|
+ public void updateSmsReceptionRefuse(Integer custNo) {
|
|
|
|
|
+ // 수신거부 처리
|
|
|
|
|
+ int result = customerDao.updateSmsReceptionRefuse(custNo);
|
|
|
|
|
+
|
|
|
|
|
+ if (result > 0) {
|
|
|
|
|
+ Customer customer = new Customer();
|
|
|
|
|
+ customer.setCustNo(custNo);
|
|
|
|
|
+ customer.setSmsAgreeYn("N");
|
|
|
|
|
+ customer.setRegNo(custNo);
|
|
|
|
|
+
|
|
|
|
|
+ // 마케팅수신동의이력 생성
|
|
|
|
|
+ coreCustomerService.createCustomerMarketHst(customer);
|
|
|
|
|
+
|
|
|
|
|
+ // 고객이력 생성
|
|
|
|
|
+ coreCustomerService.createCustomerHistory(customer);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 메일수신거부 처리
|
|
|
|
|
+ * @param custNo - 고객번호
|
|
|
|
|
+ * @author gagamel
|
|
|
|
|
+ * @since 2021. 5. 11
|
|
|
|
|
+ */
|
|
|
|
|
+ @Transactional("shopTxnManager")
|
|
|
|
|
+ public void updateEmailReceptionRefuse(Integer custNo) {
|
|
|
|
|
+ // 수신거부 처리
|
|
|
|
|
+ int result = customerDao.updateEmailReceptionRefuse(custNo);
|
|
|
|
|
+
|
|
|
|
|
+ if (result > 0) {
|
|
|
|
|
+ Customer customer = new Customer();
|
|
|
|
|
+ customer.setCustNo(custNo);
|
|
|
|
|
+ customer.setEmailAgreeYn("N");
|
|
|
|
|
+ customer.setRegNo(custNo);
|
|
|
|
|
+
|
|
|
|
|
+ // 마케팅수신동의이력 생성
|
|
|
|
|
+ coreCustomerService.createCustomerMarketHst(customer);
|
|
|
|
|
+
|
|
|
|
|
+ // 고객이력 생성
|
|
|
|
|
+ coreCustomerService.createCustomerHistory(customer);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|