feat(pricing): 实现优惠券打印功能

- 新增 AppVoucherController 控制器处理打印请求
- 实现 VoucherPrintService 接口和 VoucherPrintServiceImpl 实现类
- 添加 VoucherPrintReq 请求对象和 VoucherPrintResp 响应对象
- 创建 VoucherPrintRecord 实体和对应的 Mapper
- 更新 PriceVoucherCodeMapper 接口,添加随机获取未打印券码的方法
- 实现分布式锁机制防止重复打印- 生成流水号并记录打印状态
This commit is contained in:
2025-08-24 01:16:16 +08:00
parent 4c794cdda2
commit 0204b3bc23
12 changed files with 616 additions and 11 deletions

View File

@@ -0,0 +1,70 @@
package com.ycwl.basic.pricing.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
/**
* 优惠券打印记录实体
*/
@Data
@TableName("voucher_print_record")
public class VoucherPrintRecord {
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 流水号
*/
private String code;
/**
* 用户faceId
*/
private Long faceId;
/**
* 经纪人ID
*/
private Long brokerId;
/**
* 景区ID
*/
private Long scenicId;
/**
* 券码ID
*/
private Long voucherCodeId;
/**
* 券码
*/
private String voucherCode;
/**
* 打印状态:0=待打印,1=打印成功,2=打印失败
*/
private Integer printStatus;
/**
* 错误信息
*/
private String errorMessage;
@TableField("create_time")
private Date createTime;
@TableField("update_time")
private Date updateTime;
private Integer deleted;
private Date deletedAt;
}