参数类型枚举类增加object类型以及生成json类中对参数类型转换逻辑增加object判断

dev
wangxuanran 2022-12-06 17:43:44 +08:00
parent e53858e7c6
commit e83d55c455
6 changed files with 30 additions and 15 deletions

1
.gitignore vendored
View File

@ -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.

View File

@ -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>

View File

@ -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);

View File

@ -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;
} }

View File

@ -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);
} }
} }

View File

@ -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);
}
} }