|
|
@@ -50,28 +50,18 @@ public class ProjectController {
|
|
|
*/
|
|
|
@RequestMapping("/getProjects")
|
|
|
@ResponseBody
|
|
|
- public Page<Project> findAll(@RequestParam(value = "page",defaultValue = "0")Integer page,
|
|
|
- @RequestParam(value = "size",defaultValue = "7")Integer size){
|
|
|
- Pageable pageable=pageSort(page,size);
|
|
|
+ public Page<Project> findAll(@RequestParam(value = "page",defaultValue = "0")int page,
|
|
|
+ @RequestParam(value = "size",defaultValue = "7")int size){
|
|
|
+ Pageable pageable=new PageRequest(page,size);
|
|
|
return projectService.findAll(pageable);
|
|
|
}
|
|
|
|
|
|
- /*审核状态正序,时间倒序排序的方式*/
|
|
|
- private Pageable pageSort(Integer page,Integer size){
|
|
|
- Sort.Order timeSort=new Sort.Order(Sort.Direction.DESC,"startTime");
|
|
|
- List<Sort.Order> list=new ArrayList<Sort.Order>();
|
|
|
- list.add(timeSort);
|
|
|
- Sort sort = new Sort(list);
|
|
|
- Pageable pageable=new PageRequest(page,size,sort);
|
|
|
- return pageable;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 根据项目状态获取列表
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@RequestMapping("/status")
|
|
|
- public Page<Project> findProjects(String status,Integer page ,Integer size){
|
|
|
+ public Page<Project> findProjects(String status,int page ,int size){
|
|
|
Pageable pageable=new PageRequest(page,size);
|
|
|
if(status=="进行中"){
|
|
|
Page<Project> projects= projectService.findInProcess(pageable);
|
|
|
@@ -86,9 +76,9 @@ public class ProjectController {
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@RequestMapping("/inprocess")
|
|
|
- public Page<Project> findInProcess(@RequestParam(value = "page",defaultValue = "0")Integer page,
|
|
|
- @RequestParam(value = "size",defaultValue = "7")Integer size){
|
|
|
- Pageable pageable=pageSort(page,size);
|
|
|
+ public Page<Project> findInProcess(@RequestParam(value = "page",defaultValue = "0")int page,
|
|
|
+ @RequestParam(value = "size",defaultValue = "7")int size){
|
|
|
+ Pageable pageable=new PageRequest(page,size);
|
|
|
return projectService.findInProcess(pageable);
|
|
|
}
|
|
|
|
|
|
@@ -100,9 +90,9 @@ public class ProjectController {
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@RequestMapping("/endproject")
|
|
|
- public Page<Project> findEndProject(@RequestParam(value = "page",defaultValue = "0")Integer page,
|
|
|
- @RequestParam(value = "size",defaultValue = "7")Integer size){
|
|
|
- Pageable pageable=pageSort(page,size);
|
|
|
+ public Page<Project> findEndProject(@RequestParam(value = "page",defaultValue = "0")int page,
|
|
|
+ @RequestParam(value = "size",defaultValue = "7")int size){
|
|
|
+ Pageable pageable=new PageRequest(page,size);
|
|
|
return projectService.findEndProject(pageable);
|
|
|
}
|
|
|
|
|
|
@@ -122,7 +112,7 @@ public class ProjectController {
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@RequestMapping("/pageArea")
|
|
|
- public Page<Project> findPageArea(String area,Integer page,Integer size){
|
|
|
+ public Page<Project> findPageArea(String area,int page,int size){
|
|
|
Pageable pageable=new PageRequest(page,size);
|
|
|
return projectService.findPageArea(area,pageable);
|
|
|
}
|