|
|
@@ -1,5 +1,7 @@
|
|
|
package com.style24.core.biz.service;
|
|
|
|
|
|
+import com.style24.core.support.env.TscConstants;
|
|
|
+import com.style24.persistence.domain.Order;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
@@ -23,6 +25,11 @@ public class TscPointService {
|
|
|
@Autowired
|
|
|
private TscPointDao pointDao;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TscEnvsetService envsetService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TscOrderService orderService;
|
|
|
|
|
|
/**
|
|
|
* 포인트 적립
|
|
|
@@ -38,12 +45,17 @@ public class TscPointService {
|
|
|
|
|
|
/**
|
|
|
* 구매확정 포인트 생성
|
|
|
- * @param Integer
|
|
|
+ * @param point
|
|
|
* @return int
|
|
|
* @author card007
|
|
|
* @since 2021. 02. 17
|
|
|
*/
|
|
|
+ @Transactional("shopTxnManager")
|
|
|
public int createOrderDecisionPoint(Point point) {
|
|
|
+ // 구매포인트소멸기한(일)
|
|
|
+ int expireDays = envsetService.getBuyPointExpireDays(TscConstants.Site.STYLE24.value());
|
|
|
+ point.setBuyPointExpireDays(expireDays);
|
|
|
+
|
|
|
// 구매확정 포인트 생성
|
|
|
pointDao.createOrderDecisionPoint(point);
|
|
|
// 구매확정 포인트 히스토리 수정
|
|
|
@@ -53,4 +65,33 @@ public class TscPointService {
|
|
|
return pointDao.getOrderDecisionPoint(point);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 자동 구매확정 포인트 생성
|
|
|
+ *
|
|
|
+ * @param point - 고객번호, 주문번호, 주문상세번호
|
|
|
+ * @author jsshin
|
|
|
+ * @since 2021. 04. 21
|
|
|
+ */
|
|
|
+ @Transactional("shopTxnManager")
|
|
|
+ public void saveAutoPurchaseConfirmation(Point point) {
|
|
|
+ // 1.구매포인트소멸기한(일)
|
|
|
+ int expireDays = envsetService.getBuyPointExpireDays(TscConstants.Site.STYLE24.value());
|
|
|
+ point.setBuyPointExpireDays(expireDays);
|
|
|
+
|
|
|
+ // 2.구매확정 포인트 생성
|
|
|
+ pointDao.createOrderDecisionPoint(point);
|
|
|
+ // 3.구매확정 포인트 히스토리 수정
|
|
|
+ pointDao.updateOrderDecisionPointHst(point);
|
|
|
+
|
|
|
+ // 4.주문상세 상태 변경 및 히스토리 생성
|
|
|
+ Order order = new Order();
|
|
|
+ order.setOrdDtlStat(TscConstants.OrderDetailStat.PURCHASE_CONFIRM.value());
|
|
|
+ order.setOrdNo(point.getOrdNo());
|
|
|
+ order.setOrdDtlNo(point.getOrdDtlNo());
|
|
|
+ order.setRegNo(point.getRegNo());
|
|
|
+ order.setUpdNo(point.getUpdNo());
|
|
|
+ orderService.saveOrdDtlStat(order);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|