fix: 0.01退款增加提示
This commit is contained in:
parent
b33d7b0f31
commit
d188906e81
|
|
@ -2965,6 +2965,11 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||
if (orderDetail.getNum().compareTo(returnNum) == 0) {
|
||||
return orderDetail.getCanReturnAmount();
|
||||
}
|
||||
if (returnNum.compareTo(BigDecimal.ONE) == 0 &&
|
||||
orderDetail.getNum().compareTo(BigDecimal.ONE) > 0 &&
|
||||
orderDetail.getCanReturnAmount().compareTo(new BigDecimal("0.01")) <= 0) {
|
||||
throw new BadRequestException(orderDetail.getProductName() + "总金额为0.01,请选择全部商品数量退回");
|
||||
}
|
||||
return orderDetail.getCanReturnAmount().divide(orderDetail.getNum(), 10, RoundingMode.HALF_DOWN).multiply(returnNum).setScale(2, RoundingMode.HALF_DOWN);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue