Commit 035c2cf28ca9a14ab899272a04f33a565061fff6

Authored by YunaiV
1 parent cca27636

promotion:完善 优惠劵模板 表~

Showing 49 changed files with 292 additions and 2493 deletions
yudao-module-mall/yudao-module-coupon-api/pom.xml deleted
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<project xmlns="http://maven.apache.org/POM/4.0.0"
3   - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4   - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5   - <parent>
6   - <groupId>cn.iocoder.boot</groupId>
7   - <artifactId>yudao-module-mall</artifactId>
8   - <version>${revision}</version>
9   - </parent>
10   -
11   - <modelVersion>4.0.0</modelVersion>
12   - <artifactId>yudao-module-coupon-api</artifactId>
13   - <packaging>jar</packaging>
14   -
15   -
16   - <name>${project.artifactId}</name>
17   - <description>
18   - coupon 模块 API,暴露给其它模块调用
19   - </description>
20   -
21   - <dependencies>
22   - <dependency>
23   - <groupId>cn.iocoder.boot</groupId>
24   - <artifactId>yudao-common</artifactId>
25   - </dependency>
26   -
27   - <!-- 参数校验 -->
28   - <dependency>
29   - <groupId>org.springframework.boot</groupId>
30   - <artifactId>spring-boot-starter-validation</artifactId>
31   - <optional>true</optional>
32   - </dependency>
33   - </dependencies>
34   -
35   -</project>
36 0 \ No newline at end of file
yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponExpireTimeTypeEnum.java deleted
1   -package cn.iocoder.yudao.module.CouponTemplete.enums;
2   -
3   -
4   -import lombok.Getter;
5   -import lombok.RequiredArgsConstructor;
6   -
7   -
8   -/**
9   - * 优惠券 - 是否开启过期提醒
10   - *
11   - * @author Sin
12   - */
13   -@RequiredArgsConstructor
14   -@Getter
15   -public enum CouponExpireTimeTypeEnum {
16   -
17   - OPEN(1,"不开启"),
18   - CLOSE(0,"开启"),;
19   -
20   - /**
21   - * 是否开启过期提醒
22   - */
23   - private final Integer type;
24   - /**
25   - * 是否开启过期提醒
26   - */
27   - private final String name;
28   -
29   -}
yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponFetchTypeEnum.java deleted
1   -package cn.iocoder.yudao.module.CouponTemplete.enums;
2   -
3   -
4   -import lombok.Getter;
5   -import lombok.RequiredArgsConstructor;
6   -
7   -
8   -/**
9   - * 优惠券 - 领取是否无限制 0
10   - *
11   - * @author Sin
12   - */
13   -@RequiredArgsConstructor
14   -@Getter
15   -public enum CouponFetchTypeEnum {
16   -
17   - LIMIT(1,"限制"),
18   - NOT_LIMIT(0,"不限制"),;
19   -
20   - /**
21   - * 是否开启过期提醒
22   - */
23   - private final Integer type;
24   - /**
25   - * 是否开启过期提醒
26   - */
27   - private final String name;
28   -
29   -}
yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponForbidPreferenceEnum.java deleted
1   -package cn.iocoder.yudao.module.CouponTemplete.enums;
2   -
3   -
4   -import lombok.Getter;
5   -import lombok.RequiredArgsConstructor;
6   -
7   -
8   -/**
9   - * 优惠券 - 优惠叠加类型
10   - *
11   - * @author Sin
12   - */
13   -@RequiredArgsConstructor
14   -@Getter
15   -public enum CouponForbidPreferenceEnum {
16   -
17   - UN_FORBID(0,"不限制"),
18   - FORBID(1,"优惠券仅原价购买商品时可用");
19   -
20   - /**
21   - * 优惠券类型
22   - */
23   - private final Integer type;
24   - /**
25   - * 优惠券类型名
26   - */
27   - private final String name;
28   -
29   -}
yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponGoodsTypeEnum.java deleted
1   -package cn.iocoder.yudao.module.CouponTemplete.enums;
2   -
3   -
4   -import lombok.Getter;
5   -import lombok.RequiredArgsConstructor;
6   -
7   -
8   -/**
9   - * 优惠券 - 优惠券商品使用类型
10   - *
11   - * @author Sin
12   - */
13   -@RequiredArgsConstructor
14   -@Getter
15   -public enum CouponGoodsTypeEnum {
16   -
17   - ALL(1,"全部商品可用"),
18   - POINT_PRODUCT(2,"指定商品可用"),
19   - POINT_PRODUCT_NOT(3,"指定商品不可用"),;
20   -
21   - /**
22   - * 优惠券商品使用类型
23   - */
24   - private final Integer type;
25   - /**
26   - * 优惠券商品使用类型名
27   - */
28   - private final String name;
29   -
30   -}
yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponStatusTypeEnum.java deleted
1   -package cn.iocoder.yudao.module.CouponTemplete.enums;
2   -
3   -
4   -import lombok.Getter;
5   -import lombok.RequiredArgsConstructor;
6   -
7   -
8   -/**
9   - * 优惠券 - 优惠券状态类型
10   - *
11   - * @author Sin
12   - */
13   -@RequiredArgsConstructor
14   -@Getter
15   -public enum CouponStatusTypeEnum {
16   -
17   - PROCESSING(1,"进行中"),
18   - END(2,"已结束"),
19   - CLOSE(3,"已关闭"),;
20   -
21   - /**
22   - * 优惠券类型
23   - */
24   - private final Integer type;
25   - /**
26   - * 优惠券类型名
27   - */
28   - private final String name;
29   -
30   -}
yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponTypeEnum.java deleted
1   -package cn.iocoder.yudao.module.CouponTemplete.enums;
2   -
3   -
4   -import lombok.Getter;
5   -import lombok.RequiredArgsConstructor;
6   -
7   -
8   -/**
9   - * 优惠券 - 优惠券类型
10   - *
11   - * @author Sin
12   - */
13   -@RequiredArgsConstructor
14   -@Getter
15   -public enum CouponTypeEnum {
16   -
17   - REWARD(1,"满减"),
18   - DISCOUNT(2,"折扣"),
19   - RANDOW(3,"随机"),;
20   -
21   - /**
22   - * 优惠券类型
23   - */
24   - private final Integer type;
25   - /**
26   - * 优惠券类型名
27   - */
28   - private final String name;
29   -
30   -}
yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponUseLimitEnum.java deleted
1   -package cn.iocoder.yudao.module.CouponTemplete.enums;
2   -
3   -
4   -import lombok.Getter;
5   -import lombok.RequiredArgsConstructor;
6   -
7   -
8   -/**
9   - * 优惠券使用类型 - 优惠券使用类型类型
10   - *
11   - * @author Sin
12   - */
13   -@RequiredArgsConstructor
14   -@Getter
15   -public enum CouponUseLimitEnum {
16   -
17   - HAS_LIMIT(1,"无门槛"),
18   - NO_LIMIT(2,"有门槛"),;
19   -
20   - /**
21   - * 优惠券使用类型
22   - */
23   - private final Integer type;
24   - /**
25   - * 优惠券使用类型名
26   - */
27   - private final String name;
28   -
29   -}
yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponValidityTypeEnum.java deleted
1   -package cn.iocoder.yudao.module.CouponTemplete.enums;
2   -
3   -import lombok.Getter;
4   -import lombok.RequiredArgsConstructor;
5   -
6   -/**
7   - * 过期类型 - 状态
8   - *
9   - * @author Sin
10   - */
11   -@RequiredArgsConstructor
12   -@Getter
13   -public enum CouponValidityTypeEnum {
14   -
15   - TIME_RANGE_EXPIRTED(1,"时间范围过期"),
16   - EXPIRES_AFTER_FIXED_DATE(2,"领取之日固定日期后过期"),
17   - EXPIRES_DATE_NEXT_FIEXD_DATE(3,"领取次日固定日期后过期"),;
18   -
19   -
20   - /**
21   - * 状态值
22   - */
23   - private final Integer status;
24   - /**
25   - * 状态名
26   - */
27   - private final String name;
28   -
29   -}
yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/ErrorCodeConstants.java deleted
1   -package cn.iocoder.yudao.module.CouponTemplete.enums;
2   -
3   -import cn.iocoder.yudao.framework.common.exception.ErrorCode;
4   -
5   -/**
6   - * coupon 优惠券错误码枚举类
7   - *
8   - * coupon 优惠券系统,使用 1-010-000-000 段
9   - */
10   -public interface ErrorCodeConstants {
11   - // ========== COUPON分类相关 1010001000 ============
12   -
13   - ErrorCode COUPON_TEMPLETE_NOT_EXISTS = new ErrorCode(1010001000, "优惠券模板不存在");
14   - ErrorCode MONEY_NOT_NULL = new ErrorCode(1010001001, "当type为reward时需要添加发放面额不能为空");
15   - ErrorCode DISCOUNT_NOT_NULL = new ErrorCode(1010001001, "当type为discount时需要添加折扣不能为空");
16   - ErrorCode DISCOUNT_LIMIT_NOT_NULL = new ErrorCode(1010001001, "当type为discount时可选择性添加最多折扣金额不能为空");
17   - ErrorCode MIN_MAX_NOT_NULL = new ErrorCode(1010001001, "当type为radom时需要添加最低金额");
18   - ErrorCode START_END_TIME_NOT_NULL = new ErrorCode(1010001001, "使用开始日期,使用结束日期不能为空");
19   - ErrorCode FIXED_TERM_NOT_NULL = new ErrorCode(1010001001, "领取之日起或者次日N天内有效不能为空");
20   -
21   -
22   - // ========== COUPON分类相关 1010002000 ============
23   - ErrorCode COUPON_NOT_EXISTS = new ErrorCode(1010001000, "优惠券模板不存在");
24   -
25   -
26   -}
27   -
yudao-module-mall/yudao-module-coupon-biz/pom.xml deleted
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<project xmlns="http://maven.apache.org/POM/4.0.0"
3   - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4   - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5   - <parent>
6   - <groupId>cn.iocoder.boot</groupId>
7   - <artifactId>yudao-module-mall</artifactId>
8   - <version>${revision}</version>
9   - </parent>
10   - <modelVersion>4.0.0</modelVersion>
11   - <packaging>jar</packaging>
12   - <artifactId>yudao-module-coupon-biz</artifactId>
13   -
14   - <name>${project.artifactId}</name>
15   -
16   - <description>
17   - coupon模块,主要负责优惠券的一些业务,含发布优惠券模板,分发优惠券等
18   - </description>
19   -
20   - <dependencies>
21   -
22   - <dependency>
23   - <groupId>cn.iocoder.boot</groupId>
24   - <artifactId>yudao-module-coupon-api</artifactId>
25   - <version>${revision}</version>
26   - </dependency>
27   -
28   - <!-- 业务组件 -->
29   - <dependency>
30   - <groupId>cn.iocoder.boot</groupId>
31   - <artifactId>yudao-spring-boot-starter-biz-operatelog</artifactId>
32   - </dependency>
33   -
34   - <!-- Web 相关 -->
35   - <dependency>
36   - <groupId>cn.iocoder.boot</groupId>
37   - <artifactId>yudao-spring-boot-starter-web</artifactId>
38   - </dependency>
39   - <dependency>
40   - <groupId>cn.iocoder.boot</groupId>
41   - <artifactId>yudao-spring-boot-starter-security</artifactId>
42   - </dependency>
43   -
44   - <!-- DB 相关 -->
45   - <dependency>
46   - <groupId>cn.iocoder.boot</groupId>
47   - <artifactId>yudao-spring-boot-starter-mybatis</artifactId>
48   - </dependency>
49   -
50   - <!-- Test 测试相关 -->
51   - <dependency>
52   - <groupId>cn.iocoder.boot</groupId>
53   - <artifactId>yudao-spring-boot-starter-test</artifactId>
54   - </dependency>
55   -
56   - <!-- 工具类相关 -->
57   - <dependency>
58   - <groupId>cn.iocoder.boot</groupId>
59   - <artifactId>yudao-spring-boot-starter-excel</artifactId>
60   - </dependency>
61   -
62   - </dependencies>
63   -
64   -</project>
yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupon/CouponController.java deleted
1   -package cn.iocoder.yudao.module.coupon.controller.admin.coupon;
2   -
3   -import org.springframework.web.bind.annotation.*;
4   -import javax.annotation.Resource;
5   -import org.springframework.validation.annotation.Validated;
6   -import org.springframework.security.access.prepost.PreAuthorize;
7   -import io.swagger.annotations.*;
8   -
9   -import javax.validation.*;
10   -import java.util.*;
11   -
12   -import cn.iocoder.yudao.framework.common.pojo.PageResult;
13   -import cn.iocoder.yudao.framework.common.pojo.CommonResult;
14   -import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
15   -
16   -
17   -import cn.iocoder.yudao.module.coupon.controller.admin.coupon.vo.*;
18   -import cn.iocoder.yudao.module.coupon.dal.dataobject.coupon.CouponDO;
19   -import cn.iocoder.yudao.module.coupon.convert.coupon.CouponConvert;
20   -import cn.iocoder.yudao.module.coupon.service.coupon.CouponService;
21   -
22   -@Api(tags = "管理后台 - 优惠券")
23   -@RestController
24   -@RequestMapping("/coupon/item")
25   -@Validated
26   -public class CouponController {
27   -
28   - @Resource
29   - private CouponService couponService;
30   -
31   -
32   - //todo 用户优惠券
33   - @PostMapping("/create")
34   - @ApiOperation("用户领取优惠券")
35   - @PreAuthorize("@ss.hasPermission('coupon::create')")
36   - public CommonResult<Long> create(@RequestParam("couponTemplateId") Long couponTemplateId) {
37   -
38   - return success(couponService.create(couponTemplateId));
39   - }
40   -
41   -
42   - @PutMapping("/update")
43   - @ApiOperation("更新优惠券")
44   - @PreAuthorize("@ss.hasPermission('coupon::update')")
45   - public CommonResult<Boolean> update(@Valid @RequestBody CouponUpdateReqVO updateReqVO) {
46   - couponService.update(updateReqVO);
47   - return success(true);
48   - }
49   -
50   - @DeleteMapping("/delete")
51   - @ApiOperation("删除优惠券")
52   - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
53   - @PreAuthorize("@ss.hasPermission('coupon::delete')")
54   - public CommonResult<Boolean> delete(@RequestParam("id") Long id) {
55   - couponService.delete(id);
56   - return success(true);
57   - }
58   -
59   - @GetMapping("/get")
60   - @ApiOperation("获得优惠券")
61   - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
62   - @PreAuthorize("@ss.hasPermission('coupon::query')")
63   - public CommonResult<CouponRespVO> get(@RequestParam("id") Long id) {
64   - CouponDO couponDO = couponService.get(id);
65   - return success(CouponConvert.INSTANCE.convert(couponDO));
66   - }
67   -
68   -
69   -
70   - @GetMapping("/list")
71   - @ApiOperation("获得优惠券列表")
72   - @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
73   - @PreAuthorize("@ss.hasPermission('coupon::query')")
74   - public CommonResult<List<CouponRespVO>> getList(@RequestParam("ids") Collection<Long> ids) {
75   - List<CouponDO> list = couponService.getList(ids);
76   - return success(CouponConvert.INSTANCE.convertList(list));
77   - }
78   -
79   - @GetMapping("/page")
80   - @ApiOperation("获得优惠券分页")
81   - @PreAuthorize("@ss.hasPermission('coupon::query')")
82   - public CommonResult<PageResult<CouponRespVO>> getPage(@Valid CouponPageReqVO pageVO) {
83   - PageResult<CouponDO> pageResult = couponService.getPage(pageVO);
84   - return success(CouponConvert.INSTANCE.convertPage(pageResult));
85   - }
86   -
87   -
88   -}
yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupon/vo/CouponBaseVO.java deleted
1   -package cn.iocoder.yudao.module.coupon.controller.admin.coupon.vo;
2   -
3   -import lombok.*;
4   -import java.util.*;
5   -import java.math.BigDecimal;
6   -import io.swagger.annotations.*;
7   -import javax.validation.constraints.*;
8   -import org.springframework.format.annotation.DateTimeFormat;
9   -
10   -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
11   -
12   -/**
13   -* 优惠券 Base VO,提供给添加、修改、详细的子 VO 使用
14   -* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
15   -*/
16   -@Data
17   -public class CouponBaseVO {
18   -
19   - @ApiModelProperty(value = "优惠券类型 reward-满减 discount-折扣 random-随机", required = true)
20   - @NotNull(message = "优惠券类型 reward-满减 discount-折扣 random-随机不能为空")
21   - private String type;
22   -
23   - @ApiModelProperty(value = "优惠券名称", required = true)
24   - @NotNull(message = "优惠券名称不能为空")
25   - private String name;
26   -
27   - @ApiModelProperty(value = "优惠券类型id")
28   - private Long couponTypeId;
29   -
30   - @ApiModelProperty(value = "优惠券编码", required = true)
31   - @NotNull(message = "优惠券编码不能为空")
32   - private String couponCode;
33   -
34   - @ApiModelProperty(value = "领用人", required = true)
35   - @NotNull(message = "领用人不能为空")
36   - private Long memberId;
37   -
38   - @ApiModelProperty(value = "优惠券使用订单id", required = true)
39   - @NotNull(message = "优惠券使用订单id不能为空")
40   - private Long useOrderId;
41   -
42   - @ApiModelProperty(value = "适用商品类型1-全部商品可用;2-指定商品可用;3-指定商品不可用", required = true)
43   - @NotNull(message = "适用商品类型1-全部商品可用;2-指定商品可用;3-指定商品不可用不能为空")
44   - private Boolean goodsType;
45   -
46   - @ApiModelProperty(value = "适用商品id", required = true)
47   - @NotNull(message = "适用商品id不能为空")
48   - private String goodsIds;
49   -
50   - @ApiModelProperty(value = "最小金额", required = true)
51   - @NotNull(message = "最小金额不能为空")
52   - private BigDecimal atLeast;
53   -
54   - @ApiModelProperty(value = "面额", required = true)
55   - @NotNull(message = "面额不能为空")
56   - private BigDecimal money;
57   -
58   - @ApiModelProperty(value = "1 =< 折扣 <= 9.9 当type为discount时需要添加", required = true)
59   - @NotNull(message = "1 =< 折扣 <= 9.9 当type为discount时需要添加不能为空")
60   - private BigDecimal discount;
61   -
62   - @ApiModelProperty(value = "最多折扣金额 当type为discount时可选择性添加", required = true)
63   - @NotNull(message = "最多折扣金额 当type为discount时可选择性添加不能为空")
64   - private BigDecimal discountLimit;
65   -
66   - @ApiModelProperty(value = "优惠叠加 0-不限制 1- 优惠券仅原价购买商品时可用", required = true)
67   - @NotNull(message = "优惠叠加 0-不限制 1- 优惠券仅原价购买商品时可用不能为空")
68   - private Boolean whetherForbidPreference;
69   -
70   - @ApiModelProperty(value = "是否开启过期提醒0-不开启 1-开启", required = true)
71   - @NotNull(message = "是否开启过期提醒0-不开启 1-开启")
72   - private Boolean whetherExpireNotice;
73   -
74   - @ApiModelProperty(value = "过期前N天提醒", required = true)
75   - @NotNull(message = "过期前N天提醒不能为空")
76   - private Integer expireNoticeFixedTerm;
77   -
78   - @ApiModelProperty(value = "是否已提醒", required = true)
79   - @NotNull(message = "是否已提醒不能为空")
80   - private Boolean whetherNoticed;
81   -
82   - @ApiModelProperty(value = "优惠券状态 1已领用(未使用) 2已使用 3已过期", required = true)
83   - @NotNull(message = "优惠券状态 1已领用(未使用) 2已使用 3已过期不能为空")
84   - private Integer state;
85   -
86   - @ApiModelProperty(value = "获取方式1订单2.直接领取3.活动领取 4转赠 5分享获取", required = true)
87   - @NotNull(message = "获取方式1订单2.直接领取3.活动领取 4转赠 5分享获取不能为空")
88   - private Boolean getType;
89   -
90   - @ApiModelProperty(value = "领取时间", required = true)
91   - @NotNull(message = "领取时间不能为空")
92   - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
93   - private Date fetchTime;
94   -
95   - @ApiModelProperty(value = "使用时间", required = true)
96   - @NotNull(message = "使用时间不能为空")
97   - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
98   - private Date useTime;
99   -
100   - @ApiModelProperty(value = "可使用的开始时间", required = true)
101   - @NotNull(message = "可使用的开始时间不能为空")
102   - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
103   - private Date startTime;
104   -
105   - @ApiModelProperty(value = "有效期结束时间", required = true)
106   - @NotNull(message = "有效期结束时间不能为空")
107   - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
108   - private Date endTime;
109   -
110   -}
yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupon/vo/CouponCreateReqVO.java deleted
1   -package cn.iocoder.yudao.module.coupon.controller.admin.coupon.vo;
2   -
3   -import lombok.*;
4   -import java.util.*;
5   -import io.swagger.annotations.*;
6   -import javax.validation.constraints.*;
7   -
8   -@ApiModel("管理后台 - 优惠券创建 Request VO")
9   -@Data
10   -@EqualsAndHashCode(callSuper = true)
11   -@ToString(callSuper = true)
12   -public class CouponCreateReqVO extends CouponBaseVO {
13   -
14   -}
yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupon/vo/CouponExcelVO.java deleted
1   -package cn.iocoder.yudao.module.coupon.controller.admin.coupon.vo;
2   -
3   -import lombok.*;
4   -import java.util.*;
5   -import java.math.BigDecimal;
6   -import io.swagger.annotations.*;
7   -
8   -import com.alibaba.excel.annotation.ExcelProperty;
9   -
10   -/**
11   - * 优惠券 Excel VO
12   - *
13   - * @author wxr
14   - */
15   -@Data
16   -public class CouponExcelVO {
17   -
18   - @ExcelProperty("用户ID")
19   - private Long id;
20   -
21   - @ExcelProperty("优惠券类型 reward-满减 discount-折扣 random-随机")
22   - private String type;
23   -
24   - @ExcelProperty("优惠券名称")
25   - private String name;
26   -
27   - @ExcelProperty("优惠券类型id")
28   - private Long couponTypeId;
29   -
30   - @ExcelProperty("优惠券编码")
31   - private String couponCode;
32   -
33   - @ExcelProperty("领用人")
34   - private Long memberId;
35   -
36   - @ExcelProperty("优惠券使用订单id")
37   - private Long useOrderId;
38   -
39   - @ExcelProperty("适用商品类型1-全部商品可用;2-指定商品可用;3-指定商品不可用")
40   - private Boolean goodsType;
41   -
42   - @ExcelProperty("适用商品id")
43   - private String goodsIds;
44   -
45   - @ExcelProperty("最小金额")
46   - private BigDecimal atLeast;
47   -
48   - @ExcelProperty("面额")
49   - private BigDecimal money;
50   -
51   - @ExcelProperty("1 =< 折扣 <= 9.9 当type为discount时需要添加")
52   - private BigDecimal discount;
53   -
54   - @ExcelProperty("最多折扣金额 当type为discount时可选择性添加")
55   - private BigDecimal discountLimit;
56   -
57   - @ExcelProperty("优惠叠加 0-不限制 1- 优惠券仅原价购买商品时可用")
58   - private Boolean whetherForbidPreference;
59   -
60   - @ExcelProperty("是否开启过期提醒0-不开启 1-开启")
61   - private Boolean whetherExpireNotice;
62   -
63   - @ExcelProperty("过期前N天提醒")
64   - private Integer expireNoticeFixedTerm;
65   -
66   - @ExcelProperty("是否已提醒")
67   - private Boolean whetherNoticed;
68   -
69   - @ExcelProperty("优惠券状态 1已领用(未使用) 2已使用 3已过期")
70   - private Integer state;
71   -
72   - @ExcelProperty("获取方式1订单2.直接领取3.活动领取 4转赠 5分享获取")
73   - private Boolean getType;
74   -
75   - @ExcelProperty("领取时间")
76   - private Date fetchTime;
77   -
78   - @ExcelProperty("使用时间")
79   - private Date useTime;
80   -
81   - @ExcelProperty("可使用的开始时间")
82   - private Date startTime;
83   -
84   - @ExcelProperty("有效期结束时间")
85   - private Date endTime;
86   -
87   - @ExcelProperty("创建时间")
88   - private Date createTime;
89   -
90   -}
yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupon/vo/CouponExportReqVO.java deleted
1   -package cn.iocoder.yudao.module.coupon.controller.admin.coupon.vo;
2   -
3   -import lombok.*;
4   -
5   -import java.math.BigDecimal;
6   -import java.util.*;
7   -import io.swagger.annotations.*;
8   -import cn.iocoder.yudao.framework.common.pojo.PageParam;
9   -import org.springframework.format.annotation.DateTimeFormat;
10   -
11   -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
12   -
13   -@ApiModel(value = "管理后台 - 优惠券 Excel 导出 Request VO", description = "参数和 CouponPageReqVO 是一致的")
14   -@Data
15   -public class CouponExportReqVO {
16   -
17   - @ApiModelProperty(value = "优惠券类型 reward-满减 discount-折扣 random-随机")
18   - private String type;
19   -
20   - @ApiModelProperty(value = "优惠券名称")
21   - private String name;
22   -
23   - @ApiModelProperty(value = "优惠券类型id")
24   - private Long couponTypeId;
25   -
26   - @ApiModelProperty(value = "优惠券编码")
27   - private String couponCode;
28   -
29   - @ApiModelProperty(value = "领用人")
30   - private Long memberId;
31   -
32   - @ApiModelProperty(value = "优惠券使用订单id")
33   - private Long useOrderId;
34   -
35   - @ApiModelProperty(value = "适用商品类型1-全部商品可用;2-指定商品可用;3-指定商品不可用")
36   - private Boolean goodsType;
37   -
38   - @ApiModelProperty(value = "适用商品id")
39   - private String goodsIds;
40   -
41   - @ApiModelProperty(value = "最小金额")
42   - private BigDecimal atLeast;
43   -
44   - @ApiModelProperty(value = "面额")
45   - private BigDecimal money;
46   -
47   - @ApiModelProperty(value = "1 =< 折扣 <= 9.9 当type为discount时需要添加")
48   - private BigDecimal discount;
49   -
50   - @ApiModelProperty(value = "最多折扣金额 当type为discount时可选择性添加")
51   - private BigDecimal discountLimit;
52   -
53   - @ApiModelProperty(value = "优惠叠加 0-不限制 1- 优惠券仅原价购买商品时可用")
54   - private Boolean whetherForbidPreference;
55   -
56   - @ApiModelProperty(value = "是否开启过期提醒0-不开启 1-开启")
57   - private Boolean whetherExpireNotice;
58   -
59   - @ApiModelProperty(value = "过期前N天提醒")
60   - private Integer expireNoticeFixedTerm;
61   -
62   - @ApiModelProperty(value = "是否已提醒")
63   - private Boolean whetherNoticed;
64   -
65   - @ApiModelProperty(value = "优惠券状态 1已领用(未使用) 2已使用 3已过期")
66   - private Integer state;
67   -
68   - @ApiModelProperty(value = "获取方式1订单2.直接领取3.活动领取 4转赠 5分享获取")
69   - private Boolean getType;
70   -
71   - @ApiModelProperty(value = "领取时间")
72   - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
73   - private Date[] fetchTime;
74   -
75   - @ApiModelProperty(value = "使用时间")
76   - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
77   - private Date[] useTime;
78   -
79   - @ApiModelProperty(value = "可使用的开始时间")
80   - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
81   - private Date[] startTime;
82   -
83   - @ApiModelProperty(value = "有效期结束时间")
84   - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
85   - private Date[] endTime;
86   -
87   - @ApiModelProperty(value = "创建时间")
88   - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
89   - private Date[] createTime;
90   -
91   -}
yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupon/vo/CouponPageReqVO.java deleted
1   -package cn.iocoder.yudao.module.coupon.controller.admin.coupon.vo;
2   -
3   -import lombok.*;
4   -
5   -import java.math.BigDecimal;
6   -import java.util.*;
7   -import io.swagger.annotations.*;
8   -import cn.iocoder.yudao.framework.common.pojo.PageParam;
9   -import org.springframework.format.annotation.DateTimeFormat;
10   -
11   -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
12   -
13   -@ApiModel("管理后台 - 优惠券分页 Request VO")
14   -@Data
15   -@EqualsAndHashCode(callSuper = true)
16   -@ToString(callSuper = true)
17   -public class CouponPageReqVO extends PageParam {
18   -
19   - @ApiModelProperty(value = "优惠券类型 reward-满减 discount-折扣 random-随机")
20   - private String type;
21   -
22   - @ApiModelProperty(value = "优惠券名称")
23   - private String name;
24   -
25   - @ApiModelProperty(value = "优惠券类型id")
26   - private Long couponTypeId;
27   -
28   - @ApiModelProperty(value = "优惠券编码")
29   - private String couponCode;
30   -
31   - @ApiModelProperty(value = "领用人")
32   - private Long memberId;
33   -
34   - @ApiModelProperty(value = "优惠券使用订单id")
35   - private Long useOrderId;
36   -
37   - @ApiModelProperty(value = "适用商品类型1-全部商品可用;2-指定商品可用;3-指定商品不可用")
38   - private Boolean goodsType;
39   -
40   - @ApiModelProperty(value = "适用商品id")
41   - private String goodsIds;
42   -
43   - @ApiModelProperty(value = "最小金额")
44   - private BigDecimal atLeast;
45   -
46   - @ApiModelProperty(value = "面额")
47   - private BigDecimal money;
48   -
49   - @ApiModelProperty(value = "1 =< 折扣 <= 9.9 当type为discount时需要添加")
50   - private BigDecimal discount;
51   -
52   - @ApiModelProperty(value = "最多折扣金额 当type为discount时可选择性添加")
53   - private BigDecimal discountLimit;
54   -
55   - @ApiModelProperty(value = "优惠叠加 0-不限制 1- 优惠券仅原价购买商品时可用")
56   - private Boolean whetherForbidPreference;
57   -
58   - @ApiModelProperty(value = "是否开启过期提醒0-不开启 1-开启")
59   - private Boolean whetherExpireNotice;
60   -
61   - @ApiModelProperty(value = "过期前N天提醒")
62   - private Integer expireNoticeFixedTerm;
63   -
64   - @ApiModelProperty(value = "是否已提醒")
65   - private Boolean whetherNoticed;
66   -
67   - @ApiModelProperty(value = "优惠券状态 1已领用(未使用) 2已使用 3已过期")
68   - private Integer state;
69   -
70   - @ApiModelProperty(value = "获取方式1订单2.直接领取3.活动领取 4转赠 5分享获取")
71   - private Boolean getType;
72   -
73   - @ApiModelProperty(value = "领取时间")
74   - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
75   - private Date[] fetchTime;
76   -
77   - @ApiModelProperty(value = "使用时间")
78   - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
79   - private Date[] useTime;
80   -
81   - @ApiModelProperty(value = "可使用的开始时间")
82   - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
83   - private Date[] startTime;
84   -
85   - @ApiModelProperty(value = "有效期结束时间")
86   - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
87   - private Date[] endTime;
88   -
89   - @ApiModelProperty(value = "创建时间")
90   - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
91   - private Date[] createTime;
92   -
93   -}
yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupon/vo/CouponRespVO.java deleted
1   -package cn.iocoder.yudao.module.coupon.controller.admin.coupon.vo;
2   -
3   -import lombok.*;
4   -import java.util.*;
5   -import io.swagger.annotations.*;
6   -
7   -@ApiModel("管理后台 - 优惠券 Response VO")
8   -@Data
9   -@EqualsAndHashCode(callSuper = true)
10   -@ToString(callSuper = true)
11   -public class CouponRespVO extends CouponBaseVO {
12   -
13   - @ApiModelProperty(value = "用户ID", required = true)
14   - private Long id;
15   -
16   - @ApiModelProperty(value = "创建时间", required = true)
17   - private Date createTime;
18   -
19   -}
yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupon/vo/CouponUpdateReqVO.java deleted
1   -package cn.iocoder.yudao.module.coupon.controller.admin.coupon.vo;
2   -
3   -import lombok.*;
4   -import java.util.*;
5   -import io.swagger.annotations.*;
6   -import javax.validation.constraints.*;
7   -
8   -@ApiModel("管理后台 - 优惠券更新 Request VO")
9   -@Data
10   -@EqualsAndHashCode(callSuper = true)
11   -@ToString(callSuper = true)
12   -public class CouponUpdateReqVO extends CouponBaseVO {
13   -
14   - @ApiModelProperty(value = "用户ID", required = true)
15   - @NotNull(message = "用户ID不能为空")
16   - private Long id;
17   -
18   -}
yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/CouponTempleteController.java deleted
1   -package cn.iocoder.yudao.module.coupon.controller.admin.templete;
2   -
3   -import cn.iocoder.yudao.module.coupon.controller.admin.templete.vo.*;
4   -import cn.iocoder.yudao.module.coupon.convert.CouponTemplete.CouponTempleteConvert;
5   -import cn.iocoder.yudao.module.coupon.dal.dataobject.CouponTemplete.CouponTempleteDO;
6   -import cn.iocoder.yudao.module.coupon.service.CouponTemplete.CouponTempleteService;
7   -import org.springframework.web.bind.annotation.*;
8   -import javax.annotation.Resource;
9   -import org.springframework.validation.annotation.Validated;
10   -import org.springframework.security.access.prepost.PreAuthorize;
11   -import io.swagger.annotations.*;
12   -
13   -import javax.validation.*;
14   -import java.util.*;
15   -
16   -import cn.iocoder.yudao.framework.common.pojo.PageResult;
17   -import cn.iocoder.yudao.framework.common.pojo.CommonResult;
18   -import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
19   -
20   -@Api(tags = "管理后台 - 优惠券模板")
21   -@RestController
22   -@RequestMapping("/coupon/template")
23   -@Validated
24   -public class CouponTempleteController {
25   -
26   - @Resource
27   - private CouponTempleteService couponTempleteServiceService;
28   -
29   - @PostMapping("/create")
30   - @ApiOperation("创建优惠券模板")
31   - @PreAuthorize("@ss.hasPermission('CouponTemplete::create')")
32   - public CommonResult<Long> create(@Valid @RequestBody CouponTempleteCreateReqVO createReqVO) {
33   - return success(couponTempleteServiceService.create(createReqVO));
34   - }
35   -
36   -// @PutMapping("/update")
37   -// @ApiOperation("更新优惠券模板")
38   -// @PreAuthorize("@ss.hasPermission('CouponTemplete::update')")
39   -// public CommonResult<Boolean> update(@Valid @RequestBody CouponTempleteUpdateReqVO updateReqVO) {
40   -// couponTempleteServiceService.update(updateReqVO);
41   -// return success(true);
42   -// }
43   -//
44   -// @DeleteMapping("/delete")
45   -// @ApiOperation("删除优惠券模板")
46   -// @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
47   -// @PreAuthorize("@ss.hasPermission('CouponTemplete::delete')")
48   -// public CommonResult<Boolean> delete(@RequestParam("id") Long id) {
49   -// couponTempleteServiceService.delete(id);
50   -// return success(true);
51   -// }
52   -//
53   -// @GetMapping("/get")
54   -// @ApiOperation("获得优惠券模板")
55   -// @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
56   -// @PreAuthorize("@ss.hasPermission('CouponTemplete::query')")
57   -// public CommonResult<CouponTempleteRespVO> get(@RequestParam("id") Long id) {
58   -// CouponTempleteDO couponTempleteDO = couponTempleteServiceService.get(id);
59   -// return success(CouponTempleteConvert.INSTANCE.convert(couponTempleteDO));
60   -// }
61   -//
62   -// @GetMapping("/list")
63   -// @ApiOperation("获得优惠券模板列表")
64   -// @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
65   -// @PreAuthorize("@ss.hasPermission('CouponTemplete::query')")
66   -// public CommonResult<List<CouponTempleteRespVO>> getList(@RequestParam("ids") Collection<Long> ids) {
67   -// List<CouponTempleteDO> list = couponTempleteServiceService.getList(ids);
68   -// return success(CouponTempleteConvert.INSTANCE.convertList(list));
69   -// }
70   -//
71   - @GetMapping("/page")
72   - @ApiOperation("获得优惠券模板分页")
73   - @PreAuthorize("@ss.hasPermission('CouponTemplete::query')")
74   - public CommonResult<PageResult<CouponTempleteRespVO>> getPage(@Valid CouponTempletePageReqVO pageVO) {
75   - PageResult<CouponTempleteDO> pageResult = couponTempleteServiceService.getPage(pageVO);
76   - return success(CouponTempleteConvert.INSTANCE.convertPage(pageResult));
77   - }
78   -
79   -
80   -
81   -}
yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempleteBaseVO.java deleted
1   -package cn.iocoder.yudao.module.coupon.controller.admin.templete.vo;
2   -
3   -import lombok.*;
4   -import java.util.*;
5   -import java.math.BigDecimal;
6   -import io.swagger.annotations.*;
7   -import javax.validation.constraints.*;
8   -import org.springframework.format.annotation.DateTimeFormat;
9   -
10   -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
11   -
12   -/**
13   -* 优惠券模板 Base VO,提供给添加、修改、详细的子 VO 使用
14   -* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
15   -*/
16   -@Data
17   -public class CouponTempleteBaseVO {
18   -
19   -
20   - //基本信息
21   -
22   - @ApiModelProperty(value = "优惠券名称", required = true)
23   - @NotNull(message = "优惠券名称不能为空")
24   - private String name;
25   -
26   - @ApiModelProperty(value = "名称备注")
27   - private String couponNameRemark;
28   -
29   - @ApiModelProperty(value = "优惠券图片")
30   - private String image;
31   -
32   - /* ============判断适用商品——开始============= */
33   -
34   -
35   - @ApiModelProperty(value = "适用商品类型1-全部商品可用;2-指定商品可用;3-指定商品不可用", required = true)
36   - @NotNull(message = "适用商品类型1-全部商品可用;2-指定商品可用;3-指定商品不可用不能为空")
37   - private Integer goodsType;
38   -
39   - @ApiModelProperty(value = "适用商品id")
40   - private String productIds;
41   -
42   - @ApiModelProperty(value = "使用门槛0-无门槛 1-有门槛", required = true)
43   - @NotNull(message = "使用门槛0-无门槛 1-有门槛不能为空")
44   - private Boolean hasUseLimit;
45   -
46   - @ApiModelProperty(value = "满多少元使用 0代表无限制", required = true)
47   - @NotNull(message = "满多少元使用 0代表无限制不能为空")
48   - private BigDecimal atLeast;
49   -
50   -
51   - /* ============折扣类型——开始============= */
52   -
53   - @ApiModelProperty(value = "优惠券类型 reward-满减 discount-折扣 random-随机", required = true)
54   - @NotNull(message = "优惠券类型 reward-满减 discount-折扣 random-随机不能为空")
55   - private String type;
56   -
57   - @ApiModelProperty(value = "发放面额 当type为reward时需要添加")
58   - @NotNull(message = "发放面额 当type为reward时需要添加不能为空")
59   - private BigDecimal money;
60   -
61   - @ApiModelProperty(value = "1 =< 折扣 <= 9.9 当type为discount时需要添加")
62   - @NotNull(message = "1 =< 折扣 <= 9.9 当type为discount时需要添加不能为空")
63   - private BigDecimal discount;
64   -
65   - @ApiModelProperty(value = "最多折扣金额 当type为discount时可选择性添加")
66   - @NotNull(message = "最多折扣金额 当type为discount时可选择性添加不能为空")
67   - private BigDecimal discountLimit;
68   -
69   - @ApiModelProperty(value = "最低金额 当type为radom时需要添加", required = true)
70   - @NotNull(message = "最低金额 当type为radom时需要添加不能为空")
71   - private BigDecimal minMoney;
72   -
73   - @ApiModelProperty(value = "最大金额 当type为radom时需要添加", required = true)
74   - @NotNull(message = "最大金额 当type为radom时需要添加不能为空")
75   - private BigDecimal maxMoney;
76   -
77   - /* ============折扣类型——结束============= */
78   -
79   -
80   - /* ============过期类型——开始============= */
81   -
82   -
83   - @ApiModelProperty(value = "过期类型1-时间范围过期 2-领取之日固定日期后过期 3-领取次日固定日期后过期", required = true)
84   - @NotNull(message = "过期类型1-时间范围过期 2-领取之日固定日期后过期 3-领取次日固定日期后过期 不能为空")
85   - private Integer validityType;
86   -
87   - @ApiModelProperty(value = "使用开始日期 过期类型1时必填")
88   - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
89   - private Date startUseTime;
90   -
91   - @ApiModelProperty(value = "使用结束日期 过期类型1时必填")
92   - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
93   - private Date endUseTime;
94   -
95   - @ApiModelProperty(value = "当validity_type为2或者3时需要添加 领取之日起或者次日N天内有效")
96   - @NotNull(message = "当validity_type为2或者3时需要添加 领取之日起或者次日N天内有效不能为空")
97   - private Integer fixedTerm;
98   -
99   - @ApiModelProperty(value = "有效日期结束时间")
100   - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
101   - private Date endTime;
102   -
103   - /* ============过期类型——结束============= */
104   -
105   -
106   - @ApiModelProperty(value = "领取是否无限制0-否 1是", required = true)
107   - @NotNull(message = "是否无限制0-否 1是")
108   - private Boolean whetherLimitless;
109   -
110   - @ApiModelProperty(value = "每人最大领取个数", required = true)
111   - @NotNull(message = "每人最大领取个数不能为空")
112   - private Integer maxFetch;
113   -
114   - @ApiModelProperty(value = "是否开启过期提醒 0-不开启 1-开启", required = true)
115   - @NotNull(message = "是否开启过期提醒0-不开启 1-开启不能为空")
116   - private Boolean whetherExpireNotice;
117   -
118   - @ApiModelProperty(value = "过期前N天提醒", required = true)
119   - @NotNull(message = "过期前N天提醒不能为空")
120   - private Integer expireNoticeFixedTerm;
121   -
122   - @ApiModelProperty(value = "优惠叠加 0-不限制 1- 优惠券仅原价购买商品时可用", required = true)
123   - @NotNull(message = "优惠叠加 0-不限制 1- 优惠券仅原价购买商品时可用不能为空")
124   - private Boolean whetherForbidPreference;
125   -
126   - @ApiModelProperty(value = "是否显示", required = true)
127   - @NotNull(message = "是否显示不能为空")
128   - private Integer whetherShow;
129   -
130   - @ApiModelProperty(value = "是否禁止发放0-否 1-是", required = true)
131   - @NotNull(message = "是否禁止发放0-否 1-是不能为空")
132   - private Boolean whetherForbidden;
133   -
134   - /* ============汇总计算——开始============= */
135   -
136   -
137   -
138   - @ApiModelProperty(value = "使用优惠券购买的商品数量", required = true)
139   - @NotNull(message = "使用优惠券购买的商品数量不能为空")
140   - private Integer orderGoodsNum;
141   -
142   - @ApiModelProperty(value = "订单的优惠总金额", required = true)
143   - @NotNull(message = "订单的优惠总金额不能为空")
144   - private BigDecimal discountOrderMoney;
145   -
146   - @ApiModelProperty(value = "用券总成交额", required = true)
147   - @NotNull(message = "用券总成交额不能为空")
148   - private BigDecimal orderMoney;
149   -
150   - @ApiModelProperty(value = "发放数量", required = true)
151   - @NotNull(message = "发放数量不能为空")
152   - private Integer count;
153   -
154   - @ApiModelProperty(value = "已领取数量", required = true)
155   - @NotNull(message = "已领取数量不能为空")
156   - private Integer leadCount;
157   -
158   - @ApiModelProperty(value = "已使用数量", required = true)
159   - @NotNull(message = "已使用数量不能为空")
160   - private Integer usedCount;
161   -
162   -
163   - /* ============汇总计算——结束============= */
164   -
165   -
166   - @ApiModelProperty(value = "状态(1进行中2已结束3已关闭)", required = true)
167   - @NotNull(message = "状态(1进行中2已结束-1已关闭)不能为空")
168   - private Integer status;
169   -
170   -
171   -
172   -}
yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempleteCreateReqVO.java deleted
1   -package cn.iocoder.yudao.module.coupon.controller.admin.templete.vo;
2   -
3   -import lombok.*;
4   -import io.swagger.annotations.*;
5   -
6   -@ApiModel("管理后台 - 优惠券模板创建 Request VO")
7   -@Data
8   -@EqualsAndHashCode(callSuper = true)
9   -@ToString(callSuper = true)
10   -public class CouponTempleteCreateReqVO extends CouponTempleteBaseVO {
11   -
12   -}
yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempleteExcelVO.java deleted
1   -package cn.iocoder.yudao.module.coupon.controller.admin.templete.vo;
2   -
3   -import lombok.*;
4   -import java.util.*;
5   -import java.math.BigDecimal;
6   -
7   -import com.alibaba.excel.annotation.ExcelProperty;
8   -
9   -/**
10   - * 优惠券模板 Excel VO
11   - *
12   - * @author wxr
13   - */
14   -@Data
15   -public class CouponTempleteExcelVO {
16   -
17   - @ExcelProperty("用户ID")
18   - private Long id;
19   -
20   - @ExcelProperty("优惠券类型 reward-满减 discount-折扣 random-随机")
21   - private String type;
22   -
23   - @ExcelProperty("优惠券名称")
24   - private String name;
25   -
26   - @ExcelProperty("名称备注")
27   - private String couponNameRemark;
28   -
29   - @ExcelProperty("优惠券图片")
30   - private String image;
31   -
32   - @ExcelProperty("发放数量")
33   - private Integer count;
34   -
35   - @ExcelProperty("已领取数量")
36   - private Integer leadCount;
37   -
38   - @ExcelProperty("已使用数量")
39   - private Integer usedCount;
40   -
41   - @ExcelProperty("适用商品类型1-全部商品可用;2-指定商品可用;3-指定商品不可用")
42   - private Integer goodsType;
43   -
44   - @ExcelProperty("适用商品id")
45   - private String productIds;
46   -
47   - @ExcelProperty("使用门槛0-无门槛 1-有门槛")
48   - private Boolean hasUseLimit;
49   -
50   - @ExcelProperty("满多少元使用 0代表无限制")
51   - private BigDecimal atLeast;
52   -
53   - @ExcelProperty("发放面额 当type为reward时需要添加")
54   - private BigDecimal money;
55   -
56   - @ExcelProperty("1 =< 折扣 <= 9.9 当type为discount时需要添加")
57   - private BigDecimal discount;
58   -
59   - @ExcelProperty("最多折扣金额 当type为discount时可选择性添加")
60   - private BigDecimal discountLimit;
61   -
62   - @ExcelProperty("最低金额 当type为radom时需要添加")
63   - private BigDecimal minMoney;
64   -
65   - @ExcelProperty("最大金额 当type为radom时需要添加")
66   - private BigDecimal maxMoney;
67   -
68   - @ExcelProperty("过期类型1-时间范围过期 2-领取之日固定日期后过期 3-领取次日固定日期后过期")
69   - private Integer validityType;
70   -
71   - @ExcelProperty("使用开始日期 过期类型1时必填")
72   - private Date startUseTime;
73   -
74   - @ExcelProperty("使用结束日期 过期类型1时必填")
75   - private Date endUseTime;
76   -
77   - @ExcelProperty("当validity_type为2或者3时需要添加 领取之日起或者次日N天内有效")
78   - private Integer fixedTerm;
79   -
80   - @ExcelProperty("是否无限制0-否 1是")
81   - private Boolean whetherLimitless;
82   -
83   - @ExcelProperty("每人最大领取个数")
84   - private Integer maxFetch;
85   -
86   - @ExcelProperty("是否开启过期提醒0-不开启 1-开启")
87   - private Boolean whetherExpireNotice;
88   -
89   - @ExcelProperty("过期前N天提醒")
90   - private Integer expireNoticeFixedTerm;
91   -
92   - @ExcelProperty("优惠叠加 0-不限制 1- 优惠券仅原价购买商品时可用")
93   - private Boolean whetherForbidPreference;
94   -
95   - @ExcelProperty("是否显示")
96   - private Integer whetherShow;
97   -
98   - @ExcelProperty("订单的优惠总金额")
99   - private BigDecimal discountOrderMoney;
100   -
101   - @ExcelProperty("用券总成交额")
102   - private BigDecimal orderMoney;
103   -
104   - @ExcelProperty("是否禁止发放0-否 1-是")
105   - private Boolean whetherForbidden;
106   -
107   - @ExcelProperty("使用优惠券购买的商品数量")
108   - private Integer orderGoodsNum;
109   -
110   - @ExcelProperty("状态(1进行中2已结束-1已关闭)")
111   - private Integer status;
112   -
113   - @ExcelProperty("有效日期结束时间")
114   - private Date endTime;
115   -
116   - @ExcelProperty("创建时间")
117   - private Date createTime;
118   -
119   -}
yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempleteExportReqVO.java deleted
1   -package cn.iocoder.yudao.module.coupon.controller.admin.templete.vo;
2   -
3   -import lombok.*;
4   -
5   -import java.math.BigDecimal;
6   -import java.util.*;
7   -import io.swagger.annotations.*;
8   -import org.springframework.format.annotation.DateTimeFormat;
9   -
10   -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
11   -
12   -@ApiModel(value = "管理后台 - 优惠券模板 Excel 导出 Request VO", description = "参数和 CouponTempletePageReqVO 是一致的")
13   -@Data
14   -public class CouponTempleteExportReqVO {
15   -
16   - @ApiModelProperty(value = "优惠券类型 reward-满减 discount-折扣 random-随机")
17   - private String type;
18   -
19   - @ApiModelProperty(value = "优惠券名称")
20   - private String name;
21   -
22   - @ApiModelProperty(value = "名称备注")
23   - private String couponNameRemark;
24   -
25   - @ApiModelProperty(value = "优惠券图片")
26   - private String image;
27   -
28   - @ApiModelProperty(value = "发放数量")
29   - private Integer count;
30   -
31   - @ApiModelProperty(value = "已领取数量")
32   - private Integer leadCount;
33   -
34   - @ApiModelProperty(value = "已使用数量")
35   - private Integer usedCount;
36   -
37   - @ApiModelProperty(value = "适用商品类型1-全部商品可用;2-指定商品可用;3-指定商品不可用")
38   - private Boolean goodsType;
39   -
40   - @ApiModelProperty(value = "适用商品id")
41   - private String productIds;
42   -
43   - @ApiModelProperty(value = "使用门槛0-无门槛 1-有门槛")
44   - private Boolean hasUseLimit;
45   -
46   - @ApiModelProperty(value = "满多少元使用 0代表无限制")
47   - private BigDecimal atLeast;
48   -
49   - @ApiModelProperty(value = "发放面额 当type为reward时需要添加")
50   - private BigDecimal money;
51   -
52   - @ApiModelProperty(value = "1 =< 折扣 <= 9.9 当type为discount时需要添加")
53   - private BigDecimal discount;
54   -
55   - @ApiModelProperty(value = "最多折扣金额 当type为discount时可选择性添加")
56   - private BigDecimal discountLimit;
57   -
58   - @ApiModelProperty(value = "最低金额 当type为radom时需要添加")
59   - private BigDecimal minMoney;
60   -
61   - @ApiModelProperty(value = "最大金额 当type为radom时需要添加")
62   - private BigDecimal maxMoney;
63   -
64   - @ApiModelProperty(value = "过期类型1-时间范围过期 2-领取之日固定日期后过期 3-领取次日固定日期后过期")
65   - private Boolean validityType;
66   -
67   - @ApiModelProperty(value = "使用开始日期 过期类型1时必填")
68   - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
69   - private Date[] startUseTime;
70   -
71   - @ApiModelProperty(value = "使用结束日期 过期类型1时必填")
72   - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
73   - private Date[] endUseTime;
74   -
75   - @ApiModelProperty(value = "当validity_type为2或者3时需要添加 领取之日起或者次日N天内有效")
76   - private Integer fixedTerm;
77   -
78   - @ApiModelProperty(value = "是否无限制0-否 1是")
79   - private Boolean whetherLimitless;
80   -
81   - @ApiModelProperty(value = "每人最大领取个数")
82   - private Integer maxFetch;
83   -
84   - @ApiModelProperty(value = "是否开启过期提醒0-不开启 1-开启")
85   - private Boolean whetherExpireNotice;
86   -
87   - @ApiModelProperty(value = "过期前N天提醒")
88   - private Integer expireNoticeFixedTerm;
89   -
90   - @ApiModelProperty(value = "优惠叠加 0-不限制 1- 优惠券仅原价购买商品时可用")
91   - private Boolean whetherForbidPreference;
92   -
93   - @ApiModelProperty(value = "是否显示")
94   - private Integer whetherShow;
95   -
96   - @ApiModelProperty(value = "订单的优惠总金额")
97   - private BigDecimal discountOrderMoney;
98   -
99   - @ApiModelProperty(value = "用券总成交额")
100   - private BigDecimal orderMoney;
101   -
102   - @ApiModelProperty(value = "是否禁止发放0-否 1-是")
103   - private Boolean whetherForbidden;
104   -
105   - @ApiModelProperty(value = "使用优惠券购买的商品数量")
106   - private Integer orderGoodsNum;
107   -
108   - @ApiModelProperty(value = "状态(1进行中2已结束-1已关闭)")
109   - private Integer status;
110   -
111   - @ApiModelProperty(value = "有效日期结束时间")
112   - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
113   - private Date[] endTime;
114   -
115   - @ApiModelProperty(value = "创建时间")
116   - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
117   - private Date[] createTime;
118   -
119   -}
yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempletePageReqVO.java deleted
1   -package cn.iocoder.yudao.module.coupon.controller.admin.templete.vo;
2   -
3   -import lombok.*;
4   -
5   -import java.math.BigDecimal;
6   -import java.util.*;
7   -import io.swagger.annotations.*;
8   -import cn.iocoder.yudao.framework.common.pojo.PageParam;
9   -import org.springframework.format.annotation.DateTimeFormat;
10   -
11   -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
12   -
13   -@ApiModel("管理后台 - 优惠券模板分页 Request VO")
14   -@Data
15   -@EqualsAndHashCode(callSuper = true)
16   -@ToString(callSuper = true)
17   -public class CouponTempletePageReqVO extends PageParam {
18   -
19   - @ApiModelProperty(value = "优惠券类型 reward-满减 discount-折扣 random-随机")
20   - private String type;
21   -
22   - @ApiModelProperty(value = "优惠券名称")
23   - private String name;
24   -
25   - @ApiModelProperty(value = "名称备注")
26   - private String couponNameRemark;
27   -
28   - @ApiModelProperty(value = "优惠券图片")
29   - private String image;
30   -
31   - @ApiModelProperty(value = "发放数量")
32   - private Integer count;
33   -
34   - @ApiModelProperty(value = "已领取数量")
35   - private Integer leadCount;
36   -
37   - @ApiModelProperty(value = "已使用数量")
38   - private Integer usedCount;
39   -
40   - @ApiModelProperty(value = "适用商品类型1-全部商品可用;2-指定商品可用;3-指定商品不可用")
41   - private Boolean goodsType;
42   -
43   - @ApiModelProperty(value = "适用商品id")
44   - private String productIds;
45   -
46   - @ApiModelProperty(value = "使用门槛0-无门槛 1-有门槛")
47   - private Boolean hasUseLimit;
48   -
49   - @ApiModelProperty(value = "满多少元使用 0代表无限制")
50   - private BigDecimal atLeast;
51   -
52   - @ApiModelProperty(value = "发放面额 当type为reward时需要添加")
53   - private BigDecimal money;
54   -
55   - @ApiModelProperty(value = "1 =< 折扣 <= 9.9 当type为discount时需要添加")
56   - private BigDecimal discount;
57   -
58   - @ApiModelProperty(value = "最多折扣金额 当type为discount时可选择性添加")
59   - private BigDecimal discountLimit;
60   -
61   - @ApiModelProperty(value = "最低金额 当type为radom时需要添加")
62   - private BigDecimal minMoney;
63   -
64   - @ApiModelProperty(value = "最大金额 当type为radom时需要添加")
65   - private BigDecimal maxMoney;
66   -
67   - @ApiModelProperty(value = "过期类型1-时间范围过期 2-领取之日固定日期后过期 3-领取次日固定日期后过期")
68   - private Boolean validityType;
69   -
70   - @ApiModelProperty(value = "使用开始日期 过期类型1时必填")
71   - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
72   - private Date[] startUseTime;
73   -
74   - @ApiModelProperty(value = "使用结束日期 过期类型1时必填")
75   - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
76   - private Date[] endUseTime;
77   -
78   - @ApiModelProperty(value = "当validity_type为2或者3时需要添加 领取之日起或者次日N天内有效")
79   - private Integer fixedTerm;
80   -
81   - @ApiModelProperty(value = "是否无限制0-否 1是")
82   - private Boolean whetherLimitless;
83   -
84   - @ApiModelProperty(value = "每人最大领取个数")
85   - private Integer maxFetch;
86   -
87   - @ApiModelProperty(value = "是否开启过期提醒0-不开启 1-开启")
88   - private Boolean whetherExpireNotice;
89   -
90   - @ApiModelProperty(value = "过期前N天提醒")
91   - private Integer expireNoticeFixedTerm;
92   -
93   - @ApiModelProperty(value = "优惠叠加 0-不限制 1- 优惠券仅原价购买商品时可用")
94   - private Boolean whetherForbidPreference;
95   -
96   - @ApiModelProperty(value = "是否显示")
97   - private Integer whetherShow;
98   -
99   - @ApiModelProperty(value = "订单的优惠总金额")
100   - private BigDecimal discountOrderMoney;
101   -
102   - @ApiModelProperty(value = "用券总成交额")
103   - private BigDecimal orderMoney;
104   -
105   - @ApiModelProperty(value = "是否禁止发放0-否 1-是")
106   - private Boolean whetherForbidden;
107   -
108   - @ApiModelProperty(value = "使用优惠券购买的商品数量")
109   - private Integer orderGoodsNum;
110   -
111   - @ApiModelProperty(value = "状态(1进行中2已结束-1已关闭)")
112   - private Integer status;
113   -
114   - @ApiModelProperty(value = "有效日期结束时间")
115   - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
116   - private Date[] endTime;
117   -
118   - @ApiModelProperty(value = "创建时间")
119   - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
120   - private Date[] createTime;
121   -
122   -}
yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempleteRespVO.java deleted
1   -package cn.iocoder.yudao.module.coupon.controller.admin.templete.vo;
2   -
3   -import lombok.*;
4   -import java.util.*;
5   -import io.swagger.annotations.*;
6   -
7   -@ApiModel("管理后台 - 优惠券模板 Response VO")
8   -@Data
9   -@EqualsAndHashCode(callSuper = true)
10   -@ToString(callSuper = true)
11   -public class CouponTempleteRespVO extends CouponTempleteBaseVO {
12   -
13   - @ApiModelProperty(value = "用户ID", required = true)
14   - private Long id;
15   -
16   - @ApiModelProperty(value = "创建时间", required = true)
17   - private Date createTime;
18   -
19   -}
yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempleteUpdateReqVO.java deleted
1   -package cn.iocoder.yudao.module.coupon.controller.admin.templete.vo;
2   -
3   -import lombok.*;
4   -import io.swagger.annotations.*;
5   -import javax.validation.constraints.*;
6   -
7   -@ApiModel("管理后台 - 优惠券模板更新 Request VO")
8   -@Data
9   -@EqualsAndHashCode(callSuper = true)
10   -@ToString(callSuper = true)
11   -public class CouponTempleteUpdateReqVO extends CouponTempleteBaseVO {
12   -
13   - @ApiModelProperty(value = "用户ID", required = true)
14   - @NotNull(message = "用户ID不能为空")
15   - private Long id;
16   -
17   -}
yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/convert/CouponTemplete/CouponTempleteConvert.java deleted
1   -package cn.iocoder.yudao.module.coupon.convert.CouponTemplete;
2   -
3   -import java.util.*;
4   -
5   -import cn.iocoder.yudao.framework.common.pojo.PageResult;
6   -
7   -import cn.iocoder.yudao.module.coupon.controller.admin.templete.vo.CouponTempleteCreateReqVO;
8   -import cn.iocoder.yudao.module.coupon.controller.admin.templete.vo.CouponTempleteExcelVO;
9   -import cn.iocoder.yudao.module.coupon.controller.admin.templete.vo.CouponTempleteRespVO;
10   -import cn.iocoder.yudao.module.coupon.controller.admin.templete.vo.CouponTempleteUpdateReqVO;
11   -import cn.iocoder.yudao.module.coupon.dal.dataobject.CouponTemplete.CouponTempleteDO;
12   -import org.mapstruct.Mapper;
13   -import org.mapstruct.factory.Mappers;
14   -
15   -
16   -/**
17   - * 优惠券模板 Convert
18   - *
19   - * @author wxr
20   - */
21   -@Mapper
22   -public interface CouponTempleteConvert {
23   -
24   - CouponTempleteConvert INSTANCE = Mappers.getMapper(CouponTempleteConvert.class);
25   -
26   - CouponTempleteDO convert(CouponTempleteCreateReqVO bean);
27   -
28   - CouponTempleteDO convert(CouponTempleteUpdateReqVO bean);
29   -
30   - CouponTempleteRespVO convert(CouponTempleteDO bean);
31   -
32   - List<CouponTempleteRespVO> convertList(List<CouponTempleteDO> list);
33   -
34   - PageResult<CouponTempleteRespVO> convertPage(PageResult<CouponTempleteDO> page);
35   -
36   - List<CouponTempleteExcelVO> convertList02(List<CouponTempleteDO> list);
37   -
38   -}
yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/convert/coupon/CouponConvert.java deleted
1   -package cn.iocoder.yudao.module.coupon.convert.coupon;
2   -
3   -import java.util.*;
4   -
5   -import cn.iocoder.yudao.framework.common.pojo.PageResult;
6   -
7   -import org.mapstruct.Mapper;
8   -import org.mapstruct.factory.Mappers;
9   -import cn.iocoder.yudao.module.coupon.controller.admin.coupon.vo.*;
10   -import cn.iocoder.yudao.module.coupon.dal.dataobject.coupon.CouponDO;
11   -
12   -/**
13   - * 优惠券 Convert
14   - *
15   - * @author wxr
16   - */
17   -@Mapper
18   -public interface CouponConvert {
19   -
20   - CouponConvert INSTANCE = Mappers.getMapper(CouponConvert.class);
21   -
22   - CouponDO convert(CouponCreateReqVO bean);
23   -
24   - CouponDO convert(CouponUpdateReqVO bean);
25   -
26   - CouponRespVO convert(CouponDO bean);
27   -
28   - List<CouponRespVO> convertList(List<CouponDO> list);
29   -
30   - PageResult<CouponRespVO> convertPage(PageResult<CouponDO> page);
31   -
32   - List<CouponExcelVO> convertList02(List<CouponDO> list);
33   -
34   -}
yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/dal/dataobject/CouponTemplete/CouponTempleteDO.java deleted
1   -package cn.iocoder.yudao.module.coupon.dal.dataobject.CouponTemplete;
2   -
3   -import lombok.*;
4   -import java.util.*;
5   -import java.math.BigDecimal;
6   -import com.baomidou.mybatisplus.annotation.*;
7   -import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
8   -
9   -/**
10   - * 优惠券模板 DO
11   - *
12   - * @author wxr
13   - */
14   -@TableName("coupon_templete")
15   -@KeySequence("coupon_templete_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
16   -@Data
17   -@EqualsAndHashCode(callSuper = true)
18   -@ToString(callSuper = true)
19   -@Builder
20   -@NoArgsConstructor
21   -@AllArgsConstructor
22   -public class CouponTempleteDO extends BaseDO {
23   -
24   - /**
25   - * 用户ID
26   - */
27   - @TableId
28   - private Long id;
29   - /**
30   - * 优惠券类型 reward-满减 discount-折扣 random-随机
31   - */
32   - private String type;
33   - /**
34   - * 优惠券名称
35   - */
36   - private String name;
37   - /**
38   - * 名称备注
39   - */
40   - private String couponNameRemark;
41   - /**
42   - * 优惠券图片
43   - */
44   - private String image;
45   - /**
46   - * 发放数量
47   - */
48   - private Integer count;
49   - /**
50   - * 已领取数量
51   - */
52   - private Integer leadCount;
53   - /**
54   - * 已使用数量
55   - */
56   - private Integer usedCount;
57   - /**
58   - * 适用商品类型1-全部商品可用;2-指定商品可用;3-指定商品不可用
59   - */
60   - private Integer goodsType;
61   - /**
62   - * 适用商品id
63   - */
64   - private String productIds;
65   - /**
66   - * 使用门槛0-无门槛 1-有门槛
67   - */
68   - private Boolean hasUseLimit;
69   - /**
70   - * 满多少元使用 0代表无限制
71   - */
72   - private BigDecimal atLeast;
73   - /**
74   - * 发放面额 当type为reward时需要添加
75   - */
76   - private BigDecimal money;
77   - /**
78   - * 1 =< 折扣 <= 9.9 当type为discount时需要添加
79   - */
80   - private BigDecimal discount;
81   - /**
82   - * 最多折扣金额 当type为discount时可选择性添加
83   - */
84   - private BigDecimal discountLimit;
85   - /**
86   - * 最低金额 当type为radom时需要添加
87   - */
88   - private BigDecimal minMoney;
89   - /**
90   - * 最大金额 当type为radom时需要添加
91   - */
92   - private BigDecimal maxMoney;
93   - /**
94   - * 过期类型1-时间范围过期 2-领取之日固定日期后过期 3-领取次日固定日期后过期
95   - */
96   - private Integer validityType;
97   - /**
98   - * 使用开始日期 过期类型1时必填
99   - */
100   - private Date startUseTime;
101   - /**
102   - * 使用结束日期 过期类型1时必填
103   - */
104   - private Date endUseTime;
105   - /**
106   - * 当validity_type为2或者3时需要添加 领取之日起或者次日N天内有效
107   - */
108   - private Integer fixedTerm;
109   - /**
110   - * 是否无限制0-否 1是
111   - */
112   - private Boolean whetherLimitless;
113   - /**
114   - * 每人最大领取个数
115   - */
116   - private Integer maxFetch;
117   - /**
118   - * 是否开启过期提醒0-不开启 1-开启
119   - */
120   - private Boolean whetherExpireNotice;
121   - /**
122   - * 过期前N天提醒
123   - */
124   - private Integer expireNoticeFixedTerm;
125   - /**
126   - * 优惠叠加 0-不限制 1- 优惠券仅原价购买商品时可用
127   - */
128   - private Boolean whetherForbidPreference;
129   - /**
130   - * 是否显示
131   - */
132   - private Integer whetherShow;
133   - /**
134   - * 订单的优惠总金额
135   - */
136   - private BigDecimal discountOrderMoney;
137   - /**
138   - * 用券总成交额
139   - */
140   - private BigDecimal orderMoney;
141   - /**
142   - * 是否禁止发放0-否 1-是
143   - */
144   - private Boolean whetherForbidden;
145   - /**
146   - * 使用优惠券购买的商品数量
147   - */
148   - private Integer orderGoodsNum;
149   - /**
150   - * 状态(1进行中2已结束-1已关闭)
151   - */
152   - private Integer status;
153   - /**
154   - * 有效日期结束时间
155   - */
156   - private Date endTime;
157   -
158   -}
yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/dal/dataobject/coupon/CouponDO.java deleted
1   -package cn.iocoder.yudao.module.coupon.dal.dataobject.coupon;
2   -
3   -import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
4   -import lombok.*;
5   -import java.util.*;
6   -import java.math.BigDecimal;
7   -import com.baomidou.mybatisplus.annotation.*;
8   -
9   -/**
10   - * 优惠券 DO
11   - *
12   - * @author wxr
13   - */
14   -@TableName("coupon")
15   -@KeySequence("coupon_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
16   -@Data
17   -@EqualsAndHashCode(callSuper = true)
18   -@ToString(callSuper = true)
19   -@Builder
20   -@NoArgsConstructor
21   -@AllArgsConstructor
22   -public class CouponDO extends BaseDO {
23   -
24   - /**
25   - * 用户ID
26   - */
27   - @TableId
28   - private Long id;
29   - /**
30   - * 优惠券类型 reward-满减 discount-折扣 random-随机
31   - */
32   - private String type;
33   - /**
34   - * 优惠券名称
35   - */
36   - private String name;
37   - /**
38   - * 优惠券类型id
39   - */
40   - private Long couponTypeId;
41   - /**
42   - * 优惠券编码
43   - */
44   - private String couponCode;
45   - /**
46   - * 领用人
47   - */
48   - private Long memberId;
49   - /**
50   - * 优惠券使用订单id
51   - */
52   - private Long useOrderId;
53   - /**
54   - * 适用商品类型1-全部商品可用;2-指定商品可用;3-指定商品不可用
55   - */
56   - private Boolean goodsType;
57   - /**
58   - * 适用商品id
59   - */
60   - private String goodsIds;
61   - /**
62   - * 最小金额
63   - */
64   - private BigDecimal atLeast;
65   - /**
66   - * 面额
67   - */
68   - private BigDecimal money;
69   - /**
70   - * 1 =< 折扣 <= 9.9 当type为discount时需要添加
71   - */
72   - private BigDecimal discount;
73   - /**
74   - * 最多折扣金额 当type为discount时可选择性添加
75   - */
76   - private BigDecimal discountLimit;
77   - /**
78   - * 优惠叠加 0-不限制 1- 优惠券仅原价购买商品时可用
79   - */
80   - private Boolean whetherForbidPreference;
81   - /**
82   - * 是否开启过期提醒0-不开启 1-开启
83   - */
84   - private Boolean whetherExpireNotice;
85   - /**
86   - * 过期前N天提醒
87   - */
88   - private Integer expireNoticeFixedTerm;
89   - /**
90   - * 是否已提醒
91   - */
92   - private Boolean whetherNoticed;
93   - /**
94   - * 优惠券状态 1已领用(未使用) 2已使用 3已过期
95   - */
96   - private Integer state;
97   - /**
98   - * 获取方式1订单2.直接领取3.活动领取 4转赠 5分享获取
99   - */
100   - private Boolean getType;
101   - /**
102   - * 领取时间
103   - */
104   - private Date fetchTime;
105   - /**
106   - * 使用时间
107   - */
108   - private Date useTime;
109   - /**
110   - * 可使用的开始时间
111   - */
112   - private Date startTime;
113   - /**
114   - * 有效期结束时间
115   - */
116   - private Date endTime;
117   -
118   -}
yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/dal/mysql/CouponTemplete/CouponTempleteMapper.java deleted
1   -package cn.iocoder.yudao.module.coupon.dal.mysql.CouponTemplete;
2   -
3   -import java.util.*;
4   -
5   -import cn.iocoder.yudao.framework.common.pojo.PageResult;
6   -import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
7   -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
8   -import cn.iocoder.yudao.module.coupon.controller.admin.templete.vo.CouponTempleteExportReqVO;
9   -import cn.iocoder.yudao.module.coupon.controller.admin.templete.vo.CouponTempletePageReqVO;
10   -import cn.iocoder.yudao.module.coupon.dal.dataobject.CouponTemplete.CouponTempleteDO;
11   -import org.apache.ibatis.annotations.Mapper;
12   -
13   -
14   -/**
15   - * 优惠券模板 Mapper
16   - *
17   - * @author wxr
18   - */
19   -@Mapper
20   -public interface CouponTempleteMapper extends BaseMapperX<CouponTempleteDO> {
21   -
22   - default PageResult<CouponTempleteDO> selectPage(CouponTempletePageReqVO reqVO) {
23   - return selectPage(reqVO, new LambdaQueryWrapperX<CouponTempleteDO>()
24   - .eqIfPresent(CouponTempleteDO::getType, reqVO.getType())
25   - .likeIfPresent(CouponTempleteDO::getName, reqVO.getName())
26   - .eqIfPresent(CouponTempleteDO::getCouponNameRemark, reqVO.getCouponNameRemark())
27   - .eqIfPresent(CouponTempleteDO::getImage, reqVO.getImage())
28   - .eqIfPresent(CouponTempleteDO::getCount, reqVO.getCount())
29   - .eqIfPresent(CouponTempleteDO::getLeadCount, reqVO.getLeadCount())
30   - .eqIfPresent(CouponTempleteDO::getUsedCount, reqVO.getUsedCount())
31   - .eqIfPresent(CouponTempleteDO::getGoodsType, reqVO.getGoodsType())
32   - .eqIfPresent(CouponTempleteDO::getProductIds, reqVO.getProductIds())
33   - .eqIfPresent(CouponTempleteDO::getHasUseLimit, reqVO.getHasUseLimit())
34   - .eqIfPresent(CouponTempleteDO::getAtLeast, reqVO.getAtLeast())
35   - .eqIfPresent(CouponTempleteDO::getMoney, reqVO.getMoney())
36   - .eqIfPresent(CouponTempleteDO::getDiscount, reqVO.getDiscount())
37   - .eqIfPresent(CouponTempleteDO::getDiscountLimit, reqVO.getDiscountLimit())
38   - .eqIfPresent(CouponTempleteDO::getMinMoney, reqVO.getMinMoney())
39   - .eqIfPresent(CouponTempleteDO::getMaxMoney, reqVO.getMaxMoney())
40   - .eqIfPresent(CouponTempleteDO::getValidityType, reqVO.getValidityType())
41   - .betweenIfPresent(CouponTempleteDO::getStartUseTime, reqVO.getStartUseTime())
42   - .betweenIfPresent(CouponTempleteDO::getEndUseTime, reqVO.getEndUseTime())
43   - .eqIfPresent(CouponTempleteDO::getFixedTerm, reqVO.getFixedTerm())
44   - .eqIfPresent(CouponTempleteDO::getWhetherLimitless, reqVO.getWhetherLimitless())
45   - .eqIfPresent(CouponTempleteDO::getMaxFetch, reqVO.getMaxFetch())
46   - .eqIfPresent(CouponTempleteDO::getWhetherExpireNotice, reqVO.getWhetherExpireNotice())
47   - .eqIfPresent(CouponTempleteDO::getExpireNoticeFixedTerm, reqVO.getExpireNoticeFixedTerm())
48   - .eqIfPresent(CouponTempleteDO::getWhetherForbidPreference, reqVO.getWhetherForbidPreference())
49   - .eqIfPresent(CouponTempleteDO::getWhetherShow, reqVO.getWhetherShow())
50   - .eqIfPresent(CouponTempleteDO::getDiscountOrderMoney, reqVO.getDiscountOrderMoney())
51   - .eqIfPresent(CouponTempleteDO::getOrderMoney, reqVO.getOrderMoney())
52   - .eqIfPresent(CouponTempleteDO::getWhetherForbidden, reqVO.getWhetherForbidden())
53   - .eqIfPresent(CouponTempleteDO::getOrderGoodsNum, reqVO.getOrderGoodsNum())
54   - .eqIfPresent(CouponTempleteDO::getStatus, reqVO.getStatus())
55   - .betweenIfPresent(CouponTempleteDO::getEndTime, reqVO.getEndTime())
56   - .betweenIfPresent(CouponTempleteDO::getCreateTime, reqVO.getCreateTime())
57   - .orderByDesc(CouponTempleteDO::getId));
58   - }
59   -
60   - default List<CouponTempleteDO> selectList(CouponTempleteExportReqVO reqVO) {
61   - return selectList(new LambdaQueryWrapperX<CouponTempleteDO>()
62   - .eqIfPresent(CouponTempleteDO::getType, reqVO.getType())
63   - .likeIfPresent(CouponTempleteDO::getName, reqVO.getName())
64   - .eqIfPresent(CouponTempleteDO::getCouponNameRemark, reqVO.getCouponNameRemark())
65   - .eqIfPresent(CouponTempleteDO::getImage, reqVO.getImage())
66   - .eqIfPresent(CouponTempleteDO::getCount, reqVO.getCount())
67   - .eqIfPresent(CouponTempleteDO::getLeadCount, reqVO.getLeadCount())
68   - .eqIfPresent(CouponTempleteDO::getUsedCount, reqVO.getUsedCount())
69   - .eqIfPresent(CouponTempleteDO::getGoodsType, reqVO.getGoodsType())
70   - .eqIfPresent(CouponTempleteDO::getProductIds, reqVO.getProductIds())
71   - .eqIfPresent(CouponTempleteDO::getHasUseLimit, reqVO.getHasUseLimit())
72   - .eqIfPresent(CouponTempleteDO::getAtLeast, reqVO.getAtLeast())
73   - .eqIfPresent(CouponTempleteDO::getMoney, reqVO.getMoney())
74   - .eqIfPresent(CouponTempleteDO::getDiscount, reqVO.getDiscount())
75   - .eqIfPresent(CouponTempleteDO::getDiscountLimit, reqVO.getDiscountLimit())
76   - .eqIfPresent(CouponTempleteDO::getMinMoney, reqVO.getMinMoney())
77   - .eqIfPresent(CouponTempleteDO::getMaxMoney, reqVO.getMaxMoney())
78   - .eqIfPresent(CouponTempleteDO::getValidityType, reqVO.getValidityType())
79   - .betweenIfPresent(CouponTempleteDO::getStartUseTime, reqVO.getStartUseTime())
80   - .betweenIfPresent(CouponTempleteDO::getEndUseTime, reqVO.getEndUseTime())
81   - .eqIfPresent(CouponTempleteDO::getFixedTerm, reqVO.getFixedTerm())
82   - .eqIfPresent(CouponTempleteDO::getWhetherLimitless, reqVO.getWhetherLimitless())
83   - .eqIfPresent(CouponTempleteDO::getMaxFetch, reqVO.getMaxFetch())
84   - .eqIfPresent(CouponTempleteDO::getWhetherExpireNotice, reqVO.getWhetherExpireNotice())
85   - .eqIfPresent(CouponTempleteDO::getExpireNoticeFixedTerm, reqVO.getExpireNoticeFixedTerm())
86   - .eqIfPresent(CouponTempleteDO::getWhetherForbidPreference, reqVO.getWhetherForbidPreference())
87   - .eqIfPresent(CouponTempleteDO::getWhetherShow, reqVO.getWhetherShow())
88   - .eqIfPresent(CouponTempleteDO::getDiscountOrderMoney, reqVO.getDiscountOrderMoney())
89   - .eqIfPresent(CouponTempleteDO::getOrderMoney, reqVO.getOrderMoney())
90   - .eqIfPresent(CouponTempleteDO::getWhetherForbidden, reqVO.getWhetherForbidden())
91   - .eqIfPresent(CouponTempleteDO::getOrderGoodsNum, reqVO.getOrderGoodsNum())
92   - .eqIfPresent(CouponTempleteDO::getStatus, reqVO.getStatus())
93   - .betweenIfPresent(CouponTempleteDO::getEndTime, reqVO.getEndTime())
94   - .betweenIfPresent(CouponTempleteDO::getCreateTime, reqVO.getCreateTime())
95   - .orderByDesc(CouponTempleteDO::getId));
96   - }
97   -
98   -}
yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/dal/mysql/coupon/CouponMapper.java deleted
1   -package cn.iocoder.yudao.module.coupon.dal.mysql.coupon;
2   -
3   -import java.util.*;
4   -
5   -import cn.iocoder.yudao.framework.common.pojo.PageResult;
6   -import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
7   -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
8   -import cn.iocoder.yudao.module.coupon.dal.dataobject.coupon.CouponDO;
9   -import org.apache.ibatis.annotations.Mapper;
10   -import cn.iocoder.yudao.module.coupon.controller.admin.coupon.vo.*;
11   -
12   -/**
13   - * 优惠券 Mapper
14   - *
15   - * @author wxr
16   - */
17   -@Mapper
18   -public interface CouponMapper extends BaseMapperX<CouponDO> {
19   -
20   - default PageResult<CouponDO> selectPage(CouponPageReqVO reqVO) {
21   - return selectPage(reqVO, new LambdaQueryWrapperX<CouponDO>()
22   - .eqIfPresent(CouponDO::getType, reqVO.getType())
23   - .likeIfPresent(CouponDO::getName, reqVO.getName())
24   - .eqIfPresent(CouponDO::getCouponTypeId, reqVO.getCouponTypeId())
25   - .eqIfPresent(CouponDO::getCouponCode, reqVO.getCouponCode())
26   - .eqIfPresent(CouponDO::getMemberId, reqVO.getMemberId())
27   - .eqIfPresent(CouponDO::getUseOrderId, reqVO.getUseOrderId())
28   - .eqIfPresent(CouponDO::getGoodsType, reqVO.getGoodsType())
29   - .eqIfPresent(CouponDO::getGoodsIds, reqVO.getGoodsIds())
30   - .eqIfPresent(CouponDO::getAtLeast, reqVO.getAtLeast())
31   - .eqIfPresent(CouponDO::getMoney, reqVO.getMoney())
32   - .eqIfPresent(CouponDO::getDiscount, reqVO.getDiscount())
33   - .eqIfPresent(CouponDO::getDiscountLimit, reqVO.getDiscountLimit())
34   - .eqIfPresent(CouponDO::getWhetherForbidPreference, reqVO.getWhetherForbidPreference())
35   - .eqIfPresent(CouponDO::getWhetherExpireNotice, reqVO.getWhetherExpireNotice())
36   - .eqIfPresent(CouponDO::getExpireNoticeFixedTerm, reqVO.getExpireNoticeFixedTerm())
37   - .eqIfPresent(CouponDO::getWhetherNoticed, reqVO.getWhetherNoticed())
38   - .eqIfPresent(CouponDO::getState, reqVO.getState())
39   - .eqIfPresent(CouponDO::getGetType, reqVO.getGetType())
40   - .betweenIfPresent(CouponDO::getFetchTime, reqVO.getFetchTime())
41   - .betweenIfPresent(CouponDO::getUseTime, reqVO.getUseTime())
42   - .betweenIfPresent(CouponDO::getStartTime, reqVO.getStartTime())
43   - .betweenIfPresent(CouponDO::getEndTime, reqVO.getEndTime())
44   - .betweenIfPresent(CouponDO::getCreateTime, reqVO.getCreateTime())
45   - .orderByDesc(CouponDO::getId));
46   - }
47   -
48   - default List<CouponDO> selectList(CouponExportReqVO reqVO) {
49   - return selectList(new LambdaQueryWrapperX<CouponDO>()
50   - .eqIfPresent(CouponDO::getType, reqVO.getType())
51   - .likeIfPresent(CouponDO::getName, reqVO.getName())
52   - .eqIfPresent(CouponDO::getCouponTypeId, reqVO.getCouponTypeId())
53   - .eqIfPresent(CouponDO::getCouponCode, reqVO.getCouponCode())
54   - .eqIfPresent(CouponDO::getMemberId, reqVO.getMemberId())
55   - .eqIfPresent(CouponDO::getUseOrderId, reqVO.getUseOrderId())
56   - .eqIfPresent(CouponDO::getGoodsType, reqVO.getGoodsType())
57   - .eqIfPresent(CouponDO::getGoodsIds, reqVO.getGoodsIds())
58   - .eqIfPresent(CouponDO::getAtLeast, reqVO.getAtLeast())
59   - .eqIfPresent(CouponDO::getMoney, reqVO.getMoney())
60   - .eqIfPresent(CouponDO::getDiscount, reqVO.getDiscount())
61   - .eqIfPresent(CouponDO::getDiscountLimit, reqVO.getDiscountLimit())
62   - .eqIfPresent(CouponDO::getWhetherForbidPreference, reqVO.getWhetherForbidPreference())
63   - .eqIfPresent(CouponDO::getWhetherExpireNotice, reqVO.getWhetherExpireNotice())
64   - .eqIfPresent(CouponDO::getExpireNoticeFixedTerm, reqVO.getExpireNoticeFixedTerm())
65   - .eqIfPresent(CouponDO::getWhetherNoticed, reqVO.getWhetherNoticed())
66   - .eqIfPresent(CouponDO::getState, reqVO.getState())
67   - .eqIfPresent(CouponDO::getGetType, reqVO.getGetType())
68   - .betweenIfPresent(CouponDO::getFetchTime, reqVO.getFetchTime())
69   - .betweenIfPresent(CouponDO::getUseTime, reqVO.getUseTime())
70   - .betweenIfPresent(CouponDO::getStartTime, reqVO.getStartTime())
71   - .betweenIfPresent(CouponDO::getEndTime, reqVO.getEndTime())
72   - .betweenIfPresent(CouponDO::getCreateTime, reqVO.getCreateTime())
73   - .orderByDesc(CouponDO::getId));
74   - }
75   -
76   -}
yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/package-info.java deleted
1   -/**
2   - * coupon模块,主要负责麦一些优惠券的额增删
3   - *
4   - * 1. Controller URL:以 /coumon/ 开头,避免和其它 Module 冲突
5   - */
6   -package cn.iocoder.yudao.module.coupon;
yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/service/CouponTemplete/CouponTempleteService.java deleted
1   -package cn.iocoder.yudao.module.coupon.service.CouponTemplete;
2   -
3   -import java.util.*;
4   -import javax.validation.*;
5   -import cn.iocoder.yudao.module.coupon.controller.admin.templete.vo.*;
6   -import cn.iocoder.yudao.framework.common.pojo.PageResult;
7   -import cn.iocoder.yudao.module.coupon.dal.dataobject.CouponTemplete.CouponTempleteDO;
8   -
9   -/**
10   - * 优惠券模板 Service 接口
11   - *
12   - * @author wxr
13   - */
14   -public interface CouponTempleteService {
15   -
16   - /**
17   - * 创建优惠券模板
18   - *
19   - * @param createReqVO 创建信息
20   - * @return 编号
21   - */
22   - Long create(@Valid CouponTempleteCreateReqVO createReqVO);
23   -
24   - /**
25   - * 更新优惠券模板
26   - *
27   - * @param updateReqVO 更新信息
28   - */
29   - void update(@Valid CouponTempleteUpdateReqVO updateReqVO);
30   -
31   - /**
32   - * 删除优惠券模板
33   - *
34   - * @param id 编号
35   - */
36   - void delete(Long id);
37   -
38   - /**
39   - * 获得优惠券模板
40   - *
41   - * @param id 编号
42   - * @return 优惠券模板
43   - */
44   - CouponTempleteDO get(Long id);
45   -
46   - /**
47   - * 获得优惠券模板列表
48   - *
49   - * @param ids 编号
50   - * @return 优惠券模板列表
51   - */
52   - List<CouponTempleteDO> getList(Collection<Long> ids);
53   -
54   - /**
55   - * 获得优惠券模板分页
56   - *
57   - * @param pageReqVO 分页查询
58   - * @return 优惠券模板分页
59   - */
60   - PageResult<CouponTempleteDO> getPage(CouponTempletePageReqVO pageReqVO);
61   -
62   - /**
63   - * 获得优惠券模板列表, 用于 Excel 导出
64   - *
65   - * @param exportReqVO 查询条件
66   - * @return 优惠券模板列表
67   - */
68   - List<CouponTempleteDO> getList(CouponTempleteExportReqVO exportReqVO);
69   -
70   -}
yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/service/CouponTemplete/CouponTempleteServiceImpl.java deleted
1   -package cn.iocoder.yudao.module.coupon.service.CouponTemplete;
2   -
3   -import cn.iocoder.yudao.module.CouponTemplete.enums.CouponTypeEnum;
4   -import cn.iocoder.yudao.module.CouponTemplete.enums.CouponValidityTypeEnum;
5   -import cn.iocoder.yudao.module.coupon.controller.admin.templete.vo.CouponTempleteCreateReqVO;
6   -import cn.iocoder.yudao.module.coupon.controller.admin.templete.vo.CouponTempleteExportReqVO;
7   -import cn.iocoder.yudao.module.coupon.controller.admin.templete.vo.CouponTempletePageReqVO;
8   -import cn.iocoder.yudao.module.coupon.controller.admin.templete.vo.CouponTempleteUpdateReqVO;
9   -import cn.iocoder.yudao.module.coupon.convert.CouponTemplete.CouponTempleteConvert;
10   -import cn.iocoder.yudao.module.coupon.dal.dataobject.CouponTemplete.CouponTempleteDO;
11   -import cn.iocoder.yudao.module.coupon.dal.mysql.CouponTemplete.CouponTempleteMapper;
12   -import org.springframework.stereotype.Service;
13   -import javax.annotation.Resource;
14   -import org.springframework.validation.annotation.Validated;
15   -
16   -import java.util.*;
17   -import cn.iocoder.yudao.framework.common.pojo.PageResult;
18   -
19   -
20   -
21   -import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
22   -import static cn.iocoder.yudao.module.CouponTemplete.enums.ErrorCodeConstants.*;
23   -
24   -/**
25   - * 优惠券模板 Service 实现类
26   - *
27   - * @author wxr
28   - */
29   -@Service
30   -@Validated
31   -public class CouponTempleteServiceImpl implements CouponTempleteService {
32   -
33   - @Resource
34   - private CouponTempleteMapper couponTempleteMapper;
35   -
36   - @Override
37   - public Long create(CouponTempleteCreateReqVO createReqVO) {
38   - // 插入
39   - CouponTempleteDO couponTempleteDO = CouponTempleteConvert.INSTANCE.convert(createReqVO);
40   - /* 验证类型、判断必填*/
41   - checkCouponType(createReqVO);
42   -
43   - /*验证过期类型、判断必填*/
44   - checkValidityType(createReqVO);
45   -
46   -
47   -
48   - couponTempleteMapper.insert(couponTempleteDO);
49   - // 返回
50   - return couponTempleteDO.getId();
51   - }
52   -
53   - /*确认优惠券类型*/
54   - private void checkValidityType(CouponTempleteCreateReqVO createReqVO) {
55   - Integer validtyType = createReqVO.getValidityType();
56   -
57   - if(CouponValidityTypeEnum.TIME_RANGE_EXPIRTED.getStatus().equals(validtyType)){
58   - if(createReqVO.getStartUseTime() == null||createReqVO.getEndUseTime() == null){
59   - throw exception(START_END_TIME_NOT_NULL);
60   - }
61   - }else{
62   - if(createReqVO.getFixedTerm() == null){
63   - throw exception(FIXED_TERM_NOT_NULL);
64   - }
65   - }
66   - }
67   -
68   - private void checkCouponType(CouponTempleteCreateReqVO createReqVO) {
69   -
70   - String couponType = createReqVO.getType();
71   - //当type=reward时候,需要添加
72   - if(couponType.equals(CouponTypeEnum.REWARD.getName())){
73   - if(createReqVO.getMoney()==null){
74   - throw exception(MONEY_NOT_NULL);
75   - }
76   - }else if(couponType.equals(CouponTypeEnum.DISCOUNT.getName())){
77   - if(createReqVO.getDiscount()==null){
78   - throw exception(DISCOUNT_NOT_NULL);
79   - }
80   - if(createReqVO.getDiscountLimit()==null){
81   - throw exception(DISCOUNT_LIMIT_NOT_NULL);
82   - }
83   - }else if (couponType.equals(CouponTypeEnum.RANDOW.getName())){
84   - //当type为radom时需要添加不能为空
85   - if(createReqVO.getMinMoney()==null||createReqVO.getMaxMoney()==null){
86   - throw exception(MIN_MAX_NOT_NULL);
87   - }
88   - }
89   - }
90   -
91   - @Override
92   - public void update(CouponTempleteUpdateReqVO updateReqVO) {
93   - // 校验存在
94   - this.validateExists(updateReqVO.getId());
95   - // 更新
96   - CouponTempleteDO updateObj = CouponTempleteConvert.INSTANCE.convert(updateReqVO);
97   - couponTempleteMapper.updateById(updateObj);
98   - }
99   -
100   - @Override
101   - public void delete(Long id) {
102   - // 校验存在
103   - this.validateExists(id);
104   - // 删除
105   - couponTempleteMapper.deleteById(id);
106   - }
107   -
108   - private void validateExists(Long id) {
109   - if (couponTempleteMapper.selectById(id) == null) {
110   - throw exception(COUPON_TEMPLETE_NOT_EXISTS);
111   - }
112   - }
113   -
114   - @Override
115   - public CouponTempleteDO get(Long id) {
116   - return couponTempleteMapper.selectById(id);
117   - }
118   -
119   - @Override
120   - public List<CouponTempleteDO> getList(Collection<Long> ids) {
121   - return couponTempleteMapper.selectBatchIds(ids);
122   - }
123   -
124   - @Override
125   - public PageResult<CouponTempleteDO> getPage(CouponTempletePageReqVO pageReqVO) {
126   - return couponTempleteMapper.selectPage(pageReqVO);
127   - }
128   -
129   - @Override
130   - public List<CouponTempleteDO> getList(CouponTempleteExportReqVO exportReqVO) {
131   - return couponTempleteMapper.selectList(exportReqVO);
132   - }
133   -
134   -}
yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/service/coupon/CouponService.java deleted
1   -package cn.iocoder.yudao.module.coupon.service.coupon;
2   -
3   -import java.util.*;
4   -import javax.validation.*;
5   -import cn.iocoder.yudao.module.coupon.controller.admin.coupon.vo.*;
6   -import cn.iocoder.yudao.module.coupon.dal.dataobject.coupon.CouponDO;
7   -import cn.iocoder.yudao.framework.common.pojo.PageResult;
8   -
9   -/**
10   - * 优惠券 Service 接口
11   - *
12   - * @author wxr
13   - */
14   -public interface CouponService {
15   -
16   - /**
17   - * 创建优惠券
18   - *
19   - * @param templateId 优惠券模板id
20   - * @return 编号
21   - */
22   - Long create(Long templateId);
23   -
24   - /**
25   - * 更新优惠券
26   - *
27   - * @param updateReqVO 更新信息
28   - */
29   - void update(@Valid CouponUpdateReqVO updateReqVO);
30   -
31   - /**
32   - * 删除优惠券
33   - *
34   - * @param id 编号
35   - */
36   - void delete(Long id);
37   -
38   - /**
39   - * 获得优惠券
40   - *
41   - * @param id 编号
42   - * @return 优惠券
43   - */
44   - CouponDO get(Long id);
45   -
46   - /**
47   - * 获得优惠券列表
48   - *
49   - * @param ids 编号
50   - * @return 优惠券列表
51   - */
52   - List<CouponDO> getList(Collection<Long> ids);
53   -
54   - /**
55   - * 获得优惠券分页
56   - *
57   - * @param pageReqVO 分页查询
58   - * @return 优惠券分页
59   - */
60   - PageResult<CouponDO> getPage(CouponPageReqVO pageReqVO);
61   -
62   - /**
63   - * 获得优惠券列表, 用于 Excel 导出
64   - *
65   - * @param exportReqVO 查询条件
66   - * @return 优惠券列表
67   - */
68   - List<CouponDO> getList(CouponExportReqVO exportReqVO);
69   -
70   -}
yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/service/coupon/CouponServiceImpl.java deleted
1   -package cn.iocoder.yudao.module.coupon.service.coupon;
2   -
3   -import cn.hutool.core.bean.BeanUtil;
4   -import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
5   -import cn.iocoder.yudao.module.coupon.dal.dataobject.CouponTemplete.CouponTempleteDO;
6   -import cn.iocoder.yudao.module.coupon.dal.mysql.CouponTemplete.CouponTempleteMapper;
7   -import org.springframework.stereotype.Service;
8   -import javax.annotation.Resource;
9   -import org.springframework.validation.annotation.Validated;
10   -
11   -import java.util.*;
12   -import cn.iocoder.yudao.module.coupon.controller.admin.coupon.vo.*;
13   -import cn.iocoder.yudao.module.coupon.dal.dataobject.coupon.CouponDO;
14   -import cn.iocoder.yudao.framework.common.pojo.PageResult;
15   -
16   -import cn.iocoder.yudao.module.coupon.convert.coupon.CouponConvert;
17   -import cn.iocoder.yudao.module.coupon.dal.mysql.coupon.CouponMapper;
18   -
19   -import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
20   -import static cn.iocoder.yudao.module.CouponTemplete.enums.ErrorCodeConstants.COUPON_NOT_EXISTS;
21   -
22   -/**
23   - * 优惠券 Service 实现类
24   - *
25   - * @author wxr
26   - */
27   -@Service
28   -@Validated
29   -public class CouponServiceImpl implements CouponService {
30   -
31   - @Resource
32   - private CouponMapper couponMapper;
33   -
34   - @Resource
35   - private CouponTempleteMapper couponTempleteMapper;
36   -
37   - public Long create(CouponCreateReqVO createReqVO) {
38   - // 插入
39   - CouponDO couponDO = CouponConvert.INSTANCE.convert(createReqVO);
40   - couponMapper.insert(couponDO);
41   - // 返回
42   - return couponDO.getId();
43   - }
44   -
45   -
46   - /**
47   - *todo 获取用户id收获优惠券
48   - *@author:wxr
49   - *@date:2022-08-13 3:11
50   - *@Description
51   - */
52   - @Override
53   - public Long create(Long templateId) {
54   - Long userid = SecurityFrameworkUtils.getLoginUserId();
55   - CouponDO couponDO = CouponDO.builder().memberId(userid).build();
56   - CouponTempleteDO couponTempleteDO = couponTempleteMapper.selectById(templateId);
57   - //todo 缺少判空
58   - BeanUtil.copyProperties(couponTempleteDO,couponTempleteDO);
59   - couponMapper.insert(couponDO);
60   - return couponDO.getId();
61   - }
62   -
63   - @Override
64   - public void update(CouponUpdateReqVO updateReqVO) {
65   - // 校验存在
66   - this.validateExists(updateReqVO.getId());
67   - // 更新
68   - CouponDO updateObj = CouponConvert.INSTANCE.convert(updateReqVO);
69   - couponMapper.updateById(updateObj);
70   - }
71   -
72   - @Override
73   - public void delete(Long id) {
74   - // 校验存在
75   - this.validateExists(id);
76   - // 删除
77   - couponMapper.deleteById(id);
78   - }
79   -
80   - private void validateExists(Long id) {
81   - if (couponMapper.selectById(id) == null) {
82   - throw exception(COUPON_NOT_EXISTS);
83   - }
84   - }
85   -
86   - @Override
87   - public CouponDO get(Long id) {
88   - return couponMapper.selectById(id);
89   - }
90   -
91   - @Override
92   - public List<CouponDO> getList(Collection<Long> ids) {
93   - return couponMapper.selectBatchIds(ids);
94   - }
95   -
96   - @Override
97   - public PageResult<CouponDO> getPage(CouponPageReqVO pageReqVO) {
98   - return couponMapper.selectPage(pageReqVO);
99   - }
100   -
101   - @Override
102   - public List<CouponDO> getList(CouponExportReqVO exportReqVO) {
103   - return couponMapper.selectList(exportReqVO);
104   - }
105   -
106   -}
yudao-module-mall/yudao-module-coupon-biz/src/main/resources/mapper/CouponTemplete/CouponTempleteMapper.xml deleted
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3   -<mapper namespace="cn.iocoder.yudao.module.coupon.dal.mysql.CouponTemplete.CouponTempleteMapper">
4   -
5   - <!--
6   - 一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
7   - 无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
8   - 代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
9   - 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
10   - -->
11   -
12   -</mapper>
yudao-module-mall/yudao-module-coupon-biz/src/main/resources/mapper/coupon/CouponMapper.xml deleted
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3   -<mapper namespace="cn.iocoder.yudao.module.coupon.dal.mysql.coupon.CouponMapper">
4   -
5   - <!--
6   - 一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
7   - 无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
8   - 代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
9   - 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
10   - -->
11   -
12   -</mapper>
yudao-module-mall/yudao-module-promotion-api/src/main/java/cn/iocoder/yudao/module/promotion/enums/common/PromotionDiscountTypeEnum.java 0 → 100644
  1 +package cn.iocoder.yudao.module.promotion.enums.common;
  2 +
  3 +import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
  4 +import lombok.AllArgsConstructor;
  5 +import lombok.Getter;
  6 +
  7 +import java.util.Arrays;
  8 +
  9 +/**
  10 + * 优惠类型枚举
  11 + *
  12 + * @author 芋道源码
  13 + */
  14 +@Getter
  15 +@AllArgsConstructor
  16 +public enum PromotionDiscountTypeEnum implements IntArrayValuable {
  17 +
  18 + PRICE(1, "减价"), // 具体金额
  19 + PERCENT(2, "打折"), // 百分比
  20 + ;
  21 +
  22 + public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(PromotionDiscountTypeEnum::getType).toArray();
  23 +
  24 + /**
  25 + * 优惠类型
  26 + */
  27 + private final Integer type;
  28 + /**
  29 + * 名字
  30 + */
  31 + private final String name;
  32 +
  33 + @Override
  34 + public int[] array() {
  35 + return ARRAYS;
  36 + }
  37 +
  38 +}
... ...
yudao-module-mall/yudao-module-promotion-api/src/main/java/cn/iocoder/yudao/module/promotion/enums/coupon/CouponTakeTypeEnum.java 0 → 100644
  1 +package cn.iocoder.yudao.module.promotion.enums.coupon;
  2 +
  3 +import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
  4 +
  5 +import java.util.Arrays;
  6 +
  7 +/**
  8 + * 优惠劵领取方式
  9 + *
  10 + * @author 芋道源码
  11 + */
  12 +public enum CouponTakeTypeEnum implements IntArrayValuable {
  13 +
  14 + BY_USER(1, "直接领取"), // 用户可在首页、每日领劵直接领取
  15 + BY_ADMIN(2, "指定发放"), // 后台指定会员赠送优惠劵
  16 + ;
  17 +
  18 + public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CouponTakeTypeEnum::getValue).toArray();
  19 +
  20 + /**
  21 + * 值
  22 + */
  23 + private final Integer value;
  24 + /**
  25 + * 名字
  26 + */
  27 + private final String name;
  28 +
  29 + CouponTakeTypeEnum(Integer value, String name) {
  30 + this.value = value;
  31 + this.name = name;
  32 + }
  33 +
  34 + public Integer getValue() {
  35 + return value;
  36 + }
  37 +
  38 + public String getName() {
  39 + return name;
  40 + }
  41 +
  42 + @Override
  43 + public int[] array() {
  44 + return ARRAYS;
  45 + }
  46 +}
... ...
yudao-module-mall/yudao-module-promotion-api/src/main/java/cn/iocoder/yudao/module/promotion/enums/coupon/CouponTemplateValidityTypeEnum.java 0 → 100644
  1 +package cn.iocoder.yudao.module.promotion.enums.coupon;
  2 +
  3 +import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
  4 +import lombok.AllArgsConstructor;
  5 +import lombok.Getter;
  6 +
  7 +import java.util.Arrays;
  8 +
  9 +/**
  10 + * 优惠劵模板的有限期类型的枚举
  11 + *
  12 + * @author 芋道源码
  13 + */
  14 +@AllArgsConstructor
  15 +@Getter
  16 +public enum CouponTemplateValidityTypeEnum implements IntArrayValuable {
  17 +
  18 + FIXED_DATE(1, "固定日期"),
  19 + FIXED_TERM_TODAY(2, "领取日期"),
  20 + ;
  21 +
  22 + public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CouponTemplateValidityTypeEnum::getType).toArray();
  23 +
  24 + /**
  25 + * 值
  26 + */
  27 + private final Integer type;
  28 + /**
  29 + * 名字
  30 + */
  31 + private final String name;
  32 +
  33 + @Override
  34 + public int[] array() {
  35 + return ARRAYS;
  36 + }
  37 +
  38 +}
