diff --git a/cmdb-core/src/main/java/com/webank/cmdb/dto/Filter.java b/cmdb-core/src/main/java/com/webank/cmdb/dto/Filter.java index f7aaa12f3..0cf08ebaa 100755 --- a/cmdb-core/src/main/java/com/webank/cmdb/dto/Filter.java +++ b/cmdb-core/src/main/java/com/webank/cmdb/dto/Filter.java @@ -10,13 +10,17 @@ public class Filter { @NotNull private Object value = null; + private Object type = null; + + public Filter() { } - public Filter(String name, String operator, Object value) { + public Filter(String name, String operator, Object value,String... type) { this.name = name; this.operator = operator; this.value = value; + this.type = type; } public String getName() { @@ -42,4 +46,12 @@ public Object getValue() { public void setValue(Object value) { this.value = value; } + + public Object getType() { + return type; + } + + public void setType(Object type) { + this.type = type; + } } diff --git a/cmdb-core/src/main/java/com/webank/cmdb/service/interceptor/CiDataInterceptorService.java b/cmdb-core/src/main/java/com/webank/cmdb/service/interceptor/CiDataInterceptorService.java index 0d90b6492..f81a4699e 100755 --- a/cmdb-core/src/main/java/com/webank/cmdb/service/interceptor/CiDataInterceptorService.java +++ b/cmdb-core/src/main/java/com/webank/cmdb/service/interceptor/CiDataInterceptorService.java @@ -418,6 +418,13 @@ private String queryValueByRule(String rootGuid, AdmCiTypeAttr attrWithGuid, Obj if (AutoFillType.Rule.getCode().equals(item.getType())) { try { List routines = JsonUtil.toList(item.getValue(), AutoFillIntegrationQueryDto.class); + routines.forEach(routine -> { + routine.getFilters().forEach(filter -> { + if ("autoFill".equals(filter.getType())){ + filter.setValue(queryValueByRule(rootGuid,attrWithGuid,filter.getValue(),sb)); + } + }); + }); QueryResponse response = queryIntegrateWithRoutines(rootGuid, attrWithGuid, routines); List targetValues = getValueFromResponse(response, routines); if(isPreviousExpressionValue && targetValues.isEmpty()) {