Commit 5d165304 by 章家宝

feat:优惠券使用门槛做校验 0 - 999 9999.99

1 parent 71b2e316
...@@ -181,8 +181,8 @@ public interface CouponActivityRepository extends BaseRepository<CouponActivity, ...@@ -181,8 +181,8 @@ public interface CouponActivityRepository extends BaseRepository<CouponActivity,
AND (:searchKey IS NULL OR ca.activity_name LIKE CONCAT('%', :searchKey, '%') OR ca.activity_id LIKE CONCAT('%', :searchKey, '%')) AND (:searchKey IS NULL OR ca.activity_name LIKE CONCAT('%', :searchKey, '%') OR ca.activity_id LIKE CONCAT('%', :searchKey, '%'))
AND (:status IS NULL OR ca.status = :status) AND (:status IS NULL OR ca.status = :status)
AND (:activityType IS NULL OR ca.activity_type = :activityType) AND (:activityType IS NULL OR ca.activity_type = :activityType)
AND (:startTime IS NULL OR ca.create_time >= :startTime) AND (:startTime IS NULL OR ca.valid_end_time >= :startTime)
AND (:endTime IS NULL OR ca.create_time <= :endTime) AND (:endTime IS NULL OR ca.valid_start_time <= :endTime)
GROUP BY ca.id, ca.activity_id, ca.activity_name, ca.valid_start_time, ca.valid_end_time, GROUP BY ca.id, ca.activity_id, ca.activity_name, ca.valid_start_time, ca.valid_end_time,
ca.activity_type, ca.target_type, ca.distribution_quantity, ca.status, ca.activity_type, ca.target_type, ca.distribution_quantity, ca.status,
ca.create_time, ca.send_notification, ca.remark, ca.update_time, ca.template_id ca.create_time, ca.send_notification, ca.remark, ca.update_time, ca.template_id
...@@ -209,8 +209,8 @@ public interface CouponActivityRepository extends BaseRepository<CouponActivity, ...@@ -209,8 +209,8 @@ public interface CouponActivityRepository extends BaseRepository<CouponActivity,
AND (:searchKey IS NULL OR ca.activity_name LIKE CONCAT('%', :searchKey, '%') OR ca.activity_id LIKE CONCAT('%', :searchKey, '%')) AND (:searchKey IS NULL OR ca.activity_name LIKE CONCAT('%', :searchKey, '%') OR ca.activity_id LIKE CONCAT('%', :searchKey, '%'))
AND (:status IS NULL OR ca.status = :status) AND (:status IS NULL OR ca.status = :status)
AND (:activityType IS NULL OR ca.activity_type = :activityType) AND (:activityType IS NULL OR ca.activity_type = :activityType)
AND (:startTime IS NULL OR ca.create_time >= :startTime) AND (:startTime IS NULL OR ca.valid_end_time >= :startTime)
AND (:endTime IS NULL OR ca.create_time <= :endTime) AND (:endTime IS NULL OR ca.valid_start_time <= :endTime)
""", """,
nativeQuery = true) nativeQuery = true)
Page<CouponActivityStatDTO> pageActivityStat( Page<CouponActivityStatDTO> pageActivityStat(
......
...@@ -476,7 +476,7 @@ public class CouponActivityService { ...@@ -476,7 +476,7 @@ public class CouponActivityService {
Integer activityType = typeObj instanceof Integer ? (Integer) typeObj : null; Integer activityType = typeObj instanceof Integer ? (Integer) typeObj : null;
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
List<String> timeRange = (List<String>) pagination.getFilterValueOrElseNull("createTime"); List<String> timeRange = (List<String>) pagination.getFilterValueOrElseNull("validTime");
LocalDateTime[] parsedRange = parseTimeRange(timeRange); LocalDateTime[] parsedRange = parseTimeRange(timeRange);
LocalDateTime startTime = parsedRange[0]; LocalDateTime startTime = parsedRange[0];
LocalDateTime endTime = parsedRange[1]; LocalDateTime endTime = parsedRange[1];
......
...@@ -35,7 +35,7 @@ public class CouponTemplateAddVO implements Serializable { ...@@ -35,7 +35,7 @@ public class CouponTemplateAddVO implements Serializable {
@Schema(description = "使用门槛(元,0 代表无门槛)", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "10000.00") @Schema(description = "使用门槛(元,0 代表无门槛)", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "10000.00")
@DecimalMin(value = "0", message = "门槛必须>=0") @DecimalMin(value = "0", message = "门槛必须>=0")
@DecimalMax(value = "9999999", message = "门槛必须<=9999999") @DecimalMax(value = "10000000", message = "门槛必须<=10000000")
private BigDecimal thresholdAmount; private BigDecimal thresholdAmount;
@Schema(description = "抵扣类型 (1:抵扣车款;2:抵扣佣金)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") @Schema(description = "抵扣类型 (1:抵扣车款;2:抵扣佣金)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
......
...@@ -39,7 +39,7 @@ public class CouponTemplateUpdateVO implements Serializable { ...@@ -39,7 +39,7 @@ public class CouponTemplateUpdateVO implements Serializable {
@Schema(description = "使用门槛(元,0 代表无门槛)", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "10000.00") @Schema(description = "使用门槛(元,0 代表无门槛)", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "10000.00")
@DecimalMin(value = "0", message = "门槛必须>=0") @DecimalMin(value = "0", message = "门槛必须>=0")
@DecimalMax(value = "9999999", message = "门槛必须<=9999999") @DecimalMax(value = "10000000", message = "门槛必须<=10000000")
private BigDecimal thresholdAmount; private BigDecimal thresholdAmount;
@Schema(description = "抵扣类型 (1:抵扣车款;2:抵扣佣金)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") @Schema(description = "抵扣类型 (1:抵扣车款;2:抵扣佣金)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!