From faf98607c46b89954997e03ff5c5f630ba357b95 Mon Sep 17 00:00:00 2001 From: xupei Date: Mon, 14 Apr 2025 13:37:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8=E6=9F=A5=E8=AF=A2DT?= =?UTF-8?q?O?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 1ce6c74f2cb79dd3ab12568fdd07fa447e3d2a1d) --- .../mapper/primary/ProductCouponsMapper.java | 8 +++ .../mapper/primary/entity/ProductCoupons.java | 49 +++++++++++++++++++ .../ai/da/model/dto/QueryCouponsPageDTO.java | 22 +++++++++ 3 files changed, 79 insertions(+) create mode 100644 src/main/java/com/ai/da/mapper/primary/ProductCouponsMapper.java create mode 100644 src/main/java/com/ai/da/mapper/primary/entity/ProductCoupons.java create mode 100644 src/main/java/com/ai/da/model/dto/QueryCouponsPageDTO.java diff --git a/src/main/java/com/ai/da/mapper/primary/ProductCouponsMapper.java b/src/main/java/com/ai/da/mapper/primary/ProductCouponsMapper.java new file mode 100644 index 00000000..f66e42a8 --- /dev/null +++ b/src/main/java/com/ai/da/mapper/primary/ProductCouponsMapper.java @@ -0,0 +1,8 @@ +package com.ai.da.mapper.primary; + +import com.ai.da.common.config.mybatis.plus.CommonMapper; +import com.ai.da.mapper.primary.entity.ProductCoupons; + +public interface ProductCouponsMapper extends CommonMapper { + +} diff --git a/src/main/java/com/ai/da/mapper/primary/entity/ProductCoupons.java b/src/main/java/com/ai/da/mapper/primary/entity/ProductCoupons.java new file mode 100644 index 00000000..66c54b0c --- /dev/null +++ b/src/main/java/com/ai/da/mapper/primary/entity/ProductCoupons.java @@ -0,0 +1,49 @@ +package com.ai.da.mapper.primary.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("t_product_coupons") +public class ProductCoupons extends BaseEntity{ + // 优惠券id + private String couponId; + // 优惠券有效期的截止日期 + private Long redeemBy; + // 绑定的推广码id + private String promotionCodeId; + // 对应的推广码 + private String promotionCode; + // 最大兑换次数 + private Integer maxRedemptions; + // 优惠券的折扣 + private float percentOff; + // 佣金比例 + private float commissionRate; + // 合作者 + private String cooperator; + // 使用了该优惠券支付的总金额 + private float totalEarnings; + // 佣金 + private float commission; + // 已付佣金 + private float paidCommission; + // 未付佣金 + private float unpaidCommission; + // 备注 + private String remark; + + public ProductCoupons() { + } + + public ProductCoupons(String couponId, Long redeemBy, String promotionCodeId, String promotionCode, float percentOff, float commissionRate) { + this.couponId = couponId; + this.redeemBy = redeemBy; + this.promotionCodeId = promotionCodeId; + this.promotionCode = promotionCode; + this.percentOff = percentOff; + this.commissionRate = commissionRate; + } +} diff --git a/src/main/java/com/ai/da/model/dto/QueryCouponsPageDTO.java b/src/main/java/com/ai/da/model/dto/QueryCouponsPageDTO.java new file mode 100644 index 00000000..3d03dfe6 --- /dev/null +++ b/src/main/java/com/ai/da/model/dto/QueryCouponsPageDTO.java @@ -0,0 +1,22 @@ +package com.ai.da.model.dto; + + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@EqualsAndHashCode(callSuper = true) +@Data +@ApiModel +public class QueryCouponsPageDTO extends QueryPageByTimeDTO { + @ApiModelProperty("DESC(按id降序) || ASC(按id升序)") + private String orderById; + @ApiModelProperty("推广码") + private String promotionCode; + @ApiModelProperty("查询过期 || 未过期的优惠券") + private Boolean isExpired; + @ApiModelProperty("按合作者名字查询") + private String cooperator; + +}