| | |
| | | } 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(); |
| | | //手动上传报告地址 |
| | |
| | | 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); |
| | |
| | | } |
| | | } |
| | | } |
| | | doc.updateFields(); |
| | | doc.save(os, SaveFormat.PDF); |
| | | |
| | | //添加骑缝章 |