gongzuming
2024-09-19 a768dc3daa04d35fedfbe75c0a59b9b2545b85c4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
package com.mzl.flower.service.coupon;
 
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mzl.flower.dto.request.coupon.*;
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;
 
/**
 * <p>
 *  服务类
 * </p>
 *
 * @author @TaoJie
 * @since 2024-08-27
 */
public interface CouponRecordService extends IService<CouponRecordDO> {
 
    List<CouponRecordVO> getList(QueryCouponRecordDTO dto) ;
    boolean createCouponRecord(CreateCouponRecordDTO dto);
 
    boolean updateCouponRecord(CreateCouponRecordDTO dto);
 
    boolean deleteCouponRecord(String id);
 
    CouponRecordVO getCouponRecordById(String id);
 
    Page<CouponRecordVO> getPage(Page page, QueryCouponRecordDTO dto);
 
    /**
     * 会员定时任务
     * 根据会员等级定时下发刷优惠券
     * @return
     */
    boolean grantVipCouponRecordList();
 
    /**
     * 根据当月日期设置上个月的日期的优惠券过期
     * @return
     */
    boolean expiredCouponRecordLastMon();
 
    Integer statisCouponTemplateCount(QueryCouponStatisticsBO queryCouponStatisticsBO);
 
    Integer statisCouponTemplateCurMonCount(QueryCouponStatisticsBO queryCouponStatisticsBO);
 
    Integer statisCouponPointCurMonPontAmonut(QueryCouponStatisticsBO queryCouponStatisticsBO);
 
    /**
     * 根据优惠券种类,优惠券ID,用户的ID查找优惠券的记录数量
     * @param queryExistCouponDTO
     * @return
     */
    Integer getExistCouponAmount(QueryExistCouponDTO queryExistCouponDTO);
 
    /**
     * 根据优惠券的ID来查找已经领取的优惠券的数量
     * @param couponId
     * @return
     */
    Integer getExistGainCouponRecordAmountById(String couponId);
 
    Integer getUserGainCouponRecordAmountById(String couponId,Long customerId);
 
    /**
     *
     * @param couponId
     * @param userId
     * @return
     */
    Integer getUserGainCouponRecordAmountByUserId(String couponId,String userId);
 
    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) ;
 
    /**
     * 查看当前人员是否已经重复发过此优惠券
     * @param couponId
     * @param customId
     * @return
     */
    boolean checkUserCouponExists(String couponId, Long customId);
 
 
}