|
|
@@ -1,9 +1,11 @@
|
|
|
package com.jpsoft.employment.modules.base.api;
|
|
|
|
|
|
import com.github.pagehelper.Page;
|
|
|
+import com.jpsoft.employment.modules.base.dto.TasksAndProjectsDTO;
|
|
|
import com.jpsoft.employment.modules.base.entity.FeedbackMethod;
|
|
|
import com.jpsoft.employment.modules.base.entity.LoveProject;
|
|
|
import com.jpsoft.employment.modules.base.entity.ParticipateProjectInfo;
|
|
|
+import com.jpsoft.employment.modules.base.entity.WishInfoUserRecord;
|
|
|
import com.jpsoft.employment.modules.base.service.*;
|
|
|
import com.jpsoft.employment.modules.common.dto.MessageResult;
|
|
|
import com.jpsoft.employment.modules.common.dto.Sort;
|
|
|
@@ -44,7 +46,7 @@ public class ChartApi {
|
|
|
MessageResult msgResult = new MessageResult<>();
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
|
- map.put("countXYHH", wishInfoUserRecordService.countByUser(null));
|
|
|
+ map.put("countXYHH", wishInfoUserRecordService.findByUser(null).size());
|
|
|
map.put("countXMHD", loveProjectService.countByType("1"));
|
|
|
map.put("countAXHZ", loveProjectService.countByType("2"));
|
|
|
map.put("countZYHX", loveProjectService.countByType("4"));
|
|
|
@@ -58,29 +60,52 @@ public class ChartApi {
|
|
|
|
|
|
@ApiOperation(value="我的数据统计")
|
|
|
@RequestMapping(value = "dataMyTotal",method = RequestMethod.POST)
|
|
|
- public MessageResult dataMyTotal(HttpServletRequest request){
|
|
|
+ public MessageResult dataMyTotal(String status, HttpServletRequest request){
|
|
|
MessageResult msgResult = new MessageResult<>();
|
|
|
String subject = (String)request.getAttribute("subject");
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
|
Map<String,Object> searchParams = new HashMap<>();
|
|
|
searchParams.put("regUserId",subject);
|
|
|
- searchParams.put("status","2");
|
|
|
+ if(StringUtils.isNotEmpty(status)){
|
|
|
+ searchParams.put("status",status);
|
|
|
+ }
|
|
|
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
sortList.add(new Sort("create_time","desc"));
|
|
|
|
|
|
- Page<ParticipateProjectInfo> page = participateProjectInfoService.pageSearch(searchParams,1,100,false,sortList);
|
|
|
+ Page<TasksAndProjectsDTO> page = participateProjectInfoService.pageSearchTasksAndProjects(searchParams,1,100,false,sortList);
|
|
|
+ map.put("countGood",page.getResult().size());
|
|
|
|
|
|
- Integer countWishRecord = wishInfoUserRecordService.countByUser(subject);
|
|
|
- Integer countGood = page.getResult().size();
|
|
|
-
|
|
|
- map.put("countWishRecord",countWishRecord);
|
|
|
- map.put("countGood",countGood);
|
|
|
+ List<WishInfoUserRecord> list = wishInfoUserRecordService.findByUser(subject);
|
|
|
+ map.put("countWishRecord",list.size());
|
|
|
|
|
|
msgResult.setResult(true);
|
|
|
msgResult.setData(map);
|
|
|
|
|
|
return msgResult;
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value="志愿行动列表")
|
|
|
+ @RequestMapping(value = "listZYXD",method = RequestMethod.POST)
|
|
|
+ public MessageResult listZYXD(String status, HttpServletRequest request){
|
|
|
+ MessageResult msgResult = new MessageResult<>();
|
|
|
+ String subject = (String)request.getAttribute("subject");
|
|
|
+
|
|
|
+ Map<String,Object> searchParams = new HashMap<>();
|
|
|
+ searchParams.put("regUserId",subject);
|
|
|
+ if(StringUtils.isNotEmpty(status)){
|
|
|
+ searchParams.put("status",status);
|
|
|
+ }
|
|
|
+
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("create_time","desc"));
|
|
|
+
|
|
|
+ Page<TasksAndProjectsDTO> page = participateProjectInfoService.pageSearchTasksAndProjects(searchParams,1,100,false,sortList);
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(page.getResult());
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
}
|