fix promotion优惠券工程迁移
This commit is contained in:
@@ -1,48 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>promotion</artifactId>
|
||||
<groupId>cn.iocoder.mall</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>promotion-service-api</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<!-- Mall 相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.mall</groupId>
|
||||
<artifactId>common-framework</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 工具类相关 -->
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct</artifactId> <!-- use mapstruct-jdk8 for Java 8 or higher -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct-jdk8</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- 提供给 mapstruct 使用 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -1,28 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api;
|
||||
|
||||
import cn.iocoder.common.framework.enums.CommonStatusEnum;
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import cn.iocoder.mall.promotion.api.bo.BannerBO;
|
||||
import cn.iocoder.mall.promotion.api.bo.BannerPageBO;
|
||||
import cn.iocoder.mall.promotion.api.dto.BannerAddDTO;
|
||||
import cn.iocoder.mall.promotion.api.dto.BannerPageDTO;
|
||||
import cn.iocoder.mall.promotion.api.dto.BannerUpdateDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface BannerService {
|
||||
|
||||
List<BannerBO> getBannerListByStatus(Integer status);
|
||||
|
||||
BannerPageBO getBannerPage(BannerPageDTO bannerPageDTO);
|
||||
|
||||
BannerBO addBanner(Integer adminId, BannerAddDTO bannerAddDTO);
|
||||
|
||||
Boolean updateBanner(Integer adminId, BannerUpdateDTO bannerUpdateDTO);
|
||||
|
||||
Boolean updateBannerStatus(Integer adminId, Integer bannerId,
|
||||
@InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") Integer status);
|
||||
|
||||
Boolean deleteBanner(Integer adminId, Integer bannerId);
|
||||
|
||||
}
|
||||
@@ -1,125 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api;
|
||||
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import cn.iocoder.mall.promotion.api.bo.*;
|
||||
import cn.iocoder.mall.promotion.api.constant.CouponTemplateStatusEnum;
|
||||
import cn.iocoder.mall.promotion.api.dto.*;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
public interface CouponService {
|
||||
|
||||
// ========== 优惠劵(码)模板 ==========
|
||||
|
||||
CouponTemplateBO getCouponTemplate(Integer couponTemplateId);
|
||||
|
||||
CouponTemplatePageBO getCouponTemplatePage(CouponTemplatePageDTO couponTemplatePageDTO);
|
||||
|
||||
/**
|
||||
* 创建优惠码模板
|
||||
*
|
||||
* @param couponCodeTemplateAddDTO 优惠码模板添加 DTO
|
||||
* @return 优惠码模板
|
||||
*/
|
||||
CouponTemplateBO addCouponCodeTemplate(CouponCodeTemplateAddDTO couponCodeTemplateAddDTO);
|
||||
|
||||
/**
|
||||
* 创建优惠劵模板
|
||||
*
|
||||
* @param couponCardTemplateAddDTO 优惠码模板添加 DTO
|
||||
* @return 优惠劵模板
|
||||
*/
|
||||
CouponTemplateBO addCouponCardTemplate(CouponCardTemplateAddDTO couponCardTemplateAddDTO);
|
||||
|
||||
/**
|
||||
* 更新优惠码模板
|
||||
*
|
||||
* @param couponCodeTemplateUpdateDTO 优惠码模板修改 DTO
|
||||
* @return 是否成功
|
||||
*/
|
||||
Boolean updateCouponCodeTemplate(CouponCodeTemplateUpdateDTO couponCodeTemplateUpdateDTO);
|
||||
|
||||
/**
|
||||
* 更新优惠劵模板
|
||||
*
|
||||
* @param couponCardTemplateUpdateDTO 优惠劵模板修改 DTO
|
||||
* @return 是否成功
|
||||
*/
|
||||
Boolean updateCouponCardTemplate(CouponCardTemplateUpdateDTO couponCardTemplateUpdateDTO);
|
||||
|
||||
/**
|
||||
* 更新优惠劵(码)模板的状态
|
||||
*
|
||||
* @param adminId 操作管理员编号
|
||||
* @param couponTemplateId 模板编号
|
||||
* @param status 状态
|
||||
* @return 是否成功
|
||||
*/
|
||||
Boolean updateCouponTemplateStatus(Integer adminId, Integer couponTemplateId,
|
||||
@InEnum(value = CouponTemplateStatusEnum.class, message = "修改状态必须是 {value}") Integer status);
|
||||
|
||||
// ========== 优惠劵 ==========
|
||||
|
||||
CouponCardPageBO getCouponCardPage(CouponCardPageDTO couponCardPageDTO);
|
||||
|
||||
/**
|
||||
* 基于优惠劵模板,领取优惠劵
|
||||
*
|
||||
* @param userId 用户编号
|
||||
* @param couponTemplateId 优惠劵模板
|
||||
* @return 优惠劵
|
||||
*/
|
||||
CouponCardBO addCouponCard(Integer userId, Integer couponTemplateId);
|
||||
|
||||
/**
|
||||
* 使用优惠劵下单
|
||||
*
|
||||
* @param userId 用户编号
|
||||
* @param couponCardId 优惠劵编号
|
||||
* @return 是否成功
|
||||
*/
|
||||
Boolean useCouponCard(Integer userId,
|
||||
@NotNull(message = "优惠劵编号不能为空") Integer couponCardId);
|
||||
|
||||
/**
|
||||
* 取消优惠劵的使用
|
||||
*
|
||||
* @param userId 用户编号
|
||||
* @param couponCardId 优惠劵编号
|
||||
* @return 是否成功
|
||||
*/
|
||||
Boolean cancelUseCouponCard(Integer userId, Integer couponCardId);
|
||||
|
||||
/**
|
||||
* 获得指定优惠劵
|
||||
*
|
||||
* @param userId 用户编号
|
||||
* @param couponCardId 优惠劵编号
|
||||
* @return 优惠劵
|
||||
*/
|
||||
CouponCardDetailBO getCouponCardDetail(Integer userId, Integer couponCardId);
|
||||
|
||||
/**
|
||||
* 获得用户所有优惠劵,并标明是否可用
|
||||
* <p>
|
||||
* 注意,spus 是作为条件,判断优惠劵是否可用
|
||||
*
|
||||
* @param userId 用户编号
|
||||
* @param spus 匹配的商品/分类
|
||||
* @return 优惠劵列表
|
||||
*/
|
||||
List<CouponCardAvailableBO> getCouponCardList(Integer userId, List<CouponCardSpuDTO> spus);
|
||||
|
||||
// ========== 优惠码 ==========
|
||||
|
||||
/**
|
||||
* 使用优惠码,兑换优惠劵
|
||||
*
|
||||
* @param userId 用户编号
|
||||
* @param code 优惠码
|
||||
* @return 优惠劵
|
||||
*/
|
||||
CouponCardBO useCouponCode(Integer userId, String code);
|
||||
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api;
|
||||
|
||||
import cn.iocoder.common.framework.enums.CommonStatusEnum;
|
||||
import cn.iocoder.common.framework.exception.ServiceException;
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import cn.iocoder.mall.promotion.api.bo.ProductRecommendBO;
|
||||
import cn.iocoder.mall.promotion.api.bo.ProductRecommendPageBO;
|
||||
import cn.iocoder.mall.promotion.api.dto.ProductRecommendAddDTO;
|
||||
import cn.iocoder.mall.promotion.api.dto.ProductRecommendPageDTO;
|
||||
import cn.iocoder.mall.promotion.api.dto.ProductRecommendUpdateDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ProductRecommendService {
|
||||
|
||||
List<ProductRecommendBO> getProductRecommendList(Integer type, Integer status);
|
||||
|
||||
ProductRecommendPageBO getProductRecommendPage(ProductRecommendPageDTO productRecommendPageDTO);
|
||||
|
||||
ProductRecommendBO addProductRecommend(Integer adminId, ProductRecommendAddDTO productRecommendAddDTO) throws ServiceException;
|
||||
|
||||
Boolean updateProductRecommend(Integer adminId, ProductRecommendUpdateDTO productRecommendUpdateDTO) throws ServiceException;
|
||||
|
||||
Boolean updateProductRecommendStatus(Integer adminId, Integer productRecommendId,
|
||||
@InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") Integer status) throws ServiceException;
|
||||
|
||||
Boolean deleteProductRecommend(Integer adminId, Integer productRecommendId);
|
||||
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api;
|
||||
|
||||
import cn.iocoder.mall.promotion.api.bo.PromotionActivityBO;
|
||||
import cn.iocoder.mall.promotion.api.bo.PromotionActivityPageBO;
|
||||
import cn.iocoder.mall.promotion.api.dto.PromotionActivityPageDTO;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public interface PromotionActivityService {
|
||||
|
||||
List<PromotionActivityBO> getPromotionActivityListBySpuId(Integer spuId,
|
||||
Collection<Integer> activityStatuses);
|
||||
|
||||
List<PromotionActivityBO> getPromotionActivityListBySpuIds(Collection<Integer> spuIds,
|
||||
Collection<Integer> activityStatuses);
|
||||
|
||||
PromotionActivityPageBO getPromotionActivityPage(PromotionActivityPageDTO promotionActivityPageDTO);
|
||||
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.bo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Banner BO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class BannerBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 跳转链接
|
||||
*/
|
||||
private String url;
|
||||
/**
|
||||
* 图片链接
|
||||
*/
|
||||
private String picUrl;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String memo;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.bo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Banner 分页 BO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class BannerPageBO implements Serializable {
|
||||
|
||||
/**
|
||||
* Banner 数组
|
||||
*/
|
||||
private List<BannerBO> list;
|
||||
/**
|
||||
* 总量
|
||||
*/
|
||||
private Integer total;
|
||||
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.bo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 可用优惠劵 BO
|
||||
*
|
||||
* 注意,如果优惠劵不可用,标记 available = false ,并写明 unavailableReason 原因
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class CouponCardAvailableBO extends CouponCardBO {
|
||||
|
||||
/**
|
||||
* 是否可用
|
||||
*/
|
||||
private Boolean available;
|
||||
/**
|
||||
* 不可用原因
|
||||
*/
|
||||
private String unavailableReason;
|
||||
|
||||
}
|
||||
@@ -1,112 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.bo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 优惠劵 BO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class CouponCardBO implements Serializable {
|
||||
|
||||
// ========== 基本信息 BEGIN ==========
|
||||
/**
|
||||
* 优惠劵编号
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 优惠劵(码)分组编号
|
||||
*/
|
||||
private Integer templateId;
|
||||
/**
|
||||
* 优惠劵名
|
||||
*/
|
||||
private String title;
|
||||
// /**
|
||||
// * 核销码
|
||||
// */
|
||||
// private String verifyCode;
|
||||
/**
|
||||
* 优惠码状态
|
||||
*
|
||||
* 1-未使用
|
||||
* 2-已使用
|
||||
* 3-已失效
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
// ========== 基本信息 END ==========
|
||||
|
||||
// ========== 领取情况 BEGIN ==========
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 领取类型
|
||||
*
|
||||
* 1 - 用户主动领取
|
||||
* 2 - 后台自动发放
|
||||
*/
|
||||
private Integer takeType;
|
||||
// ========== 领取情况 END ==========
|
||||
|
||||
// ========== 使用规则 BEGIN ==========
|
||||
/**
|
||||
* 是否设置满多少金额可用,单位:分
|
||||
*/
|
||||
private Integer priceAvailable;
|
||||
/**
|
||||
* 生效开始时间
|
||||
*/
|
||||
private Date validStartTime;
|
||||
/**
|
||||
* 生效结束时间
|
||||
*/
|
||||
private Date validEndTime;
|
||||
// ========== 使用规则 END ==========
|
||||
|
||||
// ========== 使用效果 BEGIN ==========
|
||||
/**
|
||||
* 优惠类型
|
||||
*
|
||||
* 1-代金卷
|
||||
* 2-折扣卷
|
||||
*/
|
||||
private Integer preferentialType;
|
||||
/**
|
||||
* 折扣
|
||||
*/
|
||||
private Integer percentOff;
|
||||
/**
|
||||
* 优惠金额,单位:分。
|
||||
*/
|
||||
private Integer priceOff;
|
||||
/**
|
||||
* 折扣上限,仅在 {@link #preferentialType} 等于 2 时生效。
|
||||
*
|
||||
* 例如,折扣上限为 20 元,当使用 8 折优惠券,订单金额为 1000 元时,最高只可折扣 20 元,而非 80 元。
|
||||
*/
|
||||
private Integer discountPriceLimit;
|
||||
// ========== 使用效果 END ==========
|
||||
|
||||
// ========== 使用情况 BEGIN ==========
|
||||
/**
|
||||
* 使用时间
|
||||
*/
|
||||
private Date usedTime;
|
||||
|
||||
// TODO 芋艿,后续要加优惠劵的使用日志,因为下单后,可能会取消。
|
||||
|
||||
// ========== 使用情况 END ==========
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -1,143 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.bo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 优惠劵明细 BO 。
|
||||
*
|
||||
* 主要是,会带上 {@link CouponTemplateBO} 的信息
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class CouponCardDetailBO implements Serializable {
|
||||
|
||||
// ========== 基本信息 BEGIN ==========
|
||||
/**
|
||||
* 优惠劵编号
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 优惠劵(码)分组编号
|
||||
*/
|
||||
private Integer templateId;
|
||||
/**
|
||||
* 优惠劵名
|
||||
*/
|
||||
private String title;
|
||||
// /**
|
||||
// * 核销码
|
||||
// */
|
||||
// private String verifyCode;
|
||||
/**
|
||||
* 优惠码状态
|
||||
*
|
||||
* 1-未使用
|
||||
* 2-已使用
|
||||
* 3-已失效
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
// ========== 基本信息 END ==========
|
||||
|
||||
// ========== 领取情况 BEGIN ==========
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 领取类型
|
||||
*
|
||||
* 1 - 用户主动领取
|
||||
* 2 - 后台自动发放
|
||||
*/
|
||||
private Integer takeType;
|
||||
// ========== 领取情况 END ==========
|
||||
|
||||
// ========== 使用规则 BEGIN ==========
|
||||
/**
|
||||
* 是否设置满多少金额可用,单位:分
|
||||
*/
|
||||
private Integer priceAvailable;
|
||||
/**
|
||||
* 生效开始时间
|
||||
*/
|
||||
private Date validStartTime;
|
||||
/**
|
||||
* 生效结束时间
|
||||
*/
|
||||
private Date validEndTime;
|
||||
// ========== 使用规则 END ==========
|
||||
|
||||
// ========== 使用效果 BEGIN ==========
|
||||
/**
|
||||
* 优惠类型
|
||||
*
|
||||
* 1-代金卷
|
||||
* 2-折扣卷
|
||||
*/
|
||||
private Integer preferentialType;
|
||||
/**
|
||||
* 折扣
|
||||
*/
|
||||
private Integer percentOff;
|
||||
/**
|
||||
* 优惠金额,单位:分。
|
||||
*/
|
||||
private Integer priceOff;
|
||||
/**
|
||||
* 折扣上限,仅在 {@link #preferentialType} 等于 2 时生效。
|
||||
*
|
||||
* 例如,折扣上限为 20 元,当使用 8 折优惠券,订单金额为 1000 元时,最高只可折扣 20 元,而非 80 元。
|
||||
*/
|
||||
private Integer discountPriceLimit;
|
||||
// ========== 使用效果 END ==========
|
||||
|
||||
// ========== 使用情况 BEGIN ==========
|
||||
/**
|
||||
* 是否使用
|
||||
*/
|
||||
private Boolean used;
|
||||
/**
|
||||
* 使用订单号
|
||||
*/
|
||||
private Integer usedOrderId;
|
||||
/**
|
||||
* 订单中优惠面值,单位:分
|
||||
*/
|
||||
private Integer usedPrice;
|
||||
/**
|
||||
* 使用时间
|
||||
*/
|
||||
private Date usedTime;
|
||||
|
||||
// TODO 芋艿,后续要加优惠劵的使用日志,因为下单后,可能会取消。
|
||||
|
||||
// ========== 使用情况 END ==========
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
// ========== FROM template 使用规则 BEGIN ==========
|
||||
/**
|
||||
* 可用范围的类型
|
||||
*
|
||||
* 10-全部(ALL):所有可用
|
||||
* 20-部分(PART):部分商品可用,或指定商品可用
|
||||
* 21-部分(PART):部分商品不可用,或指定商品可用
|
||||
* 30-部分(PART):部分分类可用,或指定商品可用
|
||||
* 31-部分(PART):部分分类不可用,或指定商品可用
|
||||
*/
|
||||
private Integer rangeType;
|
||||
/**
|
||||
* 指定商品 / 分类列表,使用逗号分隔商品编号
|
||||
*/
|
||||
private List<Integer> rangeValues;
|
||||
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.bo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 优惠劵分页 BO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class CouponCardPageBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 优惠劵数组
|
||||
*/
|
||||
private List<CouponCardBO> list;
|
||||
/**
|
||||
* 总量
|
||||
*/
|
||||
private Integer total;
|
||||
|
||||
}
|
||||
@@ -1,155 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.bo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 优惠劵(码)模板 BO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class CouponTemplateBO implements Serializable {
|
||||
|
||||
// ========== 基本信息 BEGIN ==========
|
||||
/**
|
||||
* 模板编号,自增唯一。
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 使用说明
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 类型
|
||||
*
|
||||
* 1-优惠劵
|
||||
* 2-优惠码
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 码类型
|
||||
*
|
||||
* 1-一卡一码(UNIQUE)
|
||||
* 2-通用码(GENERAL)
|
||||
*
|
||||
* 【优惠码独有】 @see CouponCodeDO
|
||||
*/
|
||||
private Integer codeType;
|
||||
/**
|
||||
* 优惠码状态
|
||||
*
|
||||
* 1-开启中
|
||||
* 2-禁用中
|
||||
* 3-已过期
|
||||
*
|
||||
* 当优惠劵(码)开启中,可以手动操作,设置禁用中。
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 每人限领个数
|
||||
*
|
||||
* null - 则表示不限制
|
||||
*/
|
||||
private Integer quota;
|
||||
/**
|
||||
* 发放总量
|
||||
*/
|
||||
private Integer total;
|
||||
// ========== 领取规则 END ==========
|
||||
|
||||
// ========== 使用规则 BEGIN ==========
|
||||
/**
|
||||
* 是否设置满多少金额可用,单位:分
|
||||
*
|
||||
* 0-不限制
|
||||
* 大于0-多少金额可用
|
||||
*/
|
||||
private Integer priceAvailable;
|
||||
/**
|
||||
* 可用范围的类型
|
||||
*
|
||||
* 10-全部(ALL):所有可用
|
||||
* 20-部分(PART):部分商品可用,或指定商品可用
|
||||
* 21-部分(PART):部分商品不可用,或指定商品可用
|
||||
* 30-部分(PART):部分分类可用,或指定商品可用
|
||||
* 31-部分(PART):部分分类不可用,或指定商品可用
|
||||
*/
|
||||
private Integer rangeType;
|
||||
/**
|
||||
* 指定商品 / 分类列表,使用逗号分隔商品编号
|
||||
*/
|
||||
private String rangeValues;
|
||||
/**
|
||||
* 生效日期类型
|
||||
*
|
||||
* 1-固定日期
|
||||
* 2-领取日期:领到券 {@link #fixedStartTerm} 日开始 N 天内有效
|
||||
*/
|
||||
private Integer dateType;
|
||||
/**
|
||||
* 固定日期-生效开始时间
|
||||
*/
|
||||
private Date validStartTime;
|
||||
/**
|
||||
* 固定日期-生效结束时间
|
||||
*/
|
||||
private Date validEndTime;
|
||||
/**
|
||||
* 领取日期-开始天数
|
||||
*
|
||||
* 例如,0-当天;1-次天
|
||||
*/
|
||||
private Integer fixedStartTerm;
|
||||
/**
|
||||
* 领取日期-结束天数
|
||||
*/
|
||||
private Integer fixedEndTerm;
|
||||
// ========== 使用规则 END ==========
|
||||
|
||||
// ========== 使用效果 BEGIN ==========
|
||||
/**
|
||||
* 优惠类型
|
||||
*
|
||||
* 1-代金卷
|
||||
* 2-折扣卷
|
||||
*/
|
||||
private Integer preferentialType;
|
||||
/**
|
||||
* 折扣百分比。
|
||||
*
|
||||
* 例如,80% 为 80。
|
||||
* 当 100% 为 100 ,则代表免费。
|
||||
*/
|
||||
private Integer percentOff;
|
||||
/**
|
||||
* 优惠金额,单位:分
|
||||
*/
|
||||
private Integer priceOff;
|
||||
/**
|
||||
* 折扣上限,仅在 {@link #preferentialType} 等于 2 时生效。
|
||||
*
|
||||
* 例如,折扣上限为 20 元,当使用 8 折优惠券,订单金额为 1000 元时,最高只可折扣 20 元,而非 80 元。
|
||||
*/
|
||||
private Integer discountPriceLimit;
|
||||
// ========== 使用效果 END ==========
|
||||
|
||||
// ========== 统计信息 BEGIN ==========
|
||||
/**
|
||||
* 领取优惠券的次数
|
||||
*/
|
||||
private Integer statFetchNum;
|
||||
// ========== 统计信息 END ==========
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.bo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 优惠劵(码)模板分页 BO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class CouponTemplatePageBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 优惠劵(码)数组
|
||||
*/
|
||||
private List<CouponTemplateBO> list;
|
||||
/**
|
||||
* 总量
|
||||
*/
|
||||
private Integer total;
|
||||
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.bo;
|
||||
|
||||
import cn.iocoder.mall.promotion.api.constant.ProductRecommendTypeEnum;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 商品推荐 BO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ProductRecommendBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 类型
|
||||
*
|
||||
* {@link ProductRecommendTypeEnum}
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 商品 Spu 编号
|
||||
*/
|
||||
private Integer productSpuId;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 状态
|
||||
*
|
||||
* {@link cn.iocoder.common.framework.enums.CommonStatusEnum}
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String memo;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.bo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品推荐分页 BO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ProductRecommendPageBO implements Serializable {
|
||||
|
||||
/**
|
||||
* ProductRecommend 数组
|
||||
*/
|
||||
private List<ProductRecommendBO> list;
|
||||
/**
|
||||
* 总量
|
||||
*/
|
||||
private Integer total;
|
||||
|
||||
}
|
||||
@@ -1,151 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.bo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PromotionActivityBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 活动编号
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 活动标题
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 活动类型
|
||||
*
|
||||
* 参见 {@link cn.iocoder.mall.promotion.api.constant.PromotionActivityTypeEnum} 枚举
|
||||
*/
|
||||
private Integer activityType;
|
||||
/**
|
||||
* 活动状态
|
||||
*
|
||||
* 参见 {@link cn.iocoder.mall.promotion.api.constant.PromotionActivityStatusEnum} 枚举
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private Date startTime;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
/**
|
||||
* 限制折扣
|
||||
*/
|
||||
private TimeLimitedDiscount timeLimitedDiscount;
|
||||
/**
|
||||
* 满减送
|
||||
*/
|
||||
private FullPrivilege fullPrivilege;
|
||||
|
||||
/**
|
||||
* 限时折扣
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class TimeLimitedDiscount implements Serializable {
|
||||
|
||||
/**
|
||||
* 商品折扣
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class Item implements Serializable {
|
||||
|
||||
/**
|
||||
* 商品 SPU 编号
|
||||
*/
|
||||
private Integer spuId;
|
||||
/**
|
||||
* 优惠类型
|
||||
*/
|
||||
private Integer preferentialType;
|
||||
/**
|
||||
* 优惠值
|
||||
*/
|
||||
private Integer preferentialValue;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 每人每种限购多少
|
||||
*
|
||||
* 当 quota = 0 时,表示不限购
|
||||
*/
|
||||
private Integer quota;
|
||||
/**
|
||||
* 商品折扣数组
|
||||
*/
|
||||
private List<Item> items;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 满减送
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class FullPrivilege implements Serializable {
|
||||
|
||||
/**
|
||||
* 优惠
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class Privilege implements Serializable {
|
||||
|
||||
/**
|
||||
* 满足类型
|
||||
*
|
||||
* 1 - 金额
|
||||
* 2 - 件数
|
||||
*/
|
||||
private Integer meetType;
|
||||
/**
|
||||
* 满足值
|
||||
*/
|
||||
private Integer meetValue;
|
||||
/**
|
||||
* 优惠类型
|
||||
*/
|
||||
private Integer preferentialType;
|
||||
/**
|
||||
* 优惠值
|
||||
*/
|
||||
private Integer preferentialValue;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 可用范围的类型
|
||||
*
|
||||
* 参见 {@link cn.iocoder.mall.promotion.api.constant.RangeTypeEnum} 枚举
|
||||
* 暂时只用 “所有可用” + “PRODUCT_INCLUDE_PRT”
|
||||
*/
|
||||
private Integer rangeType;
|
||||
/**
|
||||
* 指定可用商品列表
|
||||
*/
|
||||
private List<Integer> rangeValues;
|
||||
/**
|
||||
* 是否循环
|
||||
*/
|
||||
private Boolean cycled;
|
||||
/**
|
||||
* 优惠数组
|
||||
*/
|
||||
private List<Privilege> privileges;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.bo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 促销活动分页 BO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PromotionActivityPageBO {
|
||||
|
||||
/**
|
||||
* PromotionActivityBO 数组
|
||||
*/
|
||||
private List<PromotionActivityBO> list;
|
||||
/**
|
||||
* 总量
|
||||
*/
|
||||
private Integer total;
|
||||
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.constant;
|
||||
|
||||
import cn.iocoder.common.framework.core.IntArrayValuable;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 优惠劵状态枚举
|
||||
*/
|
||||
public enum CouponCardStatusEnum implements IntArrayValuable {
|
||||
|
||||
UNUSED(1, "未使用"),
|
||||
USED(2, "已使用"),
|
||||
EXPIRE(3, "已过期"),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CouponCardStatusEnum::getValue).toArray();
|
||||
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
private final Integer value;
|
||||
/**
|
||||
* 名字
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
CouponCardStatusEnum(Integer value, String name) {
|
||||
this.value = value;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.constant;
|
||||
|
||||
import cn.iocoder.common.framework.core.IntArrayValuable;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 优惠劵领取方式
|
||||
*/
|
||||
public enum CouponCardTakeTypeEnum implements IntArrayValuable {
|
||||
|
||||
BY_USER(1, "用户主动领取"),
|
||||
BY_ADMIN(2, "已使用"),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CouponCardTakeTypeEnum::getValue).toArray();
|
||||
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
private final Integer value;
|
||||
/**
|
||||
* 名字
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
CouponCardTakeTypeEnum(Integer value, String name) {
|
||||
this.value = value;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.constant;
|
||||
|
||||
import cn.iocoder.common.framework.core.IntArrayValuable;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public enum CouponTemplateDateTypeEnum implements IntArrayValuable {
|
||||
|
||||
FIXED_DATE(1, "固定日期"),
|
||||
FIXED_TERM(2, "领取日期"),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CouponTemplateDateTypeEnum::getValue).toArray();
|
||||
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
private final Integer value;
|
||||
/**
|
||||
* 名字
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
CouponTemplateDateTypeEnum(Integer value, String name) {
|
||||
this.value = value;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.constant;
|
||||
|
||||
import cn.iocoder.common.framework.core.IntArrayValuable;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public enum CouponTemplateStatusEnum implements IntArrayValuable {
|
||||
|
||||
ENABLE(1, "生效中"),
|
||||
DISABLE(2, "已失效"),
|
||||
// EXPIRE(3, "已过期"), TODO 芋艿,暂时不考虑过期的
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CouponTemplateStatusEnum::getValue).toArray();
|
||||
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
private final Integer value;
|
||||
/**
|
||||
* 名字
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
CouponTemplateStatusEnum(Integer value, String name) {
|
||||
this.value = value;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.constant;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public enum CouponTemplateTypeEnum {
|
||||
|
||||
CARD(1, "优惠劵"),
|
||||
CODE(2, "折扣卷"),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CouponTemplateTypeEnum::getValue).toArray();
|
||||
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
private final Integer value;
|
||||
/**
|
||||
* 名字
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
CouponTemplateTypeEnum(Integer value, String name) {
|
||||
this.value = value;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.constant;
|
||||
|
||||
/**
|
||||
* 匹配类型枚举
|
||||
*/
|
||||
public enum MeetTypeEnum {
|
||||
|
||||
PRICE(1, "金额"),
|
||||
QUANTITY(2, "数量"),;
|
||||
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
private final Integer value;
|
||||
/**
|
||||
* 名字
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
MeetTypeEnum(Integer value, String name) {
|
||||
this.value = value;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.constant;
|
||||
|
||||
import cn.iocoder.common.framework.core.IntArrayValuable;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 优惠类型枚举
|
||||
*/
|
||||
public enum PreferentialTypeEnum implements IntArrayValuable {
|
||||
|
||||
PRICE(1, "减价"),
|
||||
DISCOUNT(2, "打折"),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(PreferentialTypeEnum::getValue).toArray();
|
||||
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
private final Integer value;
|
||||
/**
|
||||
* 名字
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
PreferentialTypeEnum(Integer value, String name) {
|
||||
this.value = value;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.constant;
|
||||
|
||||
import cn.iocoder.common.framework.core.IntArrayValuable;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 商品推荐类型
|
||||
*/
|
||||
public enum ProductRecommendTypeEnum implements IntArrayValuable {
|
||||
|
||||
HOT(1, "热卖推荐"),
|
||||
NEW(2, "新品推荐"),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ProductRecommendTypeEnum::getValue).toArray();
|
||||
|
||||
/**
|
||||
* 状态值
|
||||
*/
|
||||
private final Integer value;
|
||||
/**
|
||||
* 状态名
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
ProductRecommendTypeEnum(Integer value, String name) {
|
||||
this.value = value;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public static boolean isValid(Integer status) {
|
||||
if (status == null) {
|
||||
return false;
|
||||
}
|
||||
return HOT.value.equals(status)
|
||||
|| NEW.value.equals(status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.constant;
|
||||
|
||||
/**
|
||||
* 促销活动状态枚举
|
||||
*/
|
||||
public enum PromotionActivityStatusEnum {
|
||||
|
||||
WAIT(10, "未开始"),
|
||||
RUN(20, "进行中"),
|
||||
END(30, "已结束"),
|
||||
/**
|
||||
* 1. WAIT、RUN、END 可以转换成 INVALID 状态。
|
||||
* 2. INVALID 只可以转换成 DELETED 状态。
|
||||
*/
|
||||
INVALID(40, "已撤销"),
|
||||
DELETED(50, "已删除"),
|
||||
;
|
||||
|
||||
/**
|
||||
* 状态值
|
||||
*/
|
||||
private final Integer value;
|
||||
/**
|
||||
* 状态名
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
PromotionActivityStatusEnum(Integer value, String name) {
|
||||
this.value = value;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.constant;
|
||||
|
||||
/**
|
||||
* 推广活动类型枚举
|
||||
*/
|
||||
public enum PromotionActivityTypeEnum {
|
||||
|
||||
TIME_LIMITED_DISCOUNT(1, "限时折扣"),
|
||||
FULL_PRIVILEGE(2, "满减送"),
|
||||
;
|
||||
|
||||
/**
|
||||
* 类型值
|
||||
*/
|
||||
private final Integer value;
|
||||
/**
|
||||
* 类型名
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
PromotionActivityTypeEnum(Integer value, String name) {
|
||||
this.value = value;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.constant;
|
||||
|
||||
/**
|
||||
* 错误码枚举类
|
||||
*
|
||||
* 营销系统,使用 1-006-000-000 段
|
||||
*/
|
||||
public enum PromotionErrorCodeEnum {
|
||||
|
||||
// ========== Banner 模块 ==========
|
||||
BANNER_NOT_EXISTS(1006000000, "账号不存在"),
|
||||
|
||||
// ========== PRODUCT RECOMMEND 模块 ==========
|
||||
PRODUCT_RECOMMEND_NOT_EXISTS(1006001000, "商品推荐不存在"),
|
||||
PRODUCT_RECOMMEND_PRODUCT_NOT_EXISTS(1006001001, "商品不存在"),
|
||||
PRODUCT_RECOMMEND_EXISTS(1006001002, "该商品推荐已经存在"),
|
||||
|
||||
|
||||
// ========== COUPON TEMPLATE 模块 ==========
|
||||
COUPON_TEMPLATE_NOT_EXISTS(1006002000, "优惠劵模板(码)不存在"),
|
||||
COUPON_TEMPLATE_NOT_CARD(1006002001, "不是优惠劵模板"),
|
||||
COUPON_TEMPLATE_NOT_CODE(1006002002, "不是优惠码模板"),
|
||||
COUPON_TEMPLATE_TOTAL_CAN_NOT_REDUCE(1006002003, "优惠劵(码)模板的发放数量不能减小"),
|
||||
COUPON_TEMPLATE_STATUS_NOT_ENABLE(1006002004, "优惠劵模板(码)未开启"),
|
||||
COUPON_TEMPLATE_TOTAL_NOT_ENOUGH(1006002005, "优惠劵(码)模板的发放量不足"),
|
||||
COUPON_TEMPLATE_CARD_ADD_EXCEED_QUOTA(1006002006, "优惠劵领取到达上限"),
|
||||
|
||||
// ========== COUPON CARD 模块 ==========
|
||||
COUPON_CARD_NOT_EXISTS(1006003000, "优惠劵不存在"),
|
||||
COUPON_CARD_ERROR_USER(1006003001, "优惠劵不属于当前用户"),
|
||||
COUPON_CARD_NOT_MATCH(1006003002, "优惠劵不匹配,无法使用"),
|
||||
COUPON_CARD_STATUS_NOT_UNUSED(1006003003, "优惠劵不处于待使用状态"),
|
||||
COUPON_CARD_STATUS_NOT_USED(1006003004, "优惠劵不处于已使用状态"),
|
||||
;
|
||||
|
||||
|
||||
private final int code;
|
||||
private final String message;
|
||||
|
||||
PromotionErrorCodeEnum(int code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.constant;
|
||||
|
||||
import cn.iocoder.common.framework.core.IntArrayValuable;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public enum RangeTypeEnum implements IntArrayValuable {
|
||||
|
||||
ALL(10, "所有可用"),
|
||||
PRODUCT_INCLUDE_PART(20, "部分商品可用,或指定商品可用"),
|
||||
PRODUCT_EXCLUDE_PART(21, "部分商品不可用,或指定商品可用"),
|
||||
CATEGORY_INCLUDE_PART(30, "部分分类可用,或指定分类可用"),
|
||||
CATEGORY_EXCLUDE_PART(31, "部分分类不可用,或指定分类可用"),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(RangeTypeEnum::getValue).toArray();
|
||||
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
private final Integer value;
|
||||
/**
|
||||
* 名字
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
RangeTypeEnum(Integer value, String name) {
|
||||
this.value = value;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import org.hibernate.validator.constraints.URL;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Banner 添加 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class BannerAddDTO implements Serializable {
|
||||
|
||||
@NotEmpty(message = "标题不能为空")
|
||||
@Length(min = 2, max = 32, message = "标题长度为 2-32 位")
|
||||
private String title;
|
||||
@NotEmpty(message = "跳转链接不能为空")
|
||||
@URL(message = "跳转链接格式不正确")
|
||||
@Length(max = 255, message = "跳转链接最大长度为 255 位")
|
||||
private String url;
|
||||
@NotEmpty(message = "图片链接不能为空")
|
||||
@URL(message = "图片链接格式不正确")
|
||||
@Length(max = 255, message = "图片链接最大长度为 255 位")
|
||||
private String picUrl;
|
||||
@NotNull(message = "排序不能为空")
|
||||
private Integer sort;
|
||||
@Length(max = 255, message = "备注最大长度为 255 位")
|
||||
private String memo;
|
||||
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Banner 分页 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class BannerPageDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 标题,模糊匹配
|
||||
*/
|
||||
private String title;
|
||||
|
||||
@NotNull(message = "页码不能为空")
|
||||
private Integer pageNo;
|
||||
@NotNull(message = "每页条数不能为空")
|
||||
private Integer pageSize;
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import org.hibernate.validator.constraints.URL;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Banner 更新 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class BannerUpdateDTO implements Serializable {
|
||||
|
||||
@NotNull(message = "编号不能为空")
|
||||
private Integer id;
|
||||
@NotEmpty(message = "标题不能为空")
|
||||
@Length(min = 2, max = 32, message = "标题长度为 2-32 位")
|
||||
private String title;
|
||||
@NotEmpty(message = "跳转链接不能为空")
|
||||
@URL(message = "跳转链接格式不正确")
|
||||
@Length(max = 255, message = "跳转链接最大长度为 255 位")
|
||||
private String url;
|
||||
@NotEmpty(message = "图片链接不能为空")
|
||||
@URL(message = "图片链接格式不正确")
|
||||
@Length(max = 255, message = "图片链接最大长度为 255 位")
|
||||
private String picUrl;
|
||||
@NotNull(message = "排序不能为空")
|
||||
private Integer sort;
|
||||
@Length(max = 255, message = "备注最大长度为 255 位")
|
||||
private String memo;
|
||||
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 优惠劵分页 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class CouponCardPageDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
@NotNull(message = "页码不能为空")
|
||||
private Integer pageNo;
|
||||
@NotNull(message = "每页条数不能为空")
|
||||
private Integer pageSize;
|
||||
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 优惠劵商品 DTO
|
||||
*
|
||||
* 主要用于 {@link cn.iocoder.mall.promotion.api.CouponService#getCouponCardList(Integer, List)}
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class CouponCardSpuDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 商品 SPU 编号
|
||||
*/
|
||||
private Integer spuId;
|
||||
/**
|
||||
* 商品 SKU 编号
|
||||
*/
|
||||
private Integer skuId;
|
||||
/**
|
||||
* 分类编号
|
||||
*/
|
||||
private Integer categoryId;
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private Integer price;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Integer quantity;
|
||||
|
||||
}
|
||||
@@ -1,143 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.dto;
|
||||
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import cn.iocoder.mall.promotion.api.constant.CouponTemplateDateTypeEnum;
|
||||
import cn.iocoder.mall.promotion.api.constant.PreferentialTypeEnum;
|
||||
import cn.iocoder.mall.promotion.api.constant.RangeTypeEnum;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 优惠劵模板添加 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class CouponCardTemplateAddDTO implements Serializable {
|
||||
|
||||
// ========== 基本信息 BEGIN ==========
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@NotEmpty(message = "标题不能为空")
|
||||
@Length(min = 2, max = 16, message = "标题长度为 {min}-{max} 位")
|
||||
private String title;
|
||||
/**
|
||||
* 使用说明
|
||||
*/
|
||||
@Length(max = 255, message = "使用说明最大长度为 {max} 位")
|
||||
private String description;
|
||||
// ========== 基本信息 END ==========
|
||||
|
||||
// ========== 领取规则 BEGIN ==========
|
||||
/**
|
||||
* 每人限领个数
|
||||
*/
|
||||
@NotNull(message = "每人限领个数不能为空")
|
||||
@Min(value = 1, message = "每人限领个数最小为 {value}")
|
||||
private Integer quota;
|
||||
/**
|
||||
* 发放总量
|
||||
*/
|
||||
@NotNull(message = "发放总量不能为空")
|
||||
@Min(value = 1, message = "每人限领个数最小为 {value}")
|
||||
private Integer total;
|
||||
// ========== 领取规则 END ==========
|
||||
|
||||
// ========== 使用规则 BEGIN ==========
|
||||
/**
|
||||
* 是否设置满多少金额可用,单位:分
|
||||
*
|
||||
* 0-不限制
|
||||
* 大于0-多少金额可用
|
||||
*/
|
||||
@NotNull(message = "使用金额门槛不能为空")
|
||||
@Min(value = 0L, message = "使用金额门槛最低为 {value}")
|
||||
private Integer priceAvailable;
|
||||
/**
|
||||
* 可用范围的类型
|
||||
*
|
||||
* 10-全部(ALL):所有可用
|
||||
* 20-部分(PART):部分商品可用,或指定商品可用
|
||||
* 21-部分(PART):部分商品不可用,或指定商品可用
|
||||
* 30-部分(PART):部分分类可用,或指定分类可用
|
||||
* 31-部分(PART):部分分类不可用,或指定分类可用
|
||||
*/
|
||||
@NotNull(message = "可用范围的类型不能为空")
|
||||
@InEnum(value = RangeTypeEnum.class, message = "可用范围的类型必须在 {value}")
|
||||
private Integer rangeType;
|
||||
/**
|
||||
* 指定商品 / 分类列表,使用逗号分隔商品编号
|
||||
*/
|
||||
private String rangeValues;
|
||||
/**
|
||||
* 生效日期类型
|
||||
*
|
||||
* 1-固定日期
|
||||
* 2-领取日期:领到券 {@link #fixedEndTerm} 日开始 N 天内有效
|
||||
*/
|
||||
@NotNull(message = "生效日期类型不能为空")
|
||||
@InEnum(value = CouponTemplateDateTypeEnum.class, message = "生效日期类型必须在 {value}")
|
||||
private Integer dateType;
|
||||
/**
|
||||
* 固定日期-生效开始时间
|
||||
*/
|
||||
private Date validStartTime;
|
||||
/**
|
||||
* 固定日期-生效结束时间
|
||||
*/
|
||||
private Date validEndTime;
|
||||
/**
|
||||
* 领取日期-开始天数
|
||||
*
|
||||
* 例如,0-当天;1-次天
|
||||
*/
|
||||
@Min(value = 0L, message = "领取日期开始时间最小为 {value}")
|
||||
private Integer fixedBeginTerm;
|
||||
/**
|
||||
* 领取日期-结束天数
|
||||
*/
|
||||
@Min(value = 1L, message = "领取日期结束时间最小为 {value}")
|
||||
private Integer fixedEndTerm;
|
||||
// ========== 使用规则 END ==========
|
||||
|
||||
// ========== 使用效果 BEGIN ==========
|
||||
/**
|
||||
* 优惠类型
|
||||
*
|
||||
* 1-代金卷
|
||||
* 2-折扣卷
|
||||
*/
|
||||
@NotNull(message = "优惠类型不能为空")
|
||||
@InEnum(value = PreferentialTypeEnum.class, message = "优惠类型必须在 {value}")
|
||||
private Integer preferentialType;
|
||||
/**
|
||||
* 优惠金额,单位:分
|
||||
*/
|
||||
@Min(value = 1, message = "优惠金额最小值为 {value}")
|
||||
private Integer priceOff;
|
||||
/**
|
||||
* 折扣百分比。
|
||||
*
|
||||
* 例如,80% 为 80。
|
||||
* 当 100% 为 100 ,则代表免费。
|
||||
*/
|
||||
@Max(value = 100, message = "折扣比最大值为 {value}")
|
||||
private Integer percentOff;
|
||||
/**
|
||||
* 折扣上限,仅在 {@link #preferentialType} 等于 2 时生效。
|
||||
*
|
||||
* 例如,折扣上限为 20 元,当使用 8 折优惠券,订单金额为 1000 元时,最高只可折扣 20 元,而非 80 元。
|
||||
*/
|
||||
@Min(value = 1, message = "折扣上限最小值为 {value}")
|
||||
private Integer discountPriceLimit;
|
||||
// ========== 使用效果 END ==========
|
||||
|
||||
}
|
||||
@@ -1,204 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.dto;
|
||||
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import cn.iocoder.mall.promotion.api.constant.RangeTypeEnum;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 优惠劵模板更新 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class CouponCardTemplateUpdateDTO implements Serializable {
|
||||
|
||||
@NotNull(message = "编号不能为空")
|
||||
private Integer id;
|
||||
|
||||
// ========== 基本信息 BEGIN ==========
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@NotEmpty(message = "标题不能为空")
|
||||
@Length(min = 2, max = 16, message = "标题长度为 {min}-{max} 位")
|
||||
private String title;
|
||||
/**
|
||||
* 使用说明
|
||||
*/
|
||||
@Length(max = 255, message = "使用说明最大长度为 {max} 位")
|
||||
private String description;
|
||||
// ========== 基本信息 END ==========
|
||||
|
||||
// ========== 领取规则 BEGIN ==========
|
||||
/**
|
||||
* 每人限领个数
|
||||
*/
|
||||
@NotNull(message = "每人限领个数不能为空")
|
||||
@Min(value = 1, message = "每人限领个数最小为 {value}")
|
||||
private Integer quota;
|
||||
/**
|
||||
* 发放总量
|
||||
*/
|
||||
@NotNull(message = "发放总量不能为空")
|
||||
@Min(value = 1, message = "每人限领个数最小为 {value}")
|
||||
private Integer total;
|
||||
// ========== 领取规则 END ==========
|
||||
|
||||
// ========== 使用规则 BEGIN ==========
|
||||
// /**
|
||||
// * 是否设置满多少金额可用,单位:分
|
||||
// *
|
||||
// * 0-不限制
|
||||
// * 大于0-多少金额可用
|
||||
// */
|
||||
// @NotNull(message = "使用金额门槛不能为空")
|
||||
// @Min(value = 0L, message = "使用金额门槛最低为 {value}")
|
||||
// private Integer priceAvailable;
|
||||
/**
|
||||
* 可用范围的类型
|
||||
*
|
||||
* 10-全部(ALL):所有可用
|
||||
* 20-部分(PART):部分商品可用,或指定商品可用
|
||||
* 21-部分(PART):部分商品不可用,或指定商品可用
|
||||
* 30-部分(PART):部分分类可用,或指定分类可用
|
||||
* 31-部分(PART):部分分类不可用,或指定分类可用
|
||||
*/
|
||||
@NotNull(message = "可用范围的类型不能为空")
|
||||
@InEnum(value = RangeTypeEnum.class, message = "可用范围的类型必须在 {value}")
|
||||
private Integer rangeType;
|
||||
/**
|
||||
* 指定商品 / 分类列表,使用逗号分隔商品编号
|
||||
*/
|
||||
private String rangeValues;
|
||||
// /**
|
||||
// * 生效日期类型
|
||||
// *
|
||||
// * 1-固定日期
|
||||
// * 2-领取日期:领到券 {@link #fixedEndTerm} 日开始 N 天内有效
|
||||
// */
|
||||
// @NotNull(message = "生效日期类型不能为空")
|
||||
// @InEnum(value = CouponTemplateDateTypeEnum.class, message = "生效日期类型必须在 {value}")
|
||||
// private Integer dateType;
|
||||
// /**
|
||||
// * 固定日期-生效开始时间
|
||||
// */
|
||||
// private Date validStartTime;
|
||||
// /**
|
||||
// * 固定日期-生效结束时间
|
||||
// */
|
||||
// private Date validEndTime;
|
||||
// /**
|
||||
// * 领取日期-开始天数
|
||||
// *
|
||||
// * 例如,0-当天;1-次天
|
||||
// */
|
||||
// @Min(value = 0L, message = "领取日期开始时间最小为 {value}")
|
||||
// private Integer fixedBeginTerm;
|
||||
// /**
|
||||
// * 领取日期-结束天数
|
||||
// */
|
||||
// @Min(value = 1L, message = "领取日期结束时间最小为 {value}")
|
||||
// private Integer fixedEndTerm;
|
||||
// ========== 使用规则 END ==========
|
||||
|
||||
// ========== 使用效果 BEGIN ==========
|
||||
// /**
|
||||
// * 优惠类型
|
||||
// *
|
||||
// * 1-代金卷
|
||||
// * 2-折扣卷
|
||||
// */
|
||||
// @NotNull(message = "优惠类型不能为空")
|
||||
// @InEnum(value = CouponTemplatePreferentialTypeEnum.class, message = "优惠类型必须在 {value}")
|
||||
// private Integer preferentialType;
|
||||
// /**
|
||||
// * 优惠金额,单位:分
|
||||
// */
|
||||
// @Min(value = 1, message = "优惠金额最小值为 {value}")
|
||||
// private Integer priceOff;
|
||||
// /**
|
||||
// * 折扣百分比。
|
||||
// *
|
||||
// * 例如,80% 为 80。
|
||||
// * 当 100% 为 100 ,则代表免费。
|
||||
// */
|
||||
// @Max(value = 100, message = "折扣比最大值为 {value}")
|
||||
// private Integer percentOff;
|
||||
// /**
|
||||
// * 折扣上限,仅在 {@link #preferentialType} 等于 2 时生效。
|
||||
// *
|
||||
// * 例如,折扣上限为 20 元,当使用 8 折优惠券,订单金额为 1000 元时,最高只可折扣 20 元,而非 80 元。
|
||||
// */
|
||||
// @Min(value = 1, message = "折扣上限最小值为 {value}")
|
||||
// private Integer discountPriceLimit;
|
||||
// ========== 使用效果 END ==========
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public CouponCardTemplateUpdateDTO setId(Integer id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public CouponCardTemplateUpdateDTO setTitle(String title) {
|
||||
this.title = title;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public CouponCardTemplateUpdateDTO setDescription(String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getQuota() {
|
||||
return quota;
|
||||
}
|
||||
|
||||
public CouponCardTemplateUpdateDTO setQuota(Integer quota) {
|
||||
this.quota = quota;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public CouponCardTemplateUpdateDTO setTotal(Integer total) {
|
||||
this.total = total;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getRangeType() {
|
||||
return rangeType;
|
||||
}
|
||||
|
||||
public CouponCardTemplateUpdateDTO setRangeType(Integer rangeType) {
|
||||
this.rangeType = rangeType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRangeValues() {
|
||||
return rangeValues;
|
||||
}
|
||||
|
||||
public CouponCardTemplateUpdateDTO setRangeValues(String rangeValues) {
|
||||
this.rangeValues = rangeValues;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 优惠码模板添加 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class CouponCodeTemplateAddDTO implements Serializable {
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 优惠码模板更新 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class CouponCodeTemplateUpdateDTO implements Serializable {
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 优惠劵模板分页 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class CouponTemplatePageDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 优惠类型
|
||||
*/
|
||||
private Integer preferentialType;
|
||||
|
||||
@NotNull(message = "页码不能为空")
|
||||
private Integer pageNo;
|
||||
@NotNull(message = "每页条数不能为空")
|
||||
private Integer pageSize;
|
||||
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.dto;
|
||||
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import cn.iocoder.mall.promotion.api.constant.ProductRecommendTypeEnum;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 商品推荐添加 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ProductRecommendAddDTO implements Serializable {
|
||||
|
||||
@InEnum(value = ProductRecommendTypeEnum.class, message = "修改推荐类型必须是 {value}")
|
||||
@NotNull(message = "推荐类型不能为空")
|
||||
private Integer type;
|
||||
@NotNull(message = "商品编号不能为空")
|
||||
private Integer productSpuId;
|
||||
@NotNull(message = "排序不能为空")
|
||||
private Integer sort;
|
||||
@Length(max = 255, message = "备注最大长度为 255 位")
|
||||
private String memo;
|
||||
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 商品推荐分页 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ProductRecommendPageDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 推荐类型
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
@NotNull(message = "页码不能为空")
|
||||
private Integer pageNo;
|
||||
@NotNull(message = "每页条数不能为空")
|
||||
private Integer pageSize;
|
||||
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.dto;
|
||||
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import cn.iocoder.mall.promotion.api.constant.ProductRecommendTypeEnum;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 商品推荐更新 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ProductRecommendUpdateDTO implements Serializable {
|
||||
|
||||
@NotNull(message = "编号不能为空")
|
||||
private Integer id;
|
||||
@NotNull(message = "类型不能为空")
|
||||
@InEnum(value = ProductRecommendTypeEnum.class, message = "修改推荐类型必须是 {value}")
|
||||
private Integer type;
|
||||
@NotNull(message = "商品编号不能为空")
|
||||
private Integer productSpuId;
|
||||
@NotNull(message = "排序不能为空")
|
||||
private Integer sort;
|
||||
@Length(max = 255, message = "备注最大长度为 255 位")
|
||||
private String memo;
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 商品推荐分页 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PromotionActivityPageDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*
|
||||
* 模糊匹配
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 活动类型
|
||||
*/
|
||||
private Integer activityType;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Collection<Integer> statuses;
|
||||
|
||||
@NotNull(message = "页码不能为空")
|
||||
private Integer pageNo;
|
||||
@NotNull(message = "每页条数不能为空")
|
||||
private Integer pageSize;
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package cn.iocoder.mall.promotion.biz.config;
|
||||
|
||||
import cn.iocoder.common.framework.util.ServiceExceptionUtil;
|
||||
import cn.iocoder.mall.promotion.api.constant.PromotionErrorCodeEnum;
|
||||
import cn.iocoder.mall.promotion.api.enums.PromotionErrorCodeEnum;
|
||||
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.event.EventListener;
|
||||
|
||||
@@ -38,7 +38,7 @@ public class CouponTemplateDO extends BaseDO {
|
||||
/**
|
||||
* 优惠码状态
|
||||
*
|
||||
* {@link cn.iocoder.mall.promotion.api.constant.CouponTemplateStatusEnum}
|
||||
* {@link cn.iocoder.mall.promotion.api.enums.CouponTemplateStatusEnum}
|
||||
*
|
||||
* 当优惠劵(码)开启中,可以手动操作,设置禁用中。
|
||||
*/
|
||||
|
||||
@@ -2,7 +2,7 @@ package cn.iocoder.mall.promotion.biz.dataobject;
|
||||
|
||||
|
||||
import cn.iocoder.mall.mybatis.core.dataobject.DeletableDO;
|
||||
import cn.iocoder.mall.promotion.api.constant.ProductRecommendTypeEnum;
|
||||
import cn.iocoder.mall.promotion.api.enums.ProductRecommendTypeEnum;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ public class PromotionActivityDO extends BaseDO {
|
||||
/**
|
||||
* 活动类型
|
||||
*
|
||||
* 参见 {@link cn.iocoder.mall.promotion.api.constant.PromotionActivityTypeEnum} 枚举
|
||||
* 参见 {@link cn.iocoder.mall.promotion.api.enums.PromotionActivityTypeEnum} 枚举
|
||||
*/
|
||||
private Integer activityType;
|
||||
// /**
|
||||
@@ -36,7 +36,7 @@ public class PromotionActivityDO extends BaseDO {
|
||||
/**
|
||||
* 活动状态
|
||||
*
|
||||
* 参见 {@link cn.iocoder.mall.promotion.api.constant.PromotionActivityStatusEnum} 枚举
|
||||
* 参见 {@link cn.iocoder.mall.promotion.api.enums.PromotionActivityStatusEnum} 枚举
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
@@ -165,7 +165,7 @@ public class PromotionActivityDO extends BaseDO {
|
||||
/**
|
||||
* 可用范围的类型
|
||||
*
|
||||
* 参见 {@link cn.iocoder.mall.promotion.api.constant.RangeTypeEnum} 枚举
|
||||
* 参见 {@link cn.iocoder.mall.promotion.api.enums.RangeTypeEnum} 枚举
|
||||
* 暂时只用 “所有可用” + “PRODUCT_INCLUDE_PRT”
|
||||
*/
|
||||
private Integer rangeType;
|
||||
|
||||
@@ -6,7 +6,7 @@ import cn.iocoder.mall.mybatis.core.enums.DeletedStatusEnum;
|
||||
import cn.iocoder.mall.promotion.api.BannerService;
|
||||
import cn.iocoder.mall.promotion.api.bo.BannerBO;
|
||||
import cn.iocoder.mall.promotion.api.bo.BannerPageBO;
|
||||
import cn.iocoder.mall.promotion.api.constant.PromotionErrorCodeEnum;
|
||||
import cn.iocoder.mall.promotion.api.enums.PromotionErrorCodeEnum;
|
||||
import cn.iocoder.mall.promotion.api.dto.BannerAddDTO;
|
||||
import cn.iocoder.mall.promotion.api.dto.BannerPageDTO;
|
||||
import cn.iocoder.mall.promotion.api.dto.BannerUpdateDTO;
|
||||
|
||||
@@ -6,7 +6,7 @@ import cn.iocoder.common.framework.util.ServiceExceptionUtil;
|
||||
import cn.iocoder.common.framework.util.StringUtil;
|
||||
import cn.iocoder.mall.promotion.api.CouponService;
|
||||
import cn.iocoder.mall.promotion.api.bo.*;
|
||||
import cn.iocoder.mall.promotion.api.constant.*;
|
||||
import cn.iocoder.mall.promotion.api.enums.*;
|
||||
import cn.iocoder.mall.promotion.api.dto.*;
|
||||
import cn.iocoder.mall.promotion.biz.convert.CouponCardConvert;
|
||||
import cn.iocoder.mall.promotion.biz.convert.CouponTemplateConvert;
|
||||
|
||||
@@ -7,7 +7,7 @@ import cn.iocoder.mall.product.rpc.api.ProductSpuRpc;
|
||||
import cn.iocoder.mall.promotion.api.ProductRecommendService;
|
||||
import cn.iocoder.mall.promotion.api.bo.ProductRecommendBO;
|
||||
import cn.iocoder.mall.promotion.api.bo.ProductRecommendPageBO;
|
||||
import cn.iocoder.mall.promotion.api.constant.PromotionErrorCodeEnum;
|
||||
import cn.iocoder.mall.promotion.api.enums.PromotionErrorCodeEnum;
|
||||
import cn.iocoder.mall.promotion.api.dto.ProductRecommendAddDTO;
|
||||
import cn.iocoder.mall.promotion.api.dto.ProductRecommendPageDTO;
|
||||
import cn.iocoder.mall.promotion.api.dto.ProductRecommendUpdateDTO;
|
||||
|
||||
@@ -3,8 +3,8 @@ package cn.iocoder.mall.promotion.biz.service;
|
||||
import cn.iocoder.mall.promotion.api.PromotionActivityService;
|
||||
import cn.iocoder.mall.promotion.api.bo.PromotionActivityBO;
|
||||
import cn.iocoder.mall.promotion.api.bo.PromotionActivityPageBO;
|
||||
import cn.iocoder.mall.promotion.api.constant.PromotionActivityTypeEnum;
|
||||
import cn.iocoder.mall.promotion.api.constant.RangeTypeEnum;
|
||||
import cn.iocoder.mall.promotion.api.enums.PromotionActivityTypeEnum;
|
||||
import cn.iocoder.mall.promotion.api.enums.RangeTypeEnum;
|
||||
import cn.iocoder.mall.promotion.api.dto.PromotionActivityPageDTO;
|
||||
import cn.iocoder.mall.promotion.biz.convert.PromotionActivityConvert;
|
||||
import cn.iocoder.mall.promotion.biz.dao.PromotionActivityMapper;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package cn.iocoder.mall.promotion.biz.dao;
|
||||
|
||||
import cn.iocoder.common.framework.util.DateUtil;
|
||||
import cn.iocoder.mall.promotion.api.constant.PreferentialTypeEnum;
|
||||
import cn.iocoder.mall.promotion.api.constant.PromotionActivityStatusEnum;
|
||||
import cn.iocoder.mall.promotion.api.constant.PromotionActivityTypeEnum;
|
||||
import cn.iocoder.mall.promotion.api.constant.RangeTypeEnum;
|
||||
import cn.iocoder.mall.promotion.api.enums.PreferentialTypeEnum;
|
||||
import cn.iocoder.mall.promotion.api.enums.PromotionActivityStatusEnum;
|
||||
import cn.iocoder.mall.promotion.api.enums.PromotionActivityTypeEnum;
|
||||
import cn.iocoder.mall.promotion.api.enums.RangeTypeEnum;
|
||||
import cn.iocoder.mall.promotion.biz.dataobject.PromotionActivityDO;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -3,7 +3,7 @@ package cn.iocoder.mall.promotion.application.controller.admins;
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.promotion.api.PromotionActivityService;
|
||||
import cn.iocoder.mall.promotion.api.bo.PromotionActivityPageBO;
|
||||
import cn.iocoder.mall.promotion.api.constant.PromotionActivityStatusEnum;
|
||||
import cn.iocoder.mall.promotion.api.enums.PromotionActivityStatusEnum;
|
||||
import cn.iocoder.mall.promotion.api.dto.PromotionActivityPageDTO;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
|
||||
Reference in New Issue
Block a user