diff --git a/alerter/src/main/java/com/usthe/alert/service/impl/AlertServiceImpl.java b/alerter/src/main/java/com/usthe/alert/service/impl/AlertServiceImpl.java index 6e9bc47..9958022 100644 --- a/alerter/src/main/java/com/usthe/alert/service/impl/AlertServiceImpl.java +++ b/alerter/src/main/java/com/usthe/alert/service/impl/AlertServiceImpl.java @@ -75,10 +75,14 @@ public class AlertServiceImpl implements AlertService { - alertSummary.getPriorityEmergencyNum() - alertSummary.getPriorityWarningNum(); alertSummary.setDealNum(dealNum); try { - float rate = BigDecimal.valueOf(100 * (float) dealNum / total) - .setScale(2, RoundingMode.HALF_UP) - .floatValue(); - alertSummary.setRate(rate); + if (total == 0) { + alertSummary.setRate(100); + } else { + float rate = BigDecimal.valueOf(100 * (float) dealNum / total) + .setScale(2, RoundingMode.HALF_UP) + .floatValue(); + alertSummary.setRate(rate); + } } catch (Exception e) { log.error(e.getMessage(), e); } diff --git a/web-app/src/app/routes/dashboard/dashboard.component.html b/web-app/src/app/routes/dashboard/dashboard.component.html index da2f7cf..5604be6 100644 --- a/web-app/src/app/routes/dashboard/dashboard.component.html +++ b/web-app/src/app/routes/dashboard/dashboard.component.html @@ -145,7 +145,7 @@ [autoResize]="true" [loading]="alertsLoading" (chartInit)="onAlertNumChartInit($event)" - style="width: 100%; height: 100%" + style="width: 100%; min-height: 300px" >