feat: 计算导入数据总数优化

This commit is contained in:
tangwei 2026-04-27 08:28:26 +08:00
parent 65e669f9d9
commit 15db44b2f5

View File

@ -147,8 +147,6 @@ public class FishImportServiceImpl implements IFishImportService {
Map<Integer, String> columnIndexMap = new HashMap<>(EXCEL_COLUMN_INDEX_MAPPING); Map<Integer, String> columnIndexMap = new HashMap<>(EXCEL_COLUMN_INDEX_MAPPING);
int totalRows = sheet.getLastRowNum(); int totalRows = sheet.getLastRowNum();
result.setTotalCount(totalRows);
for (int i = 1; i <= totalRows; i++) { for (int i = 1; i <= totalRows; i++) {
Row row = sheet.getRow(i); Row row = sheet.getRow(i);
if (row == null || isRowEmpty(row)) { if (row == null || isRowEmpty(row)) {
@ -156,6 +154,7 @@ public class FishImportServiceImpl implements IFishImportService {
} }
FishImportResult.FishImportRow importRow = parseRow(row, columnIndexMap, i); FishImportResult.FishImportRow importRow = parseRow(row, columnIndexMap, i);
result.setTotalCount(result.getTotalCount() + 1);
if (importRow.getData() != null && importRow.getWarnings().isEmpty()) { if (importRow.getData() != null && importRow.getWarnings().isEmpty()) {
result.getSuccessRows().add(importRow); result.getSuccessRows().add(importRow);
result.setSuccessCount(result.getSuccessCount() + 1); result.setSuccessCount(result.getSuccessCount() + 1);