|
@@ -526,16 +526,20 @@ public class POIUtil {
|
|
|
currentCellNum++;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
if (picMap != null) {
|
|
|
for (Entry<String, List<PictureData>> pics : picMap.entrySet()) {
|
|
|
String key = pics.getKey();
|
|
|
String[] split = key.split("-");
|
|
|
- obj.put(fieldsName[Integer.parseInt(split[1])], pics.getValue());
|
|
|
+ int rowIndex = Integer.parseInt(split[0]);
|
|
|
+ int cellIndex = Integer.parseInt(split[1]);
|
|
|
+ if (rowIndex != (currentRowNum - 1)) continue;
|
|
|
+ obj.put(fieldsName[cellIndex], pics.getValue());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
if (obj != null && hasVal)
|
|
|
datas.add(obj);
|
|
|
-
|
|
|
}
|
|
|
if (!datas.isEmpty())
|
|
|
result.put(sheet.getSheetName(), datas);
|
|
@@ -641,7 +645,7 @@ public class POIUtil {
|
|
|
*/
|
|
|
public static Map<String, List<PictureData>> getXlsPictures(HSSFSheet sheet) throws IOException {
|
|
|
Map<String, List<PictureData>> map = new HashMap<>();
|
|
|
- if(sheet.getDrawingPatriarch() == null || sheet.getDrawingPatriarch().getChildren()==null){
|
|
|
+ if (sheet.getDrawingPatriarch() == null || sheet.getDrawingPatriarch().getChildren() == null) {
|
|
|
return map;
|
|
|
}
|
|
|
List<HSSFShape> list = sheet.getDrawingPatriarch().getChildren();
|