From 9bb9952db0b22034b4aea1f486df827d77a03031 Mon Sep 17 00:00:00 2001 From: cloudroam <cloudroam> Date: 星期四, 17 十月 2024 14:41:35 +0800 Subject: [PATCH] add:销售合计统计运费+打包费;售后扣平台款字段,增加增加统计售后“打包运费(散户)”字段 --- 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