券兑换码相关接口
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
package com.czg.market.dto;
|
||||
|
||||
import com.czg.validator.group.UpdateGroup;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.*;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
@Data
|
||||
public class MkCouponRedemptionConfigDTO implements Serializable {
|
||||
|
||||
|
||||
@NotNull(message = "id不能为空", groups = UpdateGroup.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@NotBlank(message = "名称不能为空")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 券信息
|
||||
*/
|
||||
@Valid
|
||||
private List<CouponInfoDTO> couponInfoList;
|
||||
|
||||
/**
|
||||
* 库存
|
||||
*/
|
||||
private Integer stock;
|
||||
|
||||
/**
|
||||
* 总数
|
||||
*/
|
||||
@Min(value = 0, message = "总数不能小于0")
|
||||
@NotNull(message = "总数不能为空")
|
||||
@Max(value = 1000, message = "总数不能大于1000")
|
||||
private Integer total;
|
||||
|
||||
/**
|
||||
* 可用开始时间
|
||||
*/
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 可用结束时间
|
||||
*/
|
||||
private LocalDateTime endTime;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.czg.market.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 兑换码明细 实体类。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-10-22
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("mk_coupon_redemption_code")
|
||||
@Accessors(chain = true)
|
||||
public class MkCouponRedemptionCode implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 兑换配置id
|
||||
*/
|
||||
private Long redemptionId;
|
||||
|
||||
/**
|
||||
* 主店id
|
||||
*/
|
||||
private Long mainShopId;
|
||||
|
||||
/**
|
||||
* 兑换时间
|
||||
*/
|
||||
private LocalDateTime redemptionTime;
|
||||
|
||||
/**
|
||||
* 0未兑换 1已兑换
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 店铺用户id
|
||||
*/
|
||||
private Long shopUserId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
private String code;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.czg.market.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 充值优惠券修改 实体类。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-10-22
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("mk_coupon_redemption_config")
|
||||
public class MkCouponRedemptionConfig implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
|
||||
/**
|
||||
* 券信息
|
||||
*/
|
||||
private String couponInfoList;
|
||||
/**
|
||||
* 库存
|
||||
*/
|
||||
private Integer stock;
|
||||
|
||||
/**
|
||||
* 总数
|
||||
*/
|
||||
private Integer total;
|
||||
|
||||
/**
|
||||
* 可用开始时间
|
||||
*/
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 可用结束时间
|
||||
*/
|
||||
private LocalDateTime endTime;
|
||||
|
||||
/**
|
||||
* 门店id
|
||||
*/
|
||||
private Long mainShopId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private Integer isEnable;
|
||||
@Column(ignore = true)
|
||||
private int status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.czg.market.service;
|
||||
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.market.entity.MkCouponRedemptionCode;
|
||||
|
||||
/**
|
||||
* 兑换码明细 服务层。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-10-22
|
||||
*/
|
||||
public interface MkCouponRedemptionCodeService extends IService<MkCouponRedemptionCode> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.czg.market.service;
|
||||
|
||||
import com.czg.market.dto.MkCouponRedemptionConfigDTO;
|
||||
import com.czg.market.vo.MkCouponRedemptionCodeVO;
|
||||
import com.czg.market.vo.MkCouponRedemptionConfigVO;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.market.entity.MkCouponRedemptionConfig;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 充值优惠券修改 服务层。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-10-22
|
||||
*/
|
||||
public interface MkCouponRedemptionConfigService extends IService<MkCouponRedemptionConfig> {
|
||||
MkCouponRedemptionConfigVO detail(Long mainShopId);
|
||||
|
||||
Boolean edit(Long shopId, MkCouponRedemptionConfigDTO dto);
|
||||
|
||||
boolean add(Long mainShopId, MkCouponRedemptionConfigDTO dto);
|
||||
|
||||
Page<MkCouponRedemptionConfigVO> pageInfo(Long mainShopId, Integer status);
|
||||
|
||||
Page<MkCouponRedemptionCodeVO> codeList(Long mainShopId, Long id, String code, Integer status);
|
||||
|
||||
void exportCodeList(Long mainShopId, Long redemptionId, String code, Integer status, HttpServletResponse response, HttpServletRequest request);
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.czg.market.vo;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 兑换码明细 实体类。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-10-21
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class MkCouponRedemptionCodeVO implements Serializable {
|
||||
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 兑换配置id
|
||||
*/
|
||||
private Long redemptionId;
|
||||
|
||||
/**
|
||||
* 主店id
|
||||
*/
|
||||
private Long mainShopId;
|
||||
|
||||
/**
|
||||
* 兑换时间
|
||||
*/
|
||||
private LocalDateTime redemptionTime;
|
||||
|
||||
/**
|
||||
* 0未兑换 1已兑换
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 店铺用户id
|
||||
*/
|
||||
private Long shopUserId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 兑换码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
private String nickName;
|
||||
/**
|
||||
* 用户手机号
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.czg.market.vo;
|
||||
|
||||
import com.czg.market.entity.MkRechargeRedemptionConfig;
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
@Data
|
||||
public class MkCouponRedemptionConfigVO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 赠送金额
|
||||
*/
|
||||
private List<CouponInfoVO> couponInfoList;
|
||||
/**
|
||||
* 优惠券数量
|
||||
*/
|
||||
private int couponNum;
|
||||
|
||||
/**
|
||||
* 库存
|
||||
*/
|
||||
private Integer stock;
|
||||
|
||||
/**
|
||||
* 总数
|
||||
*/
|
||||
private Integer total;
|
||||
|
||||
/**
|
||||
* 可用开始时间
|
||||
*/
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 可用结束时间
|
||||
*/
|
||||
private LocalDateTime endTime;
|
||||
|
||||
/**
|
||||
* 门店id
|
||||
*/
|
||||
private Long mainShopId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@Column(ignore = true)
|
||||
private Integer status;
|
||||
}
|
||||
@@ -26,10 +26,8 @@ public interface TableValueConstant {
|
||||
interface EnableConfig {
|
||||
@Getter
|
||||
enum Type {
|
||||
RECHARGE_REDEMPTION("RECHARGE_REDEMPTION", "充值兑换"),
|
||||
PAY("PAY", "购买会员增积分"),
|
||||
MEMBER_TASK("MEMBER_TASK", "会员周奖励"),
|
||||
COST("COST", "消费增积分");
|
||||
RECHARGE_REDEMPTION("recharge_redemption", "充值兑换"),
|
||||
COUPON_REDEMPTION("coupon_redemption", "券兑换");
|
||||
private final String code;
|
||||
private final String msg;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user