消费返现相关
This commit is contained in:
@@ -7,6 +7,7 @@ import com.mybatisflex.annotation.Table;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
@@ -24,6 +25,7 @@ import java.time.LocalDateTime;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("tb_shop_info")
|
||||
@Accessors(chain = true)
|
||||
public class ShopInfo implements Serializable {
|
||||
|
||||
@Serial
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
|
||||
package com.czg.market.dto;
|
||||
|
||||
import com.czg.market.entity.MkConsumeCashbackStep;
|
||||
import com.czg.market.entity.MkConsumeDiscountRandom;
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
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 zs
|
||||
* @since 2025-09-16
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MkConsumeCashbackDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* all 全部可用 part部分门店可用
|
||||
*/
|
||||
@NotBlank(message = "适用门店不为空")
|
||||
private String useType;
|
||||
|
||||
/**
|
||||
* 门店列表
|
||||
*/
|
||||
@NotEmpty(message = "门店列表不为空")
|
||||
private List<Long> shopIdList;
|
||||
|
||||
/**
|
||||
* 适用用户 all全部用户 new新用户 vip会员
|
||||
*/
|
||||
@NotBlank(message = "适用用户不为空")
|
||||
private String applicableUser;
|
||||
|
||||
/**
|
||||
* 返现类型 percentage比例 fix固定
|
||||
*/
|
||||
@NotBlank(message = "返现类型不为空")
|
||||
private String cashbackType;
|
||||
|
||||
/**
|
||||
* 返现配置
|
||||
*/
|
||||
@Valid
|
||||
private List<MkConsumeCashbackStep> cashbackStepList;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
@NotNull
|
||||
private Integer isEnable;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
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-13
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("mk_consume_cashback")
|
||||
public class MkConsumeCashback implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 主店id
|
||||
*/
|
||||
private Long mainShopId;
|
||||
|
||||
/**
|
||||
* all 全部可用 part部分门店可用
|
||||
*/
|
||||
private String useType;
|
||||
|
||||
/**
|
||||
* 门店列表
|
||||
*/
|
||||
private String shopIdList;
|
||||
|
||||
/**
|
||||
* 适用用户 all全部用户 new新用户 vip会员
|
||||
*/
|
||||
private String applicableUser;
|
||||
|
||||
/**
|
||||
* 返现类型 percentage比例 fix固定
|
||||
*/
|
||||
private String cashbackType;
|
||||
|
||||
/**
|
||||
* 返现配置
|
||||
*/
|
||||
private String cashbackStepList;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private Integer isEnable;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
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-10-13
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("mk_consume_cashback_record")
|
||||
public class MkConsumeCashbackRecord implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
private String orderNo;
|
||||
|
||||
/**
|
||||
* 主店id
|
||||
*/
|
||||
private Long mainShopId;
|
||||
|
||||
/**
|
||||
* 分店id
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 返现金额
|
||||
*/
|
||||
private BigDecimal cashbackAmount;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 店铺用户id
|
||||
*/
|
||||
private Long shopUserId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
|
||||
package com.czg.market.entity;
|
||||
|
||||
import jakarta.validation.constraints.DecimalMin;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 新客立减 实体类。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-09-16
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MkConsumeCashbackStep implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@NotNull(message = "id不为空")
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 是否开启
|
||||
*/
|
||||
@NotNull(message = "返现金额/比例不为空")
|
||||
@DecimalMin(value = "0.01",message = "返现金额/比例不能为0")
|
||||
private BigDecimal cashbackAmount;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.czg.market.service;
|
||||
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.market.entity.MkConsumeCashbackRecord;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 消费返现明细 服务层。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-10-13
|
||||
*/
|
||||
public interface MkConsumeCashbackRecordService extends IService<MkConsumeCashbackRecord> {
|
||||
|
||||
Map<String, Object> getRecord(Long mainShopId, Long shopId, String key, LocalDateTime startTime, LocalDateTime endTime);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.czg.market.service;
|
||||
|
||||
import com.czg.exception.ApiNotPrintException;
|
||||
import com.czg.market.dto.MkConsumeCashbackDTO;
|
||||
import com.czg.market.dto.MkConsumeDiscountDTO;
|
||||
import com.czg.market.vo.MkConsumeCashbackVO;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.market.entity.MkConsumeCashback;
|
||||
|
||||
/**
|
||||
* 服务层。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-10-13
|
||||
*/
|
||||
public interface MkConsumeCashbackService extends IService<MkConsumeCashback> {
|
||||
MkConsumeCashbackVO detail(Long shopId);
|
||||
|
||||
Boolean edit(Long shopId, MkConsumeCashbackDTO consumeDiscountDTO) throws ApiNotPrintException;
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.czg.market.vo;
|
||||
|
||||
import com.czg.market.entity.MkConsumeCashbackStep;
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
@Data
|
||||
public class MkConsumeCashbackRecordVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
private String orderNo;
|
||||
|
||||
/**
|
||||
* 主店id
|
||||
*/
|
||||
private Long mainShopId;
|
||||
|
||||
/**
|
||||
* 分店id
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 返现金额
|
||||
*/
|
||||
private BigDecimal cashbackAmount;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 店铺用户id
|
||||
*/
|
||||
private Long shopUserId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
private String shopName;
|
||||
private String phone;
|
||||
private String nickName;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.czg.market.vo;
|
||||
|
||||
import com.czg.market.entity.MkConsumeCashbackStep;
|
||||
import com.czg.market.entity.MkConsumeDiscountRandom;
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
@Data
|
||||
public class MkConsumeCashbackVO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 主店id
|
||||
*/
|
||||
private Long mainShopId;
|
||||
|
||||
/**
|
||||
* all 全部可用 part部分门店可用
|
||||
*/
|
||||
private String useType;
|
||||
|
||||
/**
|
||||
* 门店列表
|
||||
*/
|
||||
private String shopIdList;
|
||||
|
||||
/**
|
||||
* 适用用户 all全部用户 new新用户 vip会员
|
||||
*/
|
||||
private String applicableUser;
|
||||
|
||||
/**
|
||||
* 返现类型 percentage比例 fix固定
|
||||
*/
|
||||
private String cashbackType;
|
||||
|
||||
/**
|
||||
* 返现配置
|
||||
*/
|
||||
private List<MkConsumeCashbackStep> cashbackStepList;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private Integer isEnable;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user