Skip to content

Commit

Permalink
#695 Auto fill filter
Browse files Browse the repository at this point in the history
#695 Auto fill filter
  • Loading branch information
xuxuzhesi committed Feb 28, 2020
1 parent 38b43d2 commit ab2ca8b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
14 changes: 13 additions & 1 deletion cmdb-core/src/main/java/com/webank/cmdb/dto/Filter.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,13 @@ private String queryValueByRule(String rootGuid, AdmCiTypeAttr attrWithGuid, Obj
if (AutoFillType.Rule.getCode().equals(item.getType())) {
try {
List<AutoFillIntegrationQueryDto> 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<String> targetValues = getValueFromResponse(response, routines);
if(isPreviousExpressionValue && targetValues.isEmpty()) {
Expand Down

0 comments on commit ab2ca8b

Please sign in to comment.