src/main/java/com/mzl/flower/dto/request/coupon/CreateCouponTemplateActivyDTO.java
@@ -6,6 +6,7 @@ import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; import javax.validation.constraints.Max; import javax.validation.constraints.Min; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; @@ -85,6 +86,8 @@ * 领取后有效时间整数,比如90(天,小时,分钟) */ @ApiModelProperty(value = "领取后有效时间整数") @Min(value = 1,message = "领取后有效时间必须大于等于1") @Max(value = 99999999,message = "领取后有效时间不能超过99999999") private Integer usageTimeNum; @@ -127,6 +130,7 @@ @ApiModelProperty(value = "发放数量") @NotNull(message = "发放数量不能为空") @Min(value = 1,message = "发放数量必须大于0") @Max(value = 99999999,message = "库存数量不能超过99999999") private Integer couponAmount; @@ -136,6 +140,7 @@ @ApiModelProperty(value = "每人限领") @NotNull(message = "每人限领不能为空") @Min(value = 1,message = "每人限领必须大于0") @Max(value = 99999999,message = "每人限领不能超过99999999") private Integer getLimit; src/main/java/com/mzl/flower/dto/request/coupon/CreateCouponTemplatePointDTO.java
@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.Max; import javax.validation.constraints.Min; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; @@ -54,6 +55,7 @@ @ApiModelProperty(value ="领取后有效时间整数,比如90(天,小时,分钟)" ) @NotNull(message = "领取后有效时间不能为空") @Min(value = 1,message = "领取后有效时间必须大于等于1") @Max(value = 99999999,message = "领取后有效时间不能超过99999999") private Integer usageTimeNum; /** @@ -61,6 +63,7 @@ */ @ApiModelProperty(value = "使用条件") @NotNull(message = "使用条件不能为空") @Max(value = 99999999,message = "使用条件不能超过99999999") private BigDecimal minOrderAmount; /** @@ -69,6 +72,7 @@ @ApiModelProperty(value = "优惠券面值") @NotNull(message = "优惠券面值不能为空") @Min(value = 1,message = "优惠券面值大于0") @Max(value = 99999999,message = "优惠券面值不能超过99999999") private BigDecimal couponDiscountValue; /** @@ -77,12 +81,14 @@ @ApiModelProperty(value = "库存") @NotNull(message = "库存不能为空") @Min(value = 1,message = "库存数量必须大于0") @Max(value = 99999999,message = "库存数量不能超过99999999") private Integer couponAmount; @ApiModelProperty(value = "积分数量") @NotNull(message = "积分数量不能为空") @Min(value = 1,message = "积分数量必须大于0") @Max(value = 99999999,message = "积分数量不能超过99999999") private Integer point; src/main/java/com/mzl/flower/dto/request/coupon/CreateCouponTemplateUserDTO.java
@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.Max; import javax.validation.constraints.Min; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; @@ -52,6 +53,7 @@ @ApiModelProperty(value ="领取后有效时间整数,比如90(天,小时,分钟)" ) @NotNull(message = "领取后有效时间不能为空") @Min(value = 1,message = "领取后有效时间必须大于0") @Max(value = 99999999,message = "领取后有效时间不能超过99999999") private Integer usageTimeNum; /** @@ -59,6 +61,7 @@ */ @ApiModelProperty(value = "使用条件") @NotNull(message = "使用条件不能为空") @Max(value = 99999999,message = "使用条件不能超过99999999") private BigDecimal minOrderAmount; /** @@ -67,6 +70,7 @@ @ApiModelProperty(value = "优惠券面值") @NotNull(message = "优惠券面值不能为空") @Min(value = 1,message = "优惠券面值大于0") @Max(value = 99999999,message = "优惠券面值不能超过99999999") private BigDecimal couponDiscountValue; src/main/java/com/mzl/flower/dto/request/coupon/CreateCouponTemplateVipDTO.java
@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.Max; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.math.BigDecimal; @@ -41,6 +42,7 @@ */ @ApiModelProperty(value = "优惠券面值") @NotNull(message = "优惠券面值不能为空") @Max(value = 99999999,message = "优惠券面值不能超过99999999") private BigDecimal couponDiscountValue; /** @@ -48,6 +50,7 @@ */ @ApiModelProperty(value = "使用条件") @NotNull(message = "使用条件不能为空") @Max(value = 99999999,message = "使用条件不能超过99999999") private BigDecimal minOrderAmount; @@ -68,6 +71,7 @@ * 领取后有效时间整数,比如90(天,小时,分钟) */ @ApiModelProperty(value = "领取后有效时间整数") @Max(value = 99999999,message = "领取后有效时间不能超过99999999") private Integer usageTimeNum; src/main/resources/mapper/coupon/CouponTemplateMapperCustom.xml
@@ -76,8 +76,11 @@ SELECT * FROM t_coupon_template t WHERE t.deleted = FALSE AND t.get_start_date <= NOW() AND NOW() <= t.get_end_date <if test="param.category != null and param.category != '' and param.category == 'activity' "> AND t.get_start_date <= NOW() AND NOW() <= t.get_end_date </if> <if test="param.category != null and param.category != ''"> AND category = #{param.category} </if>