Cui Zhi Feng
2024-09-22 e718b00c64088cab2b4999a9e0885ab72701f552
src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplateActivyController.java
@@ -180,7 +180,7 @@
        if (StringUtils.isNotBlank(dto.getCouponDiscountType())
                && dto.getCouponDiscountType().equals(CouponTypeEnum.DISCOUNT.getType())
                && dto.getMinOrderAmount().compareTo(dto.getCouponDiscountValue()) < 0) {
            throw new ValidationException("订单金额不能小于折扣金额");
            throw new ValidationException("优惠券使用条件不能小于面值金额");
        }
        if (StringUtils.isNotBlank(dto.getCouponDiscountType())
                && dto.getCouponDiscountType().equals(CouponTypeEnum.DISCOUNT.getType())
@@ -203,6 +203,19 @@
            if(dto.getUsageEndDate()==null){
                throw new ValidationException("固定时间结束日期不能为空");
            }
            if(dto.getUsageStartDate().isAfter(dto.getUsageEndDate())){
                throw new ValidationException("固定时间开始时间不能大于结束日期");
            }
            // 固定时间的使用开始时间必须大于领取的结束时间
            if(null!=dto.getGetEndDate() && null!=dto.getUsageStartDate() && dto.getGetEndDate().isAfter(dto.getUsageStartDate())){
                throw new ValidationException("使用开始时间必须大于领取结束时间!");
            }
        }
        // 领取后 有效时间
@@ -229,6 +242,8 @@
            }
        }
        //
    }
}