| | |
| | | return id; |
| | | } |
| | | |
| | | @Test |
| | | public void uploadPdf(){ |
| | | String base64String = PDFBinaryUtil.getPDFBinary("E:\\文档\\报告体检模板new - 首页.pdf"); |
| | | System.out.println("base64String = " + base64String); |
| | | TjReportTemplate template = new TjReportTemplate(); |
| | | template.setReportTemId(1864937292297244675L); |
| | | template.setTemplate(base64String); |
| | | reportTemplateService.updateById(template); |
| | | } |
| | | |
| | | /** |
| | | * 调用生成报告 |
| | | */ |
| | |
| | | log.error(String.valueOf(e)); |
| | | } |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | String str = " (1) 双肾输尿管膀胱B超:\n" + |
| | | " 肝脏、胆囊、胰腺、脾脏声像图所见未见明显异常\n" + |
| | | " 双肾、输尿管声像图未见明显异常\n" + |
| | | " \n" + |
| | | " \n" + |
| | | " \n" + |
| | | " "; |
| | | |
| | | str = str.replaceAll("[\\n\\r]+$", ""); // 去除末尾的换行符 |
| | | str = str.replaceAll("\\s+$", ""); // 去除末尾的空格 |
| | | System.out.println(str); |
| | | } |
| | | } |