From af63efdfd4b82e1efa995992768c2f283fa6d98f Mon Sep 17 00:00:00 2001
From: Cui Zhi Feng <7426394+wuxixiaocui@user.noreply.gitee.com>
Date: 星期三, 04 九月 2024 15:43:04 +0800
Subject: [PATCH] 优惠券使用
---
src/main/java/com/mzl/flower/service/coupon/CouponRecordService.java | 40 +++++++++++++++++++++++++++++++++++++++-
1 files changed, 39 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/mzl/flower/service/coupon/CouponRecordService.java b/src/main/java/com/mzl/flower/service/coupon/CouponRecordService.java
index b55d1e1..530dc08 100644
--- a/src/main/java/com/mzl/flower/service/coupon/CouponRecordService.java
+++ b/src/main/java/com/mzl/flower/service/coupon/CouponRecordService.java
@@ -6,6 +6,8 @@
import com.mzl.flower.dto.response.coupon.CouponRecordVO;
import com.mzl.flower.entity.coupon.CouponRecordDO;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
import java.util.List;
/**
@@ -40,7 +42,7 @@
* 根据当月日期设置上个月的日期的优惠券过期
* @return
*/
- boolean expiredCouponRecordByListCurMonth();
+ boolean expiredCouponRecordLastMon();
Integer statisCouponTemplateCount(QueryCouponStatisticsBO queryCouponStatisticsBO);
@@ -66,4 +68,40 @@
List<CouponRecordVO> getMineCouponRecordList(QueryMineCouponRecordDTO dto);
+ /**
+ * 检查优惠券是否到期
+ * @param dto
+ */
+ void checkCouponExpired(QueryMineCouponRecordDTO dto);
+
+ boolean checkCurMonVipCouponExists(String couponId, Long customId, LocalDateTime startDateTime,LocalDateTime endDateTime);
+
+
+ /**
+ * 优惠券的使用
+ * @param couponId 优惠券ID
+ * @param orderId 订单的ID
+ * @param orderMount 订单的金额
+ * @return
+ */
+ boolean useCoupon(String couponId, String orderId, BigDecimal orderMount);
+
+ /**
+ * 优惠券退单
+ * @param orderId
+ * @return
+ */
+ boolean cancelCouponUsage(String orderId);
+
+ /**
+ * 根据订单号查找优惠券信息
+ * @param orderId
+ * @return
+ */
+ List<CouponRecordDO> getCouponListByOrderId(String orderId) ;
+
+
+ CouponRecordDO getCouponByOrderId(String orderId) ;
+
+
}
--
Gitblit v1.9.3