|  | @ -1,7 +1,9 @@
 | 
	
		
			
				|  |  | package com.yihu.jw.patient.endpoint.settings;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.patient.AccountAppealDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.patient.FeedbackDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.patient.service.settings.FeedbackService;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.base.patient.AccountAppealVO;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.base.patient.FeedbackVO;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.Envelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.ListEnvelop;
 | 
	
	
		
			
				|  | @ -14,64 +16,77 @@ import io.swagger.annotations.ApiOperation;
 | 
	
		
			
				|  |  | import io.swagger.annotations.ApiParam;
 | 
	
		
			
				|  |  | import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | import org.springframework.web.bind.annotation.*;
 | 
	
		
			
				|  |  | import org.springframework.web.multipart.MultipartFile;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import java.util.List;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | /**
 | 
	
		
			
				|  |  | *
 | 
	
		
			
				|  |  | * 意见反馈控制器
 | 
	
		
			
				|  |  | *
 | 
	
		
			
				|  |  | * @version
 | 
	
		
			
				|  |  | * <pre>
 | 
	
		
			
				|  |  |  * 意见反馈控制器
 | 
	
		
			
				|  |  |  *
 | 
	
		
			
				|  |  |  * @version <pre>
 | 
	
		
			
				|  |  |  * Author	Version		Date		Changes
 | 
	
		
			
				|  |  |  * Administrator 	1.0  		2018年11月27日 	Created
 | 
	
		
			
				|  |  |  *
 | 
	
		
			
				|  |  |  * </pre>
 | 
	
		
			
				|  |  | * @since 1.
 | 
	
		
			
				|  |  | */
 | 
	
		
			
				|  |  |  * @since 1.
 | 
	
		
			
				|  |  |  */
 | 
	
		
			
				|  |  | @RestController
 | 
	
		
			
				|  |  | @RequestMapping(value = BaseRequestMapping.Feedback.PREFIX)
 | 
	
		
			
				|  |  | @Api(value = "意见反馈管理", description = "意见反馈管理服务接口", tags = {"wlyy基础服务 - 意见反馈管理服务接口"})
 | 
	
		
			
				|  |  | public class FeedbackEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | @Autowired
 | 
	
		
			
				|  |  | private FeedbackService feedbackService;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private FeedbackService feedbackService;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | @PostMapping(value = BaseRequestMapping.Feedback.CREATE)
 | 
	
		
			
				|  |  | @ApiOperation(value = "创建")
 | 
	
		
			
				|  |  | public ObjEnvelop<FeedbackVO> create (
 | 
	
		
			
				|  |  |     @ApiParam(name = "jsonData", value = "Json数据", required = true)
 | 
	
		
			
				|  |  |     @RequestParam String jsonData) throws Exception {
 | 
	
		
			
				|  |  |     FeedbackDO feedback = toEntity(jsonData, FeedbackDO.class);
 | 
	
		
			
				|  |  |     feedback = feedbackService.save(feedback);
 | 
	
		
			
				|  |  |     return success(feedback, FeedbackVO.class);
 | 
	
		
			
				|  |  |     @PostMapping(value = BaseRequestMapping.Feedback.CREATE)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "创建")
 | 
	
		
			
				|  |  |     public ObjEnvelop<FeedbackVO> create(
 | 
	
		
			
				|  |  |             @ApiParam(name = "jsonData", value = "Json数据", required = true)
 | 
	
		
			
				|  |  |             @RequestParam String jsonData) throws Exception {
 | 
	
		
			
				|  |  |         FeedbackDO feedback = toEntity(jsonData, FeedbackDO.class);
 | 
	
		
			
				|  |  |         feedback = feedbackService.save(feedback);
 | 
	
		
			
				|  |  |         return success(feedback, FeedbackVO.class);
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @PostMapping(value = BaseRequestMapping.AccountAppeal.CREATE)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "创建反馈")
 | 
	
		
			
				|  |  |     public ObjEnvelop<FeedbackVO> create(
 | 
	
		
			
				|  |  |             @ApiParam(name = "type", value = "反馈类型", required = true)
 | 
	
		
			
				|  |  |             @RequestParam FeedbackDO.Type type,
 | 
	
		
			
				|  |  |             @ApiParam(name = "images", value = "反馈图片", required = true)
 | 
	
		
			
				|  |  |             @RequestParam List<MultipartFile> images,
 | 
	
		
			
				|  |  |             @ApiParam(name = "mobile", value = "反馈手机号", required = true)
 | 
	
		
			
				|  |  |             @RequestParam String mobile,
 | 
	
		
			
				|  |  |             @ApiParam(name = "content", value = "反馈内容", required = true)
 | 
	
		
			
				|  |  |             @RequestParam String content ) throws Exception {
 | 
	
		
			
				|  |  |         return success(feedbackService.create(type,content,mobile,images), FeedbackVO.class);
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  |     @PostMapping(value = BaseRequestMapping.Feedback.DELETE)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "删除")
 | 
	
		
			
				|  |  |     public Envelop delete(
 | 
	
		
			
				|  |  |     @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
 | 
	
		
			
				|  |  |     @RequestParam(value = "ids") String ids) {
 | 
	
		
			
				|  |  |     feedbackService.delete(ids.split(","));
 | 
	
		
			
				|  |  |     return success("删除成功");
 | 
	
		
			
				|  |  |             @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
 | 
	
		
			
				|  |  |             @RequestParam(value = "ids") String ids) {
 | 
	
		
			
				|  |  |         feedbackService.delete(ids.split(","));
 | 
	
		
			
				|  |  |         return success("删除成功");
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @PostMapping(value = BaseRequestMapping.Feedback.UPDATE)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "更新")
 | 
	
		
			
				|  |  |     public ObjEnvelop<FeedbackVO> update (
 | 
	
		
			
				|  |  |         @ApiParam(name = "jsonData", value = "Json数据", required = true)
 | 
	
		
			
				|  |  |         @RequestParam String jsonData) throws Exception {
 | 
	
		
			
				|  |  |     public ObjEnvelop<FeedbackVO> update(
 | 
	
		
			
				|  |  |             @ApiParam(name = "jsonData", value = "Json数据", required = true)
 | 
	
		
			
				|  |  |             @RequestParam String jsonData) throws Exception {
 | 
	
		
			
				|  |  |         FeedbackDO feedback = toEntity(jsonData, FeedbackDO.class);
 | 
	
		
			
				|  |  |         if (null == feedback.getId()) {
 | 
	
		
			
				|  |  |         return failed("ID不能为空", ObjEnvelop.class);
 | 
	
		
			
				|  |  |             return failed("ID不能为空", ObjEnvelop.class);
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         feedback = feedbackService.save(feedback);
 | 
	
		
			
				|  |  |         return success(feedback, FeedbackVO.class);
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         @GetMapping(value = BaseRequestMapping.Feedback.PAGE)
 | 
	
		
			
				|  |  |         @ApiOperation(value = "获取分页")
 | 
	
		
			
				|  |  |         public PageEnvelop<FeedbackVO> page (
 | 
	
		
			
				|  |  |     @GetMapping(value = BaseRequestMapping.Feedback.PAGE)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "获取分页")
 | 
	
		
			
				|  |  |     public PageEnvelop<FeedbackVO> page(
 | 
	
		
			
				|  |  |             @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
 | 
	
		
			
				|  |  |             @RequestParam(value = "fields", required = false) String fields,
 | 
	
		
			
				|  |  |             @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
 | 
	
	
		
			
				|  | @ -82,22 +97,22 @@ public ObjEnvelop<FeedbackVO> create (
 | 
	
		
			
				|  |  |             @RequestParam(value = "page") int page,
 | 
	
		
			
				|  |  |             @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
 | 
	
		
			
				|  |  |             @RequestParam(value = "size") int size) throws Exception {
 | 
	
		
			
				|  |  |             List<FeedbackDO> feedbacks = feedbackService.search(fields, filters, sorts, page, size);
 | 
	
		
			
				|  |  |                 int count = (int)feedbackService.getCount(filters);
 | 
	
		
			
				|  |  |                 return success(feedbacks, count, page, size, FeedbackVO.class);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |         List<FeedbackDO> feedbacks = feedbackService.search(fields, filters, sorts, page, size);
 | 
	
		
			
				|  |  |         int count = (int) feedbackService.getCount(filters);
 | 
	
		
			
				|  |  |         return success(feedbacks, count, page, size, FeedbackVO.class);
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |          @GetMapping(value = BaseRequestMapping.Feedback.LIST)
 | 
	
		
			
				|  |  |          @ApiOperation(value = "获取列表")
 | 
	
		
			
				|  |  |          public ListEnvelop<FeedbackVO> list (
 | 
	
		
			
				|  |  |              @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
 | 
	
		
			
				|  |  |              @RequestParam(value = "fields", required = false) String fields,
 | 
	
		
			
				|  |  |              @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
 | 
	
		
			
				|  |  |              @RequestParam(value = "filters", required = false) String filters,
 | 
	
		
			
				|  |  |              @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
 | 
	
		
			
				|  |  |              @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
 | 
	
		
			
				|  |  |              List<FeedbackDO> feedbacks = feedbackService.search(fields, filters, sorts);
 | 
	
		
			
				|  |  |                   return success(feedbacks, FeedbackVO.class);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |     @GetMapping(value = BaseRequestMapping.Feedback.LIST)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "获取列表")
 | 
	
		
			
				|  |  |     public ListEnvelop<FeedbackVO> list(
 | 
	
		
			
				|  |  |             @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
 | 
	
		
			
				|  |  |             @RequestParam(value = "fields", required = false) String fields,
 | 
	
		
			
				|  |  |             @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
 | 
	
		
			
				|  |  |             @RequestParam(value = "filters", required = false) String filters,
 | 
	
		
			
				|  |  |             @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
 | 
	
		
			
				|  |  |             @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
 | 
	
		
			
				|  |  |         List<FeedbackDO> feedbacks = feedbackService.search(fields, filters, sorts);
 | 
	
		
			
				|  |  |         return success(feedbacks, FeedbackVO.class);
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  | }
 |