Commit ef961c64 by wang_jiaxing

同火车去重

parent 30d8f274
...@@ -1636,7 +1636,7 @@ public class GjServiceImpl implements GjService { ...@@ -1636,7 +1636,7 @@ public class GjServiceImpl implements GjService {
"people_trail01 where _type= " + "people_trail01 where _type= " +
"'hcdpall' and " + "'hcdpall' and " +
"DD = '" + obj.get("DD") + "' AND KSSJ >= '" + "DD = '" + obj.get("DD") + "' AND KSSJ >= '" +
obj.get("KSSJ")+"' AND KSSJ <= '" +obj.get("KSSJ")+" ' limit 0,1000"; obj.get("KSSJ")+"' AND KSSJ <= '" +obj.get("KSSJ")+" 'order by KSSJ desc, DD desc, ZJHM desc, JLRKSJ desc limit 0,1000";
String wbDdMap = EsUtils.newQueryEss(request, newSql); String wbDdMap = EsUtils.newQueryEss(request, newSql);
JSONObject object = JSONObject.parseObject(wbDdMap); JSONObject object = JSONObject.parseObject(wbDdMap);
JSONArray jsonArray = object.getJSONArray("data"); JSONArray jsonArray = object.getJSONArray("data");
...@@ -1644,6 +1644,18 @@ public class GjServiceImpl implements GjService { ...@@ -1644,6 +1644,18 @@ public class GjServiceImpl implements GjService {
for (int j = 0; j < jsonArray.size(); j++) { for (int j = 0; j < jsonArray.size(); j++) {
JSONObject arrayJSONObject = jsonArray.getJSONObject(j); JSONObject arrayJSONObject = jsonArray.getJSONObject(j);
if (!arrayJSONObject.getString("ZJHM").equals(zjhm)) { if (!arrayJSONObject.getString("ZJHM").equals(zjhm)) {
if (j > 1) {
JSONObject lastObject = jsonArray.getJSONObject(j-1);
if (!lastObject.getString("ZJHM").equals(zjhm)) {
if (Objects.equals(lastObject.getString("KSSJ"), arrayJSONObject.getString("KSSJ"))
&& Objects.equals(lastObject.getString("DD"), arrayJSONObject.getString("DD"))
&& Objects.equals(lastObject.getString("SFD"), arrayJSONObject.getString("SFD"))
&& Objects.equals(lastObject.getString("MDD"), arrayJSONObject.getString("MDD"))
&& Objects.equals(lastObject.getString("ZJHM"), arrayJSONObject.getString("ZJHM"))) {
continue;
}
}
}
HashMap<String, Object> txry = new HashMap<>(); HashMap<String, Object> txry = new HashMap<>();
txry.put("dd", arrayJSONObject.getString("DD")); txry.put("dd", arrayJSONObject.getString("DD"));
txry.put("xb", arrayJSONObject.getString("XB")); txry.put("xb", arrayJSONObject.getString("XB"));
...@@ -1719,7 +1731,7 @@ public class GjServiceImpl implements GjService { ...@@ -1719,7 +1731,7 @@ public class GjServiceImpl implements GjService {
"people_trail01 where _type= " + "people_trail01 where _type= " +
"'hcdpall' and " + "'hcdpall' and " +
"DD = '" + obj.get("DD") + "' AND CXH = '"+obj.get("CXH")+"' AND KSSJ >= '" + "DD = '" + obj.get("DD") + "' AND CXH = '"+obj.get("CXH")+"' AND KSSJ >= '" +
obj.get("KSSJ")+"' AND KSSJ <= '" +obj.get("KSSJ")+" ' limit 0,1000"; obj.get("KSSJ")+"' AND KSSJ <= '" +obj.get("KSSJ")+" 'order by KSSJ desc, DD desc, ZJHM desc, JLRKSJ desc limit 0,1000";
String wbDdMap = EsUtils.newQueryEss(request, newSql); String wbDdMap = EsUtils.newQueryEss(request, newSql);
JSONObject object = JSONObject.parseObject(wbDdMap); JSONObject object = JSONObject.parseObject(wbDdMap);
JSONArray jsonArray = object.getJSONArray("data"); JSONArray jsonArray = object.getJSONArray("data");
...@@ -1727,6 +1739,18 @@ public class GjServiceImpl implements GjService { ...@@ -1727,6 +1739,18 @@ public class GjServiceImpl implements GjService {
for (int j = 0; j < jsonArray.size(); j++) { for (int j = 0; j < jsonArray.size(); j++) {
JSONObject arrayJSONObject = jsonArray.getJSONObject(j); JSONObject arrayJSONObject = jsonArray.getJSONObject(j);
if (!arrayJSONObject.getString("ZJHM").equals(zjhm)) { if (!arrayJSONObject.getString("ZJHM").equals(zjhm)) {
if (j > 1) {
JSONObject lastObject = jsonArray.getJSONObject(j-1);
if (!lastObject.getString("ZJHM").equals(zjhm)) {
if (Objects.equals(lastObject.getString("KSSJ"), arrayJSONObject.getString("KSSJ"))
&& Objects.equals(lastObject.getString("DD"), arrayJSONObject.getString("DD"))
&& Objects.equals(lastObject.getString("SFD"), arrayJSONObject.getString("SFD"))
&& Objects.equals(lastObject.getString("MDD"), arrayJSONObject.getString("MDD"))
&& Objects.equals(lastObject.getString("ZJHM"), arrayJSONObject.getString("ZJHM"))) {
continue;
}
}
}
HashMap<String, Object> txry = new HashMap<>(); HashMap<String, Object> txry = new HashMap<>();
txry.put("dd", arrayJSONObject.getString("DD")); txry.put("dd", arrayJSONObject.getString("DD"));
txry.put("xb", arrayJSONObject.getString("XB")); txry.put("xb", arrayJSONObject.getString("XB"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment