|
@@ -18,7 +18,6 @@ import org.springframework.stereotype.Component;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.text.DecimalFormat;
|
|
|
import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
import java.util.LinkedHashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -184,19 +183,16 @@ public class ConsoleFacade {
|
|
|
retResults.add(result);
|
|
|
} else {
|
|
|
num += result.getNum();
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
ResultDetailDTO retResult = new ResultDetailDTO();
|
|
|
retResult.setName("其他");
|
|
|
retResult.setNum(num);
|
|
|
- retResult.setPercent(BigDecimal.valueOf(1)
|
|
|
- .min(BigDecimal.valueOf(rate))
|
|
|
- .doubleValue());
|
|
|
+ retResult.setPercent(BigDecimal.valueOf(1).subtract(BigDecimal.valueOf(rate)).doubleValue());
|
|
|
retResults.add(retResult);
|
|
|
}
|
|
|
retResults.forEach(result -> {
|
|
|
- DecimalFormat df = new DecimalFormat("#.00");
|
|
|
+ DecimalFormat df = new DecimalFormat("#0.00");
|
|
|
String percentStr
|
|
|
= df.format(BigDecimal.valueOf(result.getPercent()).multiply(BigDecimal.valueOf(100))) + "%";
|
|
|
result.setPercentStr(percentStr);
|
|
@@ -280,22 +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).divide(BigDecimal.valueOf(num), 2).doubleValue();
|
|
|
+ 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;
|