|
@@ -385,18 +385,22 @@ public class ConsoleByDeptFacade {
|
|
|
retList.addAll(entryByDeptList);
|
|
|
} else {
|
|
|
int count = 0;
|
|
|
+ double sumPercent = 0d;
|
|
|
for (NumDTO numDTO : entryByDeptList) {
|
|
|
if (retList.size() < limitCount - 1) {
|
|
|
retList.add(numDTO);
|
|
|
count += numDTO.getNum();
|
|
|
+ sumPercent = BigDecimal.valueOf(sumPercent)
|
|
|
+ .add(BigDecimal.valueOf(numDTO.getPercent()))
|
|
|
+ .doubleValue();
|
|
|
} else {
|
|
|
NumDTO otherNumDTO = new NumDTO();
|
|
|
int num = totle - count;
|
|
|
otherNumDTO.setName("其他");
|
|
|
otherNumDTO.setNum(num);
|
|
|
otherNumDTO.setTotleNum(totle);
|
|
|
- Double percent = BigDecimal.valueOf(numDTO.getNum())
|
|
|
- .divide(BigDecimal.valueOf(totle), 4, RoundingMode.HALF_UP)
|
|
|
+ Double percent = BigDecimal.valueOf(1)
|
|
|
+ .subtract(BigDecimal.valueOf(sumPercent))
|
|
|
.doubleValue();
|
|
|
otherNumDTO.setPercent(percent);
|
|
|
String percentStr
|