diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/util/ReportExcelUtil.java b/blade-service/logpm-report/src/main/java/com/logpm/report/util/ReportExcelUtil.java index 1b862b28a..625bddc6b 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/util/ReportExcelUtil.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/util/ReportExcelUtil.java @@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.logpm.report.constant.ReportConstants; import com.logpm.report.service.ExportReader; import org.apache.poi.ss.formula.functions.T; +import org.springblade.core.log.exception.ServiceException; import javax.servlet.http.HttpServletResponse; import java.io.IOException; @@ -87,6 +88,9 @@ public class ReportExcelUtil { ReportExcelUtil.setExportHeader(response, fileName); // 获取需要导出的总条数 Long count = service.getCount(query); + if(count > 500000L){ + throw new ServiceException("导出数据不能大于50w,请增加检索条件"); + } // 每个 sheet 放多少条数据 Double sheetDataNum = onceSheetDataNum.doubleValue(); // 总共要几个 sheet