|
@@ -45,7 +45,7 @@ public class RollHeightServiceImpl extends ServiceImpl<RollHeightMapper, RollHei
|
|
|
Integer amountTotal = rollHeightList.stream().map(RollHeight::getAmountTotal).reduce(0, Integer::sum);
|
|
|
// 先将每个RollHeight对象中的heightValue属性值乘以blankOutput,再求和
|
|
|
double sumResult = rollHeightList.stream().mapToDouble(rollHeight -> rollHeight.getAmountTotal() * rollHeight.getBlankOutput()).sum();
|
|
|
- BigDecimal bd = BigDecimal.valueOf(sumResult).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal bd = BigDecimal.valueOf(sumResult).setScale(4, BigDecimal.ROUND_HALF_UP);
|
|
|
double finalResult = bd.doubleValue();
|
|
|
destinationStatistics.setCounts(amountTotal);
|
|
|
destinationStatistics.setBlankOutput(finalResult);
|