充值兑换码相关接口
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
package com.czg.market.dto;
|
||||
|
||||
import com.czg.market.entity.ShopCoupon;
|
||||
import com.czg.validator.group.UpdateGroup;
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
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 MkRechargeRedemptionConfigDTO implements Serializable {
|
||||
|
||||
|
||||
@NotNull(message = "id不能为空", groups = UpdateGroup.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@NotBlank(message = "名称不能为空")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 赠送金额
|
||||
*/
|
||||
@NotNull(message = "赠送金额不能为空")
|
||||
@DecimalMin(value = "0.01", message = "赠送金额不能小于0.01")
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 库存
|
||||
*/
|
||||
|
||||
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,62 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 兑换码明细 实体类。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-10-21
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("mk_enable_config")
|
||||
public class MkEnableConfig implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 主店id
|
||||
*/
|
||||
private Long mainShopId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 模块类型
|
||||
*/
|
||||
private String type;
|
||||
|
||||
private Integer isEnable;
|
||||
|
||||
private Long shopId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
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-21
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("mk_recharge_redemption_code")
|
||||
@Accessors(chain = true)
|
||||
public class MkRechargeRedemptionCode 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,86 @@
|
||||
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 lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 充值优惠券修改 实体类。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-10-21
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("mk_recharge_redemption_config")
|
||||
@Accessors(chain = true)
|
||||
public class MkRechargeRedemptionConfig implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 赠送金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 库存
|
||||
*/
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.czg.market.service;
|
||||
|
||||
import com.czg.constant.TableValueConstant;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.market.entity.MkEnableConfig;
|
||||
|
||||
/**
|
||||
* 兑换码明细 服务层。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-10-21
|
||||
*/
|
||||
public interface MkEnableConfigService extends IService<MkEnableConfig> {
|
||||
|
||||
Boolean upEnable(Long mainShopId, Long shopId, Integer enable, TableValueConstant.EnableConfig.Type type);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.czg.market.service;
|
||||
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.market.entity.MkRechargeRedemptionCode;
|
||||
|
||||
/**
|
||||
* 兑换码明细 服务层。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-10-21
|
||||
*/
|
||||
public interface MkRechargeRedemptionCodeService extends IService<MkRechargeRedemptionCode> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.czg.market.service;
|
||||
|
||||
import com.czg.market.dto.MkRechargeRedemptionConfigDTO;
|
||||
import com.czg.market.vo.MkRechargeRedemptionCodeVO;
|
||||
import com.czg.market.vo.MkRechargeRedemptionConfigVO;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.market.entity.MkRechargeRedemptionConfig;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 充值优惠券修改 服务层。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-10-21
|
||||
*/
|
||||
public interface MkRechargeRedemptionConfigService extends IService<MkRechargeRedemptionConfig> {
|
||||
|
||||
MkRechargeRedemptionConfigVO detail(Long mainShopId);
|
||||
|
||||
Boolean edit(Long shopId, MkRechargeRedemptionConfigDTO dto);
|
||||
|
||||
boolean add(Long mainShopId, MkRechargeRedemptionConfigDTO dto);
|
||||
|
||||
Page<MkRechargeRedemptionConfig> pageInfo(Long mainShopId, Integer status);
|
||||
|
||||
Page<MkRechargeRedemptionCodeVO> 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,89 @@
|
||||
package com.czg.market.vo;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 兑换码明细 实体类。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-10-21
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class MkRechargeRedemptionCodeVO 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,25 @@
|
||||
package com.czg.market.vo;
|
||||
|
||||
import com.czg.market.dto.MemberConfigDTO;
|
||||
import com.czg.market.entity.MkRechargeRedemptionConfig;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.DecimalMin;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class MkRechargeRedemptionConfigVO extends MkRechargeRedemptionConfig implements Serializable {
|
||||
|
||||
}
|
||||
@@ -22,6 +22,23 @@ public interface TableValueConstant {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
interface EnableConfig {
|
||||
@Getter
|
||||
enum Type {
|
||||
RECHARGE_REDEMPTION("RECHARGE_REDEMPTION", "充值兑换"),
|
||||
PAY("PAY", "购买会员增积分"),
|
||||
MEMBER_TASK("MEMBER_TASK", "会员周奖励"),
|
||||
COST("COST", "消费增积分");
|
||||
private final String code;
|
||||
private final String msg;
|
||||
|
||||
Type(String code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
interface ConsumeDiscount {
|
||||
|
||||
Reference in New Issue
Block a user