From 0cd809b07fdc09185d64db29164f7b0a604443de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=9D=BE?= <8605635+zhang3064194730@user.noreply.gitee.com> Date: Sat, 23 Nov 2024 09:31:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=94=AF=E6=8C=81=E9=9B=B6=E5=85=83?= =?UTF-8?q?=E9=80=80=E6=AC=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/shopimpl/TbShopTableServiceImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopTableServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopTableServiceImpl.java index fec306fa..38ac2668 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopTableServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopTableServiceImpl.java @@ -2865,7 +2865,11 @@ public class TbShopTableServiceImpl implements TbShopTableService { orderDetail.setStatus("refund"); } - if (hasNormalReturn && returnAmount.compareTo(new BigDecimal("0.01")) <= 0) { + if (returnAmount.compareTo(BigDecimal.ZERO) < 0) { + throw new BadRequestException("退款金额为负数有误"); + } + + if (hasNormalReturn && returnAmount.compareTo(new BigDecimal("0.01")) <= 0 && oldOrderInfo.getPayAmount().compareTo(BigDecimal.ZERO) != 0) { throw new BadRequestException("退款金额必须大于0"); }