提交 a6c3bf44 authored 作者: YunaiV's avatar YunaiV

后端:优惠劵模板 + 优惠劵的表结构

上级 6ca3fc8f
package cn.iocoder.mall.promotion.biz.dataobject; package cn.iocoder.mall.promotion.biz.dataobject;
import cn.iocoder.common.framework.dataobject.BaseDO;
import java.util.Date; import java.util.Date;
/** /**
* 优惠劵 * 优惠劵 DO
*/ */
public class Coupon { public class CouponDO extends BaseDO {
// ========== 基本信息 BEGIN ========== // ========== 基本信息 BEGIN ==========
/** /**
* 卡券ID * 优惠劵(码)编号
*/ */
private Integer id; private Integer id;
/**
* 店铺编号
*/
private Integer shopId;
/** /**
* 类型 * 类型
* *
...@@ -24,17 +22,13 @@ public class Coupon { ...@@ -24,17 +22,13 @@ public class Coupon {
*/ */
private Integer type; private Integer type;
/** /**
* 优惠劵(码)分组编号,{@link CouponTemplate} 的 id * 优惠劵(码)分组编号,{@link CouponTemplateDO} 的 id
*/
private Integer couponGroupId;
/**
* 核销码
*/
private String verifyCode;
/**
* 创建时间
*/ */
private Date createTime; private Integer templateId;
// /**
// * 核销码
// */
// private String verifyCode;
/** /**
* 优惠码状态 * 优惠码状态
* *
...@@ -43,6 +37,8 @@ public class Coupon { ...@@ -43,6 +37,8 @@ public class Coupon {
* 3-已过期 * 3-已过期
* 4-已删除 * 4-已删除
* 5-已使用 * 5-已使用
*
* TODO 需要讨论下
*/ */
private Integer status; private Integer status;
...@@ -52,7 +48,7 @@ public class Coupon { ...@@ -52,7 +48,7 @@ public class Coupon {
/** /**
* 是否领取 * 是否领取
*/ */
private Boolean isTake; private Boolean taked;
/** /**
* 领取用户编号 * 领取用户编号
*/ */
...@@ -61,6 +57,13 @@ public class Coupon { ...@@ -61,6 +57,13 @@ public class Coupon {
* 领取时间 * 领取时间
*/ */
private Date takeTime; private Date takeTime;
/**
* 领取类型
*
* 1 - 用户主动领取
* 2 - 后台自动发放
*/
private Integer takeType;
// ========== 领取情况 END ========== // ========== 领取情况 END ==========
// ========== 使用规则 BEGIN ========== // ========== 使用规则 BEGIN ==========
...@@ -79,32 +82,38 @@ public class Coupon { ...@@ -79,32 +82,38 @@ public class Coupon {
* 优惠类型 * 优惠类型
* *
* 1-代金卷 * 1-代金卷
* 2-折扣卷 【优惠劵独有】 * 2-折扣卷
*/ */
private Integer preferentialType; private Integer preferentialType;
/** /**
* 折扣 * 折扣
*/ */
private Double discount; private Double percentOff;
/** /**
* 优惠金额,单位:分。 * 优惠金额,单位:分。
*/ */
private Integer value; private Integer priceOff;
/**
* 折扣上限,仅在 {@link #preferentialType} 等于 2 时生效。
*
* 例如,折扣上限为 20 元,当使用 8 折优惠券,订单金额为 1000 元时,最高只可折扣 20 元,而非 80 元。
*/
private Integer discountPriceLimit;
// ========== 使用效果 END ========== // ========== 使用效果 END ==========
// ========== 使用情况 BEGIN ========== // ========== 使用情况 BEGIN ==========
/** /**
* 是否使用 * 是否使用
*/ */
private Boolean isUsed; private Boolean used;
/** /**
* 使用订单号 * 使用订单号
*/ */
private String usedInTid; private String usedOrderId;
/** /**
* 订单中优惠面值,单位:分 * 订单中优惠面值,单位:分
*/ */
private Integer usedValue; private Integer usedPrice;
/** /**
* 使用时间 * 使用时间
*/ */
......
package cn.iocoder.mall.promotion.biz.dataobject; package cn.iocoder.mall.promotion.biz.dataobject;
import cn.iocoder.common.framework.dataobject.BaseDO;
import java.util.Date; import java.util.Date;
/** /**
* 优惠劵(码)模板 * 优惠劵(码)模板 DO
* *
* 当用户领取时,会生成 {@link Coupon} 优惠劵(码)。 * 当用户领取时,会生成 {@link CouponDO} 优惠劵(码)。
*/ */
public class CouponTemplate { public class CouponTemplateDO extends BaseDO {
// ========== 基本信息 BEGIN ========== // ========== 基本信息 BEGIN ==========
/** /**
* 编号,自增唯一。 * 模板编号,自增唯一。
*/ */
private Integer id; private Integer id;
/**
* 店铺编号
*/
private Integer shopId;
/**
* 别名
*
* 系统生成,作为唯一标识。例如,2fpa62tbmsl9h
* 可以用于生成优惠券(码)领取链接,例如,https://wap.youzan.com/v2/showcase/coupon/fetch?alias=17xcvjbd8
*/
private String alias;
/** /**
* 标题 * 标题
*/ */
...@@ -40,14 +31,6 @@ public class CouponTemplate { ...@@ -40,14 +31,6 @@ public class CouponTemplate {
* 2-优惠码 * 2-优惠码
*/ */
private Integer type; private Integer type;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/** /**
* 优惠码状态 * 优惠码状态
* *
...@@ -57,12 +40,14 @@ public class CouponTemplate { ...@@ -57,12 +40,14 @@ public class CouponTemplate {
* 4-已删除 * 4-已删除
* *
* 当优惠劵(码)有效时,可以手动操作,设置成无效。 * 当优惠劵(码)有效时,可以手动操作,设置成无效。
*
* TODO 需要讨论下
*/ */
private Integer status; private Integer status;
/** // /**
* 是否可分享领取链接 // * 是否可分享领取链接
*/ // */
private Boolean isShare; // private Boolean isShare;
/** /**
* 设置为失效时间 * 设置为失效时间
*/ */
...@@ -93,50 +78,44 @@ public class CouponTemplate { ...@@ -93,50 +78,44 @@ public class CouponTemplate {
// ========== 码信息 END ========== // ========== 码信息 END ==========
// ========== 领取规则 BEGIN ========== // ========== 领取规则 BEGIN ==========
/** // /**
* 是否限制领用者的等级 // * 是否限制领用者的等级
* // *
* 0-不限制 // * 0-不限制
* 大于0-领用者必须是这个等级编号 // * 大于0-领用者必须是这个等级编号
* // *
* 【优惠劵独有】 // * 【优惠劵独有】
*/ // */
private Integer needUserLevel; // private Integer needUserLevel;
/** /**
* 每人限领个数 * 每人限领个数
* *
* 0-则表示不限制 * null - 则表示不限制
*/ */
private Integer quota; private Integer quota;
/** /**
* 剩余可用库存 * 剩余可用库存
*
* null - 则表示无限库存
*/ */
private Integer stock; private Integer stock;
/**
* 总库存
*/
private Integer total;
/**
* 领取优惠券要给用户打上的标签的列表,使用逗号分隔标签编号
*/
private String markTags;
// ========== 领取规则 END ========== // ========== 领取规则 END ==========
// ========== 使用规则 BEGIN ========== // ========== 使用规则 BEGIN ==========
/** // /**
* 是否仅原价购买商品时可用 // * 是否仅原价购买商品时可用
* // *
* true-是 // * true-是
* false-否 // * false-否
*/ // */
private Boolean isForbidPreference; // private Boolean isForbidPreference;
/** /**
* 是否设置满多少金额可用,单位:分 * 是否设置满多少金额可用,单位:分
* *
* 0-不限制 * 0-不限制
* 大于0-多少金额可用 * 大于0-多少金额可用
*/ */
private Integer condition; private Integer priceAvailable;
/** /**
* 可用范围的类型 * 可用范围的类型
* *
...@@ -145,14 +124,14 @@ public class CouponTemplate { ...@@ -145,14 +124,14 @@ public class CouponTemplate {
*/ */
private Integer rangeType; private Integer rangeType;
/** /**
* 指定可用商品列表,使用逗号分隔商品编号 {@link cn.iocoder.doraemon.itemgroup.item.entity.Item#id} * 指定可用商品列表,使用逗号分隔商品编号
*/ */
private String rangeValues; private String rangeValues;
/** /**
* 生效日期类型 * 生效日期类型
* *
* 1-固定日期 * 1-固定日期
* 2-领取日期:领到券 {@link #fixedBeginTerm} 日开始 N 天内有效 * 2-领取日期:领到券 {@link #fixedTerm} 日开始 N 天内有效
*/ */
private Integer dateType; private Integer dateType;
/** /**
...@@ -163,23 +142,23 @@ public class CouponTemplate { ...@@ -163,23 +142,23 @@ public class CouponTemplate {
* 固定日期-生效结束时间 * 固定日期-生效结束时间
*/ */
private Date validEndTime; private Date validEndTime;
/** // /**
* 领取日期-开始天数 // * 领取日期-开始天数
* // *
* 例如,0-当天;1-次天 // * 例如,0-当天;1-次天
*/ // */
private Integer fixedBeginTerm; // private Integer fixedBeginTerm;
/** /**
* 领取日期-结束天数 * 领取日期-结束天数
*/ */
private Integer fixedTerm; private Integer fixedTerm;
/** // /**
* 是否到期前4天发送提醒 // * 是否到期前4天发送提醒
* // *
* true-发送 // * true-发送
* false-不发送 // * false-不发送
*/ // */
private Boolean expireNotice; // private Boolean expireNotice;
// ========== 使用规则 END ========== // ========== 使用规则 END ==========
// ========== 使用效果 BEGIN ========== // ========== 使用效果 BEGIN ==========
...@@ -187,92 +166,57 @@ public class CouponTemplate { ...@@ -187,92 +166,57 @@ public class CouponTemplate {
* 优惠类型 * 优惠类型
* *
* 1-代金卷 * 1-代金卷
* 2-折扣卷 【优惠劵独有】 * 2-折扣卷
*/ */
private Integer preferentialType; private Integer preferentialType;
/** /**
* 折扣。例如,80% 为 80。 * 折扣百分比。
*
*【优惠劵独有】
*/
private Integer discount;
/**
* 是否是随机优惠券
* *
* true-随机 * 例如,80% 为 80。
* false-不随机 * 当 100% 为 100 ,则代表免费。
*
* 【优惠劵独有】
*/ */
private Boolean isRandom; private Integer percentOff;
// /**
// * 是否是随机优惠券
// *
// * true-随机
// * false-不随机
// *
// * 【优惠劵独有】
// */
// private Boolean isRandom;
/** /**
* 优惠金额,单位:分 * 优惠金额,单位:分
*
* 当 {@link #isRandom} 为 true 时,代表随机优惠金额的下限
*/ */
private Integer value; // * 当 {@link #isRandom} 为 true 时,代表随机优惠金额的下限
private Integer priceOff;
// /**
// * 优惠金额上限
// *
// * 【优惠劵独有】
// */
// private Integer valueRandomTo;
/** /**
* 优惠金额上限 * 折扣上限,仅在 {@link #preferentialType} 等于 2 时生效。
* *
* 【优惠劵独有】 * 例如,折扣上限为 20 元,当使用 8 折优惠券,订单金额为 1000 元时,最高只可折扣 20 元,而非 80 元。
*/ */
private Integer valueRandomTo; private Integer discountPriceLimit;
// ========== 使用效果 END ========== // ========== 使用效果 END ==========
// ========== 统计信息 BEGIN ========== // // ========== 统计信息 BEGIN ==========
/** // /**
* 领取优惠券的人数 // * 领取优惠券的人数
*/ // */
private Integer statFetchUserNum; // private Integer statFetchUserNum;
/** // /**
* 领取优惠券的次数 // * 领取优惠券的次数
*/ // */
private Integer statFetchNum; // private Integer statFetchNum;
/** // /**
* 使用优惠券的次数 // * 使用优惠券的次数
*/ // */
private Integer statUseNum; // private Integer statUseNum;
// ========== 统计信息 END ========== // // ========== 统计信息 END ==========
// ========== 微信卡卷 BEGIN ==========
/**
* 是否同步微信卡券
*
* true-是
* false-否
*/
private Boolean isSyncWeixin;
/**
* 同步微信卡券,选择的卡券颜色的值。
*
* 例如,Color10
*/
private String weixinColor;
/**
* 同步微信卡券,选择的卡券颜色的RGB值
*
* 例如,#ffaaff
*/
private String weixinColorRGB;
/**
* 同步微信卡券,卡券的标题
*/
private String weixinTitle;
/**
* 同步微信卡券,卡券的副标题
*/
private String weixinSubTitle;
/**
* 同步微信卡券,卡券的客服电话
*/
private String servicePhone;
/**
* 同步微信卡券,设置是否可以转赠
*
* true-可以
* false-不可以
*/
private Boolean canGiveFriend;
// ========== 微信卡卷 END ==========
} }
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论