var parameterValue = com.alibaba.fastjson.JSON.parseObject(body, parameter.getParameterType()); var currentClass = parameter.getParameterType(); Field taskIdField = null; while (currentClass != null) { var fields = Arrays.stream(currentClass.getDeclaredFields()).collect(Collectors.toList()); var taskIdFieldWrapper = fields.stream() .filter(x -> x.getName().equals(annotation.fieldName())).findFirst(); if (taskIdFieldWrapper.isPresent()) { taskIdField = taskIdFieldWrapper.get(); break; } currentClass = currentClass.getSuperclass(); } if (taskIdField == null) { return false; } taskIdField.setAccessible(true); var taskIdValue = ReflectionUtils.getField(taskIdField, parameterValue);