Просмотр исходного кода

알림톡 수정 및 회원가입 완료 페이지 수정

jsshin 5 лет назад
Родитель
Сommit
31efc4b93e

+ 16 - 0
src/main/java/com/style24/front/biz/service/TsfCouponService.java

@@ -838,4 +838,20 @@ public class TsfCouponService {
 		return result;
 	}
 
+	/**
+	 * 회원가입 쿠폰 정보 조회
+	 *
+	 *
+	 * @return Coupon
+	 * @author jsshin
+	 * @since 2021. 05. 27
+	 */
+	public Coupon getJoinCouponInfo() {
+		Coupon coupon = new Coupon();
+		coupon.setSiteCd(TscConstants.Site.STYLE24.value());
+		coupon.setCustGrade(TscConstants.CustGrade.WELCOME.value());
+		coupon.setFrontGb(TsfSession.getFrontGb());
+		return couponDao.getJoinCoupon(coupon);
+	}
+
 }

+ 9 - 1
src/main/java/com/style24/front/biz/web/TsfCustomerController.java

@@ -3,6 +3,8 @@ package com.style24.front.biz.web;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpSession;
 
+import com.style24.front.biz.service.TsfCouponService;
+import com.style24.persistence.domain.Coupon;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -55,6 +57,9 @@ public class TsfCustomerController extends TsfBaseController {
 	@Autowired
 	private TscKakaotalkService kakaotalkService;
 
+	@Autowired
+	private TsfCouponService couponService;
+
 	@Autowired
 	private NiceCertify niceCertify;
 
@@ -604,10 +609,12 @@ 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, customer.getCustNo());
+					kakaotalkService.sendJoinCongrat(customer, coupon, customer.getCustNo());
 				}
 			} catch (Exception e) {
 				log.error("error", e);
@@ -621,6 +628,7 @@ public class TsfCustomerController extends TsfBaseController {
 			} catch (Exception e) {
 				log.error("error", e);
 			}
+
 			customerService.getLogin(customer.getCustNo(), request);
 		}
 

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

@@ -170,6 +170,7 @@
 		            ELSE DATE_FORMAT(CP.AVAIL_STDT, '%Y%m%d%H%i%S')              END AS AVAIL_STDT
 		     , CASE WHEN CP.PD_GB = 'D' THEN DATE_FORMAT(CONCAT(CURRENT_DATE + INTERVAL CP.AVAIL_DAYS DAY, ' 23:59:59'), '%Y%m%d%H%i%S')
 		            ELSE  DATE_FORMAT(CP.AVAIL_EDDT, '%Y%m%d%H%i%S')             END AS AVAIL_EDDT
+		     , CP.CPN_NM
 		FROM  TB_CUST_GRADE_POLICY CGP
 		INNER JOIN
 		      TB_COUPON CP

+ 7 - 6
src/main/webapp/WEB-INF/views/mob/customer/JoinCompleteFormMob.html

@@ -96,12 +96,13 @@
 	$(document).ready(function(){
 		if (_isApp === 'true') {
 			if (gagajf.isNull(maskingCustId)) {
-				document.location.href = "idsend://?id=" + [[${custNo}]] + "^link=";
-				if (_osType === 'A') {
-					window.style24.pushEnable('ON');
-				} else if (_osType === 'I') {
-					window.webkit.messageHandlers.pushEnable.postMessage({"status":"ON"});
-				}
+				$.get("idsend://?id=" + [[${custNo}]] + "^link=", function () {
+					if (_osType === 'A') {
+						window.style24.pushEnable('ON');
+					} else if (_osType === 'I') {
+						window.webkit.messageHandlers.pushEnable.postMessage({"status":"ON"});
+					}
+				});
 			}
 		}
 	});