jsshin пре 5 година
родитељ
комит
c08d3a4f27

+ 45 - 0
src/main/java/com/style24/front/biz/service/TsfCustomerService.java

@@ -7,6 +7,7 @@ import java.util.List;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpSession;
 
+import com.style24.core.biz.service.TscKakaotalkService;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
@@ -61,6 +62,9 @@ public class TsfCustomerService {
 	@Autowired
 	private TsfCouponService couponService;
 
+	@Autowired
+	private TscKakaotalkService kakaotalkService;
+
 	@Autowired
 	private ObjectMapper objectMapper;
 
@@ -278,6 +282,26 @@ public class TsfCustomerService {
 			isJoin = false;
 		}
 
+		if(isJoin) {
+			Coupon coupon = couponService.getJoinCouponInfo();
+			// 알림톡 발송
+			try {
+				if (StringUtils.isNotBlank(customer.getCellPhnno())) {
+					kakaotalkService.sendJoinCongrat(customer, coupon, customer.getCustNo());
+				}
+			} catch (Exception e) {
+				log.error("error", e);
+			}
+
+			// 이메일 발송
+			try {
+				if (StringUtils.isNotBlank(customer.getEmail())) {
+					// TODO : 2021.02.23 이메일 모듈 개발 필요 jsshin
+				}
+			} catch (Exception e) {
+				log.error("error", e);
+			}
+		}
 		return isJoin;
 	}
 
@@ -319,6 +343,27 @@ public class TsfCustomerService {
 			isJoin = false;
 		}
 
+		if (isJoin) {
+			Coupon coupon = couponService.getJoinCouponInfo();
+			// 알림톡 발송
+			try {
+				if (StringUtils.isNotBlank(customer.getCellPhnno())) {
+					kakaotalkService.sendJoinCongrat(customer, coupon, customer.getCustNo());
+				}
+			} catch (Exception e) {
+				log.error("error", e);
+			}
+
+			// 이메일 발송
+			try {
+				if (StringUtils.isNotBlank(customer.getEmail())) {
+					// TODO : 2021.02.23 이메일 모듈 개발 필요 jsshin
+				}
+			} catch (Exception e) {
+				log.error("error", e);
+			}
+		}
+
 		return isJoin;
 
 	}

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

@@ -209,11 +209,11 @@ public class KaKaoLogin {
 			}
 
 			// 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("-","");
-			}
+			String ci = kakaoAccount.getString("account_ci");
+//			if (StringUtils.isBlank(ci)) {
+//				ci = "LU9VuATNfK86YTDEsHvOGO5hOhgfHYlaj6rWKGZXPGJtBK4IHlFx/+tbBFrbYMjYUSzI9RCQHygvBwaqKS/tNA=="; // jsshin6246 CI값
+//				//ci = UUID.randomUUID().toString().replaceAll("-","");
+//			}
 
 			resultMap.setString("snsId", snsId);
 			resultMap.setString("custNm", custNm);

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

@@ -57,9 +57,6 @@ public class TsfCustomerController extends TsfBaseController {
 	@Autowired
 	private TscKakaotalkService kakaotalkService;
 
-	@Autowired
-	private TsfCouponService couponService;
-
 	@Autowired
 	private NiceCertify niceCertify;
 
@@ -611,26 +608,6 @@ public class TsfCustomerController extends TsfBaseController {
 		boolean isJoin = customerService.saveJoinCustomer(customer);
 
 		if (isJoin) {
-			Coupon coupon = couponService.getJoinCouponInfo();
-
-			// 4.알림톡 발송
-			try {
-				if (StringUtils.isNotBlank(customer.getCellPhnno())) {
-					kakaotalkService.sendJoinCongrat(customer, coupon, customer.getCustNo());
-				}
-			} catch (Exception e) {
-				log.error("error", e);
-			}
-
-			// 5. 이메일 발송
-			try {
-				if (StringUtils.isNotBlank(customer.getEmail())) {
-					// TODO : 2021.02.23 이메일 모듈 개발 필요 jsshin
-				}
-			} catch (Exception e) {
-				log.error("error", e);
-			}
-
 			customerService.getLogin(customer.getCustNo(), request);
 		}
 
@@ -895,10 +872,12 @@ public class TsfCustomerController extends TsfBaseController {
 		// 1. SNS처리
 		GagaMap resultMap = customerService.customerSnsProcessing(custSnsInfo);
 		String custStat = resultMap.getString("custStat");
+
 		// 2.신규가입 및 연동이면 바로 로그인 처리
 		if ("NEW_CUST".equals(custStat)) {
 			customerService.getLogin(Integer.parseInt(resultMap.getString("custNo")), request);
 		}
+
 		// 3.YES24 연동처리
 		if ("NEW_CUST".equals(custStat) || "SUCC_CUST".equals(custStat)) {
 			yes24Login.saveLink(custSnsInfo);

+ 2 - 0
src/main/java/com/style24/front/biz/web/TsfIndexController.java

@@ -8,6 +8,8 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
+import com.style24.core.biz.service.TscKakaotalkService;
+import com.style24.front.biz.service.TsfCouponService;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;