List<TerminalStoreRepeatDto> pageNewData=new ArrayList<>();
int currIdx = (page.getPageNumber() > 0 ? page.getPageNumber() * page.getPageSize() : 0);
for (int i = 0; i < page.getPageSize() && i < terminalStoreRepeatDtoList.size() - currIdx; i++) {
TerminalStoreRepeatDto terminalStoreRepeatDto = terminalStoreRepeatDtoList.get(currIdx + i);
pageNewData.add(terminalStoreRepeatDto);
}
PageImpl<TerminalStoreRepeatDto> pageData = new PageImpl<TerminalStoreRepeatDto>(pageNewData,page,terminalStoreRepeatDtoList.size());
转载于:https://www.cnblogs.com/Logan626/p/10039956.html