修改ZERO
This commit is contained in:
@@ -22,7 +22,7 @@ public class SumAggregate extends Aggregate {
|
|||||||
protected List<BindData> doAggregate(DatasetValue expr, Cell cell, Context context,
|
protected List<BindData> doAggregate(DatasetValue expr, Cell cell, Context context,
|
||||||
List<Map<String, Object>> objList) {
|
List<Map<String, Object>> objList) {
|
||||||
List<BigDecimal> bindDataList = DataUtils.dataList(expr, objList);
|
List<BigDecimal> bindDataList = DataUtils.dataList(expr, objList);
|
||||||
BigDecimal result = bindDataList.stream().reduce(BigDecimal.YUNZHUPAAS, BigDecimal::add);
|
BigDecimal result = bindDataList.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
BindData bindData = new BindData();
|
BindData bindData = new BindData();
|
||||||
bindData.setValue(result.doubleValue());
|
bindData.setValue(result.doubleValue());
|
||||||
List<BindData> list = new ArrayList<>();
|
List<BindData> list = new ArrayList<>();
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class AvgFunction implements Function {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BigDecimal result = list.stream().reduce(BigDecimal.YUNZHUPAAS, BigDecimal::add);
|
BigDecimal result = list.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
if (!list.isEmpty()) {
|
if (!list.isEmpty()) {
|
||||||
result = result.divide(new BigDecimal(list.size()), 8, BigDecimal.ROUND_HALF_UP);
|
result = result.divide(new BigDecimal(list.size()), 8, BigDecimal.ROUND_HALF_UP);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class SumFunction implements Function {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BigDecimal result = list.stream().reduce(BigDecimal.YUNZHUPAAS, BigDecimal::add);
|
BigDecimal result = list.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user