fei
9 小时以前 359f1d48b1d859a23cd35a425d2cffb1e9d1c811
ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/archiveAllExportController.java
@@ -6,11 +6,14 @@
import com.itextpdf.text.*;
import com.itextpdf.text.pdf.PdfPCell;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.common.utils.poi.*;
import com.ruoyi.domain.ArchiveProjectName;
import com.ruoyi.domain.ArchiveRecords;
import com.ruoyi.domain.DocumentMaterials;
import com.ruoyi.domain.vo.*;
import com.ruoyi.service.IArchiveProjectNameService;
import com.ruoyi.service.IArchiveRecordsService;
import com.ruoyi.service.IDocumentMaterialsService;
import com.ruoyi.service.impl.BarcodeService;
@@ -53,7 +56,8 @@
    private BarcodeService barcodeService;
    @Autowired
    private IDocumentMaterialsService documentMaterialsService;
    @Autowired
    private IArchiveProjectNameService iArchiveProjectNameService;
    @Autowired
    private IArchiveRecordsService iArchiveRecordsService;
@@ -330,7 +334,7 @@
        String recordId = aIV.getRecordId();
        byte[] imgr = barcodeService.generateBarcodeImage(recordId);
        byte[] sedcode = pdfGenerateService.createQrCodeN(recordId, 30, 30);
        byte[] sedcode = pdfGenerateService.createQrCodeN(recordId, 100, 100);
        ExcelExp e1 = new ExcelExp("案卷封面数据",arsi, ArchiveInfoVo.class);
        ExcelExp e2 = new ExcelExp("案卷封面",  arsi, recordId, imgr,sedcode, ArchiveInfoVo.class);
        List<ExcelExp> mysheet = new ArrayList<ExcelExp>();
@@ -561,13 +565,29 @@
                {
                    for(DocumentMaterialFileStyle documentMaterialFileStyle:dmfs)
                    {
                        if(documentMaterialFileStyle.getFileStyle().equals("文字材料"))
                        if(documentMaterialFileStyle.getFileStyle()!=null&&documentMaterialFileStyle.getFileStyle().equals("文字材料"))
                            texPages = documentMaterialFileStyle.getCnt();
                        if(documentMaterialFileStyle.getFileStyle().equals("图样材料"))
                        if(documentMaterialFileStyle.getFileStyle()!=null&&documentMaterialFileStyle.getFileStyle().equals("图样材料"))
                            patPages = documentMaterialFileStyle.getCnt();
                        if(documentMaterialFileStyle.getFileStyle().equals("照片材料"))
                        if(documentMaterialFileStyle.getFileStyle()!=null&&documentMaterialFileStyle.getFileStyle().equals("照片材料"))
                            picPages = documentMaterialFileStyle.getCnt();
                    }
                }
                String compName = "广州盈家档案管理有限公司";
                String li_person = "仇翀";
                String sh_person = "曾瑞莹";
                ArchiveRecords archiveRecords1 = iArchiveRecordsService.selectArchiveRecordsById(ids[i]);
                ArchiveProjectName tmp = new ArchiveProjectName();
                tmp.setName(archiveRecords1.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();
                }
                allPages = texPages + picPages + patPages;
                hs.put("pages", allPages);
