超级会员购买相关
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
|
||||
package com.czg.market.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import java.io.Serial;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 会员经验值流水表 实体类。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-09-12
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MemberExpFlowDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 类型 + -
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 来源类型 COST消费赠送 RECHARGE充值
|
||||
*/
|
||||
private String sourceType;
|
||||
|
||||
/**
|
||||
* 赠送数量
|
||||
*/
|
||||
private Integer value;
|
||||
|
||||
/**
|
||||
* 来源id
|
||||
*/
|
||||
private Long sourceId;
|
||||
|
||||
private Long userId;
|
||||
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -34,7 +34,7 @@ public class MemberLevelDTO {
|
||||
*/
|
||||
@Min(value = 0, message = "成长值不能小于0")
|
||||
@NotNull(message = "成长值不为空")
|
||||
private Long experienceValue;
|
||||
private Integer experienceValue;
|
||||
|
||||
/**
|
||||
* 会员折扣
|
||||
@@ -63,8 +63,10 @@ public class MemberLevelDTO {
|
||||
/**
|
||||
* 周期时间包含周 月 年 日
|
||||
*/
|
||||
@NotBlank(message = "周期时间不为空", groups = MemberLevelCycleRewardGroup.class)
|
||||
private String cycleTime;
|
||||
@NotNull(message = "周期时间不为空", groups = MemberLevelCycleRewardGroup.class)
|
||||
private Integer cycleTime;
|
||||
@NotBlank(message = "周期单位不为空", groups = MemberLevelCycleRewardGroup.class)
|
||||
private String cycleUnit;
|
||||
|
||||
/**
|
||||
* 赠送积分
|
||||
@@ -75,7 +77,13 @@ public class MemberLevelDTO {
|
||||
/**
|
||||
* 优惠券列表
|
||||
*/
|
||||
private List<ShopCoupon> cycleRewardCouponList;
|
||||
|
||||
private List<ConfigCoupon> cycleRewardCouponList;
|
||||
|
||||
@Data
|
||||
public static class ConfigCoupon {
|
||||
@Min(value = 1, message = "数量不能小于1")
|
||||
private Integer num;
|
||||
private ShopCoupon coupon;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 会员经验值流水表 实体类。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-09-12
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("tb_member_exp_flow")
|
||||
public class MemberExpFlow implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 类型 + -
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 来源类型 COST消费赠送 RECHARGE充值
|
||||
*/
|
||||
private String sourceType;
|
||||
|
||||
/**
|
||||
* 赠送数量
|
||||
*/
|
||||
private Integer value;
|
||||
|
||||
/**
|
||||
* 来源id
|
||||
*/
|
||||
private Long sourceId;
|
||||
|
||||
private Long userId;
|
||||
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
private BigDecimal money;
|
||||
|
||||
}
|
||||
@@ -46,7 +46,7 @@ public class MemberLevelConfig implements Serializable {
|
||||
/**
|
||||
* 所需成长值
|
||||
*/
|
||||
private Long experienceValue;
|
||||
private Integer experienceValue;
|
||||
|
||||
/**
|
||||
* 会员折扣
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.czg.market.service;
|
||||
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.market.entity.MemberExpFlow;
|
||||
|
||||
/**
|
||||
* 会员经验值流水表 服务层。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-09-12
|
||||
*/
|
||||
public interface MemberExpFlowService extends IService<MemberExpFlow> {
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.czg.market.service;
|
||||
|
||||
import com.czg.constant.TableValueConstant;
|
||||
import com.czg.market.dto.MemberConfigDTO;
|
||||
import com.czg.market.dto.MemberLevelDTO;
|
||||
import com.czg.market.vo.MemberConfigVO;
|
||||
@@ -40,6 +41,6 @@ public interface TbMemberConfigService extends IService<TbMemberConfig> {
|
||||
* 发放会员奖励
|
||||
* @param isCost 是否是消费 true 消费 false 充值
|
||||
*/
|
||||
boolean deliver(Long shopId, Long userId, BigDecimal money, boolean isCost);
|
||||
boolean deliver(Long shopId, Long userId, TableValueConstant.MemberExpFlow.Type type, BigDecimal money, boolean isCost);
|
||||
|
||||
}
|
||||
|
||||
@@ -8,12 +8,13 @@ import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class MemberConfigVO {
|
||||
public class MemberConfigVO implements Serializable {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
package com.czg.market.vo;
|
||||
|
||||
import com.czg.market.dto.MemberLevelDTO;
|
||||
import com.czg.market.entity.ShopCoupon;
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -11,9 +15,12 @@ import java.util.List;
|
||||
public class MemberLevelVO implements Serializable {
|
||||
|
||||
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
@@ -24,7 +31,7 @@ public class MemberLevelVO implements Serializable {
|
||||
/**
|
||||
* 所需成长值
|
||||
*/
|
||||
private Long experienceValue;
|
||||
private Integer experienceValue;
|
||||
|
||||
/**
|
||||
* 会员折扣
|
||||
@@ -59,7 +66,7 @@ public class MemberLevelVO implements Serializable {
|
||||
/**
|
||||
* 优惠券列表
|
||||
*/
|
||||
private List<ShopCoupon> cycleRewardCouponList;
|
||||
private List<MemberLevelDTO.ConfigCoupon> cycleRewardCouponList;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.czg.constant;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
public interface TableValueConstant {
|
||||
interface MemberExpFlow {
|
||||
@Getter
|
||||
enum Type {
|
||||
RECHARGE("RECHARGE", "充值增积分"),
|
||||
PAY("PAY", "购买会员增积分"),
|
||||
COST("COST", "消费增积分");
|
||||
private final String code;
|
||||
private final String msg;
|
||||
|
||||
Type(String code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user