Commit ed0b20dd authored by 廖旭伟's avatar 廖旭伟

汇总bug修改

parent b8028932
......@@ -138,8 +138,8 @@ public class CheckAllRecordController extends BaseJsonBodyController {
CheckAllScoreSummaryVo current = checkAllRecordService.getScoreSummary(query);
NumberFormat numberFormat = NumberFormat.getPercentInstance();
numberFormat.setMaximumFractionDigits(2);
BigDecimal zero = new BigDecimal(0);
if (current != null) {
BigDecimal zero = new BigDecimal(0);
model.put("initScore", current.getInitScore());
model.put("checkScore", current.getCheckScore());
model.put("appealScore", current.getAppealScore());
......@@ -153,9 +153,11 @@ public class CheckAllRecordController extends BaseJsonBodyController {
CheckAllScoreSummaryVo last = checkAllRecordService.getScoreSummary(lastQuery);
if (last != null) {
BigDecimal huanbi = current.getTotal().subtract(last.getTotal());
huanbi = huanbi.divide(last.getTotal(), 6, BigDecimal.ROUND_HALF_UP);
model.put("huanbi", numberFormat.format(huanbi));
if(last.getTotal().compareTo(zero)>0) {
BigDecimal huanbi = current.getTotal().subtract(last.getTotal());
huanbi = huanbi.divide(last.getTotal(), 6, BigDecimal.ROUND_HALF_UP);
model.put("huanbi", numberFormat.format(huanbi));
}
}
if (query.getSummaryType() == SummaryTopTypeEnum..getValue()) {
if (last != null) {
......@@ -177,9 +179,11 @@ public class CheckAllRecordController extends BaseJsonBodyController {
}
CheckAllScoreSummaryVo tb = checkAllRecordService.getScoreSummary(lastQuery);
if (tb != null) {
BigDecimal tongbi = current.getTotal().subtract(tb.getTotal());
tongbi = tongbi.divide(last.getTotal(), 6, BigDecimal.ROUND_HALF_UP);
model.put("tongbi", numberFormat.format(tongbi));
if(last.getTotal().compareTo(zero)>0) {
BigDecimal tongbi = current.getTotal().subtract(tb.getTotal());
tongbi = tongbi.divide(last.getTotal(), 6, BigDecimal.ROUND_HALF_UP);
model.put("tongbi", numberFormat.format(tongbi));
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment