From 50f0b242b75fa91afc4f4f38549103a7f5441c15 Mon Sep 17 00:00:00 2001 From: wangshaoping Date: Tue, 31 Dec 2024 17:48:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E5=B8=83=208.2.3=201.=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E9=BB=98=E8=AE=A4=E5=AE=89=E8=A3=85=E6=97=B6=E7=BC=BA?= =?UTF-8?q?=E5=A4=B1=20protocol=20=E5=B1=9E=E6=80=A7=E7=9A=84=20bug?= =?UTF-8?q?=E3=80=82=202.=20=E5=89=8D=E7=AB=AF=E6=9B=B4=E6=96=B0=E5=88=B0?= =?UTF-8?q?=208.2.17=E3=80=82=203.=20=E8=A7=84=E5=88=99=E5=BC=95=E6=93=8E?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=8F=82=E6=95=B0=E7=B1=BB=E5=9E=8B=E4=B8=BA?= =?UTF-8?q?=E7=89=B9=E5=BE=81=E7=9A=84=E8=BE=93=E5=85=A5=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- erm.frontend/package.json | 2 +- gradle.properties | 2 +- io.sc.engine.mv.frontend/package.json | 2 +- .../rule/core/code/template/import_render.tpl | 6 +- io.sc.engine.rule.frontend/package.json | 2 +- ...20515__Rule Engine Database Schema DDL.xml | 5 +- io.sc.engine.st.frontend/package.json | 2 +- io.sc.platform.core.frontend/package.json | 2 +- .../template-project/package.json | 4 +- io.sc.platform.developer.doc/package.json | 2 +- .../package.json | 2 +- io.sc.platform.lcdp.frontend/package.json | 2 +- .../src/components/index.ts | 8 + .../package.json | 2 +- io.sc.platform.mvc.frontend/package.json | 2 +- .../package.json | 2 +- io.sc.platform.system.frontend/package.json | 2 +- .../io/sc/platform/util/CollectionUtil.java | 18 ++ .../java/io/sc/platform/util/DateUtil.java | 286 +++++++++--------- .../util/PlaceHolderExpressionUtil.java | 9 +- io.sc.standard.frontend/package.json | 2 +- io.sc.website/package.json | 2 +- 22 files changed, 199 insertions(+), 167 deletions(-) diff --git a/erm.frontend/package.json b/erm.frontend/package.json index be9a1ef4..2447002b 100644 --- a/erm.frontend/package.json +++ b/erm.frontend/package.json @@ -111,7 +111,7 @@ "node-sql-parser": "5.3.4", "pinia": "2.2.6", "pinia-undo": "0.2.4", - "platform-core": "8.2.18", + "platform-core": "8.2.19", "quasar": "2.17.4", "sort-array": "5.0.0", "svg-path-commander": "2.1.5", diff --git a/gradle.properties b/gradle.properties index 7ff386c4..c55936c3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -38,7 +38,7 @@ application_version=1.0.0 platform_group=io.sc platform_version=8.2.3 platform_plugin_version=8.2.3 -platform_core_frontend_version=8.2.18 +platform_core_frontend_version=8.2.19 ########################################################### # dependencies version diff --git a/io.sc.engine.mv.frontend/package.json b/io.sc.engine.mv.frontend/package.json index 63fad59f..1e51c8be 100644 --- a/io.sc.engine.mv.frontend/package.json +++ b/io.sc.engine.mv.frontend/package.json @@ -111,7 +111,7 @@ "node-sql-parser": "5.3.4", "pinia": "2.2.6", "pinia-undo": "0.2.4", - "platform-core": "8.2.18", + "platform-core": "8.2.19", "quasar": "2.17.4", "sort-array": "5.0.0", "svg-path-commander": "2.1.5", diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/import_render.tpl b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/import_render.tpl index f7f0e338..03a5d341 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/import_render.tpl +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/import_render.tpl @@ -57,10 +57,10 @@ import static io.sc.engine.rule.core.function.StringFunction.startsWith; import static io.sc.engine.rule.core.function.StringFunction.trim; import static io.sc.engine.rule.core.function.StringFunction.upperCase; import static io.sc.platform.util.CollectionUtil.hasElements; -import static io.sc.platform.util.DateUtil.yearBetween; -import static io.sc.platform.util.DateUtil.monthBetween; +import static io.sc.platform.util.DateUtil.yearsBetween; +import static io.sc.platform.util.DateUtil.monthsBetween; import static io.sc.platform.util.DateUtil.weeksBetween; -import static io.sc.platform.util.DateUtil.dayBetween; +import static io.sc.platform.util.DateUtil.daysBetween; import static io.sc.platform.util.DateUtil.hoursBetween; import static io.sc.platform.util.DateUtil.minutesBetween; import static io.sc.platform.util.DateUtil.secondsBetween; diff --git a/io.sc.engine.rule.frontend/package.json b/io.sc.engine.rule.frontend/package.json index 07b8d973..7f6c0d4a 100644 --- a/io.sc.engine.rule.frontend/package.json +++ b/io.sc.engine.rule.frontend/package.json @@ -111,7 +111,7 @@ "node-sql-parser": "5.3.4", "pinia": "2.2.6", "pinia-undo": "0.2.4", - "platform-core": "8.2.18", + "platform-core": "8.2.19", "quasar": "2.17.4", "sort-array": "5.0.0", "svg-path-commander": "2.1.5", diff --git a/io.sc.engine.rule.server/src/main/resources/liquibase/RE_1.0.0_20220515__Rule Engine Database Schema DDL.xml b/io.sc.engine.rule.server/src/main/resources/liquibase/RE_1.0.0_20220515__Rule Engine Database Schema DDL.xml index 097cb651..f867b2fd 100644 --- a/io.sc.engine.rule.server/src/main/resources/liquibase/RE_1.0.0_20220515__Rule Engine Database Schema DDL.xml +++ b/io.sc.engine.rule.server/src/main/resources/liquibase/RE_1.0.0_20220515__Rule Engine Database Schema DDL.xml @@ -843,8 +843,9 @@ - - + + + diff --git a/io.sc.engine.st.frontend/package.json b/io.sc.engine.st.frontend/package.json index 43b60fc1..608472fb 100644 --- a/io.sc.engine.st.frontend/package.json +++ b/io.sc.engine.st.frontend/package.json @@ -111,7 +111,7 @@ "node-sql-parser": "5.3.4", "pinia": "2.2.6", "pinia-undo": "0.2.4", - "platform-core": "8.2.18", + "platform-core": "8.2.19", "quasar": "2.17.4", "sort-array": "5.0.0", "svg-path-commander": "2.1.5", diff --git a/io.sc.platform.core.frontend/package.json b/io.sc.platform.core.frontend/package.json index 3aa3abbf..c9228caf 100644 --- a/io.sc.platform.core.frontend/package.json +++ b/io.sc.platform.core.frontend/package.json @@ -1,6 +1,6 @@ { "name": "platform-core", - "version": "8.2.17", + "version": "8.2.19", "description": "前端核心包,用于快速构建前端的脚手架", "//main": "库的主文件", "main": "dist/platform-core.js", diff --git a/io.sc.platform.core.frontend/template-project/package.json b/io.sc.platform.core.frontend/template-project/package.json index a02d7310..ec5e688c 100644 --- a/io.sc.platform.core.frontend/template-project/package.json +++ b/io.sc.platform.core.frontend/template-project/package.json @@ -1,6 +1,6 @@ { "name": "platform-core", - "version": "8.2.17", + "version": "8.2.19", "description": "前端核心包,用于快速构建前端的脚手架", "private": false, "keywords": [], @@ -110,7 +110,7 @@ "mockjs": "1.1.0", "node-sql-parser": "5.3.4", "pinia": "2.2.6", - "platform-core": "8.2.17", + "platform-core": "8.2.19", "quasar": "2.17.4", "sort-array": "5.0.0", "svg-path-commander": "2.1.5", diff --git a/io.sc.platform.developer.doc/package.json b/io.sc.platform.developer.doc/package.json index 9ce05919..1d11e5e3 100644 --- a/io.sc.platform.developer.doc/package.json +++ b/io.sc.platform.developer.doc/package.json @@ -28,7 +28,7 @@ "vuepress": "2.0.0-rc.15" }, "dependencies": { - "platform-core": "8.2.18", + "platform-core": "8.2.19", "quasar": "2.17.4", "vue": "3.5.13", "vue-i18n": "10.0.4" diff --git a/io.sc.platform.developer.frontend/package.json b/io.sc.platform.developer.frontend/package.json index f003bef8..4f0954a8 100644 --- a/io.sc.platform.developer.frontend/package.json +++ b/io.sc.platform.developer.frontend/package.json @@ -111,7 +111,7 @@ "node-sql-parser": "5.3.4", "pinia": "2.2.6", "pinia-undo": "0.2.4", - "platform-core": "8.2.18", + "platform-core": "8.2.19", "quasar": "2.17.4", "sort-array": "5.0.0", "svg-path-commander": "2.1.5", diff --git a/io.sc.platform.lcdp.frontend/package.json b/io.sc.platform.lcdp.frontend/package.json index df3ac5eb..ea274e7d 100644 --- a/io.sc.platform.lcdp.frontend/package.json +++ b/io.sc.platform.lcdp.frontend/package.json @@ -111,7 +111,7 @@ "node-sql-parser": "5.3.4", "pinia": "2.2.6", "pinia-undo": "0.2.4", - "platform-core": "8.2.18", + "platform-core": "8.2.19", "quasar": "2.17.4", "sort-array": "5.0.0", "svg-path-commander": "2.1.5", diff --git a/io.sc.platform.lcdp.frontend/src/components/index.ts b/io.sc.platform.lcdp.frontend/src/components/index.ts index 23e06cb3..0dd56a71 100644 --- a/io.sc.platform.lcdp.frontend/src/components/index.ts +++ b/io.sc.platform.lcdp.frontend/src/components/index.ts @@ -5,11 +5,19 @@ import component_lcdp_Frontend from '@/views/Frontend.vue'; import component_lcdp_Theme from '@/views/Theme.vue'; import component_lcdp_bpm from '@/views/bpm/Bpm.vue'; +import component_lcdp_form_page from '@/views/form/Page.vue'; +import component_lcdp_excel_report from '@/views/excel_template/ExcelReport.vue'; +import component_lcdp_formConfig from '@/views/form/FormConfig.vue'; +import component_lcdp_excel_template from '@/views/excel_template/TemplateGrid.vue'; const localComponents = { 'component.lcdp.Frontend': component_lcdp_Frontend, 'component.lcdp.Theme': component_lcdp_Theme, 'component.lcdp.bpm': component_lcdp_bpm, + 'component.lcdp.form.page': component_lcdp_form_page, + 'component.lcdp.excel.report': component_lcdp_excel_report, + 'component.lcdp.formConfig': component_lcdp_formConfig, + 'component.lcdp.excel.template': component_lcdp_excel_template, }; export default localComponents; diff --git a/io.sc.platform.license.keygen.frontend/package.json b/io.sc.platform.license.keygen.frontend/package.json index f210511b..4b518ee7 100644 --- a/io.sc.platform.license.keygen.frontend/package.json +++ b/io.sc.platform.license.keygen.frontend/package.json @@ -111,7 +111,7 @@ "node-sql-parser": "5.3.4", "pinia": "2.2.6", "pinia-undo": "0.2.4", - "platform-core": "8.2.18", + "platform-core": "8.2.19", "quasar": "2.17.4", "sort-array": "5.0.0", "svg-path-commander": "2.1.5", diff --git a/io.sc.platform.mvc.frontend/package.json b/io.sc.platform.mvc.frontend/package.json index 72563f32..58762864 100644 --- a/io.sc.platform.mvc.frontend/package.json +++ b/io.sc.platform.mvc.frontend/package.json @@ -111,7 +111,7 @@ "node-sql-parser": "5.3.4", "pinia": "2.2.6", "pinia-undo": "0.2.4", - "platform-core": "8.2.18", + "platform-core": "8.2.19", "quasar": "2.17.4", "sort-array": "5.0.0", "svg-path-commander": "2.1.5", diff --git a/io.sc.platform.scheduler.manager.frontend/package.json b/io.sc.platform.scheduler.manager.frontend/package.json index ca0eb78e..400c2902 100644 --- a/io.sc.platform.scheduler.manager.frontend/package.json +++ b/io.sc.platform.scheduler.manager.frontend/package.json @@ -111,7 +111,7 @@ "node-sql-parser": "5.3.4", "pinia": "2.2.6", "pinia-undo": "0.2.4", - "platform-core": "8.2.18", + "platform-core": "8.2.19", "quasar": "2.17.4", "sort-array": "5.0.0", "svg-path-commander": "2.1.5", diff --git a/io.sc.platform.system.frontend/package.json b/io.sc.platform.system.frontend/package.json index 444bad99..3a5ecaee 100644 --- a/io.sc.platform.system.frontend/package.json +++ b/io.sc.platform.system.frontend/package.json @@ -110,7 +110,7 @@ "mockjs": "1.1.0", "node-sql-parser": "5.3.4", "pinia": "2.2.6", - "platform-core": "8.2.18", + "platform-core": "8.2.19", "quasar": "2.17.4", "sort-array": "5.0.0", "svg-path-commander": "2.1.5", diff --git a/io.sc.platform.util/src/main/java/io/sc/platform/util/CollectionUtil.java b/io.sc.platform.util/src/main/java/io/sc/platform/util/CollectionUtil.java index a6afcaab..129b7653 100644 --- a/io.sc.platform.util/src/main/java/io/sc/platform/util/CollectionUtil.java +++ b/io.sc.platform.util/src/main/java/io/sc/platform/util/CollectionUtil.java @@ -144,6 +144,24 @@ public class CollectionUtil { } return result; } + + /** + * 将 Set 转为 List + * @param set 对象集合 + * @return 对象列表 + * + * @param 数据类型 + */ + public static List set2List(Set set){ + if(set==null || set.isEmpty()){ + return Collections.emptyList(); + } + List result =new ArrayList<>(); + for(T item : set){ + result.add(item); + } + return result; + } /** * 冒泡排序 diff --git a/io.sc.platform.util/src/main/java/io/sc/platform/util/DateUtil.java b/io.sc.platform.util/src/main/java/io/sc/platform/util/DateUtil.java index a5d5c1e8..7b482e05 100644 --- a/io.sc.platform.util/src/main/java/io/sc/platform/util/DateUtil.java +++ b/io.sc.platform.util/src/main/java/io/sc/platform/util/DateUtil.java @@ -332,211 +332,211 @@ public class DateUtil { /** * 计算两个日期相差的年数 - * @param d1 日期1 - * @param d2 日期2 + * @param o1 日期对象1 + * @param o2 日期对象2 * @return 两个日期相差的年数 */ - public static long yearBetween(Date d1,Date d2){ - LocalDateTime ld1 =toLocalDateTime(d1); - LocalDateTime ld2 =toLocalDateTime(d2); - return ChronoUnit.YEARS.between(ld2,ld1); - } - - /** - * 计算两个日期相差的年数 - * @param d1Str 日期字符串1 - * @param d2Str 日期字符串2 - * @return 两个日期相差的年数 - */ - public static long yearBetween(String d1Str,String d2Str){ - try { - Date d1 = tryParseDate(d1Str); - Date d2 = tryParseDate(d2Str); - LocalDateTime ld1 = toLocalDateTime(d1); - LocalDateTime ld2 = toLocalDateTime(d2); - return ChronoUnit.YEARS.between(ld2, ld1); - }catch (Exception e){ - throw new RuntimeException(e); + public static long yearsBetween(Object o1,Object o2){ + if(o1==null || o2==null) throw new RuntimeException("parameter can NOT be null"); + Date d1 =null; + Date d2 =null; + if(o1 instanceof String){ + try { d1 = tryParseDate(o1.toString()); }catch (Exception e){ throw new RuntimeException(e); } + }else if(o1 instanceof Date){ + d1 =(Date)o1; + }else{ + throw new RuntimeException("parameter must be String or Date type."); } - } - /** - * 计算两个日期相差的月数 - * @param d1 日期1 - * @param d2 日期2 - * @return 两个日期相差的月数 - */ - public static long monthBetween(Date d1,Date d2){ + if(o2 instanceof String){ + try { d2 = tryParseDate(o2.toString()); }catch (Exception e){ throw new RuntimeException(e); } + }else if(o2 instanceof Date){ + d1 =(Date)o2; + }else{ + throw new RuntimeException("parameter must be String or Date type."); + } LocalDateTime ld1 =toLocalDateTime(d1); LocalDateTime ld2 =toLocalDateTime(d2); - return ChronoUnit.MONTHS.between(ld2,ld1); + return ChronoUnit.YEARS.between(ld1,ld2); } /** * 计算两个日期相差的月数 - * @param d1Str 日期字符串1 - * @param d2Str 日期字符串2 + * @param o1 日期对象1 + * @param o2 日期对象2 * @return 两个日期相差的月数 */ - public static long monthBetween(String d1Str,String d2Str){ - try { - Date d1 = tryParseDate(d1Str); - Date d2 = tryParseDate(d2Str); - LocalDateTime ld1 = toLocalDateTime(d1); - LocalDateTime ld2 = toLocalDateTime(d2); - return ChronoUnit.MONTHS.between(ld2, ld1); - }catch (Exception e){ - throw new RuntimeException(e); + public static long monthsBetween(Object o1,Object o2){ + if(o1==null || o2==null) throw new RuntimeException("parameter can NOT be null"); + Date d1 =null; + Date d2 =null; + if(o1 instanceof String){ + try { d1 = tryParseDate(o1.toString()); }catch (Exception e){ throw new RuntimeException(e); } + }else if(o1 instanceof Date){ + d1 =(Date)o1; + }else{ + throw new RuntimeException("parameter must be String or Date type."); } - } - /** - * 计算两个日期相差的周数 - * @param d1 日期1 - * @param d2 日期2 - * @return 两个日期相差的周数 - */ - public static long weeksBetween(Date d1,Date d2){ + if(o2 instanceof String){ + try { d2 = tryParseDate(o2.toString()); }catch (Exception e){ throw new RuntimeException(e); } + }else if(o2 instanceof Date){ + d1 =(Date)o2; + }else{ + throw new RuntimeException("parameter must be String or Date type."); + } LocalDateTime ld1 =toLocalDateTime(d1); LocalDateTime ld2 =toLocalDateTime(d2); - return ChronoUnit.WEEKS.between(ld2,ld1); + return ChronoUnit.MONTHS.between(ld1,ld2); } /** * 计算两个日期相差的周数 - * @param d1Str 日期字符串1 - * @param d2Str 日期字符串2 + * @param o1 日期对象1 + * @param o2 日期对象2 * @return 两个日期相差的周数 */ - public static long weeksBetween(String d1Str,String d2Str){ - try { - Date d1 = tryParseDate(d1Str); - Date d2 = tryParseDate(d2Str); - LocalDateTime ld1 = toLocalDateTime(d1); - LocalDateTime ld2 = toLocalDateTime(d2); - return ChronoUnit.SECONDS.between(ld2, ld1); - }catch (Exception e){ - throw new RuntimeException(e); + public static long weeksBetween(Object o1,Object o2){ + if(o1==null || o2==null) throw new RuntimeException("parameter can NOT be null"); + Date d1 =null; + Date d2 =null; + if(o1 instanceof String){ + try { d1 = tryParseDate(o1.toString()); }catch (Exception e){ throw new RuntimeException(e); } + }else if(o1 instanceof Date){ + d1 =(Date)o1; + }else{ + throw new RuntimeException("parameter must be String or Date type."); } - } - /** - * 计算两个日期相差的天数 - * @param d1 日期1 - * @param d2 日期2 - * @return 两个日期相差的天数 - */ - public static long dayBetween(Date d1,Date d2){ + if(o2 instanceof String){ + try { d2 = tryParseDate(o2.toString()); }catch (Exception e){ throw new RuntimeException(e); } + }else if(o2 instanceof Date){ + d1 =(Date)o2; + }else{ + throw new RuntimeException("parameter must be String or Date type."); + } LocalDateTime ld1 =toLocalDateTime(d1); LocalDateTime ld2 =toLocalDateTime(d2); - return ChronoUnit.DAYS.between(ld2,ld1); + return ChronoUnit.WEEKS.between(ld1,ld2); } /** * 计算两个日期相差的天数 - * @param d1Str 日期字符串1 - * @param d2Str 日期字符串2 + * @param o1 日期对象1 + * @param o2 日期对象2 * @return 两个日期相差的天数 */ - public static long dayBetween(String d1Str,String d2Str){ - try { - Date d1 = tryParseDate(d1Str); - Date d2 = tryParseDate(d2Str); - LocalDateTime ld1 = toLocalDateTime(d1); - LocalDateTime ld2 = toLocalDateTime(d2); - return ChronoUnit.DAYS.between(ld2, ld1); - }catch (Exception e){ - throw new RuntimeException(e); + public static long daysBetween(Object o1,Object o2){ + if(o1==null || o2==null) throw new RuntimeException("parameter can NOT be null"); + Date d1 =null; + Date d2 =null; + if(o1 instanceof String){ + try { d1 = tryParseDate(o1.toString()); }catch (Exception e){ throw new RuntimeException(e); } + }else if(o1 instanceof Date){ + d1 =(Date)o1; + }else{ + throw new RuntimeException("parameter must be String or Date type."); } - } - /** - * 计算两个日期相差的小时数 - * @param d1 日期1 - * @param d2 日期2 - * @return 两个日期相差的小时数 - */ - public static long hoursBetween(Date d1,Date d2){ + if(o2 instanceof String){ + try { d2 = tryParseDate(o2.toString()); }catch (Exception e){ throw new RuntimeException(e); } + }else if(o2 instanceof Date){ + d1 =(Date)o2; + }else{ + throw new RuntimeException("parameter must be String or Date type."); + } LocalDateTime ld1 =toLocalDateTime(d1); LocalDateTime ld2 =toLocalDateTime(d2); - return ChronoUnit.HOURS.between(ld2,ld1); + return ChronoUnit.MONTHS.between(ld1,ld2); } /** * 计算两个日期相差的小时数 - * @param d1Str 日期字符串1 - * @param d2Str 日期字符串2 + * @param o1 日期对象1 + * @param o2 日期对象2 * @return 两个日期相差的小时数 */ - public static long hoursBetween(String d1Str,String d2Str){ - try { - Date d1 = tryParseDate(d1Str); - Date d2 = tryParseDate(d2Str); - LocalDateTime ld1 = toLocalDateTime(d1); - LocalDateTime ld2 = toLocalDateTime(d2); - return ChronoUnit.HOURS.between(ld2, ld1); - }catch (Exception e){ - throw new RuntimeException(e); + public static long hoursBetween(Object o1,Object o2){ + if(o1==null || o2==null) throw new RuntimeException("parameter can NOT be null"); + Date d1 =null; + Date d2 =null; + if(o1 instanceof String){ + try { d1 = tryParseDate(o1.toString()); }catch (Exception e){ throw new RuntimeException(e); } + }else if(o1 instanceof Date){ + d1 =(Date)o1; + }else{ + throw new RuntimeException("parameter must be String or Date type."); } - } - /** - * 计算两个日期相差的分钟数 - * @param d1 日期1 - * @param d2 日期2 - * @return 两个日期相差的分钟数 - */ - public static long minutesBetween(Date d1,Date d2){ + if(o2 instanceof String){ + try { d2 = tryParseDate(o2.toString()); }catch (Exception e){ throw new RuntimeException(e); } + }else if(o2 instanceof Date){ + d1 =(Date)o2; + }else{ + throw new RuntimeException("parameter must be String or Date type."); + } LocalDateTime ld1 =toLocalDateTime(d1); LocalDateTime ld2 =toLocalDateTime(d2); - return ChronoUnit.MINUTES.between(ld2,ld1); + return ChronoUnit.MONTHS.between(ld1,ld2); } /** * 计算两个日期相差的分钟数 - * @param d1Str 日期字符串1 - * @param d2Str 日期字符串2 + * @param o1 日期对象1 + * @param o2 日期对象2 * @return 两个日期相差的分钟数 */ - public static long minutesBetween(String d1Str,String d2Str){ - try { - Date d1 = tryParseDate(d1Str); - Date d2 = tryParseDate(d2Str); - LocalDateTime ld1 = toLocalDateTime(d1); - LocalDateTime ld2 = toLocalDateTime(d2); - return ChronoUnit.HOURS.between(ld2, ld1); - }catch (Exception e){ - throw new RuntimeException(e); + public static long minutesBetween(Object o1,Object o2){ + if(o1==null || o2==null) throw new RuntimeException("parameter can NOT be null"); + Date d1 =null; + Date d2 =null; + if(o1 instanceof String){ + try { d1 = tryParseDate(o1.toString()); }catch (Exception e){ throw new RuntimeException(e); } + }else if(o1 instanceof Date){ + d1 =(Date)o1; + }else{ + throw new RuntimeException("parameter must be String or Date type."); } - } - /** - * 计算两个日期相差的秒数 - * @param d1 日期1 - * @param d2 日期2 - * @return 两个日期相差的秒数 - */ - public static long secondsBetween(Date d1,Date d2){ + if(o2 instanceof String){ + try { d2 = tryParseDate(o2.toString()); }catch (Exception e){ throw new RuntimeException(e); } + }else if(o2 instanceof Date){ + d1 =(Date)o2; + }else{ + throw new RuntimeException("parameter must be String or Date type."); + } LocalDateTime ld1 =toLocalDateTime(d1); LocalDateTime ld2 =toLocalDateTime(d2); - return ChronoUnit.SECONDS.between(ld2,ld1); + return ChronoUnit.MONTHS.between(ld1,ld2); } /** * 计算两个日期相差的秒数 - * @param d1Str 日期字符串1 - * @param d2Str 日期字符串2 + * @param o1 日期对象1 + * @param o2 日期对象2 * @return 两个日期相差的秒数 */ - public static long secondsBetween(String d1Str,String d2Str){ - try { - Date d1 = tryParseDate(d1Str); - Date d2 = tryParseDate(d2Str); - LocalDateTime ld1 = toLocalDateTime(d1); - LocalDateTime ld2 = toLocalDateTime(d2); - return ChronoUnit.SECONDS.between(ld2, ld1); - }catch (Exception e){ - throw new RuntimeException(e); + public static long secondsBetween(Object o1,Object o2){ + if(o1==null || o2==null) throw new RuntimeException("parameter can NOT be null"); + Date d1 =null; + Date d2 =null; + if(o1 instanceof String){ + try { d1 = tryParseDate(o1.toString()); }catch (Exception e){ throw new RuntimeException(e); } + }else if(o1 instanceof Date){ + d1 =(Date)o1; + }else{ + throw new RuntimeException("parameter must be String or Date type."); } + + if(o2 instanceof String){ + try { d2 = tryParseDate(o2.toString()); }catch (Exception e){ throw new RuntimeException(e); } + }else if(o2 instanceof Date){ + d1 =(Date)o2; + }else{ + throw new RuntimeException("parameter must be String or Date type."); + } + LocalDateTime ld1 =toLocalDateTime(d1); + LocalDateTime ld2 =toLocalDateTime(d2); + return ChronoUnit.MONTHS.between(ld1,ld2); } } diff --git a/io.sc.platform.util/src/main/java/io/sc/platform/util/PlaceHolderExpressionUtil.java b/io.sc.platform.util/src/main/java/io/sc/platform/util/PlaceHolderExpressionUtil.java index 01833ae5..47d119dc 100644 --- a/io.sc.platform.util/src/main/java/io/sc/platform/util/PlaceHolderExpressionUtil.java +++ b/io.sc.platform.util/src/main/java/io/sc/platform/util/PlaceHolderExpressionUtil.java @@ -119,7 +119,12 @@ public class PlaceHolderExpressionUtil { * @return 解析后的占位符表达式列表 */ public static List parse(String content) { - List expressions =new ArrayList<>(); + Set expressions =new TreeSet<>(new Comparator() { + @Override + public int compare(PlaceholderExpression o1, PlaceholderExpression o2) { + return o2.getExpression().compareTo(o1.getExpression()); + } + }); Matcher matcher =PH_EXPRESSION_REG_PATTERN.matcher(content); while(matcher.find()){ String group =matcher.group(); @@ -128,7 +133,7 @@ public class PlaceHolderExpressionUtil { expressions.add(expression); } } - return expressions; + return CollectionUtil.set2List(expressions); } /** diff --git a/io.sc.standard.frontend/package.json b/io.sc.standard.frontend/package.json index 152e7ab7..b4afd0fd 100644 --- a/io.sc.standard.frontend/package.json +++ b/io.sc.standard.frontend/package.json @@ -111,7 +111,7 @@ "node-sql-parser": "5.3.4", "pinia": "2.2.6", "pinia-undo": "0.2.4", - "platform-core": "8.2.18", + "platform-core": "8.2.19", "quasar": "2.17.4", "sort-array": "5.0.0", "svg-path-commander": "2.1.5", diff --git a/io.sc.website/package.json b/io.sc.website/package.json index cc35ee55..f2f28dac 100644 --- a/io.sc.website/package.json +++ b/io.sc.website/package.json @@ -28,6 +28,6 @@ }, "dependencies": { "vue": "3.5.13", - "platform-core": "8.2.18" + "platform-core": "8.2.19" } } \ No newline at end of file