| | |
| | | private boolean includeHeader; |
| | | |
| | | public ExcelDocumentSplitter(int rowsPerChunk) { |
| | | this(rowsPerChunk, true); |
| | | if (rowsPerChunk <= 0) { |
| | | throw new IllegalArgumentException("rows must be greater than 0"); |
| | | } |
| | | this.rowsPerChunk = rowsPerChunk; |
| | | } |
| | | |
| | | public ExcelDocumentSplitter(int rowsPerChunk, boolean includeHeader) { |
| | |
| | | @RequestParam(name="rowsPerChunk", required = false) Integer rowsPerChunk, |
| | | @RequestParam(name="userWillSave") boolean userWillSave |
| | | ) throws IOException { |
| | | if (chunkSize == null){ |
| | | chunkSize = 100; |
| | | } |
| | | if (overlapSize == null){ |
| | | overlapSize = 200; |
| | | } |
| | | if (rowsPerChunk == null){ |
| | | rowsPerChunk = 1; |
| | | } |
| | | if (file.getOriginalFilename() == null){ |
| | | return Result.fail(1,"文件名不能为空"); |
| | | } |