Commit 699e57ab authored by hongguangwu's avatar hongguangwu

MVP1.7.18-优化

parent a787f0c5
......@@ -1363,6 +1363,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
String cellValue;
String key;
String newValue;
String[] qianMingArr;
for (Row row : sheet) {
for (Cell cell : row) {
if (cell.getCellType() == CellType.STRING) {
......@@ -1370,11 +1371,18 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
if (cellValue.startsWith("${") && cellValue.endsWith("}")) {
// 正常的主表的单元格的占位,类似"${empName}"
key = cellValue.substring(2, cellValue.length() - 1);
newValue = getFieldValue(vo, key);
if (!CommonConstants.QIAN_MING.equals(key)) {
cell.setCellValue(newValue);
if (key.contains(CommonConstants.QIAN_MING)) {
qianMingArr = key.split("&");
if (qianMingArr.length>1) {
key = qianMingArr[1];
} else {
key = "empName";
}
newValue = getFieldValue(vo, key);
setQianMingStyle(cell, newValue);
} else {
newValue = getFieldValue(vo, key);
cell.setCellValue(newValue);
}
} else if (containsPlaceholder(cellValue)) {
// 非正常的主表的单元格的占位,类似"经办人:${empName} 单位名称${unitName}"
......
......@@ -162,6 +162,9 @@ public class ExcelToImage {
int targetHeight = 200; // 高度
// 创建缩放后的公章图像
if (seal == null) {
return image;
}
Image scaledSeal = seal.getScaledInstance(targetWidth, targetHeight, Image.SCALE_SMOOTH);
BufferedImage resizedSeal = new BufferedImage(targetWidth, targetHeight, BufferedImage.TYPE_INT_ARGB);
Graphics2D g2d = resizedSeal.createGraphics();
......
......@@ -58,10 +58,10 @@ public class RandomFontStyleUtil {
cellStyle.setFont(font);
//设置单元格边框样式
cellStyle.setBorderTop(BorderStyle.THIN);
/*cellStyle.setBorderTop(BorderStyle.THIN);
cellStyle.setBorderBottom(BorderStyle.THIN);
cellStyle.setBorderLeft(BorderStyle.THIN);
cellStyle.setBorderRight(BorderStyle.THIN);
cellStyle.setBorderRight(BorderStyle.THIN);*/
cell.setCellStyle(cellStyle);
cell.setCellValue(value);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment