|
|
@@ -153,40 +153,39 @@ public class IndexController {
|
|
|
|
|
|
PageRequest pageable=new PageRequest(page,size);
|
|
|
|
|
|
- //得到历史参与总人数
|
|
|
- Long historyPerson = projectRecodeService.historyPerson();
|
|
|
- //得到历史参与总捐款额
|
|
|
- Double totality = projectRecodeService.totality();
|
|
|
- //得到轮播图
|
|
|
+ //得到历史参与总人数
|
|
|
+ Long historyPerson = projectRecodeService.historyPerson();
|
|
|
+ //得到历史参与总捐款额
|
|
|
+ Double totality = projectRecodeService.totality();
|
|
|
+ //得到轮播图
|
|
|
List<JSONObject> carouselList=carouselService.getCarousels(useFor);
|
|
|
- //动态获取所有领域分类
|
|
|
- List<String> areaList=projectService.allArea();
|
|
|
-
|
|
|
- //展示不同的状态列表
|
|
|
- if (!"全部".equals(status) && "全部".equals(area)) {
|
|
|
- if("进行中".equals(status)){
|
|
|
- Page<Project> projects=projectService.findInProcess(pageable);
|
|
|
- model.addAttribute("page", projects);
|
|
|
- }
|
|
|
- if("已结束".equals(status)){
|
|
|
- Page<Project> projects= projectService.findEndProject(pageable);
|
|
|
- model.addAttribute("page", projects);
|
|
|
- }
|
|
|
- } else if ("全部".equals(status) && !"全部".equals(area)) {
|
|
|
- Page<Project> projects = projectService.findPageArea(area,pageable);
|
|
|
- model.addAttribute("page", projects);
|
|
|
- } else if ("全部".equals(status) && "全部".equals(area)) {
|
|
|
- Page<Project> projects = projectService.findAll(pageable);
|
|
|
- model.addAttribute("page", projects);
|
|
|
- } else {
|
|
|
- if("进行中".equals(status)){
|
|
|
- Page<Project> projects= projectService.findInProcessArea(pageable,area);
|
|
|
- model.addAttribute("page",projects);
|
|
|
- }else if("已结束".equals(status)){
|
|
|
- Page<Project> projects= projectService.findEndProjectArea(pageable,area);
|
|
|
- model.addAttribute("page",projects);
|
|
|
- }
|
|
|
- }
|
|
|
+ //动态获取所有领域分类
|
|
|
+ List<String> areaList = projectService.allArea();
|
|
|
+ //展示不同的状态列表
|
|
|
+ if (!Status.ALL.getPhrase().equals(status) && Status.ALL.getPhrase().equals(area)) {
|
|
|
+ if (Status.LOADING.getPhrase().equals(status)) {
|
|
|
+ Page<Project> projects = projectService.findInProcess(pageable);
|
|
|
+ model.addAttribute("page", projects);
|
|
|
+ }
|
|
|
+ if (Status.END.getPhrase().equals(status)) {
|
|
|
+ Page<Project> projects = projectService.findEndProject(pageable);
|
|
|
+ model.addAttribute("page", projects);
|
|
|
+ }
|
|
|
+ } else if (Status.ALL.getPhrase().equals(status) && !Status.ALL.getPhrase().equals(area)) {
|
|
|
+ Page<Project> projects = projectService.findPageArea(area, pageable);
|
|
|
+ model.addAttribute("page", projects);
|
|
|
+ } else if (Status.ALL.getPhrase().equals(status) && Status.ALL.getPhrase().equals(area)) {
|
|
|
+ Page<Project> projects = projectService.findAll(pageable);
|
|
|
+ model.addAttribute("page", projects);
|
|
|
+ } else {
|
|
|
+ if (Status.ALL.getPhrase().equals(status)) {
|
|
|
+ Page<Project> projects = projectService.findInProcessArea(pageable, area);
|
|
|
+ model.addAttribute("page", projects);
|
|
|
+ } else if (Status.END.getPhrase().equals(status)) {
|
|
|
+ Page<Project> projects = projectService.findEndProjectArea(pageable, area);
|
|
|
+ model.addAttribute("page", projects);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
if(!"".equals(search)){
|
|
|
Page<Project> projects=projectService.searchPage(pageable,search);
|