修复兼容接口查询通道列表查询

This commit is contained in:
648540858
2021-12-28 09:33:25 +08:00
parent a4c93cf613
commit 7241e0d2d2
5 changed files with 29 additions and 6 deletions

View File

@@ -110,14 +110,14 @@ public class ApiDeviceController {
return result;
}
List<DeviceChannel> deviceChannels;
List<DeviceChannel> allDeviceChannelList = storager.queryChannelsByDeviceId(serial);
if (start == null || limit ==null) {
deviceChannels = storager.queryChannelsByDeviceId(serial);
deviceChannels = allDeviceChannelList;
result.put("ChannelCount", deviceChannels.size());
}else {
start ++;
PageInfo pageResult = storager.queryChannelsByDeviceId(serial, null, null, null,start, limit);
result.put("ChannelCount", pageResult.getList().size());
deviceChannels = pageResult.getList();
deviceChannels = storager.queryChannelsByDeviceIdWithStartAndLimit(serial, null, null, null,start, limit);
int total = allDeviceChannelList.size();
result.put("ChannelCount", total);
}
JSONArray channleJSONList = new JSONArray();