消费赠券 优惠券
This commit is contained in:
@@ -46,7 +46,7 @@ public class MkCouponGiftDTO implements Serializable {
|
||||
private String couponName;
|
||||
|
||||
/**
|
||||
* 券ID
|
||||
* 券ID 如果是子店铺 则使用主店铺的券ID
|
||||
*/
|
||||
private Long couponId;
|
||||
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
|
||||
package com.czg.market.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import java.io.Serial;
|
||||
import java.util.List;
|
||||
|
||||
import com.czg.validator.group.InsertGroup;
|
||||
import com.czg.validator.group.UpdateGroup;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Null;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 消费赠券表 实体类。
|
||||
*
|
||||
* @author ww
|
||||
* @since 2025-09-12
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MkShopConsumerCouponDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
@Null(message = "ID必须为空", groups = InsertGroup.class)
|
||||
@NotNull(message = "ID不能为空", groups = UpdateGroup.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺ID
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 同步Id 预留
|
||||
*/
|
||||
// private Long syncId;
|
||||
|
||||
/**
|
||||
* 券名称
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* only-仅本店 all全部 /custom 指定
|
||||
*/
|
||||
// private String useShopType;
|
||||
|
||||
/**
|
||||
* 可用门店
|
||||
*/
|
||||
// private String useShops;
|
||||
|
||||
/**
|
||||
* 可使用类型:dine堂食/pickup自取/deliv配送/express快递
|
||||
*/
|
||||
private String useType;
|
||||
|
||||
/**
|
||||
* 总发放数量,-10086为不限量
|
||||
*/
|
||||
private Integer giveNum;
|
||||
|
||||
/**
|
||||
* 每人领取限量,-10086为不限量
|
||||
*/
|
||||
private Integer getLimit;
|
||||
|
||||
/**
|
||||
* 每人每日使用限量,-10086为不限量
|
||||
*/
|
||||
private Integer useLimit;
|
||||
|
||||
/**
|
||||
* 状态:0-禁用,1-启用
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 已使用数量
|
||||
*/
|
||||
private Integer useNum;
|
||||
|
||||
/**
|
||||
* 剩余数量
|
||||
*/
|
||||
private Integer leftNum;
|
||||
|
||||
/**
|
||||
* 使用门槛:满多少金额
|
||||
*/
|
||||
private BigDecimal fullAmount;
|
||||
|
||||
/**
|
||||
* 券ID
|
||||
*/
|
||||
private Integer couponId;
|
||||
|
||||
/**
|
||||
* 券数量
|
||||
*/
|
||||
private Integer couponNum;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
List<MkCouponGiftDTO> couponGiftList;
|
||||
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 券赠送关联表 实体类。
|
||||
@@ -22,6 +23,7 @@ import lombok.NoArgsConstructor;
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@Table("mk_coupon_gift")
|
||||
public class MkCouponGift implements Serializable {
|
||||
|
||||
@@ -52,7 +54,7 @@ public class MkCouponGift implements Serializable {
|
||||
private String couponName;
|
||||
|
||||
/**
|
||||
* 券ID
|
||||
* 券ID 如果是子店铺 则使用主店铺的券ID
|
||||
*/
|
||||
private Long couponId;
|
||||
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
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 ww
|
||||
* @since 2025-09-12
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("mk_shop_consumer_coupon")
|
||||
public class MkShopConsumerCoupon implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺ID
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 同步Id 预留
|
||||
*/
|
||||
// private Long syncId;
|
||||
|
||||
/**
|
||||
* 券名称
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* only-仅本店 all全部 /custom 指定
|
||||
*/
|
||||
// private String useShopType;
|
||||
|
||||
/**
|
||||
* 可用门店
|
||||
*/
|
||||
// private String useShops;
|
||||
|
||||
/**
|
||||
* 可使用类型:dine堂食/pickup自取/deliv配送/express快递
|
||||
*/
|
||||
private String useType;
|
||||
|
||||
/**
|
||||
* 总发放数量,-10086为不限量
|
||||
*/
|
||||
private Integer giveNum;
|
||||
|
||||
/**
|
||||
* 每人领取限量,-10086为不限量
|
||||
*/
|
||||
private Integer getLimit;
|
||||
|
||||
/**
|
||||
* 每人每日使用限量,-10086为不限量
|
||||
*/
|
||||
private Integer useLimit;
|
||||
|
||||
/**
|
||||
* 状态:0-禁用,1-启用
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 已使用数量
|
||||
*/
|
||||
private Integer useNum;
|
||||
|
||||
/**
|
||||
* 剩余数量
|
||||
*/
|
||||
private Integer leftNum;
|
||||
|
||||
/**
|
||||
* 使用门槛:满多少金额
|
||||
*/
|
||||
private BigDecimal fullAmount;
|
||||
|
||||
/**
|
||||
* 券ID
|
||||
*/
|
||||
private Integer couponId;
|
||||
|
||||
/**
|
||||
* 券数量
|
||||
*/
|
||||
private Integer couponNum;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(onUpdateValue = "now()")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 优惠券信息表 实体类。
|
||||
@@ -27,6 +28,7 @@ import lombok.NoArgsConstructor;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("mk_shop_coupon")
|
||||
@Accessors(chain = true)
|
||||
public class ShopCoupon implements Serializable {
|
||||
|
||||
@Serial
|
||||
@@ -230,4 +232,9 @@ public class ShopCoupon implements Serializable {
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除状态:0-正常,1-已删除
|
||||
*/
|
||||
private Integer isDel;
|
||||
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public interface MkCouponGiftService extends IService<MkCouponGift> {
|
||||
*
|
||||
* @param sourceId 来源ID
|
||||
* @param type 类型 1 会员开通赠券 2 会员周活动 3 消费赠券
|
||||
* @param couponGiftList 券ID-数量
|
||||
* @param couponGiftList 券ID 如果是子店铺 则使用主店铺的券ID-数量
|
||||
*/
|
||||
void addCouponGift(Long sourceId, String sourceName, Integer type, List<MkCouponGiftDTO> couponGiftList);
|
||||
|
||||
@@ -43,7 +43,7 @@ public interface MkCouponGiftService extends IService<MkCouponGift> {
|
||||
*
|
||||
* @param sourceId 来源ID
|
||||
* @param type 类型 1 会员开通赠券 2 会员周活动 3 消费赠券
|
||||
* @param couponGiftList 券ID和数量必填
|
||||
* @param couponGiftList 券ID 如果是子店铺 则使用主店铺的券ID和数量必填
|
||||
*/
|
||||
void upCouponGift(Long sourceId, String sourceName, Integer type, List<MkCouponGiftDTO> couponGiftList);
|
||||
|
||||
@@ -54,4 +54,19 @@ public interface MkCouponGiftService extends IService<MkCouponGift> {
|
||||
* @param type 类型 1 会员开通赠券 2 会员周活动 3 消费赠券
|
||||
*/
|
||||
void deleteJoinCouponGift(Long sourceId, Integer type);
|
||||
|
||||
/**
|
||||
* 通过券删除关联
|
||||
*
|
||||
* @param couponId 券ID
|
||||
*/
|
||||
void deleteCoupon(Long couponId);
|
||||
|
||||
/**
|
||||
* 更新券名称
|
||||
*
|
||||
* @param couponId 券ID
|
||||
* @param couponName 券名称
|
||||
*/
|
||||
void upCouponName(Long couponId, String couponName);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.czg.market.service;
|
||||
|
||||
import com.czg.market.dto.MkShopConsumerCouponDTO;
|
||||
import com.czg.market.entity.MkShopConsumerCoupon;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
|
||||
/**
|
||||
* 消费赠券表 服务层。
|
||||
*
|
||||
* @author ww
|
||||
* @since 2025-09-12
|
||||
*/
|
||||
public interface MkShopConsumerCouponService extends IService<MkShopConsumerCoupon> {
|
||||
|
||||
Page<MkShopConsumerCouponDTO> getConsumerCouponPage(MkShopConsumerCouponDTO param);
|
||||
MkShopConsumerCouponDTO getConsumerCouponById(Long id);
|
||||
void addConsumerCoupon(MkShopConsumerCouponDTO param);
|
||||
void updateConsumerCouponById(MkShopConsumerCouponDTO param);
|
||||
void deleteConsumerCoupon(Long id);
|
||||
}
|
||||
Reference in New Issue
Block a user