|
|
@@ -290,7 +290,7 @@ public class IndexServiceImpl implements IndexService {
|
|
|
int fileIndex = 1;
|
|
|
if (startFileIndex != null) {
|
|
|
if (startFileIndex < 1) {
|
|
|
- throw new SearchException("startFileIndex需大于1");
|
|
|
+ throw new SearchException("startFileIndex不小于1");
|
|
|
} else {
|
|
|
fileIndex = startFileIndex;
|
|
|
}
|
|
|
@@ -308,6 +308,10 @@ public class IndexServiceImpl implements IndexService {
|
|
|
Page<T> pageResult = dao.findAll(pageInfo);
|
|
|
|
|
|
// 数据库中数据的总数目
|
|
|
+ if (pageResult.getTotalElements() < (fileIndex - 1) * SINGLE_FILE_MAX_SIZE) {
|
|
|
+ throw new SearchException("startFileIndex不超过"
|
|
|
+ + ((int) Math.ceil(pageResult.getTotalElements() / (1.0 * SINGLE_FILE_MAX_SIZE))));
|
|
|
+ }
|
|
|
long totalElements = pageResult.getTotalElements() - (fileIndex - 1) * SINGLE_FILE_MAX_SIZE;
|
|
|
logger.info("发现数据:" + totalElements + "条");
|
|
|
// 已翻页的数据数目
|