| | |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Path; |
| | | import java.nio.file.Paths; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.util.*; |
| | | import java.util.List; |
| | |
| | | import javax.imageio.ImageIO; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.aspose.words.License; |
| | | import com.deepoove.poi.XWPFTemplate; |
| | | import com.drew.imaging.ImageMetadataReader; |
| | |
| | | vo.setCreator(doc.getCreator()); |
| | | vo.setTitle(doc.getTitle()); |
| | | vo.setDate(doc.getDate()); |
| | | vo.setPageNumber(doc.getPageNumber()); |
| | | vo.setPageNumberFormatted(doc.getPageNumber().toString()); |
| | | vo.setRemarks(doc.getRemarks()); |
| | | // vo.setRecordId(doc.getRecordId() != null ? doc.getRecordId().toString() : null); |
| | | // vo.setPublicity(doc.getPublicity()); |
| | |
| | | String li_person = "仇翀"; |
| | | String sh_person = "曾瑞莹"; |
| | | ArchiveRecords archiveRecords = iArchiveRecordsService.selectArchiveRecordsById(id); |
| | | if(!StringUtils.isEmpty(archiveRecords.getLiPerson())) |
| | | li_person = archiveRecords.getLiPerson(); |
| | | ArchiveProjectName tmp = new ArchiveProjectName(); |
| | | tmp.setName(archiveRecords.getProjectName()); |
| | | List<ArchiveProjectName> projectName = iArchiveProjectNameService.selectArchiveProjectNameList(tmp); |
| | | if(!projectName.isEmpty()) |
| | | { |
| | | if(StringUtils.isEmpty(projectName.get(0).getCompanyName())) |
| | | System.out.println(projectName.get(0).getCompanyName()); |
| | | 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(); |
| | | if(!StringUtils.isEmpty(projectName.get(0).getCreatePerson())) |
| | | sh_person = projectName.get(0).getCreatePerson(); |
| | | |
| | | System.out.println(compName+"--+"+sh_person); |
| | | |
| | | } |
| | | |
| | | |
| | | System.out.println(compName+"--+"+sh_person); |
| | | // pdfGenerateService.generateFileStyleInfo(pdf09Path, aIV.getRecordId(), id); |
| | | //拿到相关数据 |
| | | List<DocumentMaterialFileStyle> dmfs = documentMaterialsService.findFileStyleInfo(Math.toIntExact(id)); |
| | |
| | | hs.put("texPages", texPages); |
| | | hs.put("volumeNumber", recordId); |
| | | hs.put("company", compName); |
| | | hs.put("liPerson", li_person); |
| | | hs.put("shPerson", sh_person); |
| | | hs.put("time", cdt); |
| | | |
| | | if (!getLicense()) { |
| | |
| | | |
| | | //导出案卷封面 |
| | | @PostMapping("/exportPageInfo/{id}/{recordId}") |
| | | public void exportPageInfo(HttpServletResponse response, @PathVariable Long id, @PathVariable String recordId) throws IOException { |
| | | public void exportPageInfo(HttpServletResponse response, @PathVariable Long id, @PathVariable String recordId) throws IOException, ParseException { |
| | | |
| | | ArchiveInfoVo aIV = iArchiveRecordsService.selectByRecordId(id); |
| | | |
| | |
| | | arsi.add(aIV); |
| | | |
| | | String recordId1 = recordId; |
| | | if(aIV!=null) |
| | | { |
| | | String date = ""; |
| | | if(arsi.get(0).getPreparationDate()!=null) { |
| | | System.out.println(arsi.get(0).getPreparationDate().toString() + "]]]]]]]]"); |
| | | |
| | | System.out.println(DateUtil.parseCST(arsi.get(0).getPreparationDate().toString())); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | DateTime dat = DateUtil.parseCST(arsi.get(0).getPreparationDate().toString()); |
| | | date = new SimpleDateFormat("yyyy-MM-dd").format(dat); |
| | | } |
| | | |
| | | |
| | | String tmp = "档号:" + |
| | | arsi.get(0).getRecordId() + |
| | | ";档案馆(室)号:" + arsi.get(0).getArchiveRoomNumber()+ |
| | | ";缩微号:" + arsi.get(0).getMicrofilmNumber()+ |
| | | ";发文号:" + arsi.get(0).getInquiryNumber()+ |
| | | ";案卷题名:" + arsi.get(0).getCaseTitle() + |
| | | ";编制日期:" + date + |
| | | ";编制单位:" + arsi.get(0).getPreparationUnit() + |
| | | ";保管期限:" + arsi.get(0).getRetentionPeriod() + |
| | | ";密级:" + arsi.get(0).getSecurityClassification(); |
| | | byte[] imgr1 = barcodeService.generateBarcodeImage(recordId1); |
| | | byte[] sedcode = pdfGenerateService.createQrCodeN(recordId1, 200, 200); |
| | | byte[] sedcode = pdfGenerateService.createQrCodeN(tmp, 210, 210); |
| | | ExcelExp e3 = new ExcelExp("案卷封面数据",arsi, ArchiveInfoVo.class); |
| | | ExcelExp e4 = new ExcelExp("案卷封面", arsi, recordId1, imgr1,sedcode, ArchiveInfoVo.class); |
| | | List<ExcelExp> mysheet1 = new ArrayList<ExcelExp>(); |
| | |
| | | |
| | | // System.out.println(bos2); |
| | | bos2.writeTo(response.getOutputStream()); |
| | | } |
| | | |
| | | } |
| | | |