|
|
@@ -1,9 +1,11 @@
|
|
|
package com.uas.service.donate.controller;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.uas.service.donate.model.Activity;
|
|
|
import com.uas.service.donate.model.Award;
|
|
|
import com.uas.service.donate.service.ActivityService;
|
|
|
import com.uas.service.donate.service.AwardService;
|
|
|
+import com.uas.service.donate.service.CarouselService;
|
|
|
import com.uas.service.donate.service.ProjectRecodeService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
@@ -30,6 +32,9 @@ public class ActiveCenterController {
|
|
|
@Autowired
|
|
|
private AwardService awardService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CarouselService carouselService;
|
|
|
+
|
|
|
/**
|
|
|
* 返回一元捐活动列表freemarker页面
|
|
|
* @param modelMap
|
|
|
@@ -44,13 +49,16 @@ public class ActiveCenterController {
|
|
|
@RequestParam(value = "status", defaultValue = "全部") String status,
|
|
|
@RequestParam(value = "search", required = false) String search,
|
|
|
@RequestParam(value = "page", defaultValue = "0") int page,
|
|
|
- @RequestParam(value = "size", defaultValue = "7") int size) {
|
|
|
+ @RequestParam(value = "size", defaultValue = "7") int size,
|
|
|
+ @RequestParam(value = "useFor",defaultValue ="donate")String useFor) {
|
|
|
//得到历史参与总人数
|
|
|
Long historyPerson = projectRecodeService.historyPerson();
|
|
|
//得到历史参与总捐款额
|
|
|
Double totality = projectRecodeService.totality();
|
|
|
|
|
|
PageRequest pageable = new PageRequest(page, size);
|
|
|
+ //得到轮播图
|
|
|
+ List<JSONObject> carouselList=carouselService.getCarousels(useFor);
|
|
|
|
|
|
//根据活动状态查询出所有活动
|
|
|
if ("进行中".equals(status)) {
|
|
|
@@ -80,7 +88,7 @@ public class ActiveCenterController {
|
|
|
activity.setAwards(awardList);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ modelMap.put("carouselList",carouselList);
|
|
|
modelMap.put("historyPerson", historyPerson);
|
|
|
modelMap.put("totality", totality);
|
|
|
return "activeCenter";
|