| | |
| | | import com.ruoyi.common.core.text.Convert; |
| | | import com.ruoyi.common.utils.ServletUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.utils.file.FileUploadUtils; |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelExp; |
| | |
| | | public void exportDir(HttpServletResponse response, DocumentMaterials documentMaterials, @RequestParam(value = "ids", required = false) Long[] ids) |
| | | { |
| | | ArchiveRecords archiveRecords = iArchiveRecordsService.selectArchiveRecordsById(documentMaterials.getRecordId()); |
| | | List<DocumentMaterialsVo> dsvs = documentMaterialsService.findArchMInfo(documentMaterials.getRecordId().toString(), archiveRecords.getPageCount()); |
| | | List<DocumentMaterialsVoMid> dsvs = documentMaterialsService.findArchMInfoAll(documentMaterials.getRecordId().toString(), archiveRecords.getPageCount()); |
| | | |
| | | List<DocumentMaterialsVoSmall> list2 = dsvs.stream().map(res1 -> new DocumentMaterialsVoSmall(res1.getNum(), res1.getDocumentNumber(),res1.getCreator(), |
| | | res1.getTitle(), res1.getDate(), res1.getPageNumberFormatted(), res1.getRemarks())).collect(Collectors.toList()); |
| | | // List<DocumentMaterialsVoSmall> list2 = dsvs.stream().map(res1 -> new DocumentMaterialsVoSmall(res1.getNum(), res1.getDocumentNumber(),res1.getCreator(), |
| | | // res1.getTitle(), res1.getDate(), res1.getPageNumberFormatted(), res1.getRemarks())).collect(Collectors.toList()); |
| | | |
| | | // List<DocumentMaterials> list; |
| | | // System.out.println(ids); |
| | |
| | | // return vo; |
| | | // }).collect(Collectors.toList()); |
| | | |
| | | ExcelUtil<DocumentMaterialsVoSmall> util = new ExcelUtil<DocumentMaterialsVoSmall>(DocumentMaterialsVoSmall.class); |
| | | util.exportExcel(response, list2, "卷内目录"); |
| | | ExcelUtil<DocumentMaterialsVoMid> util = new ExcelUtil<DocumentMaterialsVoMid>(DocumentMaterialsVoMid.class); |
| | | util.exportExcel(response, dsvs, "卷内目录"); |
| | | } |
| | | |
| | | // List<DocumentMaterialsVo> dsvs = documentMaterialsService.findArchMInfo(id.toString()); |
| | |
| | | System.out.println(compName+"--+"+sh_person); |
| | | // pdfGenerateService.generateFileStyleInfo(pdf09Path, aIV.getRecordId(), id); |
| | | //拿到相关数据 |
| | | List<DocumentMaterialFileStyle> dmfs = documentMaterialsService.findFileStyleInfo(Math.toIntExact(id)); |
| | | // List<DocumentMaterialFileStyle> dmfs = documentMaterialsService.findFileStyleInfo(Math.toIntExact(id)); |
| | | |
| | | |
| | | List<DocumentMaterials> docAllInfo = documentMaterialsService.SelectAllRecordsByPageNumbersToList(id, archiveRecords.getPageCount()); |
| | | if (docAllInfo==null||docAllInfo.isEmpty()) |
| | | { |
| | | throw new RuntimeException("请补充完整信息,然后导出ISO包!"); |
| | | } |
| | | //把DocumentMaterils转到docs |
| | | // List<DocumentMaterialsVoLarge> docs = new ArrayList<>(); |
| | | int texPages = 0; |
| | | int patPages = 0; |
| | | int picPages = 0; |
| | | for (DocumentMaterials mater : docAllInfo) { |
| | | |
| | | if(mater.getFileStyle()!=null&&mater.getFileStyle().equals("文字材料")) |
| | | texPages++; |
| | | if(mater.getFileStyle()!=null&&mater.getFileStyle().equals("图样材料")) |
| | | patPages++; |
| | | if(mater.getFileStyle()!=null&&mater.getFileStyle().equals("照片材料")) |
| | | picPages++; |
| | | } |
| | | |
| | | |
| | | LocalDate currentDate = LocalDate.now(); |
| | | |
| | |
| | | |
| | | HashMap<String, Object> hs = new HashMap<String, Object>(); |
| | | int allPages = 0; |
| | | int texPages = 0; |
| | | int picPages = 0; |
| | | int patPages = 0; |
| | | if(!dmfs.isEmpty()) |
| | | { |
| | | for(DocumentMaterialFileStyle documentMaterialFileStyle:dmfs) |
| | | { |
| | | if(documentMaterialFileStyle.getFileStyle()!=null&&documentMaterialFileStyle.getFileStyle().equals("文字材料")) |
| | | texPages = documentMaterialFileStyle.getCnt(); |
| | | if(documentMaterialFileStyle.getFileStyle()!=null&&documentMaterialFileStyle.getFileStyle().equals("图样材料")) |
| | | patPages = documentMaterialFileStyle.getCnt(); |
| | | if(documentMaterialFileStyle.getFileStyle()!=null&&documentMaterialFileStyle.getFileStyle().equals("照片材料")) |
| | | picPages = documentMaterialFileStyle.getCnt(); |
| | | } |
| | | } |
| | | |
| | | |
| | | allPages = texPages + picPages + patPages; |
| | | hs.put("pages", allPages); |
| | | hs.put("patPages", patPages); |
| | |
| | | @PostMapping("/exportJuan/{id}") |
| | | |
| | | public void exportJuanInfo(HttpServletResponse response, @PathVariable Long id) throws IOException { |
| | | System.out.println("+++++++++++++aaaaaaaaaaaaaaaaaa"); |
| | | |
| | | ArchiveRecords archiveRecords = iArchiveRecordsService.selectArchiveRecordsById(id); |
| | | System.out.println("+++++++++++++aaaaaaaaaaaaaaaaaa"); |
| | | |
| | | if(archiveRecords.getPageCount()==null) |
| | | return; |
| | | List<DocumentMaterialsVo> dsvs = documentMaterialsService.findArchMInfo(id.toString(), archiveRecords.getPageCount()); |
| | | System.out.println("+++++++++++++aaaaaaaaaaaaaaaaaa"); |
| | | |
| | | //拿到卷内目录的excel |
| | | List<DocumentMaterialsVoSmall> list2 = dsvs.stream().map(res1 -> new DocumentMaterialsVoSmall(res1.getNum(), res1.getDocumentNumber(),res1.getCreator(), |
| | | res1.getTitle(), res1.getDate(), res1.getPageNumberFormatted(), res1.getRemarks())).collect(Collectors.toList()); |
| | | System.out.println("+++++++++++++aaaaaaaaaaaaaaaaaa"); |
| | | |
| | | if(!dsvs.isEmpty()) { |
| | | System.out.println("+++++++++++++aaaaaaaaaaaaaaaaaa"); |
| | | |
| | | String recordId = dsvs.get(0).getRecordId(); |
| | | byte[] imgr = barcodeService.generateBarcodeImage(recordId); |
| | | ExcelExp e1 = new ExcelExp("卷内目录数据", dsvs, DocumentMaterialsVo.class); |
| | |
| | | // System.out.println(dsvs); |
| | | // zos.putNextEntry(entr); |
| | | ByteOutputStream bos8 = new ByteOutputStream(); |
| | | |
| | | System.out.println("+++++++++++++aaaaaaaaaaaaaaaaaa"); |
| | | util2.exportExcelManySheet(bos8, mysheet); |
| | | |
| | | bos8.writeTo( response.getOutputStream()); |