提交 2c25db9b authored 作者: 朱旭欣's avatar 朱旭欣

第五次提交

上级 0098e95e
...@@ -81,7 +81,7 @@ public class WeeklyFileServiceImpl implements WeeklyFileService { ...@@ -81,7 +81,7 @@ public class WeeklyFileServiceImpl implements WeeklyFileService {
@Override @Override
public Page<WeeklyUser> findAllWeekly(WeeklyCondition weeklyCondition) { public Page<WeeklyUser> findAllWeekly(WeeklyCondition weeklyCondition) {
//根据传入的数据,进行分页数据查询 //根据传入的数据,进行分页数据查询
Pageable of1 = PageRequest.of(weeklyCondition.getPage(), weeklyCondition.getPageSize()); Pageable of1 = PageRequest.of(weeklyCondition.getPage()-1, weeklyCondition.getPageSize());
Map<String, WeeklyUser> userMap = weeklyUserDao.findAll().stream().collect(Collectors.toMap(WeeklyUser::getUserName, Function.identity())); Map<String, WeeklyUser> userMap = weeklyUserDao.findAll().stream().collect(Collectors.toMap(WeeklyUser::getUserName, Function.identity()));
List<String> userNames = new ArrayList<>(userMap.keySet()); List<String> userNames = new ArrayList<>(userMap.keySet());
//动态查询构造器 //动态查询构造器
...@@ -133,7 +133,8 @@ public class WeeklyFileServiceImpl implements WeeklyFileService { ...@@ -133,7 +133,8 @@ public class WeeklyFileServiceImpl implements WeeklyFileService {
} }
} }
//做物理分页 //做物理分页
Page<WeeklyUser> perPage = PageUtil.getPerPage(of1.getPageNumber() - 1, of1.getPageSize(), userList1, of1); Page<WeeklyUser> perPage = PageUtil.getPerPage(of1.getPageNumber(), of1.getPageSize(), userList1, of1);
long totalElements = perPage.getTotalElements();
return perPage; return perPage;
} }
......
...@@ -10,8 +10,8 @@ spring.jpa.hibernate.ddl-auto=update ...@@ -10,8 +10,8 @@ spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true spring.jpa.properties.hibernate.format_sql=true
#file.path=/root/projects/weekly/download/ty-weekly.zip file.path=/root/projects/weekly/download/ty-weekly.zip
file.path=C:/Intel/ty-weekly.zip #file.path=C:/Intel/ty-weekly.zip
#
file.path1=C:/Intel/ #file.path1=C:/Intel/
#file.path1=/root/projects/weekly/save/ file.path1=/root/projects/weekly/save/
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论