|
|
@@ -1,6 +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;
|
|
|
@@ -27,6 +28,9 @@ public class TscPointService {
|
|
|
@Autowired
|
|
|
private TscEnvsetService envsetService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TscOrderService orderService;
|
|
|
+
|
|
|
/**
|
|
|
* 포인트 적립
|
|
|
* @param point - 포인트 정보
|
|
|
@@ -61,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);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|