| | |
| | | insReport.setWriteUserId(getLook.selectPowerByMethodAndUserId(null).get("userId"));//提交人 |
| | | insReport.setWriteTime(LocalDateTime.now());//提交时间 |
| | | //获取提交人的签名地址 |
| | | String signatureUrl = userMapper.selectById(insReport.getWriteUserId()).getSignatureUrl(); |
| | | String signatureUrl; |
| | | try { |
| | | signatureUrl = userMapper.selectById(insReport.getWriteUserId()).getSignatureUrl(); |
| | | }catch (Exception e){ |
| | | throw new ErrorException("找不到编制人的签名"); |
| | | } |
| | | //系统生成报告地址 |
| | | String url = insReport.getUrl(); |
| | | //手动上传报告地址 |
| | |
| | | return insReportMapper.updateById(insReport); |
| | | } |
| | | //获取审核人的签名地址 |
| | | String signatureUrl = userMapper.selectById(insReport.getExamineUserId()).getSignatureUrl(); |
| | | String signatureUrl; |
| | | try { |
| | | signatureUrl = userMapper.selectById(insReport.getExamineUserId()).getSignatureUrl(); |
| | | }catch (Exception e){ |
| | | throw new ErrorException("找不到审核人的签名"); |
| | | } |
| | | //系统生成报告地址 |
| | | String url = insReport.getUrl(); |
| | | //手动上传报告地址 |
| | |
| | | insReport.setState(0);//提交状态改为待提交 |
| | | return insReportMapper.updateById(insReport); |
| | | } |
| | | //获取审核人的签名地址 |
| | | String signatureUrl = userMapper.selectById(insReport.getRatifyUserId()).getSignatureUrl(); |
| | | //获取批准人的签名地址 |
| | | String signatureUrl; |
| | | try { |
| | | signatureUrl = userMapper.selectById(insReport.getRatifyUserId()).getSignatureUrl(); |
| | | }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(); |
| | | //手动上传报告地址 |
| | | String urlS = insReport.getUrlS(); |
| | | wordInsertUrl(new HashMap<String, Object>(){{ |
| | | put("ratifyUrl", Pictures.ofLocal(imgUrl+"/"+signatureUrl).create()); |
| | | put("seal1", Pictures.ofLocal(imgUrl+"/"+sealUrl).create()); |
| | | put("seal2", Pictures.ofLocal(imgUrl+"/"+sealUrl).create()); |
| | | }}, (urlS==null?url:urlS).replace("/word", wordUrl)); |
| | | wordToPdf((urlS == null ? url : urlS).replace("/word", wordUrl)); |
| | | InsOrder insOrder = new InsOrder(); |
| | |
| | | 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); |