| | |
| | | } |
| | | //添加07 的pdf |
| | | //pdf目录封面 |
| | | String pdfPathF = "07-卷面封面.pdf"; |
| | | String pdfPathF = "07-案卷封面.pdf"; |
| | | pdfGenerateService.generatePdf(pdfPathF, ids[i]); |
| | | // 2. 压缩PDF到ZIP文件 |
| | | // 添加PDF文件到ZIP |
| | |
| | | zos.write(buffer, 0, len); |
| | | } |
| | | } |
| | | |
| | | //08-卷内卷内目录的pdf |
| | | String pdf08Path= "08-卷内目录.pdf"; |
| | | List<DocumentMaterialsVo> list3 = dsvs; |
| | | if(list3.size()>0) { |
| | | pdfGenerateService.generateFileDirectoryPdf(pdf08Path, list3); |
| | | ZipEntry zipEntry3 = new ZipEntry(fna + adir +"/"+pdf08Path); |
| | | zos.putNextEntry(zipEntry3); |
| | | |
| | | // 读取PDF文件内容并写入ZIP |
| | | try (FileInputStream fis = new FileInputStream(pdf08Path)) { |
| | | byte[] buffer = new byte[1024]; |
| | | int len; |
| | | while ((len = fis.read(buffer)) > 0) { |
| | | zos.write(buffer, 0, len); |
| | | } |
| | | } |
| | | } |
| | | //09-备考表.pdf |
| | | String pdf09Path = "09-备考表.pdf"; |
| | | pdfGenerateService.generateFileStyleInfo(pdf09Path, aIV.getRecordId(), ids[i]); |
| | | // 2. 压缩PDF到ZIP文件 |
| | | // 添加PDF文件到ZIP |
| | | ZipEntry zipEntry4 = new ZipEntry(fna + adir +"/"+pdf09Path); |
| | | zos.putNextEntry(zipEntry4); |
| | | |
| | | // 读取PDF文件内容并写入ZIP |
| | | try (FileInputStream fis = new FileInputStream(pdf09Path)) { |
| | | byte[] buffer = new byte[1024]; |
| | | int len; |
| | | while ((len = fis.read(buffer)) > 0) { |
| | | zos.write(buffer, 0, len); |
| | | } |
| | | } |
| | | |
| | | //excel 卷内封面导出zip |
| | | ZipEntry entryiv = new ZipEntry(fna + adir +"/"+"案卷封面" + ".xls"); |
| | | |
| | | List<ArchiveInfoVo> arsi = new ArrayList<>(); |
| | | arsi.add(aIV); |
| | | |
| | | String recordId1 = aIV.getRecordId(); |
| | | byte[] imgr1 = barcodeService.generateBarcodeImage(recordId1); |
| | | byte[] sedcode = pdfGenerateService.createQrCodeN(recordId1, 30, 30); |
| | | ExcelExp e3 = new ExcelExp("案卷封面数据",arsi, ArchiveInfoVo.class); |
| | | ExcelExp e4 = new ExcelExp("案卷封面", arsi, recordId1, imgr1,sedcode, ArchiveInfoVo.class); |
| | | List<ExcelExp> mysheet1 = new ArrayList<ExcelExp>(); |
| | | mysheet1.add(e3); |
| | | mysheet1.add(e4); |
| | | ByteOutputStream bos2 = new ByteOutputStream(); |
| | | ExcelUtilManySheetSecond<List<ExcelExp>> util3 = new ExcelUtilManySheetSecond<List<ExcelExp>>(mysheet1); |
| | | |
| | | util3.exportExcelManySheet(bos2, mysheet1); |
| | | |
| | | // System.out.println(bos2); |
| | | zos.putNextEntry(entryiv); |
| | | |
| | | // ExcelUtil<ArchiveInfoVo> utilsv = new ExcelUtil<ArchiveInfoVo>(ArchiveInfoVo.class); |
| | | // |
| | | // |
| | | // ByteOutputStream boss = new ByteOutputStream(); |
| | | // List<ArchiveInfoVo> aivs = new ArrayList<>(); |
| | | // aivs.add(aIV); |
| | | // utilsv.byteOutputStreamExcel(boss, aivs,"Date List", ""); |
| | | bos2.writeTo(zos); |
| | | |
| | | |
| | | |
| | | //写入电子目录 xsxl |
| | | |
| | | ZipEntry entry5 = new ZipEntry(fna + adir +"/"+"电子文件目录" + ".xls"); |
| | | ExcelUtil<DocumentMaterialsVoLarge> util5 = new ExcelUtil<DocumentMaterialsVoLarge>(DocumentMaterialsVoLarge.class); |
| | | |
| | | zos.putNextEntry(entry5); |
| | | ByteOutputStream bos5 = new ByteOutputStream(); |
| | | util5.byteOutputStreamExcel(bos5, docs,"电子文件目录", ""); |
| | | bos.writeTo(zos); |
| | | |
| | | //拿到卷内目录的excel |
| | | List<DocumentMaterialsVoSmall> list2 = dsvs.stream().map(res1 -> new DocumentMaterialsVoSmall(res1.getNum(), res1.getDocumentNumber(),res1.getCreator(), |
| | | res1.getTitle(), res1.getDate(), res1.getPageNumber(), res1.getRemarks())).collect(Collectors.toList()); |
| | | if(!dsvs.isEmpty()) { |
| | | String recordId = dsvs.get(0).getRecordId(); |
| | | byte[] imgr = barcodeService.generateBarcodeImage(recordId); |
| | | ExcelExp e1 = new ExcelExp("卷内目录数据", dsvs, DocumentMaterialsVo.class); |
| | | ExcelExp e2 = new ExcelExp("卷内数据", list2, recordId, imgr, DocumentMaterialsVoSmall.class); |
| | | List<ExcelExp> mysheet = new ArrayList<ExcelExp>(); |
| | | mysheet.add(e1); |
| | | mysheet.add(e2); |
| | | ExcelUtilManySheet<List<ExcelExp>> util2 = new ExcelUtilManySheet<List<ExcelExp>>(mysheet); |
| | | ZipEntry entr = new ZipEntry(fna + adir + "/" + "卷内目录" + ".xls"); |
| | | // ExcelUtil<DocumentMaterialsVo> util1 = new ExcelUtil<DocumentMaterialsVo>(DocumentMaterialsVo.class); |
| | | System.out.println(dsvs); |
| | | zos.putNextEntry(entr); |
| | | ByteOutputStream bos6 = new ByteOutputStream(); |
| | | |
| | | util2.exportExcelManySheet(bos6, mysheet); |
| | | |
| | | // util1.byteOutputStreamExcel(bos1, dsvs,"Date List", ""); |
| | | bos6.writeTo(zos); |
| | | } |
| | | //把excel转为pdf |
| | | |
| | | |
| | | |
| | | byte[] buf = new byte[1024]; |
| | | for (DocumentMaterialsVoLarge dc : docs) { |
| | | String filePath = dc.getUrl(); |
| | |
| | | zos = new ZipOutputStream(os); |
| | | |
| | | //pdf目录封面 |
| | | String pdfPathF = "07-卷面封面.pdf"; |
| | | String pdfPathF = "07-案卷封面.pdf"; |
| | | pdfGenerateService.generatePdf(pdfPathF, 55L); |
| | | // 2. 压缩PDF到ZIP文件 |
| | | // 添加PDF文件到ZIP |
| | |
| | | |
| | | |
| | | //excel 卷内封面导出zip |
| | | ZipEntry entryiv = new ZipEntry("卷内封面" + ".xls"); |
| | | ZipEntry entryiv = new ZipEntry("案卷封面" + ".xls"); |
| | | |
| | | List<ArchiveInfoVo> arsi = new ArrayList<>(); |
| | | arsi.add(aIV); |