|
@@ -276,24 +276,27 @@ public class ConsoleFacade {
|
|
|
retAverageList = BeanUtil.listCopyTo(averageList, AverageStatisticsDTO.class);
|
|
|
} else {
|
|
|
Double averageValue = 0d;
|
|
|
+ Double totleValue = 0d;
|
|
|
Integer num = 0;
|
|
|
for (AverageStatisticsDTO averageStatisticsDTO : averageList) {
|
|
|
if (retAverageList.size() < limitCount - 1) {
|
|
|
retAverageList.add(averageStatisticsDTO);
|
|
|
} else {
|
|
|
- averageValue = BigDecimal
|
|
|
- .valueOf(averageValue)
|
|
|
- .add(BigDecimal.valueOf(averageStatisticsDTO.getAverageValue()))
|
|
|
+ totleValue = BigDecimal
|
|
|
+ .valueOf(totleValue)
|
|
|
+ .add(BigDecimal.valueOf(averageStatisticsDTO.getTotleValue()))
|
|
|
.doubleValue();
|
|
|
- num++;
|
|
|
+ num += averageStatisticsDTO.getNum();
|
|
|
}
|
|
|
}
|
|
|
- averageValue = BigDecimal.valueOf(averageValue)
|
|
|
+ averageValue = BigDecimal.valueOf(totleValue)
|
|
|
.divide(BigDecimal.valueOf(num), 2)
|
|
|
.doubleValue();
|
|
|
AverageStatisticsDTO retAverageStatistics = new AverageStatisticsDTO();
|
|
|
retAverageStatistics.setDeptName("其他");
|
|
|
+ retAverageStatistics.setNum(num);
|
|
|
retAverageStatistics.setAverageValue(averageValue);
|
|
|
+ retAverageStatistics.setTotleValue(totleValue);
|
|
|
retAverageList.add(retAverageStatistics);
|
|
|
}
|
|
|
return retAverageList;
|