兑换码优化
This commit is contained in:
@@ -1,66 +0,0 @@
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.util.List;
|
||||
* @author Administrator
|
||||
*/
|
||||
@Data
|
||||
public class MkCouponRedemptionConfigDTO implements Serializable {
|
||||
public class MkRedemptionConfigDTO implements Serializable {
|
||||
|
||||
|
||||
@NotNull(message = "id不能为空", groups = UpdateGroup.class)
|
||||
@@ -26,6 +26,12 @@ public class MkCouponRedemptionConfigDTO implements Serializable {
|
||||
@NotBlank(message = "名称不能为空")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 赠送金额
|
||||
*/
|
||||
@DecimalMin(value = "0.01", message = "赠送金额不能小于0.01")
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 券信息
|
||||
*/
|
||||
@@ -1,85 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
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;
|
||||
|
||||
@Column(ignore = true)
|
||||
private Integer status;
|
||||
}
|
||||
@@ -25,9 +25,9 @@ import lombok.experimental.Accessors;
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("mk_coupon_redemption_code")
|
||||
@Table("mk_redemption_code")
|
||||
@Accessors(chain = true)
|
||||
public class MkCouponRedemptionCode implements Serializable {
|
||||
public class MkRedemptionCode implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -9,7 +9,6 @@ import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -26,8 +25,8 @@ import lombok.NoArgsConstructor;
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("mk_coupon_redemption_config")
|
||||
public class MkCouponRedemptionConfig implements Serializable {
|
||||
@Table("mk_redemption_config")
|
||||
public class MkRedemptionConfig implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -40,6 +39,8 @@ public class MkCouponRedemptionConfig implements Serializable {
|
||||
*/
|
||||
private String name;
|
||||
|
||||
private BigDecimal amount;
|
||||
|
||||
|
||||
/**
|
||||
* 券信息
|
||||
@@ -89,4 +90,6 @@ public class MkCouponRedemptionConfig implements Serializable {
|
||||
@Column(ignore = true)
|
||||
private int status;
|
||||
|
||||
private Integer type;
|
||||
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package com.czg.market.service;
|
||||
|
||||
import com.czg.market.dto.MkCouponRedemptionConfigDTO;
|
||||
import com.czg.market.dto.MkRedemptionDTO;
|
||||
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, Long id);
|
||||
|
||||
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);
|
||||
|
||||
void exchange(long userId, MkRedemptionDTO dto);
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
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> {
|
||||
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package com.czg.market.service;
|
||||
|
||||
import com.czg.market.dto.MkRechargeRedemptionConfigDTO;
|
||||
import com.czg.market.dto.MkRedemptionDTO;
|
||||
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);
|
||||
|
||||
void exchange(long userId, MkRedemptionDTO dto);
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.czg.market.service;
|
||||
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.market.entity.MkCouponRedemptionCode;
|
||||
import com.czg.market.entity.MkRedemptionCode;
|
||||
|
||||
/**
|
||||
* 兑换码明细 服务层。
|
||||
@@ -9,6 +9,6 @@ import com.czg.market.entity.MkCouponRedemptionCode;
|
||||
* @author zs
|
||||
* @since 2025-10-22
|
||||
*/
|
||||
public interface MkCouponRedemptionCodeService extends IService<MkCouponRedemptionCode> {
|
||||
public interface MkRedemptionCodeService extends IService<MkRedemptionCode> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.czg.market.service;
|
||||
|
||||
import com.czg.market.dto.MkRedemptionConfigDTO;
|
||||
import com.czg.market.dto.MkRedemptionDTO;
|
||||
import com.czg.market.vo.MkRedemptionCodeVO;
|
||||
import com.czg.market.vo.MkRedemptionConfigVO;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.market.entity.MkRedemptionConfig;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 充值优惠券修改 服务层。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-10-22
|
||||
*/
|
||||
public interface MkRedemptionConfigService extends IService<MkRedemptionConfig> {
|
||||
MkRedemptionConfigVO detail(Long mainShopId, Long id);
|
||||
|
||||
Boolean edit(Long shopId, MkRedemptionConfigDTO dto, boolean isRecharge);
|
||||
|
||||
boolean add(Long mainShopId, MkRedemptionConfigDTO dto, boolean isRecharge);
|
||||
|
||||
Page<MkRedemptionConfigVO> pageInfo(Long mainShopId, Integer status, boolean isRecharge);
|
||||
|
||||
Page<MkRedemptionCodeVO> codeList(Long mainShopId, Long id, String code, Integer status, boolean isRecharge);
|
||||
|
||||
void exportCodeList(Long mainShopId, Long redemptionId, String code, Integer status, HttpServletResponse response, HttpServletRequest request, boolean isRecharge);
|
||||
|
||||
void exchange(long userId, MkRedemptionDTO dto);
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
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 {
|
||||
|
||||
}
|
||||
@@ -23,7 +23,7 @@ import java.time.LocalDateTime;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class MkCouponRedemptionCodeVO implements Serializable {
|
||||
public class MkRedemptionCodeVO implements Serializable {
|
||||
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
@@ -1,12 +1,10 @@
|
||||
package com.czg.market.vo;
|
||||
|
||||
import com.czg.market.dto.CouponInfoDTO;
|
||||
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;
|
||||
@@ -18,7 +16,7 @@ import java.util.List;
|
||||
* @author Administrator
|
||||
*/
|
||||
@Data
|
||||
public class MkCouponRedemptionConfigVO implements Serializable {
|
||||
public class MkRedemptionConfigVO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -78,4 +76,7 @@ public class MkCouponRedemptionConfigVO implements Serializable {
|
||||
|
||||
@Column(ignore = true)
|
||||
private Integer status;
|
||||
|
||||
private BigDecimal amount;
|
||||
private Integer type;
|
||||
}
|
||||
Reference in New Issue
Block a user