参数类型枚举类增加object类型以及生成json类中对参数类型转换逻辑增加object判断
parent
e53858e7c6
commit
e83d55c455
|
@ -18,6 +18,7 @@ log
|
||||||
.idea/
|
.idea/
|
||||||
#.gitignore
|
#.gitignore
|
||||||
!.gitignore
|
!.gitignore
|
||||||
|
*.iml
|
||||||
# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
|
# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
|
||||||
# should NOT be excluded as they contain compiler settings and other important
|
# should NOT be excluded as they contain compiler settings and other important
|
||||||
# information for Eclipse / Flash Builder.
|
# information for Eclipse / Flash Builder.
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module version="4">
|
|
||||||
<component name="NewModuleRootManager">
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
|
|
||||||
</content>
|
|
||||||
</component>
|
|
||||||
</module>
|
|
|
@ -5,10 +5,15 @@ import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* <h1>参数类型枚举类</h1>
|
||||||
* @author XiaoBokang
|
* @author XiaoBokang
|
||||||
* @create 2022/6/14 12:56
|
* @create 2022/6/14 12:56
|
||||||
|
* <h1>版本改动说明 : </h1>
|
||||||
|
* <p>
|
||||||
|
* v2.0 xuanran.wang 2022-12-06
|
||||||
|
* 增加Object类型的枚举 字段值来自于自定义接口时可以选此选项 保留自定义接口返回参数类型
|
||||||
|
* </p>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public enum ParamTypeEnum {
|
public enum ParamTypeEnum {
|
||||||
|
|
||||||
STRING("0"),
|
STRING("0"),
|
||||||
|
@ -21,7 +26,8 @@ public enum ParamTypeEnum {
|
||||||
CUS_DATE_STR("7"),
|
CUS_DATE_STR("7"),
|
||||||
TIME_STAMP("8"),
|
TIME_STAMP("8"),
|
||||||
DATE_VAL("9"),
|
DATE_VAL("9"),
|
||||||
Boolean("10");
|
Boolean("10"),
|
||||||
|
Object("11");
|
||||||
|
|
||||||
|
|
||||||
private static final Map<String, ParamTypeEnum> LOOK_UP = new HashMap<>(8);
|
private static final Map<String, ParamTypeEnum> LOOK_UP = new HashMap<>(8);
|
||||||
|
|
|
@ -541,7 +541,7 @@ public class DealWithMapping extends ToolUtil {
|
||||||
* <h1>代码版本改动说明:</h1>
|
* <h1>代码版本改动说明:</h1>
|
||||||
* <p>
|
* <p>
|
||||||
* v2.0 xuanran.wang 转换类型是默认值时增加替换规则
|
* v2.0 xuanran.wang 转换类型是默认值时增加替换规则
|
||||||
* 将自定义文本中的{?requestid}替换成requestid 以及将 ? 替换成选择的流程字段对应的值
|
* 将自定义文本中的{?requestid}替换成requestid 以及将 {?} 替换成选择的流程字段对应的值
|
||||||
* <p>
|
* <p>
|
||||||
*/
|
*/
|
||||||
private Object normalValueDeal(Map<String, Object> mainMap, Map<String, Object> detailMap, MappingDetail mappingDetail) {
|
private Object normalValueDeal(Map<String, Object> mainMap, Map<String, Object> detailMap, MappingDetail mappingDetail) {
|
||||||
|
@ -580,7 +580,7 @@ public class DealWithMapping extends ToolUtil {
|
||||||
}
|
}
|
||||||
value = Util.null2String(valueContext)
|
value = Util.null2String(valueContext)
|
||||||
.replace("{?requestid}", String.valueOf(mainMap.get("requestid")))
|
.replace("{?requestid}", String.valueOf(mainMap.get("requestid")))
|
||||||
.replace("?", workFlowVal);
|
.replace("{?}", workFlowVal);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
// 当前时间
|
// 当前时间
|
||||||
|
@ -781,6 +781,9 @@ public class DealWithMapping extends ToolUtil {
|
||||||
value = Boolean.valueOf(String.valueOf(value));
|
value = Boolean.valueOf(String.valueOf(value));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case Object:{
|
||||||
|
// 当是object类型时不转换 保留原有格式
|
||||||
|
}break;
|
||||||
default:
|
default:
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
@ -799,7 +802,7 @@ public class DealWithMapping extends ToolUtil {
|
||||||
* <h1>代码版本改动说明:</h1>
|
* <h1>代码版本改动说明:</h1>
|
||||||
* <p>
|
* <p>
|
||||||
* v2.0 xuanran.wang 转换类型是默认值时增加替换规则
|
* v2.0 xuanran.wang 转换类型是默认值时增加替换规则
|
||||||
* 将自定义文本中的{?requestid}替换成requestid 以及将 ? 替换成选择的流程字段对应的值
|
* 将自定义文本中的{?requestid}替换成requestid 以及将 {?} 替换成选择的流程字段对应的值
|
||||||
* <p>
|
* <p>
|
||||||
*/
|
*/
|
||||||
private Object normalValueDeal(Map<String, Object> mainMap, Map<String, Object> detailMap, RecordSet relationRs, MappingDetail mappingDetail) {
|
private Object normalValueDeal(Map<String, Object> mainMap, Map<String, Object> detailMap, RecordSet relationRs, MappingDetail mappingDetail) {
|
||||||
|
@ -849,7 +852,7 @@ public class DealWithMapping extends ToolUtil {
|
||||||
}
|
}
|
||||||
value = Util.null2String(valueContext)
|
value = Util.null2String(valueContext)
|
||||||
.replace("{?requestid}", String.valueOf(mainMap.get("requestid")))
|
.replace("{?requestid}", String.valueOf(mainMap.get("requestid")))
|
||||||
.replace("?", workFlowVal);
|
.replace("{?}", workFlowVal);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
// 当前时间
|
// 当前时间
|
||||||
|
@ -1065,6 +1068,9 @@ public class DealWithMapping extends ToolUtil {
|
||||||
value = Boolean.valueOf(String.valueOf(value));
|
value = Boolean.valueOf(String.valueOf(value));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case Object:{
|
||||||
|
// 当是object类型时不转换 保留原有格式
|
||||||
|
}break;
|
||||||
default:
|
default:
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,6 +66,6 @@ public class PushSealTaskSealValue implements CusInterfaceGetValue {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean checkBlank(String ... args){
|
public boolean checkBlank(String ... args){
|
||||||
return Arrays.stream(args).noneMatch(StringUtils::isBlank);
|
return Arrays.stream(args).anyMatch(StringUtils::isBlank);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,5 +50,15 @@ public class AsyncTest extends BaseTest {
|
||||||
log.info("触发成功 : " + JSONObject.toJSONString(list));
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue