修改样本查询bug

This commit is contained in:
2022-05-19 18:39:13 +08:00
parent b4d20ca24b
commit 9ceacdf9a9
2 changed files with 13 additions and 8 deletions
@@ -67,12 +67,7 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl<Seawater> i
must.add(addTerms("district_name", alias));
must.add(addMatch("cat", "sell"));
must.add(addRange("avg_price", minPrice, maxPrice));
JSONObject term = new JSONObject();
JSONObject match = new JSONObject();
match.put("p_date", 20210501);
term.put("match", match);
must.add(term);
must.add(addRangeGte("p_date", 20210501));
bool.put("must", must);
query.put("bool", bool);
@@ -168,6 +163,16 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl<Seawater> i
return term;
}
private JSONObject addRangeGte(String name, Number min){
JSONObject term = new JSONObject();
JSONObject range = new JSONObject();
JSONObject rangeValue = new JSONObject();
rangeValue.put("gte", min);
range.put(name, rangeValue);
term.put("range", range);
return term;
}
private List<Seawater> wrapSeawater(List<JSONObject> jsonList){
List<Seawater> seawaterList= new ArrayList<Seawater>();
@@ -75,8 +75,8 @@ public class AnalyticsFilter implements Filter {
if ("1".equals(request.getParameter("__refresh_cache"))) {
threadLocalData.put(ThreadLocalKey.DisableCache, "1");
}
createUID(request, response);
createSID(request, response);
//createUID(request, response);
//createSID(request, response);
response.addHeader("Access-Control-Allow-Origin", "*");
response.addHeader("Access-Control-Allow-Methods", "*");
chain.doFilter(request, response);