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

汇总bug修改

parent b8028932
...@@ -138,8 +138,8 @@ public class CheckAllRecordController extends BaseJsonBodyController { ...@@ -138,8 +138,8 @@ public class CheckAllRecordController extends BaseJsonBodyController {
CheckAllScoreSummaryVo current = checkAllRecordService.getScoreSummary(query); CheckAllScoreSummaryVo current = checkAllRecordService.getScoreSummary(query);
NumberFormat numberFormat = NumberFormat.getPercentInstance(); NumberFormat numberFormat = NumberFormat.getPercentInstance();
numberFormat.setMaximumFractionDigits(2); numberFormat.setMaximumFractionDigits(2);
BigDecimal zero = new BigDecimal(0);
if (current != null) { if (current != null) {
BigDecimal zero = new BigDecimal(0);
model.put("initScore", current.getInitScore()); model.put("initScore", current.getInitScore());
model.put("checkScore", current.getCheckScore()); model.put("checkScore", current.getCheckScore());
model.put("appealScore", current.getAppealScore()); model.put("appealScore", current.getAppealScore());
...@@ -153,9 +153,11 @@ public class CheckAllRecordController extends BaseJsonBodyController { ...@@ -153,9 +153,11 @@ public class CheckAllRecordController extends BaseJsonBodyController {
CheckAllScoreSummaryVo last = checkAllRecordService.getScoreSummary(lastQuery); CheckAllScoreSummaryVo last = checkAllRecordService.getScoreSummary(lastQuery);
if (last != null) { if (last != null) {
BigDecimal huanbi = current.getTotal().subtract(last.getTotal()); if(last.getTotal().compareTo(zero)>0) {
huanbi = huanbi.divide(last.getTotal(), 6, BigDecimal.ROUND_HALF_UP); BigDecimal huanbi = current.getTotal().subtract(last.getTotal());
model.put("huanbi", numberFormat.format(huanbi)); huanbi = huanbi.divide(last.getTotal(), 6, BigDecimal.ROUND_HALF_UP);
model.put("huanbi", numberFormat.format(huanbi));
}
} }
if (query.getSummaryType() == SummaryTopTypeEnum..getValue()) { if (query.getSummaryType() == SummaryTopTypeEnum..getValue()) {
if (last != null) { if (last != null) {
...@@ -177,9 +179,11 @@ public class CheckAllRecordController extends BaseJsonBodyController { ...@@ -177,9 +179,11 @@ public class CheckAllRecordController extends BaseJsonBodyController {
} }
CheckAllScoreSummaryVo tb = checkAllRecordService.getScoreSummary(lastQuery); CheckAllScoreSummaryVo tb = checkAllRecordService.getScoreSummary(lastQuery);
if (tb != null) { if (tb != null) {
BigDecimal tongbi = current.getTotal().subtract(tb.getTotal()); if(last.getTotal().compareTo(zero)>0) {
tongbi = tongbi.divide(last.getTotal(), 6, BigDecimal.ROUND_HALF_UP); BigDecimal tongbi = current.getTotal().subtract(tb.getTotal());
model.put("tongbi", numberFormat.format(tongbi)); 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