From e83d55c455e424dcf422817a5e13c94e9a88a6ac Mon Sep 17 00:00:00 2001 From: wangxuanran <3055088966@qq.com> Date: Tue, 6 Dec 2022 17:43:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=82=E6=95=B0=E7=B1=BB=E5=9E=8B=E6=9E=9A?= =?UTF-8?q?=E4=B8=BE=E7=B1=BB=E5=A2=9E=E5=8A=A0object=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E7=94=9F=E6=88=90json=E7=B1=BB=E4=B8=AD?= =?UTF-8?q?=E5=AF=B9=E5=8F=82=E6=95=B0=E7=B1=BB=E5=9E=8B=E8=BD=AC=E6=8D=A2?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E5=A2=9E=E5=8A=A0object=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + ecology-9-dev.iml | 8 -------- .../commons/config/enumtype/ParamTypeEnum.java | 10 ++++++++-- .../commons/config/service/DealWithMapping.java | 14 ++++++++++---- .../cus_field_value/PushSealTaskSealValue.java | 2 +- .../saic_travel/model_data_async/AsyncTest.java | 10 ++++++++++ 6 files changed, 30 insertions(+), 15 deletions(-) delete mode 100644 ecology-9-dev.iml diff --git a/.gitignore b/.gitignore index c5ff955..3f70b62 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ log .idea/ #.gitignore !.gitignore +*.iml # Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties` # should NOT be excluded as they contain compiler settings and other important # information for Eclipse / Flash Builder. diff --git a/ecology-9-dev.iml b/ecology-9-dev.iml deleted file mode 100644 index c545449..0000000 --- a/ecology-9-dev.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/main/java/weaver/xiao/commons/config/enumtype/ParamTypeEnum.java b/src/main/java/weaver/xiao/commons/config/enumtype/ParamTypeEnum.java index 8ae2604..c8c40ba 100644 --- a/src/main/java/weaver/xiao/commons/config/enumtype/ParamTypeEnum.java +++ b/src/main/java/weaver/xiao/commons/config/enumtype/ParamTypeEnum.java @@ -5,10 +5,15 @@ import java.util.HashMap; import java.util.Map; /** + *

参数类型枚举类

* @author XiaoBokang * @create 2022/6/14 12:56 + *

版本改动说明 :

+ *

+ * v2.0 xuanran.wang 2022-12-06 + * 增加Object类型的枚举 字段值来自于自定义接口时可以选此选项 保留自定义接口返回参数类型 + *

*/ - public enum ParamTypeEnum { STRING("0"), @@ -21,7 +26,8 @@ public enum ParamTypeEnum { CUS_DATE_STR("7"), TIME_STAMP("8"), DATE_VAL("9"), - Boolean("10"); + Boolean("10"), + Object("11"); private static final Map LOOK_UP = new HashMap<>(8); diff --git a/src/main/java/weaver/xiao/commons/config/service/DealWithMapping.java b/src/main/java/weaver/xiao/commons/config/service/DealWithMapping.java index 45e6f3c..241415e 100644 --- a/src/main/java/weaver/xiao/commons/config/service/DealWithMapping.java +++ b/src/main/java/weaver/xiao/commons/config/service/DealWithMapping.java @@ -541,7 +541,7 @@ public class DealWithMapping extends ToolUtil { *

代码版本改动说明:

*

* v2.0 xuanran.wang 转换类型是默认值时增加替换规则 - * 将自定义文本中的{?requestid}替换成requestid 以及将 ? 替换成选择的流程字段对应的值 + * 将自定义文本中的{?requestid}替换成requestid 以及将 {?} 替换成选择的流程字段对应的值 *

*/ private Object normalValueDeal(Map mainMap, Map detailMap, MappingDetail mappingDetail) { @@ -580,7 +580,7 @@ public class DealWithMapping extends ToolUtil { } value = Util.null2String(valueContext) .replace("{?requestid}", String.valueOf(mainMap.get("requestid"))) - .replace("?", workFlowVal); + .replace("{?}", workFlowVal); } break; // 当前时间 @@ -781,6 +781,9 @@ public class DealWithMapping extends ToolUtil { value = Boolean.valueOf(String.valueOf(value)); } break; + case Object:{ + // 当是object类型时不转换 保留原有格式 + }break; default: return value; } @@ -799,7 +802,7 @@ public class DealWithMapping extends ToolUtil { *

代码版本改动说明:

*

* v2.0 xuanran.wang 转换类型是默认值时增加替换规则 - * 将自定义文本中的{?requestid}替换成requestid 以及将 ? 替换成选择的流程字段对应的值 + * 将自定义文本中的{?requestid}替换成requestid 以及将 {?} 替换成选择的流程字段对应的值 *

*/ private Object normalValueDeal(Map mainMap, Map detailMap, RecordSet relationRs, MappingDetail mappingDetail) { @@ -849,7 +852,7 @@ public class DealWithMapping extends ToolUtil { } value = Util.null2String(valueContext) .replace("{?requestid}", String.valueOf(mainMap.get("requestid"))) - .replace("?", workFlowVal); + .replace("{?}", workFlowVal); } break; // 当前时间 @@ -1065,6 +1068,9 @@ public class DealWithMapping extends ToolUtil { value = Boolean.valueOf(String.valueOf(value)); } break; + case Object:{ + // 当是object类型时不转换 保留原有格式 + }break; default: return value; } diff --git a/src/main/java/weaver/xuanran/wang/schroeder/cus_field_value/PushSealTaskSealValue.java b/src/main/java/weaver/xuanran/wang/schroeder/cus_field_value/PushSealTaskSealValue.java index 96a484f..671e490 100644 --- a/src/main/java/weaver/xuanran/wang/schroeder/cus_field_value/PushSealTaskSealValue.java +++ b/src/main/java/weaver/xuanran/wang/schroeder/cus_field_value/PushSealTaskSealValue.java @@ -66,6 +66,6 @@ public class PushSealTaskSealValue implements CusInterfaceGetValue { } public boolean checkBlank(String ... args){ - return Arrays.stream(args).noneMatch(StringUtils::isBlank); + return Arrays.stream(args).anyMatch(StringUtils::isBlank); } } diff --git a/src/test/java/xuanran/wang/saic_travel/model_data_async/AsyncTest.java b/src/test/java/xuanran/wang/saic_travel/model_data_async/AsyncTest.java index e0d18ce..fe7657e 100644 --- a/src/test/java/xuanran/wang/saic_travel/model_data_async/AsyncTest.java +++ b/src/test/java/xuanran/wang/saic_travel/model_data_async/AsyncTest.java @@ -50,5 +50,15 @@ public class AsyncTest extends BaseTest { log.info("触发成功 : " + JSONObject.toJSONString(list)); } + @Test + public void testNotNull(){ + String str = "jssjhgdkjs?docId={?}&{$requestid}"; + System.out.println(str.replace("{?}", "123") + .replace("{$requestid}", "12194283")); + } + + public boolean checkNull(String ... args){ + return Arrays.stream(args).anyMatch(StringUtils::isBlank); + } }