Browse Source

feat(all): 增加报表导出数量限制

dist.1.3.0
zhaoqiaobo 10 months ago
parent
commit
868460f6ea
  1. 4
      blade-service/logpm-report/src/main/java/com/logpm/report/util/ReportExcelUtil.java

4
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

Loading…
Cancel
Save