From 9e530fa2aee385cb331e3c76d0765e78c40e35f7 Mon Sep 17 00:00:00 2001
From: 陶杰 <1378534974@qq.com>
Date: 星期四, 10 十月 2024 13:44:08 +0800
Subject: [PATCH] 1.增加基类是ID是string且是逻辑删的 2.财务报表-合伙人报表
---
src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplateActivyController.java | 34 ++++++++++++++++++++++++++++++----
1 files changed, 30 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 f06fbf6..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) {
@@ -203,6 +214,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 +253,8 @@
}
}
+ //
+
}
}
--
Gitblit v1.9.3