| | |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.core.text.Convert; |
| | | import com.ruoyi.common.utils.ServletUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.file.FileUploadUtils; |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelExp; |
| | | import com.ruoyi.common.utils.poi.ExcelUtilManySheet; |
| | | import com.ruoyi.common.utils.poi.ExcelUtilManySheetSecond; |
| | | import com.ruoyi.domain.ArchiveCategory; |
| | | import com.ruoyi.domain.ArchiveProjectName; |
| | | import com.ruoyi.domain.ArchiveRecords; |
| | | import com.ruoyi.domain.DocumentMaterials; |
| | | import com.ruoyi.domain.vo.*; |
| | | import com.ruoyi.framework.config.ServerConfig; |
| | | import com.ruoyi.framework.web.domain.server.Sys; |
| | | import com.ruoyi.service.IArchiveProjectNameService; |
| | | import com.ruoyi.service.IArchiveRecordsService; |
| | | import com.ruoyi.service.IDocumentMaterialsService; |
| | | import com.ruoyi.service.impl.BarcodeService; |
| | |
| | | @RequestMapping("/system/materials") |
| | | public class DocumentMaterialsController extends BaseController |
| | | { |
| | | @Autowired |
| | | private IArchiveProjectNameService iArchiveProjectNameService; |
| | | @Autowired |
| | | private BarcodeService barcodeService; |
| | | @Autowired |
| | |
| | | { |
| | | //09-备考表.pdf |
| | | String pdf09Path = "09-备考表.pdf"; |
| | | |
| | | //根据项目名称拿到公司名称和项目负责人 |
| | | |
| | | String compName = "广州盈家档案管理有限公司"; |
| | | String li_person = "仇翀"; |
| | | String sh_person = "曾瑞莹"; |
| | | ArchiveRecords archiveRecords = iArchiveRecordsService.selectArchiveRecordsById(id); |
| | | ArchiveProjectName tmp = new ArchiveProjectName(); |
| | | tmp.setName(archiveRecords.getProjectName()); |
| | | List<ArchiveProjectName> projectName = iArchiveProjectNameService.selectArchiveProjectNameList(tmp); |
| | | if(!projectName.isEmpty()) |
| | | { |
| | | if(StringUtils.isEmpty(projectName.get(0).getCompanyName())) |
| | | compName = projectName.get(0).getCompanyName(); |
| | | if(StringUtils.isEmpty(projectName.get(0).getCreatePerson())) |
| | | li_person = projectName.get(0).getCreatePerson(); |
| | | } |
| | | // pdfGenerateService.generateFileStyleInfo(pdf09Path, aIV.getRecordId(), id); |
| | | //拿到相关数据 |
| | | List<DocumentMaterialFileStyle> dmfs = documentMaterialsService.findFileStyleInfo(Math.toIntExact(id)); |
| | |
| | | hs.put("picPages", picPages); |
| | | hs.put("texPages", texPages); |
| | | hs.put("volumeNumber", recordId); |
| | | hs.put("company", compName); |
| | | hs.put("time", cdt); |
| | | |
| | | if (!getLicense()) { |
| | |
| | | try { |
| | | |
| | | // 获取 Word 模板所在路径 |
| | | String filepath = "09-备考表.docx"; |
| | | // String filepath = "09-备考表.docx"; |
| | | // // 通过 XWPFTemplate 编译文件并渲染数据到模板中 |
| | | // XWPFTemplate template = XWPFTemplate.compile(filepath).render(hs |
| | | // ); |
| | | // 获取 Word 模板所在路径 |
| | | ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); |
| | | org.springframework.core.io.Resource resource = resolver.getResource("classpath:09.docx"); |
| | | // String filepath = resource.getFile().getAbsolutePath(); |
| | | // // 通过 XWPFTemplate 编译文件并渲染数据到模板中 |
| | | // XWPFTemplate template = XWPFTemplate.compile(filepath).render(hs |
| | | // ); |
| | | |
| | | InputStream inputStream = resource.getInputStream(); |
| | | // 通过 XWPFTemplate 编译文件并渲染数据到模板中 |
| | | XWPFTemplate template = XWPFTemplate.compile(filepath).render(hs |
| | | XWPFTemplate template = XWPFTemplate.compile(inputStream).render(hs |
| | | ); |
| | | |
| | | String renderedDocPath = "rendered_output.docx"; |
| | |
| | | |
| | | //拿到卷内目录的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()); |
| | | res1.getTitle(), res1.getDate(), res1.getPageNumberFormatted(), res1.getRemarks())).collect(Collectors.toList()); |
| | | if(!dsvs.isEmpty()) { |
| | | String recordId = dsvs.get(0).getRecordId(); |
| | | byte[] imgr = barcodeService.generateBarcodeImage(recordId); |