| | |
| | | public ResponseEntity<ReturnDataDTO> create(@Validated @RequestBody CreateCouponTemplateUserDTO dto) { |
| | | |
| | | if (dto.getCouponDiscountType().equals(CouponTypeEnum.DISCOUNT.getType()) && dto.getMinOrderAmount().compareTo(dto.getCouponDiscountValue()) < 0) { |
| | | throw new ValidationException("订单金额不能小于折扣金额"); |
| | | throw new ValidationException("优惠券使用条件不能小于面值金额"); |
| | | } |
| | | |
| | | if (dto.getCouponDiscountType().equals(CouponTypeEnum.ZERO.getType()) && dto.getMinOrderAmount().compareTo(BigDecimal.ZERO) != 0) { |
| | |
| | | dto.setId(id); |
| | | |
| | | if (dto.getCouponDiscountType().equals(CouponTypeEnum.DISCOUNT.getType()) && dto.getMinOrderAmount().compareTo(dto.getCouponDiscountValue()) < 0) { |
| | | throw new ValidationException("订单金额不能小于折扣金额"); |
| | | throw new ValidationException("优惠券使用条件不能小于面值金额"); |
| | | } |
| | | |
| | | if (dto.getCouponDiscountType().equals(CouponTypeEnum.ZERO.getType()) && dto.getMinOrderAmount().compareTo(BigDecimal.ZERO) != 0) { |