Commit 9b01f7d0 by 朱海

[chg]修复空指针异常

1 parent ef0950e4
...@@ -562,9 +562,12 @@ public class PersonService { ...@@ -562,9 +562,12 @@ public class PersonService {
Date counttimeGTE = person.getCounttimeGTE(); Date counttimeGTE = person.getCounttimeGTE();
Date counttimeLTE = person.getCounttimeLTE(); Date counttimeLTE = person.getCounttimeLTE();
if (counttimeGTE != null || counttimeLTE != null) { if (counttimeGTE != null) {
// boolQuery.filter(rangeQueryBuilder); // boolQuery.filter(rangeQueryBuilder);
queries.add(QueryBuilders.range().term(s -> s.field("counttime").gte(Constant.DATE_FORMAT.get().format(counttimeGTE)).lte(Constant.DATE_FORMAT.get().format(counttimeLTE))).build()._toQuery()); queries.add(QueryBuilders.range().term(s -> s.field("counttime").gte(Constant.DATE_FORMAT.get().format(counttimeGTE))).build()._toQuery());
}
if (counttimeLTE != null) {
queries.add(QueryBuilders.range().term(s -> s.field("counttime").lte(Constant.DATE_FORMAT.get().format(counttimeLTE))).build()._toQuery());
} }
return knnQuery.filter(queries).build(); return knnQuery.filter(queries).build();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!