|
|
|
@ -385,12 +385,12 @@ public class QuoteDetailServiceImpl extends ServiceImpl<QuoteDetailMapper, Quote |
|
|
|
BigDecimal num1 = new BigDecimal(0); |
|
|
|
// 包装袋成本/包装数量 |
|
|
|
if (bagCost.get().getNumValue().compareTo(new BigDecimal(0)) >= 1 || bagQuantity.get().getNumValue().compareTo(new BigDecimal(0)) >= 1) { |
|
|
|
num1 = bagCost.get().getNumValue().divide(bagQuantity.get().getNumValue()); |
|
|
|
num1 = bagCost.get().getNumValue().divide(bagQuantity.get().getNumValue(), 16, RoundingMode.HALF_UP); |
|
|
|
} |
|
|
|
BigDecimal num2 = new BigDecimal(0); |
|
|
|
// 箱子成本/(每箱袋数*每袋数量) |
|
|
|
if (bagQuantity.get().getNumValue().compareTo(new BigDecimal(0)) >= 1 || boxOfBags.get().getNumValue().compareTo(new BigDecimal(0)) >= 1) { |
|
|
|
num2 = packBoxCost.get().getNumValue().divide(bagQuantity.get().getNumValue().multiply(boxOfBags.get().getNumValue())); |
|
|
|
num2 = packBoxCost.get().getNumValue().divide(bagQuantity.get().getNumValue().multiply(boxOfBags.get().getNumValue()), 16, RoundingMode.HALF_UP); |
|
|
|
} |
|
|
|
packCost = num1.add(num2); |
|
|
|
} |
|
|
|
@ -438,7 +438,7 @@ public class QuoteDetailServiceImpl extends ServiceImpl<QuoteDetailMapper, Quote |
|
|
|
// 运输成本/交付数量 |
|
|
|
if (shipCost.isPresent() && deliverQuantity.isPresent()) { |
|
|
|
if (Objects.nonNull(shipCost.get().getNumValue()) && (Objects.nonNull(deliverQuantity.get().getNumValue()) && deliverQuantity.get().getNumValue().compareTo(new BigDecimal(0)) >= 1)) { |
|
|
|
shippingCost = shipCost.get().getNumValue().divide(deliverQuantity.get().getNumValue()); |
|
|
|
shippingCost = shipCost.get().getNumValue().divide(deliverQuantity.get().getNumValue(), 16, RoundingMode.HALF_UP); |
|
|
|
} |
|
|
|
} |
|
|
|
// 运输成本/交付数量+运输其他成本 |
|
|
|
|