|
|
@@ -230,7 +230,7 @@ public class DataReportLogServiceImpl implements IDataReportLogService
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 比率 = 成功条数/num×100, 保留2位小数(HALF_UP); 无记录为0.0
|
|
|
+ * 比率 = 成功条数/num×100, 保留2位小数(HALF_UP), 超过100按100计; 无记录为0.0
|
|
|
*/
|
|
|
private Double calcRate(String type, Map<String, Long> typeCnt, Map<String, Integer> nums)
|
|
|
{
|
|
|
@@ -239,8 +239,12 @@ public class DataReportLogServiceImpl implements IDataReportLogService
|
|
|
{
|
|
|
return 0.0;
|
|
|
}
|
|
|
- return new BigDecimal(cnt * 100).divide(new BigDecimal(nums.get(type)), 2, RoundingMode.HALF_UP)
|
|
|
- .doubleValue();
|
|
|
+ BigDecimal rate = new BigDecimal(cnt * 100).divide(new BigDecimal(nums.get(type)), 2, RoundingMode.HALF_UP);
|
|
|
+ if (rate.compareTo(new BigDecimal("100")) > 0)
|
|
|
+ {
|
|
|
+ rate = new BigDecimal("100");
|
|
|
+ }
|
|
|
+ return rate.doubleValue();
|
|
|
}
|
|
|
|
|
|
/**
|