... ...
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/coupon/CouponDO.java
... ... @@ -2,24 +2,23 @@ package cn.iocoder.yudao.module.promotion.dal.dataobject.coupon;
2 2  
3 3 import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
4 4 import cn.iocoder.yudao.module.promotion.enums.common.PromotionProductScopeEnum;
  5 +import com.baomidou.mybatisplus.annotation.KeySequence;
5 6 import com.baomidou.mybatisplus.annotation.TableField;
6 7 import com.baomidou.mybatisplus.annotation.TableName;
7 8 import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
8 9 import lombok.Data;
9 10 import lombok.EqualsAndHashCode;
10   -import lombok.experimental.Accessors;
11 11  
12 12 import java.util.Date;
13 13 import java.util.List;
14 14  
15   -// TODO 芋艿:待完善该实体
16 15 /**
17 16 * 优惠劵 DO
18 17 */
19   -@TableName("coupon")
  18 +@TableName(value = "promotion_coupon", autoResultMap = true)
  19 +@KeySequence("promotion_coupo_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
20 20 @Data
21 21 @EqualsAndHashCode(callSuper = true)
22   -@Accessors(chain = true)
23 22 public class CouponDO extends BaseDO {
24 23  
25 24 // ========== 基本信息 BEGIN ==========
... ... @@ -28,7 +27,9 @@ public class CouponDO extends BaseDO {
28 27 */
29 28 private Long id;
30 29 /**
31   - * 优惠劵(码)分组编号,{@link CouponTemplateDO} 的 id
  30 + * 优惠劵模板编号
  31 + *
  32 + * 关联 {@link CouponTemplateDO#getId()}
32 33 */
33 34 private Integer templateId;
34 35 /**
... ...
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/coupon/CouponTemplateDO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.promotion.dal.dataobject.coupon;
  2 +
  3 +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
  4 +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
  5 +import cn.iocoder.yudao.module.promotion.enums.common.PromotionDiscountTypeEnum;
  6 +import cn.iocoder.yudao.module.promotion.enums.common.PromotionProductScopeEnum;
  7 +import cn.iocoder.yudao.module.promotion.enums.coupon.CouponTakeTypeEnum;
  8 +import cn.iocoder.yudao.module.promotion.enums.coupon.CouponTemplateValidityTypeEnum;
  9 +import com.baomidou.mybatisplus.annotation.KeySequence;
  10 +import com.baomidou.mybatisplus.annotation.TableField;
  11 +import com.baomidou.mybatisplus.annotation.TableId;
  12 +import com.baomidou.mybatisplus.annotation.TableName;
  13 +import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
  14 +import lombok.Data;
  15 +import lombok.EqualsAndHashCode;
  16 +
  17 +import java.util.Date;
  18 +import java.util.List;
  19 +
  20 +/**
  21 + * 优惠劵模板 DO
  22 + *
  23 + * 当用户领取时,会生成 {@link CouponDO} 优惠劵
  24 + */
  25 +@TableName(value = "promotion_coupon_template", autoResultMap = true)
  26 +@KeySequence("promotion_coupon_template_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
  27 +@Data
  28 +@EqualsAndHashCode(callSuper = true)
  29 +public class CouponTemplateDO extends BaseDO {
  30 +
  31 + // ========== 基本信息 BEGIN ==========
  32 + /**
  33 + * 模板编号,自增唯一
  34 + */
  35 + @TableId
  36 + private Long id;
  37 + /**
  38 + * 优惠劵名
  39 + */
  40 + private String name;
  41 + /**
  42 + * 状态
  43 + *
  44 + * 枚举 {@link CommonStatusEnum}
  45 + */
  46 + private Integer status;
  47 +
  48 + // ========== 基本信息 END ==========
  49 +
  50 + // ========== 领取规则 BEGIN ==========
  51 + /**
  52 + * 发放数量
  53 + *
  54 + * -1 - 则表示不限制发放数量
  55 + */
  56 + private Integer totalCount;
  57 + /**
  58 + * 每人限领个数
  59 + *
  60 + * -1 - 则表示不限制
  61 + */
  62 + private Integer takeLimitCount;
  63 + /**
  64 + * 领取方式
  65 + *
  66 + * 枚举 {@link CouponTakeTypeEnum}
  67 + */
  68 + private Integer takeType;
  69 + // ========== 领取规则 END ==========
  70 +
  71 + // ========== 使用规则 BEGIN ==========
  72 + /**
  73 + * 是否设置满多少金额可用,单位:分
  74 + *
  75 + * 0 - 不限制
  76 + * 大于0 - 多少金额可用
  77 + */
  78 + private Integer usePrice;
  79 + /**
  80 + * 商品范围
  81 + *
  82 + * 枚举 {@link PromotionProductScopeEnum}
  83 + */
  84 + private Integer productScope;
  85 + /**
  86 + * 商品 SPU 编号的数组
  87 + */
  88 + @TableField(typeHandler = JacksonTypeHandler.class)
  89 + private List<Long> productSpuIds;
  90 + /**
  91 + * 生效日期类型
  92 + *
  93 + * 枚举 {@link CouponTemplateValidityTypeEnum}
  94 + */
  95 + private Integer validityType;
  96 + /**
  97 + * 固定日期 - 生效开始时间
  98 + *
  99 + * 当 {@link #validityType} 为 {@link CouponTemplateValidityTypeEnum#FIXED_DATE}
  100 + */
  101 + private Date validStartTime;
  102 + /**
  103 + * 固定日期 - 生效结束时间
  104 + *
  105 + * 当 {@link #validityType} 为 {@link CouponTemplateValidityTypeEnum#FIXED_DATE}
  106 + */
  107 + private Date validEndTime;
  108 + /**
  109 + * 领取日期 - 结束天数
  110 + *
  111 + * 当 {@link #validityType} 为 {@link CouponTemplateValidityTypeEnum#FIXED_TERM_TODAY}
  112 + */
  113 + private Integer fixedEndTerm;
  114 + // ========== 使用规则 END ==========
  115 +
  116 + // ========== 使用效果 BEGIN ==========
  117 + /**
  118 + * 折扣类型
  119 + *
  120 + * 枚举 {@link PromotionDiscountTypeEnum}
  121 + */
  122 + private Integer discountType;
  123 + /**
  124 + * 折扣百分比
  125 + *
  126 + * 例如,80% 为 80
  127 + */
  128 + private Integer discountPercent;
  129 + /**
  130 + * 优惠金额,单位:分
  131 + *
  132 + * 当 {@link #discountType} 为 {@link PromotionDiscountTypeEnum#PRICE}
  133 + */
  134 + private Integer discountPrice;
  135 + /**
  136 + * 折扣上限,仅在 {@link #discountType} 等于 {@link PromotionDiscountTypeEnum#PRICE} 时生效
  137 + *
  138 + * 例如,折扣上限为 20 元,当使用 8 折优惠券,订单金额为 1000 元时,最高只可折扣 20 元,而非 80 元。
  139 + */
  140 + private Integer discountLimitPrice;
  141 + // ========== 使用效果 END ==========
  142 +
  143 + // ========== 统计信息 BEGIN ==========
  144 + /**
  145 + * 领取优惠券的数量
  146 + */
  147 + private Integer takeCount;
  148 + /**
  149 + * 使用优惠券的次数
  150 + */
  151 + private Integer useCount;
  152 + // ========== 统计信息 END ==========
  153 +
  154 +}
... ...
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/reward/RewardActivityDO.java
... ... @@ -69,7 +69,7 @@ public class RewardActivityDO extends BaseDO {
69 69 * 商品 SPU 编号的数组
70 70 */
71 71 @TableField(typeHandler = JacksonTypeHandler.class)
72   - private List<Long> spuIds;
  72 + private List<Long> productSpuIds;
73 73 /**
74 74 * 优惠规则的数组
75 75 */
... ...
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/price/PriceServiceImpl.java
... ... @@ -114,24 +114,24 @@ public class PriceServiceImpl implements PriceService {
114 114 */
115 115 private void calculatePriceForSkuLevel(Long userId, PriceCalculateRespDTO priceCalculate) {
116 116 // 获取 SKU 级别的所有优惠信息
117   - Supplier<Double> memberDiscountSupplier = getMemberDiscountSupplier(userId);
  117 + Supplier<Double> memberDiscountPercentSupplier = getMemberDiscountPercentSupplier(userId);
118 118 Map<Long, DiscountProductDO> discountProducts = discountService.getMatchDiscountProducts(
119 119 convertSet(priceCalculate.getOrder().getItems(), PriceCalculateRespDTO.OrderItem::getSkuId));
120 120  
121 121 // 处理每个 SKU 的优惠
122 122 priceCalculate.getOrder().getItems().forEach(orderItem -> {
123 123 // 获取该 SKU 的优惠信息
124   - Double memberDiscount = memberDiscountSupplier.get();
  124 + Double memberDiscountPercent = memberDiscountPercentSupplier.get();
125 125 DiscountProductDO discountProduct = discountProducts.get(orderItem.getSkuId());
126 126 if (discountProduct != null // 假设优惠价格更贵,则认为没优惠
127 127 && discountProduct.getPromotionPrice() >= orderItem.getOriginalUnitPrice()) {
128 128 discountProduct = null;
129 129 }
130   - if (memberDiscount == null && discountProduct == null) {
  130 + if (memberDiscountPercent == null && discountProduct == null) {
131 131 return;
132 132 }
133 133 // 计算价格,判断选择哪个折扣
134   - Integer memberPrice = memberDiscount != null ? (int) (orderItem.getPayPrice() * memberDiscount / 100) : null;
  134 + Integer memberPrice = memberDiscountPercent != null ? (int) (orderItem.getPayPrice() * memberDiscountPercent / 100) : null;
135 135 Integer promotionPrice = discountProduct != null ? discountProduct.getPromotionPrice() * orderItem.getCount() : null;
136 136 if (memberPrice == null) {
137 137 calculatePriceByDiscountActivity(priceCalculate, orderItem, discountProduct, promotionPrice);
... ... @@ -166,7 +166,7 @@ public class PriceServiceImpl implements PriceService {
166 166 }
167 167  
168 168 // TODO 芋艿:提前实现
169   - private Supplier<Double> getMemberDiscountSupplier(Long userId) {
  169 + private Supplier<Double> getMemberDiscountPercentSupplier(Long userId) {
170 170 return Suppliers.memoize(() -> {
171 171 if (userId == 1) {
172 172 return 90d;
... ...
yudao-module-mall/yudao-module-promotion-biz/src/test/java/cn/iocoder/yudao/module/promotion/service/price/PriceServiceTest.java
... ... @@ -198,10 +198,10 @@ public class PriceServiceTest extends BaseMockitoUnitTest {
198 198 when(productSkuApi.getSkuList(eq(asSet(10L, 20L, 30L)))).thenReturn(asList(productSku01, productSku02, productSku03));
199 199 // mock 方法(限时折扣 DiscountActivity 信息)
200 200 RewardActivityDO rewardActivity01 = randomPojo(RewardActivityDO.class, o -> o.setId(1000L).setName("活动 1000 号")
201   - .setSpuIds(asList(10L, 20L)).setConditionType(PromotionConditionTypeEnum.PRICE.getType())
  201 + .setProductSpuIds(asList(10L, 20L)).setConditionType(PromotionConditionTypeEnum.PRICE.getType())
202 202 .setRules(singletonList(new RewardActivityDO.Rule().setLimit(200).setDiscountPrice(70))));
203 203 RewardActivityDO rewardActivity02 = randomPojo(RewardActivityDO.class, o -> o.setId(2000L).setName("活动 2000 号")
204   - .setSpuIds(singletonList(30L)).setConditionType(PromotionConditionTypeEnum.COUNT.getType())
  204 + .setProductSpuIds(singletonList(30L)).setConditionType(PromotionConditionTypeEnum.COUNT.getType())
205 205 .setRules(asList(new RewardActivityDO.Rule().setLimit(1).setDiscountPrice(10),
206 206 new RewardActivityDO.Rule().setLimit(2).setDiscountPrice(60), // 最大可满足,因为是 4 个
207 207 new RewardActivityDO.Rule().setLimit(10).setDiscountPrice(100))));
... ... @@ -301,7 +301,7 @@ public class PriceServiceTest extends BaseMockitoUnitTest {
301 301 when(productSkuApi.getSkuList(eq(asSet(10L, 20L)))).thenReturn(asList(productSku01, productSku02));
302 302 // mock 方法(限时折扣 DiscountActivity 信息)
303 303 RewardActivityDO rewardActivity01 = randomPojo(RewardActivityDO.class, o -> o.setId(1000L).setName("活动 1000 号")
304   - .setSpuIds(asList(10L, 20L)).setConditionType(PromotionConditionTypeEnum.PRICE.getType())
  304 + .setProductSpuIds(asList(10L, 20L)).setConditionType(PromotionConditionTypeEnum.PRICE.getType())
305 305 .setRules(singletonList(new RewardActivityDO.Rule().setLimit(351).setDiscountPrice(70))));
306 306 Map<RewardActivityDO, Set<Long>> matchRewardActivities = new LinkedHashMap<>();
307 307 matchRewardActivities.put(rewardActivity01, asSet(1L, 2L));
... ...
yudao-ui-admin/src/views/mall/product/brand/index.vue
1 1 <template>
2 2 <div class="app-container">
3 3  
4   - <!-- 搜索工作栏 -->
5   - <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
  4 +« <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
6 5 <el-form-item label="品牌名称" prop="name">
7 6 <el-input v-model="queryParams.name" placeholder="请输入品牌名称" clearable @keyup.enter.native="handleQuery"/>
8 7 </el-form-item>
... ...