diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/PageInfo.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/PageInfo.java index 2cfdd8f840..92dd700b37 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/PageInfo.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/PageInfo.java @@ -82,10 +82,8 @@ public class PageInfo { if (pageSize == null || pageSize == 0) { pageSize = 10; } - this.totalPage = - (this.total % this.pageSize) == 0 - ? ((this.total / this.pageSize) == 0 ? 1 : (this.total / this.pageSize)) - : (this.total / this.pageSize + 1); + + this.totalPage = (int) Math.ceil((double) this.total / (double) this.pageSize); return this.totalPage; } }