From 7a268ed852ca462347cca383a6d0306ff54e1363 Mon Sep 17 00:00:00 2001 From: zss <zss@example.com> Date: 星期一, 04 十一月 2024 15:05:21 +0800 Subject: [PATCH] 添加模版 --- inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsReportServiceImpl.java | 40 ---------------------------------------- 1 files changed, 0 insertions(+), 40 deletions(-) diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsReportServiceImpl.java b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsReportServiceImpl.java index d7805c8..6bb76f0 100644 --- a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsReportServiceImpl.java +++ b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsReportServiceImpl.java @@ -101,9 +101,6 @@ private InsOrderMapper insOrderMapper; @Resource - private StandardMethodListMapper standardMethodListMapper; - - @Resource private InsOrderStateMapper insOrderStateMapper; @Resource @@ -251,15 +248,6 @@ } catch (Exception e) { throw new ErrorException("鎵句笉鍒版壒鍑嗕汉鐨勭鍚�"); } - //鑾峰彇鍦烘墍鐨勬姤鍛婁笓鐢ㄧ珷 - /* String sealUrl; - try { - String laboratory = insOrderMapper.selectById(insReport.getInsOrderId()).getLaboratory(); - sealUrl = insReportMapper.getLaboratoryByName(laboratory); - } catch (Exception e) { - throw new ErrorException("鎵句笉鍒版姤鍛婁笓鐢ㄧ珷"); - } - if (sealUrl == null) throw new ErrorException("鎵句笉鍒版姤鍛婁笓鐢ㄧ珷");*/ //绯荤粺鐢熸垚鎶ュ憡鍦板潃 String url = insReport.getUrl(); //鎵嬪姩涓婁紶鎶ュ憡鍦板潃 @@ -488,20 +476,6 @@ public String wordToPdf(String wordPath, String pdfPath, String sealUrl) { FileOutputStream os = null; try { - //鍑瘉 涓嶇劧鍒囨崲鍚庢湁姘村嵃 -// InputStream inputStream = this.getClass().getResourceAsStream("/lib/license.xml"); - /*String url; - try { - InputStream inputStream = this.getClass().getResourceAsStream("/lib/license.xml"); - File file = File.createTempFile("temp", ".tmp"); - OutputStream outputStream = new FileOutputStream(file); - IOUtils.copy(inputStream, outputStream); - url = file.getAbsolutePath(); - } catch (FileNotFoundException e) { - throw new ErrorException("鎵句笉鍒版ā鏉挎枃浠�"); - } catch (IOException e) { - throw new RuntimeException(e); - }*/ InputStream is = new ClassPathResource("/lib/license.xml").getInputStream(); License license = new License(); license.setLicense(is); @@ -514,24 +488,10 @@ os = new FileOutputStream(file); //瑕佽浆鎹㈢殑word鏂囦欢 com.aspose.words.Document doc = new com.aspose.words.Document(wordPath); - TableCollection tables = doc.getFirstSection().getBody().getTables(); - for (Table table : tables) { - RowCollection rows = table.getRows(); - table.setAllowAutoFit(false); - for (Row row : rows) { - CellCollection cells = row.getCells(); - for (Cell cell : cells) { - CellFormat cellFormat = cell.getCellFormat(); - cellFormat.setFitText(false); //璁剧疆鑷�傚簲鍏抽棴 - cellFormat.setWrapText(true); // 璁剧疆鑷姩鎹㈣ - } - } - } doc.save(os, SaveFormat.PDF); //娣诲姞楠戠紳绔� stamperCheckMarkPDF(pdfPath.replace(".pdf", "-1.pdf"), pdfPath, imgUrl + "/" + sealUrl); - } catch (Exception e) { e.printStackTrace(); -- Gitblit v1.9.3