BiFunction<BigDecimal, BigDecimal, BigDecimal> function = (source, targe) -> source.divide(targe, BigDecimal.ROUND_CEILING).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
loss.setAbnormal(false);
if (sanitizeBeforeQuantity.compareTo(BigDecimal.ZERO) <= 0) {
loss.setBadPackPercent("0.00%");
} else {
loss.setBadPackPercent(function.apply(sanitizeBeforeQuantity, prodVacuumQuantity).toString() + "%");
}
java.util.function 它包含了很多类,用来支持 Java的 函数式编程,该包中的函数式接口有: