From a38a1ac77bb6ac9ea8bf0cf5f5f6b68d0e6e6974 Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期二, 02 一月 2024 08:44:10 +0800
Subject: [PATCH] 修改
---
core/src/main/java/com/zt/life/export/service/WordFileService.java | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/core/src/main/java/com/zt/life/export/service/WordFileService.java b/core/src/main/java/com/zt/life/export/service/WordFileService.java
index 8b9208e..1abcfb8 100644
--- a/core/src/main/java/com/zt/life/export/service/WordFileService.java
+++ b/core/src/main/java/com/zt/life/export/service/WordFileService.java
@@ -67,7 +67,7 @@
builder.bind(fieldName, new HackLoopTableRenderPolicy());
} else if (staticFieldValue != null) {
if (typeName.contains("java.util.Date") && fieldName.contains("Date")) {
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy骞碝M鏈坉d鏃�");
staticFieldValue = sdf.format(staticFieldValue);
}
String valStr = staticFieldValue.toString();
@@ -80,13 +80,18 @@
BufferedImage bufferedImage = ImageIO.read(in2);
int width = bufferedImage.getWidth();
int height = bufferedImage.getHeight();
- staticFieldValue = new PictureRenderData(width, height, ".png", in);
+ if (width > 900 ) {
+ height = (height * 900) / width;
+ staticFieldValue = new PictureRenderData(900, height, ".png", in);
+ } else {
+ staticFieldValue = new PictureRenderData(width, height, ".png", in);
+ }
/*staticFieldValue = new PictureRenderData(80, 100, "d://" + valStr);*/
} catch (IOException e) {
e.printStackTrace();
}
} else {
- staticFieldValue = new PictureRenderData(100, 30, localPath+"template/noSign.png");
+ staticFieldValue = new PictureRenderData(100, 30, localPath + "template/noSign.png");
}
}
}
--
Gitblit v1.9.1