From bf2a0074e66bd9ac30b302594a45e9f3eb1e4116 Mon Sep 17 00:00:00 2001
From: cloudroam <cloudroam>
Date: 星期三, 27 十一月 2024 14:23:22 +0800
Subject: [PATCH] 569-供应商列表:1.序号ID修改为供应商ID,并移动到第一列 2.增加供应商ID查询框

---
 src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplateActivyController.java |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplateActivyController.java b/src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplateActivyController.java
index d1282d6..08026a8 100644
--- a/src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplateActivyController.java
+++ b/src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplateActivyController.java
@@ -177,11 +177,22 @@
 
     private void valid(CreateCouponTemplateActivyDTO 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())
+//                && 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