|
@@ -321,7 +321,7 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
|
|
|
urls.add(url);
|
|
|
}
|
|
|
}
|
|
|
- String localPath = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
+ String localPath = FileUtils.getSysLocalFileUrl();
|
|
|
List<String> pageUrls = FileUtils.doForPageNumberUseItextpdf(urls, localPath, newIOSSClient, archivesAuto.getProjectId());
|
|
|
for (int i = 0; i < waitArchiveFiles.size(); i++) {
|
|
|
waitArchiveFiles.get(i).setPdfPageUrl(pageUrls.get(i));
|
|
@@ -671,7 +671,41 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
|
|
|
// newStyle.setWrapText(true);
|
|
|
// cell.setCellStyle(newStyle);
|
|
|
// }
|
|
|
- cell.setCellValue(myData);
|
|
|
+ // ====================== 核心修改开始 ======================
|
|
|
+ if (myData.startsWith("twospaces")) {
|
|
|
+ // 1. 去掉开头的"twospaces",并添加"占位"两个汉字
|
|
|
+ String actualText = myData.substring("twospaces".length()).trim();
|
|
|
+ String displayText = "占位" + actualText;
|
|
|
+
|
|
|
+ // 2. 创建富文本格式:白色"占位"+默认颜色实际文本
|
|
|
+ CreationHelper helper = workbook.getCreationHelper();
|
|
|
+ RichTextString richText = helper.createRichTextString(displayText);
|
|
|
+
|
|
|
+ // 创建白色字体(用于"占位"两字)
|
|
|
+ Font whiteFont = workbook.createFont();
|
|
|
+ whiteFont.setColor(IndexedColors.WHITE.getIndex());
|
|
|
+
|
|
|
+ // 创建默认黑色字体(用于实际文本)
|
|
|
+ Font defaultFont = workbook.createFont();
|
|
|
+ defaultFont.setColor(IndexedColors.BLACK.getIndex());
|
|
|
+
|
|
|
+ // 应用不同字体:前2个字符("占位")用白色,其余用默认黑色
|
|
|
+ richText.applyFont(0, 1, whiteFont); // 第0-1个字符:白色
|
|
|
+ richText.applyFont(2, displayText.length() - 1, defaultFont); // 剩余字符:黑色
|
|
|
+
|
|
|
+ // 3. 设置单元格值
|
|
|
+ cell.setCellValue(richText);
|
|
|
+
|
|
|
+ // 4. 设置单元格样式确保白色文字不可见
|
|
|
+ CellStyle style = workbook.createCellStyle();
|
|
|
+ style.cloneStyleFrom(cell.getCellStyle());
|
|
|
+ style.setWrapText(true); // 保持自动换行
|
|
|
+ cell.setCellStyle(style);
|
|
|
+
|
|
|
+ } else {
|
|
|
+ // 非"twospaces"开头的正常处理
|
|
|
+ cell.setCellValue(myData);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -741,6 +775,12 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
|
|
|
file.setFileTime(FileUtils.cleanFileTime(file.getFileTime()));
|
|
|
|
|
|
Map<String, Object> fileMap = new ObjectMapper().convertValue(file, Map.class);
|
|
|
+
|
|
|
+ if (fileMap.containsKey("fileName") && fileMap.get("fileName") != null) {
|
|
|
+ String fileName = fileMap.get("fileName").toString();
|
|
|
+ fileMap.put("fileName", "twospaces" + fileName); // 添加两个空格前缀
|
|
|
+ }
|
|
|
+
|
|
|
fileMapList.add(fileMap);
|
|
|
}
|
|
|
//设置总页数
|