升级poi到最新版本5.5.1

master
RuoYi 3 weeks ago
parent 7c615ccd04
commit 9e1a8e54b0

@ -31,7 +31,7 @@
<fastjson.version>2.0.64</fastjson.version>
<jjwt.version>0.9.1</jjwt.version>
<minio.version>8.2.2</minio.version>
<poi.version>4.1.2</poi.version>
<poi.version>5.5.1</poi.version>
<springdoc.version>3.1.0</springdoc.version>
<transmittable-thread-local.version>2.14.5</transmittable-thread-local.version>
</properties>

@ -487,7 +487,7 @@ public class ExcelUtil<T>
/**
* listexcel
*
*
* @param response
* @param list
* @param sheetName
@ -591,7 +591,7 @@ public class ExcelUtil<T>
/**
* listexcel
*
*
* @param sheetName
* @param title
* @return
@ -840,13 +840,13 @@ public class ExcelUtil<T>
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<T>
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<T>
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<String> 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<T>
/**
* get
*
*
* @param o
* @param name
* @return value

Loading…
Cancel
Save