fix: 支持零元退款

This commit is contained in:
张松
2024-11-23 09:31:22 +08:00
parent 764fd5289b
commit 0cd809b07f

View File

@@ -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");
}