From 6f742195a668f19f75d754b4006e350aba84ce67 Mon Sep 17 00:00:00 2001
From: gongzuming <gongzuming>
Date: 星期四, 26 九月 2024 08:41:45 +0800
Subject: [PATCH] Spring定时任务线程池配置

---
 src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplatePointController.java |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplatePointController.java b/src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplatePointController.java
index 2f05ceb..b9dddbe 100644
--- a/src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplatePointController.java
+++ b/src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplatePointController.java
@@ -216,11 +216,17 @@
 
     private void valid(CreateCouponTemplatePointDTO dto){
 
-        if (StringUtils.isNotBlank(dto.getCouponDiscountType())
-                && dto.getCouponDiscountType().equals(CouponTypeEnum.DISCOUNT.getType())
-                && dto.getMinOrderAmount().compareTo(dto.getCouponDiscountValue()) < 0) {
-            throw new ValidationException("优惠券使用条件不能小于面值金额");
+        if (StringUtils.isNotBlank(dto.getCouponDiscountType()) && dto.getCouponDiscountType().equals(CouponTypeEnum.DISCOUNT.getType())) {
+
+            if(dto.getMinOrderAmount().compareTo(BigDecimal.ZERO)<=0){
+                throw new ValidationException("优惠券使用条件不能小于0");
+            }
+            if(dto.getMinOrderAmount().compareTo(dto.getCouponDiscountValue()) < 0){
+                throw new ValidationException("优惠券使用条件不能小于面值金额");
+            }
+
         }
+
         if (StringUtils.isNotBlank(dto.getCouponDiscountType())
                 && dto.getCouponDiscountType().equals(CouponTypeEnum.DISCOUNT.getType())
                 && dto.getCouponDiscountValue().compareTo(BigDecimal.ZERO) <= 0) {

--
Gitblit v1.9.3