diff --git a/pom.xml b/pom.xml index 9f7ae1552..efec74e13 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,7 @@ 2.0.64 0.9.1 8.2.2 - 4.1.2 + 5.5.1 3.1.0 2.14.5 diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java index 1320e8bf2..25ecf2564 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java @@ -487,7 +487,7 @@ public class ExcelUtil /** * 对list数据源将其里面的数据导入到excel表单 - * + * * @param response 返回数据 * @param list 导出数据集合 * @param sheetName 工作表的名称 @@ -591,7 +591,7 @@ public class ExcelUtil /** * 对list数据源将其里面的数据导入到excel表单 - * + * * @param sheetName 工作表的名称 * @param title 标题 * @return 结果 @@ -840,13 +840,13 @@ public class ExcelUtil style.cloneStyleFrom(styles.get("data")); style.setAlignment(HorizontalAlignment.CENTER); style.setVerticalAlignment(VerticalAlignment.CENTER); - style.setFillForegroundColor(excel.headerBackgroundColor().index); + style.setFillForegroundColor(excel.headerBackgroundColor().getIndex()); style.setFillPattern(FillPatternType.SOLID_FOREGROUND); Font headerFont = wb.createFont(); headerFont.setFontName("Arial"); headerFont.setFontHeightInPoints((short) 10); headerFont.setBold(true); - headerFont.setColor(excel.headerColor().index); + headerFont.setColor(excel.headerColor().getIndex()); style.setFont(headerFont); // 设置表格头单元格文本形式 DataFormat dataFormat = wb.createDataFormat(); @@ -918,7 +918,7 @@ public class ExcelUtil Font dataFont = wb.createFont(); dataFont.setFontName("Arial"); dataFont.setFontHeightInPoints((short) 10); - dataFont.setColor(excel.color().index); + dataFont.setColor(excel.color().getIndex()); style.setFont(dataFont); if (ColumnType.TEXT == excel.cellType()) { @@ -985,12 +985,15 @@ public class ExcelUtil else if (ColumnType.IMAGE == attr.cellType()) { ClientAnchor anchor = new XSSFClientAnchor(0, 0, 0, 0, (short) cell.getColumnIndex(), cell.getRow().getRowNum(), (short) (cell.getColumnIndex() + 1), cell.getRow().getRowNum() + 1); - String imagePath = Convert.toStr(value); - if (StringUtils.isNotEmpty(imagePath)) + String propertyValue = Convert.toStr(value); + if (StringUtils.isNotEmpty(propertyValue)) { - byte[] data = ImageUtils.getImage(imagePath); - getDrawingPatriarch(cell.getSheet()).createPicture(anchor, - cell.getSheet().getWorkbook().addPicture(data, getImageType(data))); + List imagePaths = StringUtils.str2List(propertyValue, SEPARATOR); + for (String imagePath : imagePaths) + { + byte[] data = ImageUtils.getImage(imagePath); + getDrawingPatriarch(cell.getSheet()).createPicture(anchor, cell.getSheet().getWorkbook().addPicture(data, getImageType(data))); + } } } } @@ -1420,7 +1423,7 @@ public class ExcelUtil /** * 以类的属性的get方法方法形式获取值 - * + * * @param o * @param name * @return value