|
@@ -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);
|
|
@@ -292,7 +288,9 @@ public class ConsoleFacade {
|
|
|
num++;
|
|
|
}
|
|
|
}
|
|
|
- averageValue = BigDecimal.valueOf(averageValue).divide(BigDecimal.valueOf(num), 2).doubleValue();
|
|
|
+ averageValue = BigDecimal.valueOf(averageValue)
|
|
|
+ .divide(BigDecimal.valueOf(num), 2)
|
|
|
+ .doubleValue();
|
|
|
AverageStatisticsDTO retAverageStatistics = new AverageStatisticsDTO();
|
|
|
retAverageStatistics.setDeptName("其他");
|
|
|
retAverageStatistics.setAverageValue(averageValue);
|