zss
2024-10-24 a00890e840b80a741f62eb6cb31b46f13be6202f
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsReportServiceImpl.java
@@ -251,15 +251,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 +479,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);
@@ -527,6 +504,7 @@
                    }
                }
            }
            doc.updateFields();
            doc.save(os, SaveFormat.PDF);
            //添加骑缝章