| | |
| | | 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()); |
| | |
| | | |
| | | //导出案卷封面 |
| | | @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()); |
| | | } |
| | | |
| | | } |
| | | |