Procházet zdrojové kódy

이태영 - 20210712 장바구니 혜택 추가 알림 푸시 개발

xodud lee před 4 roky
rodič
revize
efa7d8a4a4

+ 28 - 1
src/main/java/com/style24/batch/biz/dao/TsbCartDao.java

@@ -1,6 +1,7 @@
 package com.style24.batch.biz.dao;
 
 import com.style24.core.support.annotation.ShopDs;
+import com.style24.persistence.domain.Customer;
 import com.style24.persistence.domain.Order;
 import org.springframework.stereotype.Repository;
 
@@ -22,7 +23,25 @@ public interface TsbCartDao {
 	 * @author xodud1202
 	 * @since  2021. 07. 08
 	 */
-	Collection<Order> getDontPurchaseCartCustList(Order param);
+	Collection<Order> getUnpurchaseCartCustList(Order param);
+
+	/**
+	 * 장바구니 추가 쿠폰 혜택 알림 푸시 대상 쿠폰 조회
+	 * @param param
+	 * @return
+	 * @author xodud1202
+	 * @since  2021. 07. 09
+	 */
+	Collection<Order> getAddCouponList(Order param);
+
+	/**
+	 * 혜택 추가 푸시 알림 대상 조회
+	 * @param param
+	 * @return
+	 * @author xodud1202
+	 * @since  2021. 07. 09
+	 */
+	Collection<Customer> getAddBenefitPushCustomerList(Order param);
 
 	/**
 	 * 장바구니 기간 만료 데이터 삭제
@@ -41,4 +60,12 @@ public interface TsbCartDao {
 	 * @since  2021. 05. 03
 	 */
 	void deleteCartDetail(Order point);
+
+	/**
+	 * 장바구니 혜택추가 송부 이력 저장
+	 * @param param
+	 * @author xodud1202
+	 * @since  2021. 07. 12
+	 */
+	void createCouponNoticeSended(Order param);
 }

+ 97 - 0
src/main/java/com/style24/batch/biz/job/order/TsbCartAddCouponPushJob.java

