|
@@ -93,9 +93,9 @@ public class MyExcelUtil {
|
|
|
excelWriter.fill(obj2, fillConfig, writeSheet);
|
|
|
}
|
|
|
if(excelWriter != null &&exportImg != null){
|
|
|
- //Map<String, Object> map = BeanUtil.beanToMap(exportImg);
|
|
|
- //imageHandleByParam(map);
|
|
|
- excelWriter.fill(exportImg, fillConfig, writeSheet);
|
|
|
+ Map<String, Object> map = BeanUtil.beanToMap(exportImg);
|
|
|
+ imageHandleByParam(map);
|
|
|
+ excelWriter.fill(map, fillConfig, writeSheet);
|
|
|
}
|
|
|
|
|
|
assert excelWriter != null;
|
|
@@ -144,17 +144,13 @@ public class MyExcelUtil {
|
|
|
try {
|
|
|
File file = new File(downloadPath);
|
|
|
if(!file.exists()){
|
|
|
- fYunFileServiceInterface.downloadFile(ossPath,downloadPath );
|
|
|
+ fYunFileServiceInterface.downloadFile(ossPath.replaceAll(CacheUtil.host,""),downloadPath );
|
|
|
}
|
|
|
// 填充图片
|
|
|
ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
|
|
|
BufferedImage bufferImg = ImageIO.read(new File(downloadPath));
|
|
|
// 图片后缀格式
|
|
|
- String suffix = ".png";
|
|
|
- if(downloadPath.contains(".")){
|
|
|
- suffix = downloadPath.split("\\.")[1];
|
|
|
- }
|
|
|
- ImageIO.write(bufferImg, suffix, byteArrayOut);
|
|
|
+ ImageIO.write(bufferImg, "png", byteArrayOut);
|
|
|
|
|
|
bufferImg.flush();
|
|
|
// 注意:这里需要put回原来的key里
|