| | |
| | | } |
| | | deduct = deductAmount.multiply(new BigDecimal(dto.getNum())); |
| | | BigDecimal dt = realPrice.multiply(new BigDecimal(dto.getNum())); |
| | | if(deduct.doubleValue() > dt.doubleValue() |
| | | || (oi.getRealTotal() != null && deduct.doubleValue() > oi.getRealTotal().doubleValue())){ |
| | | if(deduct.compareTo(dt) > 0 |
| | | || (oi.getRealTotal() != null && deduct.compareTo(oi.getRealTotal()) > 0)){ |
| | | throw new ValidationException("降级金额不能大于商品处理数量的支付的金额"); |
| | | } |
| | | BigDecimal st = oi.getSupplierPrice().multiply(new BigDecimal(dto.getNum())); |
| | | if(deduct.doubleValue() > st.doubleValue()){ |
| | | if(deduct.compareTo(st) > 0){ |
| | | throw new ValidationException("降级金额不能大于商品处理数量的供应商的金额"); |
| | | } |
| | | } |