Commit f16a348b authored by taabe's avatar taabe

修改接警情况列表排序

parent 0dca5d82
......@@ -186,6 +186,16 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
}
}
private static int comparingByGroupVal(Map<String, Object> map, Map<String, Object> map2, String key) {
int result = 0;
if (map.get(key) instanceof Date) {
long r1 = ((Date) map.get(key)).getTime();
long r2 = ((Date) map2.get(key)).getTime();
result = Long.compare(r1, r2);
}
return result;
}
/**
* 根据时间区间查询警情列表信息
*
......@@ -197,7 +207,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
List<AlertCalled> alertCalledList =
this.list(new LambdaQueryWrapper<AlertCalled>().apply(!ValidationUtil.isEmpty(beginDate),
"call_time >= '" + beginDate + "'").le(true, AlertCalled::getCallTime, endDate));
"call_time >= '" + beginDate + "'").le(true, AlertCalled::getCallTime, endDate));
Map<String, String> queryParams = Maps.newHashMap();
queryParams.put("beginDate", beginDate);
queryParams.put("endDate", endDate);
......@@ -216,6 +226,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
i.putAll(Bean.BeantoMap(alertCalled));
});
}
// 按接警时间正序排序
allList.sort((e, o) -> comparingByGroupVal(e, o, "callTime"));
return allList;
}
......
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