fix: 支持零元退款

This commit is contained in:
张松 2024-11-23 09:31:22 +08:00
parent 81756dfad5
commit f05cb6e841
1 changed files with 5 additions and 1 deletions

View File

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