|
@@ -3,8 +3,6 @@ package com.persagy.ibms.data.sdk.util;
|
|
|
import java.io.BufferedInputStream;
|
|
|
import java.io.File;
|
|
|
import java.io.FileInputStream;
|
|
|
-import java.util.LinkedHashMap;
|
|
|
-import java.util.List;
|
|
|
|
|
|
import org.apache.poi.ss.usermodel.Cell;
|
|
|
import org.apache.poi.ss.usermodel.Row;
|
|
@@ -23,7 +21,7 @@ public class ExeclReadEquipStaticInfoUtil {
|
|
|
FileInputStream fis = new FileInputStream(new File(filepath));
|
|
|
Workbook workbook = WorkbookFactory.create(new BufferedInputStream(fis));
|
|
|
Sheet sheet = workbook.getSheet(sheetName);
|
|
|
- JSONObject object = new JSONObject(new LinkedHashMap());
|
|
|
+ JSONObject object = new JSONObject();
|
|
|
for (int i = 0; i < sheet.getNumMergedRegions(); i++) {
|
|
|
// 获取合并单元格的值
|
|
|
CellRangeAddress ca = sheet.getMergedRegion(i);
|
|
@@ -32,7 +30,7 @@ public class ExeclReadEquipStaticInfoUtil {
|
|
|
Cell fCell = fRow.getCell(0);
|
|
|
String caVal = getCellValue(fCell);
|
|
|
// 获取合并单元格之后的值,形成树形结构
|
|
|
- List dic = new JSONArray();
|
|
|
+ JSONArray dic = new JSONArray();
|
|
|
for (int j = firstRow; j <= ca.getLastRow(); j++) {
|
|
|
Row row = sheet.getRow(j);
|
|
|
JSONObject obj = new JSONObject();
|