@@ -575,6 +595,8 @@
                hs.put("picPages", picPages);
                hs.put("texPages", texPages);
                hs.put("volumeNumber", aIV.getRecordId());
                hs.put("company", compName);
                hs.put("time", cdt);
                if (!getLicense()) {
@@ -584,10 +606,16 @@
                try {
                    // 获取 Word 模板所在路径
                    String filepath = "09-备考表.docx";
                    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";
@@ -631,7 +659,7 @@
                String recordId1 = aIV.getRecordId();
                byte[] imgr1 = barcodeService.generateBarcodeImage(recordId1);
                byte[] sedcode = pdfGenerateService.createQrCodeN(recordId1, 30, 30);
                byte[] sedcode = pdfGenerateService.createQrCodeN(recordId1, 200, 200);
                ExcelExp e3 = new ExcelExp("案卷封面数据",arsi, ArchiveInfoVo.class);
                ExcelExp e4 = new ExcelExp("案卷封面",  arsi, recordId1, imgr1,sedcode, ArchiveInfoVo.class);
                List<ExcelExp> mysheet1 = new ArrayList<ExcelExp>();
@@ -726,7 +754,7 @@
                //拿到卷内目录的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);
@@ -1089,20 +1117,38 @@
            {
                for(DocumentMaterialFileStyle documentMaterialFileStyle:dmfs)
                {
                    if(documentMaterialFileStyle.getFileStyle().equals("文字材料"))
                    if(documentMaterialFileStyle.getFileStyle()!=null&&documentMaterialFileStyle.getFileStyle().equals("文字材料"))
                        texPages = documentMaterialFileStyle.getCnt();
                    if(documentMaterialFileStyle.getFileStyle().equals("图样材料"))
                    if(documentMaterialFileStyle.getFileStyle()!=null&&documentMaterialFileStyle.getFileStyle().equals("图样材料"))
                        patPages = documentMaterialFileStyle.getCnt();
                    if(documentMaterialFileStyle.getFileStyle().equals("照片材料"))
                    if(documentMaterialFileStyle.getFileStyle()!=null&&documentMaterialFileStyle.getFileStyle().equals("照片材料"))
                        picPages = documentMaterialFileStyle.getCnt();
                }
            }
            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();
            }
            allPages = texPages + picPages + patPages;
            hs.put("pages", allPages);
            hs.put("patPages", patPages);
            hs.put("picPages", picPages);
            hs.put("texPages", texPages);
            hs.put("volumeNumber", aIV.getRecordId());
            hs.put("company", compName);
            hs.put("time", cdt);
            if (!getLicense()) {
@@ -1113,10 +1159,22 @@
            try {
                // 获取 Word 模板所在路径
                String filepath = "09-备考表.docx";
                // 通过 XWPFTemplate 编译文件并渲染数据到模板中
                XWPFTemplate template = XWPFTemplate.compile(filepath).render(hs
                       );
                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(inputStream).render(hs
                    );
                String renderedDocPath = "rendered_output.docx";
                File renderedFile = new File(renderedDocPath);
@@ -1148,7 +1206,7 @@
            com.aspose.words.Document doc = new com.aspose.words.Document("09-备考表.docx");
           // com.aspose.words.Document doc = new com.aspose.words.Document("09.docx");
@@ -1179,7 +1237,7 @@
            String recordId1 = aIV.getRecordId();
            byte[] imgr1 = barcodeService.generateBarcodeImage(recordId1);
            byte[] sedcode = pdfGenerateService.createQrCodeN(recordId1, 30, 30);
            byte[] sedcode = pdfGenerateService.createQrCodeN(recordId1, 200, 200);
            ExcelExp e3 = new ExcelExp("案卷封面数据",arsi, ArchiveInfoVo.class);
            ExcelExp e4 = new ExcelExp("案卷封面",  arsi, recordId1, imgr1,sedcode, ArchiveInfoVo.class);
            List<ExcelExp> mysheet1 = new ArrayList<ExcelExp>();
@@ -1271,7 +1329,7 @@
            //拿到卷内目录的excel
            List<DocumentMaterialsVoSmall> list2 = dsvs.stream().map(res -> new DocumentMaterialsVoSmall(res.getNum(), res.getDocumentNumber(),res.getCreator(),
                    res.getTitle(), res.getDate(), res.getPageNumber(), res.getRemarks())).collect(Collectors.toList());
                    res.getTitle(), res.getDate(), res.getPageNumberFormatted(), res.getRemarks())).collect(Collectors.toList());
            String recordId = dsvs.get(0).getRecordId();
            byte[] imgr = barcodeService.generateBarcodeImage(recordId);