元数据模板导出 excel导入 5000条上限取消
This commit is contained in:
+4
-4
@@ -29,8 +29,8 @@ public class VersionResourceExcelService {
|
||||
|
||||
private final VersionResourceService versionResourceService;
|
||||
|
||||
/** 单次导入的最大数据行数,防止超大文件拖垮服务 */
|
||||
private static final int MAX_ROWS = 5000;
|
||||
/** 下拉校验覆盖的行数;只影响模板中下拉框的作用范围,不限制导入行数 */
|
||||
private static final int DROPDOWN_ROWS = 5000;
|
||||
|
||||
private record Column(String header, String field,
|
||||
BiConsumer<VersionResource, String> setter, int maxLen, String hint) {
|
||||
@@ -215,7 +215,7 @@ public class VersionResourceExcelService {
|
||||
DataValidationHelper helper = sheet.getDataValidationHelper();
|
||||
DataValidationConstraint constraint =
|
||||
helper.createExplicitListConstraint(options);
|
||||
CellRangeAddressList range = new CellRangeAddressList(2, MAX_ROWS, colIndex, colIndex);
|
||||
CellRangeAddressList range = new CellRangeAddressList(2, DROPDOWN_ROWS, colIndex, colIndex);
|
||||
DataValidation validation = helper.createValidation(constraint, range);
|
||||
validation.setSuppressDropDownArrow(true);
|
||||
validation.setShowErrorBox(true);
|
||||
@@ -267,7 +267,7 @@ public class VersionResourceExcelService {
|
||||
List<VersionResource> parsed = new ArrayList<>();
|
||||
List<Integer> rowNums = new ArrayList<>();
|
||||
|
||||
int last = Math.min(sheet.getLastRowNum(), startRow + MAX_ROWS);
|
||||
int last = sheet.getLastRowNum();
|
||||
for (int r = startRow; r <= last; r++) {
|
||||
Row row = sheet.getRow(r);
|
||||
if (row == null) continue;
|
||||
|
||||
Reference in New Issue
Block a user