From 5c4f24c18948011047a29834a359bdf39588cbf6 Mon Sep 17 00:00:00 2001 From: "carefreefly@163.com" <> Date: Tue, 29 Aug 2023 23:23:07 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 12 ++++---- rayin-datarule/pom.xml | 4 +-- .../java/ink/rayin/datarule/DataRule.java | 30 ++++++++++--------- rayin-htmladapter-base/pom.xml | 4 +-- rayin-htmladapter-openhtmltopdf/pom.xml | 10 +++++-- rayin-htmladapter-spring-boot-starter/pom.xml | 4 +-- rayin-springboot-sample/pom.xml | 2 +- rayin-test/pom.xml | 4 +-- .../resources/examples/example5/element1.html | 6 ++-- rayin-tools/pom.xml | 4 +-- 10 files changed, 43 insertions(+), 37 deletions(-) diff --git a/pom.xml b/pom.xml index 96a8a47..65ad9c6 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ ink.rayin rayin-parent pom - 1.1.1 + 1.1.2 rayin-parent pdf template generate tools http://rayin.ink @@ -174,29 +174,29 @@ ink.rayin rayin-tools - 1.1.1 + 1.1.2 ink.rayin rayin-htmladapter-openhtmltopdf - 1.1.1 + 1.1.2 ink.rayin rayin-htmladapter-spring-boot-starter - 1.1.1 + 1.1.2 ink.rayin rayin-htmladapter-base - 1.1.1 + 1.1.2 ink.rayin rayin-datarule - 1.1.1 + 1.1.2 org.apache.commons diff --git a/rayin-datarule/pom.xml b/rayin-datarule/pom.xml index a9f8b81..83e33a2 100644 --- a/rayin-datarule/pom.xml +++ b/rayin-datarule/pom.xml @@ -5,12 +5,12 @@ rayin-parent ink.rayin - 1.1.1 + 1.1.2 4.0.0 rayin-datarule - 1.1.1 + 1.1.2 8 8 diff --git a/rayin-datarule/src/main/java/ink/rayin/datarule/DataRule.java b/rayin-datarule/src/main/java/ink/rayin/datarule/DataRule.java index c0a7a0c..21514d6 100644 --- a/rayin-datarule/src/main/java/ink/rayin/datarule/DataRule.java +++ b/rayin-datarule/src/main/java/ink/rayin/datarule/DataRule.java @@ -11,6 +11,7 @@ import groovy.transform.ThreadInterrupt; import ink.rayin.htmladapter.base.utils.RayinException; import ink.rayin.tools.utils.DigestUtil; import ink.rayin.tools.utils.ResourceUtil; +import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.codehaus.groovy.control.CompilerConfiguration; @@ -142,8 +143,9 @@ public class DataRule { * @param scriptString 脚本字符串 * @return 数据对象 */ + @SneakyThrows public Object executeGroovyScript(JSONObject data, JSONObject otherData, String dataName, - String otherDataName, String scriptString) { + String otherDataName, String scriptString){ Binding binding = new Binding(); binding.setProperty(dataName, data); binding.setProperty(otherDataName, otherData); @@ -161,20 +163,20 @@ public class DataRule { groovyScript.setBinding(binding); Future future = threadPool.submit((Callable) groovyScript::run); - try{ + //try{ return future.get(30, TimeUnit.SECONDS); - }catch (TimeoutException exception) { - future.cancel(true); - log.error("TimeoutException,try cancel future task, is cancelled", exception); - //do something else - }catch (InterruptedException exception){ - future.cancel(true); - log.error("InterruptedException,try cancel future task, is cancelled" , exception); - }catch (ExecutionException exception){ - future.cancel(true); - log.error("ExecutionException,try cancel future task, is cancelled" , exception); - } - return null; +// }catch (TimeoutException exception) { +// future.cancel(true); +// log.error("TimeoutException,try cancel future task, is cancelled", exception); +// //do something else +// }catch (InterruptedException exception){ +// future.cancel(true); +// log.error("InterruptedException,try cancel future task, is cancelled" , exception); +// }catch (ExecutionException exception){ +// future.cancel(true); +// log.error("ExecutionException,try cancel future task, is cancelled" , exception); +// } +// return null; } /** diff --git a/rayin-htmladapter-base/pom.xml b/rayin-htmladapter-base/pom.xml index 867e3b2..4fa9a3d 100644 --- a/rayin-htmladapter-base/pom.xml +++ b/rayin-htmladapter-base/pom.xml @@ -5,12 +5,12 @@ rayin-parent ink.rayin - 1.1.1 + 1.1.2 4.0.0 rayin-htmladapter-base - 1.1.1 + 1.1.2 ink.rayin diff --git a/rayin-htmladapter-openhtmltopdf/pom.xml b/rayin-htmladapter-openhtmltopdf/pom.xml index 37d7887..d1e8a9c 100644 --- a/rayin-htmladapter-openhtmltopdf/pom.xml +++ b/rayin-htmladapter-openhtmltopdf/pom.xml @@ -5,18 +5,18 @@ rayin-parent ink.rayin - 1.1.1 + 1.1.2 4.0.0 rayin-htmladapter-openhtmltopdf - 1.1.1 + 1.1.2 jar 1.0.10 - 2.0.27 + 2.0.29 @@ -46,6 +46,10 @@ org.apache.pdfbox pdfbox + + org.apache.pdfbox + fontbox + diff --git a/rayin-htmladapter-spring-boot-starter/pom.xml b/rayin-htmladapter-spring-boot-starter/pom.xml index 80c1371..1187f93 100644 --- a/rayin-htmladapter-spring-boot-starter/pom.xml +++ b/rayin-htmladapter-spring-boot-starter/pom.xml @@ -5,12 +5,12 @@ rayin-parent ink.rayin - 1.1.1 + 1.1.2 4.0.0 rayin-htmladapter-spring-boot-starter - 1.1.1 + 1.1.2 jar diff --git a/rayin-springboot-sample/pom.xml b/rayin-springboot-sample/pom.xml index 76b80cb..e3c85ff 100644 --- a/rayin-springboot-sample/pom.xml +++ b/rayin-springboot-sample/pom.xml @@ -35,7 +35,7 @@ ink.rayin rayin-htmladapter-spring-boot-starter - 1.1.1 + 1.1.2 diff --git a/rayin-test/pom.xml b/rayin-test/pom.xml index 9b53e65..fc83249 100644 --- a/rayin-test/pom.xml +++ b/rayin-test/pom.xml @@ -5,11 +5,11 @@ rayin-parent ink.rayin - 1.1.1 + 1.1.2 4.0.0 ink.rayin - 1.1.1 + 1.1.2 rayin-test diff --git a/rayin-test/src/test/resources/examples/example5/element1.html b/rayin-test/src/test/resources/examples/example5/element1.html index 4d8ecd3..e9b5b11 100644 --- a/rayin-test/src/test/resources/examples/example5/element1.html +++ b/rayin-test/src/test/resources/examples/example5/element1.html @@ -4,10 +4,10 @@