@@ -0,0 +1,97 @@
+package com.style24.batch.biz.job.order;
+
+import com.style24.batch.biz.job.TsbAbstractJob;
+import com.style24.batch.biz.service.TsbCartService;
+import com.style24.batch.support.env.TsbConstants;
+import com.style24.core.biz.dao.TscEnvsetDao;
+import com.style24.core.biz.service.TscEnvsetService;
+import com.style24.core.biz.service.TscFingerPushService;
+import com.style24.core.biz.thirdparty.FingerPushSender;
+import com.style24.core.support.env.TscConstants;
+import com.style24.persistence.domain.Customer;
+import com.style24.persistence.domain.Order;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Collection;
+
+/**
+ * 장바구니 혜택 추가 푸시
+ *
+ * @author xodud1202
+ * @since 2021. 07. 09
+ */
+@Component
+@Slf4j
+public class TsbCartAddCouponPushJob extends TsbAbstractJob<Collection<Order>, Collection<Order>, Order> {
+
+	@Autowired
+	private TsbCartService cartService;
+
+	@Autowired
+	private TscFingerPushService coreFingerPushService;
+
+	private int succCnt = 0;
+	private int failCnt = 0;
+
+	@Override
+	public Collection<Order> read() throws Exception {
+		// 추가 다운로드 받을 수 있는 쿠폰 조회
+		Order param = new Order();
+		param.setBenefitGb("C");		// 장바구니
+		return cartService.getAddCouponList(param);
+	}
+
+	@Override
+	public Collection<Order> process(Collection<Order> params) throws Exception {
+		int[] cpnIdArr = new int[params.size()];
+
+		try {
+			int i = 0;
+			for(Order param : params) {
+				cpnIdArr[i++] = param.getCpnId();
+			}
+
+			// 추가된 쿠폰이 적용된 장바구니 상품을 가진 고객 조회
+			Order cpn = new Order();
+			cpn.setCpnIdArr(cpnIdArr);
+			cpn.setTableName("TB_CART");
+			Collection<Customer> custList = cartService.getAddBenefitPushCustomerList(cpn);
+
+			// 핑거푸시
+			for(Customer cust : custList) {
+				int ansSq = FingerPushSender.FingerPushSq.SHOPPING_BAG_DISCOUNT.value();
+				cust.setRegNo(TsbConstants.REG_NO);
+				cust.setUpdNo(TsbConstants.REG_NO);
+
+				// 앱 푸시 데이터 insert
+				coreFingerPushService.send(cust, ansSq);
+				succCnt++;
+			}
+
+			// 송부 이력 저장
+			for(Order param : params) {
+				param.setRegNo(TsbConstants.REG_NO);	// 등록자
+				param.setBenefitGb("C");				// 장바구니
+				cartService.createCouponNoticeSended(param);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+			failCnt++;
+		}
+
+		return params;
+	}
+
+	@Override
+	public Order write(Collection<Order> params) throws Exception {
+		return null;
+	}
+
+	@Override
+	public void notify(Order param) throws Exception {
+		super.printResult(succCnt, failCnt);
+	}
+
+}

+ 21 - 5
src/main/java/com/style24/batch/biz/job/order/TsbCartDontPurchaseNoticeJob.java → src/main/java/com/style24/batch/biz/job/order/TsbCartUnpurchasePushJob.java

@@ -2,9 +2,13 @@ package com.style24.batch.biz.job.order;
 
 import com.style24.batch.biz.job.TsbAbstractJob;
 import com.style24.batch.biz.service.TsbCartService;
+import com.style24.batch.support.env.TsbConstants;
 import com.style24.core.biz.dao.TscEnvsetDao;
 import com.style24.core.biz.service.TscEnvsetService;
+import com.style24.core.biz.service.TscFingerPushService;
+import com.style24.core.biz.thirdparty.FingerPushSender;
 import com.style24.core.support.env.TscConstants;
+import com.style24.persistence.domain.Customer;
 import com.style24.persistence.domain.Envset;
 import com.style24.persistence.domain.Order;
 import lombok.extern.slf4j.Slf4j;
@@ -15,14 +19,14 @@ import org.springframework.util.StringUtils;
 import java.util.Collection;
 
 /**
- * 장바구니 만료 정보 삭제
+ * 장바구니 미구매 상품 존재 알림(앱푸시) 대상 리스트트(장바구니 삭제 10일전)
  *
  * @author xodud1202
- * @since 2021. 05. 03
+ * @since 2021. 07. 08
  */
 @Component
 @Slf4j
-public class TsbCartDontPurchaseNoticeJob extends TsbAbstractJob<Collection<Order>, Collection<Order>, Order> {
+public class TsbCartUnpurchasePushJob extends TsbAbstractJob<Collection<Order>, Collection<Order>, Order> {
 
 	@Autowired
 	private TsbCartService cartService;
@@ -33,6 +37,9 @@ public class TsbCartDontPurchaseNoticeJob extends TsbAbstractJob<Collection<Orde
 	@Autowired
 	private TscEnvsetService envsetService;
 
+	@Autowired
+	private TscFingerPushService coreFingerPushService;
+
 	private int succCnt = 0;
 	private int failCnt = 0;
 
@@ -45,21 +52,30 @@ public class TsbCartDontPurchaseNoticeJob extends TsbAbstractJob<Collection<Orde
 
 		// 값이 없을 경우 종료
 		if (limitDays > 0) {
-			limitDays = limitDays - 10;
+			limitDays = limitDays - 15;
 		} else {
 			throw new IllegalArgumentException("장바구니 보관 기간이 존재하지 않습니다.");
 		}
 
 		param.setSaveLimitDay(limitDays);
 
-		return cartService.getDontPurchaseCartCustList(param);
+		return cartService.getUnpurchaseCartCustList(param);
 	}
 
 	@Override
 	public Collection<Order> process(Collection<Order> params) throws Exception {
 		for(Order order : params) {
 			// 앱 푸시 데이터 insert
+			int ansSq = FingerPushSender.FingerPushSq.GOODS_UNPURCHASED.value();
+			Customer customer = new Customer();
+			customer.setCustNo(order.getCustNo());
+			customer.setCellPhnno(order.getCellPhnno());
+			customer.setRegNo(TsbConstants.REG_NO);
+			customer.setUpdNo(TsbConstants.REG_NO);
+
+			coreFingerPushService.send(customer, ansSq);
 		}
+
 		return params;
 	}
 

+ 1 - 2
src/main/java/com/style24/batch/biz/job/order/TsbOrderDepositExpirationJob.java

@@ -73,9 +73,8 @@ public class TsbOrderDepositExpirationJob extends TsbAbstractJob<Collection<Orde
 				int ordChgSq = coreOrderChangeService.allCnclComplete(orderChange);
 				succCnt++;
 
-				// TODO 알림톡, 메일 송부?
 				try {
-					// 환불계좌X 취소 접수 알림톡 관련 정보 조회
+					// 무통장 입금 전 취소 알림톡 송부
 					OrderChange change = new OrderChange();
 					change = coreOrderChangeService.getKakaoOrderCancelInfo(ordChgSq);
 

+ 34 - 2
src/main/java/com/style24/batch/biz/service/TsbCartService.java

@@ -1,5 +1,6 @@
 package com.style24.batch.biz.service;
 
+import com.style24.persistence.domain.Customer;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -55,7 +56,38 @@ public class TsbCartService {
 	 * @author xodud1202
 	 * @since  2021. 07. 08
 	 */
-	public Collection<Order> getDontPurchaseCartCustList(Order param) {
-		return cartDao.getDontPurchaseCartCustList(param);
+	public Collection<Order> getUnpurchaseCartCustList(Order param) {
+		return cartDao.getUnpurchaseCartCustList(param);
+	}
+
+	/**
+	 * 장바구니 추가 쿠폰 혜택 알림 푸시 대상 쿠폰 조회
+	 * @return
+	 * @author xodud1202
+	 * @since  2021. 07. 09
+	 */
+	public Collection<Order> getAddCouponList(Order param) {
+		return cartDao.getAddCouponList(param);
+	}
+
+	/**
+	 * 혜택 추가 푸시 알림 대상 조회
+	 * @param param
+	 * @return
+	 * @author xodud1202
+	 * @since  2021. 07. 09
+	 */
+	public Collection<Customer> getAddBenefitPushCustomerList(Order param) {
+		return cartDao.getAddBenefitPushCustomerList(param);
+	}
+
+	/**
+	 * 장바구니 혜택추가 송부 이력 저장
+	 * @param param
+	 * @author xodud1202
+	 * @since  2021. 07. 12
+	 */
+	public void createCouponNoticeSended(Order param) {
+		cartDao.createCouponNoticeSended(param);
 	}
 }

+ 32 - 4
src/main/java/com/style24/batch/biz/task/TsbOrderTask.java

@@ -1,14 +1,11 @@
 package com.style24.batch.biz.task;
 
+import com.style24.batch.biz.job.order.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
-import com.style24.batch.biz.job.order.TsbCartExpirationJob;
-import com.style24.batch.biz.job.order.TsbOrderDepositExpirationJob;
-import com.style24.batch.biz.job.order.TsbOrderGiftExpirationJob;
-
 import lombok.extern.slf4j.Slf4j;
 
 /**
@@ -30,6 +27,12 @@ public class TsbOrderTask {
 	@Autowired
 	private TsbOrderGiftExpirationJob orderGiftExpirationJob;
 
+	@Autowired
+	private TsbCartUnpurchasePushJob cartUnpurchasePushJob;
+
+	@Autowired
+	private TsbCartAddCouponPushJob cartAddCouponPushJob;
+
 	/**
 	 * 장바구니 30일 초과 만료 데이터 삭제
 	 *
@@ -71,4 +74,29 @@ public class TsbOrderTask {
 		orderGiftExpirationJob.runById("cron.order.gift.deadline.expire");
 	}
 
+	/**
+	 * 장바구니 미구매 확인(삭제 10일 전) 푸시 송부
+	 * @throws Exception - 예외처리
+	 * @author xodud1202
+	 * @since 2021. 07. 09
+	 */
+	@Scheduled(cron = "${cron.order.cart.unpurchase.push}")
+	//@Scheduled(fixedDelay = 3500000)
+	@Async
+	public void cartUnpurchasePushJob() throws Exception {
+		cartUnpurchasePushJob.runById("cron.order.cart.unpurchase.push");
+	}
+
+	/**
+	 * 장바구니 혜택 추가 푸시
+	 * @throws Exception - 예외처리
+	 * @author xodud1202
+	 * @since 2021. 07. 09
+	 */
+	//@Scheduled(cron = "${cron.order.cart.benefit.push}")
+	@Scheduled(fixedDelay = 3500000)
+	@Async
+	public void cartBenefitPushJob() throws Exception {
+		cartAddCouponPushJob.runById("cron.order.cart.benefit.push");
+	}
 }

+ 34 - 3
src/main/java/com/style24/batch/biz/web/TsbOrderController.java

@@ -1,5 +1,6 @@
 package com.style24.batch.biz.web;
 
+import com.style24.batch.biz.job.order.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.CrossOrigin;
@@ -7,9 +8,6 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 
-import com.style24.batch.biz.job.order.TsbCartExpirationJob;
-import com.style24.batch.biz.job.order.TsbOrderDepositExpirationJob;
-import com.style24.batch.biz.job.order.TsbOrderGiftExpirationJob;
 import com.style24.core.support.controller.TscBaseController;
 
 import lombok.extern.slf4j.Slf4j;
@@ -35,6 +33,12 @@ public class TsbOrderController extends TscBaseController {
 	@Autowired
 	private TsbOrderGiftExpirationJob orderGiftExpirationJob;
 
+	@Autowired
+	private TsbCartUnpurchasePushJob cartUnpurchasePushJob;
+
+	@Autowired
+	private TsbCartAddCouponPushJob addCouponPushJob;
+
 	/**
 	 * 장바구니 30일 초과 만료 데이터 삭제
 	 *
@@ -77,4 +81,31 @@ public class TsbOrderController extends TscBaseController {
 		return "OK";
 	}
 
+	/**
+	 * 장바구니 미구매상품(삭제 10일전) 알림 푸시
+	 *
+	 * @throws Exception - 예외처리
+	 * @author xodud1202
+	 * @since 2021. 07. 09
+	 */
+	@GetMapping("/cart/unpurchase/push")
+	@ResponseBody
+	public String cartUnpurchasePush() throws Exception {
+		cartUnpurchasePushJob.runById("cron.order.cart.unpurchase.push");
+		return "OK";
+	}
+
+	/**
+	 * 장바구니 미구매상품(삭제 10일전) 알림 푸시
+	 *
+	 * @throws Exception - 예외처리
+	 * @author xodud1202
+	 * @since 2021. 07. 09
+	 */
+	@GetMapping("/cart/benefit/push")
+	@ResponseBody
+	public String cartBenefitPush() throws Exception {
+		addCouponPushJob.runById("cron.order.cart.benefit.push");
+		return "OK";
+	}
 }

+ 221 - 2
src/main/java/com/style24/persistence/mybatis/shop/TsbCart.xml

@@ -20,8 +20,8 @@
 	</delete>
 
 	<!-- 장바구니 미구매 상품 존재 알림(앱푸시) 대상 리스트트(장바구니 삭제 10일전) -->
-	<select id="getDontPurchaseCartCustList" parameterType="Order" resultType="Order">
-		/* TsbCart.getDontPurchaseCartCustList : 장바구니 미구매 상품 존재 알림(앱푸시) 대상 리스트 */
+	<select id="getUnpurchaseCartCustList" parameterType="Order" resultType="Order">
+		/* TsbCart.getUnpurchaseCartCustList : 장바구니 미구매 상품 존재 알림(앱푸시) 대상 리스트 */
 		SELECT CT.CUST_NO
 		     , CT.CELL_PHNNO
 		     , CT.CUST_NM
@@ -39,4 +39,223 @@
 		        , CT.CUST_NM
 		        , CT.CUST_ID
 	</select>
+
+	<!-- 장바구니 추가 쿠폰 혜택 알림 푸시 대상 쿠폰 조회 -->
+	<select id="getAddCouponList" resultType="Order" parameterType="Order">
+		/* TsbCart.getAddCouponList : 장바구니 추가 쿠폰 혜택 알림 푸시 대상 쿠폰 조회 */
+		SELECT CP.CPN_ID
+		     , CP.APPLY_SCOPE
+		FROM   TB_COUPON CP
+		LEFT   OUTER JOIN TB_COUPON_NOTICE_SENDED CNS
+		ON     CP.CPN_ID = CNS.CPN_ID
+		AND    CNS.BENEFIT_GB = 'C'
+		WHERE  1=1
+		AND    CNS.CPN_ID IS NULL
+		AND    CP.CPN_TYPE <![CDATA[ <> ]]> 'G230_10'
+		AND    CP.CPN_STAT = 'G232_11'
+		AND    CP.DC_CD_GB = 'G233_00'
+		AND    CP.DOWN_ABL_YN = 'Y'
+		AND    CP.FIRST_ORD_YN = 'N'
+		AND    CP.NEW_CUST_YN = 'N'
+		AND    NOW() BETWEEN CP.DOWN_STDT AND CP.DOWN_EDDT
+	</select>
+
+	<!-- 혜택 추가 푸시 알림 대상 조회 -->
+	<select id="getAddBenefitPushCustomerList" parameterType="Order" resultType="Customer">
+		/* TsbCart.getAddBenefitPushCustomerList : 혜택 추가 푸시 알림 대상 조회 */
+		SELECT CT.CUST_NO
+		     , CT.CELL_PHNNO
+		FROM   TB_CUSTOMER CT
+		INNER  JOIN (SELECT CR.CPN_ID
+		                  , G.GOODS_CD
+		                  , C.CUST_NO
+		             FROM   TB_CART C
+		             INNER  JOIN TB_GOODS G
+		             ON     C.GOODS_CD = G.GOODS_CD
+		             INNER  JOIN TB_COUPON_REFVAL CR
+		             ON     G.SUPPLY_COMP_CD = CR.REF_VAL
+		             INNER  JOIN TB_COUPON CP
+		             ON     CP.CPN_ID = CR.CPN_ID
+		             WHERE  1=1
+		             AND    CP.CPN_ID IN
+		             <foreach collection="cpnIdArr" item="item" index="index"  open="(" close=")" separator=",">
+		                        #{item}
+		             </foreach>
+		             AND    CP.APPLY_SCOPE = 'I'
+		             AND    G.GOODS_STAT = 'G008_90'
+		             AND    CR.DEL_YN = 'N'
+		             AND    CR.CPN_TYPE <![CDATA[ <> ]]> 'G230_10'
+		             AND    C.CART_GB = 'G026_BC'
+		             AND    C.CUST_NO > 0
+		             AND    CR.CPN_TARGET = 'G260_13' -- 공급업체
+		             UNION  ALL
+		             SELECT CR.CPN_ID
+		                  , G.GOODS_CD
+		                  , C.CUST_NO
+		             FROM   TB_CART C
+		             INNER  JOIN TB_GOODS G
+		             ON     C.GOODS_CD = G.GOODS_CD
+		             INNER  JOIN TB_COUPON_REFVAL CR
+		             ON     G.BRAND_CD = CR.REF_VAL
+		             INNER  JOIN TB_COUPON CP
+		             ON     CP.CPN_ID = CR.CPN_ID
+		             WHERE  1=1
+		             AND    CP.CPN_ID IN
+		             <foreach collection="cpnIdArr" item="item" index="index"  open="(" close=")" separator=",">
+		                        #{item}
+		             </foreach>
+		             AND    CP.APPLY_SCOPE = 'I'
+		             AND    G.GOODS_STAT = 'G008_90'
+		             AND    CR.DEL_YN = 'N'
+		             AND    CR.CPN_TYPE <![CDATA[ <> ]]> 'G230_10'
+		             AND    C.CART_GB = 'G026_BC'
+		             AND    C.CUST_NO > 0
+		             AND    CR.CPN_TARGET = 'G260_12' -- 브랜드
+		             UNION ALL
+		             SELECT CR.CPN_ID
+		                  , CG.GOODS_CD
+		                  , C.CUST_NO
+		             FROM   TB_CART C
+		             INNER  JOIN TB_GOODS G
+		             ON     C.GOODS_CD = G.GOODS_CD
+		             INNER  JOIN TB_CATE_GOODS CG
+		             ON     G.GOODS_CD = CG.GOODS_CD
+		             INNER  JOIN (SELECT C4.LEAF_CATE_NO
+		                               , CASE WHEN X = 1 THEN CATE1_NO
+		                                 WHEN X = 2 THEN CATE2_NO
+		                                 WHEN X = 3 THEN CATE3_NO
+		                                 WHEN X = 4 THEN CATE4_NO
+		                                 ELSE CATE5_NO
+		                                 END  CATE_NO
+		                          FROM   TB_CATE_4SRCH C4
+		                          LEFT   OUTER JOIN (SELECT 1 AS X
+		                                             UNION  ALL
+		                                             SELECT 2 AS X
+		                                             UNION  ALL
+		                                             SELECT 3 AS X
+		                                             UNION  ALL
+		                                             SELECT 4 AS X
+		                                             UNION  ALL
+		                                             SELECT 5 AS X ) B
+		                          ON     1=1
+		                          WHERE  C4.SITE_CD = 'G000_10'
+		                          AND    C4.CATE_TYPE = 'G031_10') CATE
+		             ON     CATE.LEAF_CATE_NO = CG.CATE_NO
+		             INNER  JOIN TB_COUPON_REFVAL CR
+		             ON     CG.CATE_NO = CR.REF_VAL
+		             INNER  JOIN TB_COUPON CP
+		             ON     CP.CPN_ID = CR.CPN_ID
+		             WHERE  1=1
+		             AND    CP.CPN_ID IN
+		             <foreach collection="cpnIdArr" item="item" index="index"  open="(" close=")" separator=",">
+		                        #{item}
+		             </foreach>
+		             AND    CP.APPLY_SCOPE = 'I'
+		             AND    G.GOODS_STAT = 'G008_90'
+		             AND    CR.DEL_YN = 'N'
+		             AND    CR.CPN_TYPE <![CDATA[ <> ]]> 'G230_10'
+		             AND    CR.CPN_TARGET = 'G260_11' -- 카테고리
+		             UNION ALL
+		             SELECT CR.CPN_ID
+		                  , G.GOODS_CD
+		                  , C.CUST_NO
+		             FROM   TB_CART C
+		             INNER  JOIN TB_GOODS G
+		             ON     C.GOODS_CD = G.GOODS_CD
+		             INNER  JOIN TB_COUPON_REFVAL CR
+		             ON     G.GOODS_CD = CR.REF_VAL
+		             INNER  JOIN TB_COUPON CP
+		             ON     CP.CPN_ID = CR.CPN_ID
+		             WHERE  1=1
+		             AND    CP.CPN_ID IN
+		             <foreach collection="cpnIdArr" item="item" index="index"  open="(" close=")" separator=",">
+		                        #{item}
+		             </foreach>
+		             AND    CP.APPLY_SCOPE = 'I'
+		             AND    G.GOODS_STAT = 'G008_90'
+		             AND    CR.DEL_YN = 'N'
+		             AND    CR.CPN_TYPE <![CDATA[ <> ]]> 'G230_10'
+		             AND    C.CART_GB = 'G026_BC'
+		             AND    C.CUST_NO > 0
+		             AND    CR.CPN_TARGET = 'G260_10' -- 적용상품
+		       ) A
+		ON     CT.CUST_NO = A.CUST_NO
+		INNER  JOIN TB_COUPON_CUST_GRADE CCG
+		ON     A.CPN_ID = CCG.CPN_ID
+		AND    CT.CUST_GRADE = CCG.USABLE_CUST_GRADE
+		LEFT   OUTER JOIN TB_COUPON_NOTICE_SENDED CNS
+		ON     A.CPN_ID = CNS.CPN_ID
+		AND    CNS.BENEFIT_GB = 'C'
+		LEFT   OUTER JOIN TB_COUPON_BAN_GOODS CG
+		ON     CG.GOODS_CD = A.GOODS_CD
+		AND    CG.DEL_YN = 'N'
+		LEFT   OUTER JOIN TB_COUPON_REFVAL CR
+		ON     A.CPN_ID = CR.CPN_ID
+		AND    A.GOODS_CD = CR.REF_VAL
+		AND    CR.CPN_TARGET = 'G260_14'
+		AND    CR.DEL_YN = 'N'
+		WHERE  CT.SECEDE_DT IS NULL
+		AND    CNS.CPN_ID IS NULL
+		AND    CG.GOODS_CD IS NULL
+		AND    CR.REF_VAL IS NULL
+		GROUP  BY CT.CUST_NO
+		        , CT.CELL_PHNNO
+		UNION  ALL
+		SELECT CT.CUST_NO
+		     , CT.CELL_PHNNO
+		FROM   TB_CUSTOMER CT
+		INNER  JOIN (SELECT C.GOODS_CD
+		                  , C.CUST_NO
+		                  , CP.CPN_ID
+		             FROM   TB_CART C
+		             INNER  JOIN TB_GOODS G
+		             ON     C.GOODS_CD = G.GOODS_CD
+		             INNER  JOIN TB_COUPON CP
+		             ON    CP.CPN_ID IN
+		             <foreach collection="cpnIdArr" item="item" index="index"  open="(" close=")" separator=",">
+		                        #{item}
+		             </foreach>
+		             AND    CP.APPLY_SCOPE = 'A'
+		             LEFT   OUTER JOIN TB_COUPON_REFVAL CR
+		             ON     CR.CPN_ID = CP.CPN_ID
+		             AND    G.GOODS_CD = CR.REF_VAL
+		             AND    CR.CPN_TARGET = 'G260_14' -- 제외상품
+		             AND    CR.DEL_YN = 'N'
+		             AND    CR.CPN_TYPE <![CDATA[ <> ]]> 'G230_10'
+		             LEFT   OUTER JOIN TB_COUPON_NOTICE_SENDED CNS
+		             ON     CP.CPN_ID = CNS.CPN_ID
+		             AND    CNS.BENEFIT_GB = 'C'
+		             LEFT   OUTER JOIN TB_COUPON_BAN_GOODS CG
+		             ON     CG.GOODS_CD = C.GOODS_CD
+		             AND    CG.DEL_YN = 'N'
+		             WHERE  1=1
+		             AND    CNS.CPN_ID IS NULL
+		             AND    CG.GOODS_CD IS NULL
+		             AND    G.GOODS_STAT = 'G008_90'
+		             AND    C.CART_GB = 'G026_BC'
+		             AND    C.CUST_NO > 0
+		       ) A
+		ON     CT.CUST_NO = A.CUST_NO
+		INNER  JOIN TB_COUPON_CUST_GRADE CCG
+		ON     A.CPN_ID = CCG.CPN_ID
+		AND    CT.CUST_GRADE = CCG.USABLE_CUST_GRADE
+		GROUP  BY CT.CUST_NO
+		     , CT.CELL_PHNNO
+	</select>
+
+	<!-- 장바구니 혜택추가 송부 이력 저장 -->
+	<insert id="createCouponNoticeSended" parameterType="Order">
+		/* TsbCart.createCouponNoticeSended : 장바구니 혜택추가 송부 이력 저장 */
+		INSERT INTO TB_COUPON_NOTICE_SENDED (
+		      BENEFIT_GB
+		    , CPN_ID
+		    , REG_NO
+		    , REG_DT
+		) VALUES (
+		      #{benefitGb}
+		    , #{cpnId}
+		    , #{regNo}
+		    , NOW()
+		)
+	</insert>
 </mapper>

+ 2 - 0
src/main/resources/config/application.yml

@@ -82,6 +82,8 @@ cron:
         deposit.deadline.expire: 2 22 2 29 2 ?  #무통장입금 입금기한 만료건 주문 취소
         gift.deadline.expire: 2 22 2 29 2 ?     #선물하기 배송지 등록기한 만료건 주문 취소
         pg.kcp.settle.receive: 2 22 2 29 2 ?    #KCP PG 정산 데이터 수신
+        cart.unpurchase.push: 2 22 2 29 2 ?     #장바구니 미구매 확인(삭제 10일 전) 푸시 송부
+        cart.benefit.push: 2 22 2 29 2 ?        #장바구니 혜택 추가 푸시
 
     #네이버페이
     naverPay.order.batch: 2 22 2 29 2 ?        # 네이버페이 배치 실행