Prechádzať zdrojové kódy

자동구매확정 포인트 지급 및 주문상세 상태 변경 추가

jsshin 5 rokov pred
rodič
commit
f424b68bc6

+ 11 - 3
src/main/java/com/style24/core/biz/service/TscOrderService.java

@@ -2072,9 +2072,18 @@ public class TscOrderService {
 		orderDao.createOrderDetailAllHst(order);
 		
 	}
-	
-	
 
+	/**
+	 * 주문상세상태 변경 및 이력 생성
+	 * @param order - 고객번호, 주문번호, 주문상세번호
+	 * @author jsshin
+	 * @since 2021. 04. 21
+	 */
+	@Transactional("shopTxnManager")
+	public void saveOrdDtlStat(Order order) {
+		orderDao.changedOrdDtlStat(order);
+		orderDao.createOrderDetailHst(order);
+	}
 }
 
 
@@ -2094,4 +2103,3 @@ public class TscOrderService {
 
 
 
-

+ 33 - 0
src/main/java/com/style24/core/biz/service/TscPointService.java

@@ -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);
+
+	}
+
 }