涉农结果导入

This commit is contained in:
majintao
2024-07-22 14:06:36 +08:00
parent d6b8bdbfe4
commit a41d31feb7
@@ -18,15 +18,15 @@ import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* excel读写工具类 * excel读写工具类
* *
* @author shenjian * @author shenjian
* @since 2021/07/12 * @since 2021/07/12
*/ */
public class ExcelUtils { public class ExcelUtils {
public static Map<String, List> read(InputStream inputStream, int sheetIndex, int skipRow) { public static Map<String, List> read(InputStream inputStream, int sheetIndex, int skipRow) {
// sheetIndex sheet下标 // sheetIndex sheet下标
// skipRow 跳过的表头行数 // skipRow 跳过的表头行数
Map<String, List> map = new HashMap<String, List>(); Map<String, List> map = new HashMap<String, List>();
List<List<String>> ret = new ArrayList<List<String>>(); List<List<String>> ret = new ArrayList<List<String>>();
InputStream inp = null; InputStream inp = null;
@@ -36,7 +36,7 @@ public class ExcelUtils {
Workbook workbook = WorkbookFactory.create(bufferedInputStream); Workbook workbook = WorkbookFactory.create(bufferedInputStream);
workbook.setForceFormulaRecalculation(true); workbook.setForceFormulaRecalculation(true);
Sheet sheet = workbook.getSheetAt(sheetIndex); Sheet sheet = workbook.getSheetAt(sheetIndex);
//行号 //行号
int rowIndex = 0; int rowIndex = 0;
for (Row row : sheet) { for (Row row : sheet) {
rowIndex++; rowIndex++;