对通道列表查询结果排序,避免设备通道列表乱序的问题

This commit is contained in:
Lawrence 2020-10-24 15:22:48 +08:00
parent 2c70065e36
commit 009e46f7f2

View File

@ -155,6 +155,13 @@ public class VideoManagerRedisStoragerImpl implements IVideoManagerStorager {
"_" + "*";
// List<Object> deviceChannelList = redis.keys(queryStr);
List<Object> deviceChannelList = redis.scan(queryStr);
//对查询结果排序避免出现通道排列顺序乱序的情况
Collections.sort(deviceChannelList,new Comparator<Object>(){
@Override
public int compare(Object o1, Object o2) {
return o1.toString().compareToIgnoreCase(o2.toString());
}
});
pageResult.setPage(page);
pageResult.setCount(count);
pageResult.setTotal(deviceChannelList.size());