提交 0754dc4a 编写于 作者: xignzi's avatar xignzi

fix:BaseFilter中直接.eq .in方法缺失参数

上级 f3802cb6
......@@ -28,7 +28,9 @@ import org.springframework.data.domain.Sort;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import java.lang.reflect.Field;
import java.util.*;
import java.util.stream.Collectors;
@Getter
@Setter
......@@ -206,6 +208,28 @@ public class BaseFilter<T> extends BaseData implements ISearchContextDTO {
this.getSearchCondsIf().add(searchFieldCond);
}
String fieldRealName = FieldCache.getFieldRealName(BaseFilter.class, strParamName);
if (StringUtils.isEmpty(fieldRealName) && (!this.getClass().isAssignableFrom(BaseFilter.class))) {
fieldRealName = FieldCache.getFieldRealName(this.getClass(), strParamName);
}
if (!StringUtils.isEmpty(fieldRealName)) {
try {
Field field = this.getClass().getDeclaredField(fieldRealName);
field.setAccessible(true);
if (objValue instanceof Collection) {
Collection collection = (Collection) objValue;
Object joinObject = collection.stream().collect(Collectors.joining(","));
field.set(this, joinObject != null ? String.valueOf(joinObject) : joinObject);
}else {
field.set(this, objValue);
}
} catch (NoSuchFieldException e) {
} catch (IllegalAccessException e) {
}
}
return this;
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册