|
@@ -94,25 +94,36 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
|
|
|
// System.out.println();
|
|
|
|
|
|
|
|
|
- String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
- boolean flag = FileUtils.LocalPath.equals(file_path);
|
|
|
- String excelUrl = file_path + "\\备考表.xlsx";
|
|
|
-
|
|
|
- Map<String, Object> DataInfo = new HashMap<>();
|
|
|
-
|
|
|
- DataVO dataVO = FormulaUtil.convertCellToIndex("C2");
|
|
|
- String key = "1__"+ dataVO.getY() + "_" + dataVO.getX();
|
|
|
- DataInfo.put(key,"档号12345688888888888888888888888888888888888888888888888888888888888");
|
|
|
-
|
|
|
- DataVO dataVO1 = FormulaUtil.convertCellToIndex("A9");
|
|
|
- String key1 = "2__"+ dataVO1.getY() + "_" + dataVO1.getX();
|
|
|
- DataInfo.put(key1,"hahahahaa9999999999999999999999999999999999999999999999999999999999999");
|
|
|
- try {
|
|
|
- String url = getBussPdfInfo(pkeyId.toString(),DataInfo,excelUrl,file_path,null,null);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
-
|
|
|
+// String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
+// boolean flag = FileUtils.LocalPath.equals(file_path);
|
|
|
+// String excelUrl = file_path + "\\备考表.xlsx";
|
|
|
+//
|
|
|
+// Map<String, Object> DataInfo = new HashMap<>();
|
|
|
+//
|
|
|
+// DataVO dataVO = FormulaUtil.convertCellToIndex("C2");
|
|
|
+// String key = "1__"+ dataVO.getY() + "_" + dataVO.getX();
|
|
|
+// DataInfo.put(key,"档号12345688888888888888888888888888888888888888888888888888888888888");
|
|
|
+//
|
|
|
+// DataVO dataVO1 = FormulaUtil.convertCellToIndex("A9");
|
|
|
+// String key1 = "2__"+ dataVO1.getY() + "_" + dataVO1.getX();
|
|
|
+// DataInfo.put(key1,"hahahahaa9999999999999999999999999999999999999999999999999999999999999");
|
|
|
+// try {
|
|
|
+// String url = getBussPdfInfo(pkeyId.toString(),DataInfo,excelUrl,file_path,null,null);
|
|
|
+// } catch (Exception e) {
|
|
|
+// e.printStackTrace();
|
|
|
+// }
|
|
|
+ ArchivesAuto archivesAuto = new ArchivesAuto();
|
|
|
+ archivesAuto.setProjectId(1578599210897772545L);
|
|
|
+
|
|
|
+ ArchiveFile f1 = new ArchiveFile();
|
|
|
+ f1.setFileUrl("https://bladex-chongqing-info.oss-cn-hangzhou.aliyuncs.com//upload/20220713/3b86dab241e5c000ed9ece1cd9734806.pdf");
|
|
|
+ f1.setIsElement(1);
|
|
|
+ ArchiveFile f2 = new ArchiveFile();
|
|
|
+ f2.setFileUrl("https://bladex-chongqing-info.oss-cn-hangzhou.aliyuncs.com//upload/20220713/90a67cc96d14470f94a7ba0d6a86edaa.pdf");
|
|
|
+ List<ArchiveFile> waitFiles = new ArrayList<>();
|
|
|
+ waitFiles.add(f1);
|
|
|
+ waitFiles.add(f2);
|
|
|
+ builtFilePageNo(archivesAuto,waitFiles);
|
|
|
System.out.println();
|
|
|
|
|
|
|
|
@@ -282,7 +293,11 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
|
|
|
List<String> urls = new ArrayList<>();
|
|
|
for (ArchiveFile f: waitArchiveFiles) {
|
|
|
String url = getPdfFileUrl(f);
|
|
|
- urls.add(url);
|
|
|
+ if (f.getIsElement() != null && f.getIsElement()== 1) {
|
|
|
+ urls.add(FileUtils.Element_FLAG + url);
|
|
|
+ } else {
|
|
|
+ urls.add(url);
|
|
|
+ }
|
|
|
}
|
|
|
String localPath = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
List<String> pageUrls = FileUtils.doForPageNumberUseItextpdf(urls,localPath,newIOSSClient, archivesAuto.getProjectId());
|
|
@@ -639,24 +654,28 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
|
|
|
|
|
|
//todo 增加获取总大小
|
|
|
for (ArchiveFile file: datas) {
|
|
|
- idx++;
|
|
|
- //设置序号
|
|
|
- file.setFid(idx);
|
|
|
- //设置文件编号
|
|
|
- if (StringUtil.isEmpty(file.getFileNumber())) {
|
|
|
- file.setFileNumber("\\");
|
|
|
- }
|
|
|
- //设置页数
|
|
|
- file.setPageNum(iStartPage.toString());
|
|
|
-
|
|
|
- //最后一页
|
|
|
- iStartPage += file.getFilePage();
|
|
|
- if (idx >= datas.size() ) {
|
|
|
- String lastPageNum = file.getPageNum() + "~" + (iStartPage-1);
|
|
|
- file.setPageNum(lastPageNum);
|
|
|
- }
|
|
|
|
|
|
+ if (file.getIsElement() != null && file.getIsElement()== 1){
|
|
|
|
|
|
+ }else {
|
|
|
+
|
|
|
+ idx++;
|
|
|
+ //设置序号
|
|
|
+ file.setFid(idx);
|
|
|
+ //设置文件编号
|
|
|
+ if (StringUtil.isEmpty(file.getFileNumber())) {
|
|
|
+ file.setFileNumber("\\");
|
|
|
+ }
|
|
|
+ //设置页数
|
|
|
+ file.setPageNum(iStartPage.toString());
|
|
|
+
|
|
|
+ //最后一页
|
|
|
+ iStartPage += file.getFilePage();
|
|
|
+ if (idx >= datas.size()) {
|
|
|
+ String lastPageNum = file.getPageNum() + "~" + (iStartPage - 1);
|
|
|
+ file.setPageNum(lastPageNum);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
Map<String, Object> fileMap = new ObjectMapper().convertValue(file, Map.class);
|
|
|
fileMapList.add(fileMap);
|