文档拆分-bug59381: 解决加载过长问题

This commit is contained in:
liyawei
2022-09-09 10:24:39 +08:00
parent 764afaa978
commit 4cd045abad
@@ -3550,7 +3550,20 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
// List records = infoPage.getRecords();
List records = bussDocumentLibraryEOMapper.ocrPageInfo(field, conditionSb.toString());
page.setTotal(records.size());
records = records.subList(pageNo * pageSize - pageSize, pageNo * pageSize);
int subSize = pageSize; // 每页记录数
int subCount = records.size(); // 总记录数
int subPageTotal = (subCount / subSize) + ((subCount % subSize > 0) ? 1 : 0); //总页数
// 分页计算
int fromIndex = (pageNo-1) * subSize;
int toIndex = ((pageNo == subPageTotal) ? subCount : (pageNo * subSize));
if( fromIndex <= subCount && toIndex <= subCount) {
records = records.subList(fromIndex, toIndex);
} else {
records = new ArrayList();
}
//数据字典
List<SysDictItem> sysDictItems = sysDictItemServiceImpl.selectItemsAll();