From 53b823e2b1444e33f359fba79f8ff1e078253891 Mon Sep 17 00:00:00 2001 From: cloudroam <cloudroam> Date: 星期四, 14 十一月 2024 09:26:10 +0800 Subject: [PATCH] add:-商户列表需要增加下单次数统计(已退款、已取消、待付款的不统计在内) --- src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplatePointController.java | 15 +++++++++++---- 1 files changed, 11 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 9817a86..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 @@ -76,6 +76,7 @@ } CreateCouponTemplateBO couponTemplateBO = new CreateCouponTemplateBO(); + BeanUtils.copyProperties(couponTemplateDO,couponTemplateBO); BeanUtils.copyProperties(dto, couponTemplateBO); // 设置成积分优惠券 @@ -215,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