|
|
@@ -1,13 +1,11 @@
|
|
|
package com.jpsoft.employment.modules.base.api;
|
|
|
|
|
|
import com.github.pagehelper.Page;
|
|
|
+import com.jpsoft.employment.modules.base.entity.FeedbackMethod;
|
|
|
import com.jpsoft.employment.modules.base.entity.LoveProject;
|
|
|
import com.jpsoft.employment.modules.base.entity.WishInfo;
|
|
|
import com.jpsoft.employment.modules.base.entity.WishInfoUserRecord;
|
|
|
-import com.jpsoft.employment.modules.base.service.LoveProjectService;
|
|
|
-import com.jpsoft.employment.modules.base.service.StudentAspirationsService;
|
|
|
-import com.jpsoft.employment.modules.base.service.WishInfoService;
|
|
|
-import com.jpsoft.employment.modules.base.service.WishInfoUserRecordService;
|
|
|
+import com.jpsoft.employment.modules.base.service.*;
|
|
|
import com.jpsoft.employment.modules.common.dto.MessageResult;
|
|
|
import com.jpsoft.employment.modules.common.dto.Sort;
|
|
|
import com.jpsoft.employment.modules.common.utils.PojoUtils;
|
|
|
@@ -40,14 +38,17 @@ public class LoveApi {
|
|
|
private StudentAspirationsService studentAspirationsService;
|
|
|
@Autowired
|
|
|
private DataDictionaryService dataDictionaryService;
|
|
|
+ @Autowired
|
|
|
+ private FeedbackMethodService feedbackMethodService;
|
|
|
|
|
|
@ApiOperation(value="项目列表")
|
|
|
@RequestMapping(value = "list",method = RequestMethod.POST)
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name="title", value="名称", required=false, paramType="query"),
|
|
|
+ @ApiImplicitParam(name="type", value="类型(1:爱心项目,2:爱心捐献,3:志愿者,4:爱心帮扶)", required=false, paramType="query"),
|
|
|
})
|
|
|
public MessageResult list(
|
|
|
- String title,
|
|
|
+ String title, String type,
|
|
|
@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize){
|
|
|
MessageResult msgResult = new MessageResult<>();
|
|
|
@@ -56,6 +57,9 @@ public class LoveApi {
|
|
|
if (StringUtils.isNotEmpty(title)) {
|
|
|
searchParams.put("title","%" + title + "%");
|
|
|
}
|
|
|
+ if (StringUtils.isNotEmpty(type)) {
|
|
|
+ searchParams.put("type",type);
|
|
|
+ }
|
|
|
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
sortList.add(new Sort("create_time","desc"));
|
|
|
@@ -69,15 +73,24 @@ public class LoveApi {
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value="项目详情")
|
|
|
- @GetMapping("edit/{id}")
|
|
|
+ @RequestMapping(value = "edit",method = RequestMethod.POST)
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name="id", value="ID", required=true, paramType="query"),
|
|
|
})
|
|
|
- public MessageResult<LoveProject> edit(@PathVariable("id") String id){
|
|
|
+ public MessageResult<LoveProject> edit(String id){
|
|
|
MessageResult<LoveProject> msgResult = new MessageResult<>();
|
|
|
|
|
|
try {
|
|
|
LoveProject loveProject = loveProjectService.get(id);
|
|
|
+ if(StringUtils.isNotEmpty(loveProject.getFeedbackMethod())){
|
|
|
+ String[] ids = loveProject.getFeedbackMethod().split(",");
|
|
|
+ List<FeedbackMethod> list = new ArrayList<>();
|
|
|
+ for(int i=0; i<ids.length; i++){
|
|
|
+ FeedbackMethod feedbackMethod = feedbackMethodService.get(ids[i]);
|
|
|
+ list.add(feedbackMethod);
|
|
|
+ }
|
|
|
+ loveProject.setFeedbackMethodList(list);
|
|
|
+ }
|
|
|
|
|
|
if (loveProject != null) {
|
|
|
msgResult.setResult(true);
|