From ba8c7d34848d5b52bfb06114de0458c48e9ae019 Mon Sep 17 00:00:00 2001 From: linbangquan <1437892690@qq.com> Date: Tue, 5 Dec 2023 19:12:13 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E7=BB=84=E5=90=88?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E9=98=B6=E6=AE=B5=E5=B7=A5=E5=85=B7=E7=9A=84?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=98=A0=E5=B0=84=E4=B8=8D=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E6=97=B6=E5=BC=82=E5=B8=B8=E6=8F=90=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1039907433185280]组合工具阶段工具的参数映射不正确时异常提示优化 http://192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/939050947543042/1039907433185280/939050947543057/1038938892894208 --- .../service/AutoexecCombopServiceImpl.java | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/main/java/neatlogic/module/autoexec/service/AutoexecCombopServiceImpl.java b/src/main/java/neatlogic/module/autoexec/service/AutoexecCombopServiceImpl.java index 9abe6201..aeb36b0f 100644 --- a/src/main/java/neatlogic/module/autoexec/service/AutoexecCombopServiceImpl.java +++ b/src/main/java/neatlogic/module/autoexec/service/AutoexecCombopServiceImpl.java @@ -602,30 +602,31 @@ public class AutoexecCombopServiceImpl implements AutoexecCombopService, IAutoex String key = paramMappingVo.getKey(); AutoexecParamVo inputParamVo = inputParamMap.remove(key); if (inputParamVo == null) { - throw new AutoexecParamNotFoundException(phaseName, operationName, key); + continue; } + String inputParamLabel = inputParamVo.getName() + "(" + key + ")"; String mappingMode = paramMappingVo.getMappingMode(); if (Objects.equals(mappingMode, ParamMappingMode.IS_EMPTY.getValue())) { if (Objects.equals(inputParamVo.getIsRequired(), 1)) { - throw new AutoexecParamCannotBeEmptyException(phaseName, operationName, key); + throw new AutoexecParamCannotBeEmptyException(phaseName, operationName, inputParamLabel); } continue; } Object valueObj = paramMappingVo.getValue(); if (Objects.equals(mappingMode, ParamMappingMode.CONSTANT.getValue())) { if (valueObj == null) { - throw new AutoexecParamCannotBeEmptyException(phaseName, operationName, key); + throw new AutoexecParamCannotBeEmptyException(phaseName, operationName, inputParamLabel); } else if (valueObj instanceof String) { if (StringUtils.isBlank((String) valueObj)) { - throw new AutoexecParamCannotBeEmptyException(phaseName, operationName, key); + throw new AutoexecParamCannotBeEmptyException(phaseName, operationName, inputParamLabel); } } else if (valueObj instanceof JSONArray) { if (CollectionUtils.isEmpty((JSONArray) valueObj)) { - throw new AutoexecParamCannotBeEmptyException(phaseName, operationName, key); + throw new AutoexecParamCannotBeEmptyException(phaseName, operationName, inputParamLabel); } } else if (valueObj instanceof JSONObject) { if (MapUtils.isEmpty((JSONObject) valueObj)) { - throw new AutoexecParamCannotBeEmptyException(phaseName, operationName, key); + throw new AutoexecParamCannotBeEmptyException(phaseName, operationName, inputParamLabel); } } // 文本类型参数值校验 @@ -649,7 +650,7 @@ public class AutoexecCombopServiceImpl implements AutoexecCombopService, IAutoex } AutoexecParamVo preNodeOutputParamVo = preNodeOutputParamMap.get(value); if (preNodeOutputParamVo == null) { - throw new AutoexecParamMappingTargetNotFoundException(phaseName, operationName, key, conversionPreNodeParamPath(preNodeNameMap, preOperationNameMap, value)); + throw new AutoexecParamMappingTargetNotFoundException(phaseName, operationName, inputParamLabel, conversionPreNodeParamPath(preNodeNameMap, preOperationNameMap, value)); } if (Objects.equals(preNodeOutputParamVo.getType(), inputParamVo.getType())) { continue; @@ -660,7 +661,7 @@ public class AutoexecCombopServiceImpl implements AutoexecCombopService, IAutoex continue; } } - throw new AutoexecParamMappingTargetTypeMismatchException(phaseName, operationName, key, conversionPreNodeParamPath(preNodeNameMap, preOperationNameMap, value)); + throw new AutoexecParamMappingTargetTypeMismatchException(phaseName, operationName, inputParamLabel, conversionPreNodeParamPath(preNodeNameMap, preOperationNameMap, value)); } else if (Objects.equals(mappingMode, ParamMappingMode.PRE_NODE_OUTPUT_PARAM_KEY.getValue())) { String value = null; if (valueObj instanceof JSONArray) { @@ -675,19 +676,19 @@ public class AutoexecCombopServiceImpl implements AutoexecCombopService, IAutoex } AutoexecParamVo preNodeOutputParamVo = preNodeOutputParamMap.get(value); if (preNodeOutputParamVo == null) { - throw new AutoexecParamMappingTargetNotFoundException(phaseName, operationName, key, conversionPreNodeParamPath(preNodeNameMap, preOperationNameMap, value)); + throw new AutoexecParamMappingTargetNotFoundException(phaseName, operationName, inputParamLabel, conversionPreNodeParamPath(preNodeNameMap, preOperationNameMap, value)); } continue; } String value = valueObj.toString(); if (StringUtils.isEmpty(value)) { - throw new AutoexecParamMappingNotMappedException(phaseName, operationName, key); + throw new AutoexecParamMappingNotMappedException(phaseName, operationName, inputParamLabel); } if (Objects.equals(mappingMode, ParamMappingMode.RUNTIME_PARAM.getValue())) { AutoexecParamVo runtimeParamVo = runtimeParamMap.get(value); if (runtimeParamVo == null) { - throw new AutoexecParamMappingTargetNotFoundException(phaseName, operationName, key, value); + throw new AutoexecParamMappingTargetNotFoundException(phaseName, operationName, inputParamLabel, value); } if (Objects.equals(runtimeParamVo.getType(), inputParamVo.getType())) { continue; @@ -706,19 +707,19 @@ public class AutoexecCombopServiceImpl implements AutoexecCombopService, IAutoex continue; } } - throw new AutoexecParamMappingTargetTypeMismatchException(phaseName, operationName, key, value); + throw new AutoexecParamMappingTargetTypeMismatchException(phaseName, operationName, inputParamLabel, value); } else if (Objects.equals(mappingMode, ParamMappingMode.PROFILE.getValue())) { AutoexecProfileParamVo profileParamVo = profileParamMap.get(key); if (profileParamVo == null) { - throw new AutoexecParamMappingTargetNotFoundException(phaseName, operationName, key, key); + throw new AutoexecParamMappingTargetNotFoundException(phaseName, operationName, inputParamLabel, profileParamVo.getName() + "(" + profileParamVo.getKey() + ")"); } if (!Objects.equals(profileParamVo.getType(), inputParamVo.getType())) { - throw new AutoexecParamMappingTargetTypeMismatchException(phaseName, operationName, key, key); + throw new AutoexecParamMappingTargetTypeMismatchException(phaseName, operationName, inputParamLabel, profileParamVo.getName() + "(" + profileParamVo.getKey() + ")"); } } else if (Objects.equals(mappingMode, ParamMappingMode.GLOBAL_PARAM.getValue())) { AutoexecGlobalParamVo globalParamVo = autoexecGlobalParamMapper.getGlobalParamByKey(value); if (globalParamVo == null) { - throw new AutoexecParamMappingTargetNotFoundException(phaseName, operationName, key, value); + throw new AutoexecParamMappingTargetNotFoundException(phaseName, operationName, inputParamLabel, value); } if (Objects.equals(globalParamVo.getType(), inputParamVo.getType())) { continue; @@ -737,9 +738,9 @@ public class AutoexecCombopServiceImpl implements AutoexecCombopService, IAutoex continue; } } - throw new AutoexecParamMappingTargetTypeMismatchException(phaseName, operationName, key, value); + throw new AutoexecParamMappingTargetTypeMismatchException(phaseName, operationName, inputParamLabel, value); } else { - throw new AutoexecParamMappingIncorrectException(phaseName, operationName, key); + throw new AutoexecParamMappingIncorrectException(phaseName, operationName, inputParamLabel); } } } -- Gitee