You've already forked FrameTour-BE
feat(pricing): 添加券码管理和使用功能
- 新增券码批次配置和券码实体 - 实现券码创建、领取、使用等接口 - 添加券码状态和优惠类型枚举 - 优化价格计算逻辑,支持券码优惠 - 新增优惠检测和应用相关功能
This commit is contained in:
@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 基础实体类
|
||||
@@ -15,7 +15,15 @@ public class BaseEntity {
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
private LocalDateTime createdTime;
|
||||
private Date createdTime;
|
||||
|
||||
private LocalDateTime updatedTime;
|
||||
private Date updatedTime;
|
||||
|
||||
private Long createBy;
|
||||
|
||||
private Long updateBy;
|
||||
|
||||
private Integer deleted;
|
||||
|
||||
private Date deletedAt;
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import com.ycwl.basic.pricing.enums.CouponStatus;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 优惠券领用记录实体
|
||||
@@ -28,12 +28,12 @@ public class PriceCouponClaimRecord extends BaseEntity {
|
||||
/**
|
||||
* 领取时间
|
||||
*/
|
||||
private LocalDateTime claimTime;
|
||||
private Date claimTime;
|
||||
|
||||
/**
|
||||
* 使用时间
|
||||
*/
|
||||
private LocalDateTime useTime;
|
||||
private Date useTime;
|
||||
|
||||
/**
|
||||
* 订单ID
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.ycwl.basic.pricing.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 券码批次配置实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("price_voucher_batch_config")
|
||||
public class PriceVoucherBatchConfig extends BaseEntity {
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 券码批次名称
|
||||
*/
|
||||
private String batchName;
|
||||
|
||||
/**
|
||||
* 景区ID
|
||||
*/
|
||||
private Long scenicId;
|
||||
|
||||
/**
|
||||
* 推客ID
|
||||
*/
|
||||
private Long brokerId;
|
||||
|
||||
/**
|
||||
* 优惠类型:0=全场免费,1=商品降价,2=商品打折
|
||||
*/
|
||||
private Integer discountType;
|
||||
|
||||
/**
|
||||
* 优惠值(降价金额或折扣百分比)
|
||||
*/
|
||||
private BigDecimal discountValue;
|
||||
|
||||
/**
|
||||
* 总券码数量
|
||||
*/
|
||||
private Integer totalCount;
|
||||
|
||||
/**
|
||||
* 已使用数量
|
||||
*/
|
||||
private Integer usedCount;
|
||||
|
||||
/**
|
||||
* 已领取数量
|
||||
*/
|
||||
private Integer claimedCount;
|
||||
|
||||
/**
|
||||
* 状态:0=禁用,1=启用
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long createBy;
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ycwl.basic.pricing.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 券码实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("price_voucher_code")
|
||||
public class PriceVoucherCode extends BaseEntity {
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 批次ID
|
||||
*/
|
||||
private Long batchId;
|
||||
|
||||
/**
|
||||
* 景区ID
|
||||
*/
|
||||
private Long scenicId;
|
||||
|
||||
/**
|
||||
* 券码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 状态:0=未领取,1=已领取未使用,2=已使用
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 领取人faceId
|
||||
*/
|
||||
private Long faceId;
|
||||
|
||||
/**
|
||||
* 领取时间
|
||||
*/
|
||||
private Date claimedTime;
|
||||
|
||||
/**
|
||||
* 使用时间
|
||||
*/
|
||||
private Date usedTime;
|
||||
|
||||
/**
|
||||
* 使用备注
|
||||
*/
|
||||
private String remark;
|
||||
}
|
||||
Reference in New Issue
Block a user