|  | @ -0,0 +1,125 @@
 | 
	
		
			
				|  |  | package com.yihu.jw.hospital.endpoint.survey;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.survey.service.SurveyService;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.hospital.consult.WlyyHospitalSysDictVO;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.hospital.prescription.WlyyOutpatientVO;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.ListEnvelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.MixEnvelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.ObjEnvelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
 | 
	
		
			
				|  |  | import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
 | 
	
		
			
				|  |  | import io.swagger.annotations.Api;
 | 
	
		
			
				|  |  | import io.swagger.annotations.ApiOperation;
 | 
	
		
			
				|  |  | import io.swagger.annotations.ApiParam;
 | 
	
		
			
				|  |  | import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | import org.springframework.web.bind.annotation.*;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import java.util.List;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | /**
 | 
	
		
			
				|  |  |  * Created by Trick on 2019/9/10.
 | 
	
		
			
				|  |  |  */
 | 
	
		
			
				|  |  | @RestController
 | 
	
		
			
				|  |  | @RequestMapping(value = BaseHospitalRequestMapping.WlyySurvey.PREFIX)
 | 
	
		
			
				|  |  | @Api(value = "问卷调查", description = "问卷调查", tags = {"问卷调查"})
 | 
	
		
			
				|  |  | public class SurveyEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private SurveyService surveyService;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @GetMapping(value = BaseHospitalRequestMapping.WlyySurvey.findSurveyLabel)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "问题-查询字典")
 | 
	
		
			
				|  |  |     public ListEnvelop findSurveyLabel(@ApiParam(name = "name", value = "1.surveyLabel 标签;2.surveyScreenLabel 问卷类型")
 | 
	
		
			
				|  |  |                                        @RequestParam(value = "name",required = true) String name) throws Exception {
 | 
	
		
			
				|  |  |         List<WlyyHospitalSysDictVO> vos = surveyService.findSurveyLabel(name);
 | 
	
		
			
				|  |  |         return success(vos);
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @GetMapping(value = BaseHospitalRequestMapping.WlyySurvey.findSurveyQuestion)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "问题-获取问卷问题列表")
 | 
	
		
			
				|  |  |     public MixEnvelop findSurveyQuestion(@ApiParam(name = "title", value = "标题")
 | 
	
		
			
				|  |  |                                           @RequestParam(value = "title",required = false) String title,
 | 
	
		
			
				|  |  |                                          @ApiParam(name = "questionType", value = "问题类型")
 | 
	
		
			
				|  |  |                                           @RequestParam(value = "questionType",required = false)Integer questionType,
 | 
	
		
			
				|  |  |                                          @ApiParam(name = "page", value = "第几页,1开始")
 | 
	
		
			
				|  |  |                                           @RequestParam(value = "page",required = true)Integer page,
 | 
	
		
			
				|  |  |                                          @ApiParam(name = "size", value = "每页大小")
 | 
	
		
			
				|  |  |                                           @RequestParam(value = "size",required = true)Integer size) throws Exception {
 | 
	
		
			
				|  |  |         return surveyService.findSurveyQuestion(title,questionType,page,size);
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @GetMapping(value = BaseHospitalRequestMapping.WlyySurvey.findBySurveyId)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "问题-获取问卷问题详情(单条)")
 | 
	
		
			
				|  |  |     public ObjEnvelop findBySurveyId(@ApiParam(name = "surveyId", value = "问卷Id")
 | 
	
		
			
				|  |  |                                      @RequestParam(value = "surveyId",required = true) String surveyId) throws Exception {
 | 
	
		
			
				|  |  |         return success(surveyService.findBySurveyId(surveyId));
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @PostMapping(value = BaseHospitalRequestMapping.WlyySurvey.saveSurveyQuestion)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "问题-批量保存问卷问题")
 | 
	
		
			
				|  |  |     public ObjEnvelop saveSurveyQuestion(@ApiParam(name = "sqjsons", value = "问题实体列表json")
 | 
	
		
			
				|  |  |                                          @RequestParam(value = "sqjsons",required = true)String sqjsons,
 | 
	
		
			
				|  |  |                                          @ApiParam(name = "sqOptionJson", value = "选项实体列表json")
 | 
	
		
			
				|  |  |                                          @RequestParam(value = "sqOptionJson",required = false)String sqOptionJson) throws Exception {
 | 
	
		
			
				|  |  |         return success(surveyService.saveSurveyQuestion(sqjsons,sqOptionJson));
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @PostMapping(value = BaseHospitalRequestMapping.WlyySurvey.updataSurveyQuestion)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "问题-更新问题(单条)")
 | 
	
		
			
				|  |  |     public ObjEnvelop updataSurveyQuestion(@ApiParam(name = "sqjson", value = "问题实体json")
 | 
	
		
			
				|  |  |                                            @RequestParam(value = "sqjson",required = true)String sqjson,
 | 
	
		
			
				|  |  |                                            @ApiParam(name = "sqOptionJson", value = "选项实体列表json")
 | 
	
		
			
				|  |  |                                            @RequestParam(value = "sqOptionJson",required = false)String sqOptionJson) throws Exception {
 | 
	
		
			
				|  |  |         return success(surveyService.updataSurveyQuestion(sqjson,sqOptionJson));
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @PostMapping(value = BaseHospitalRequestMapping.WlyySurvey.delSurveyQuestion)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "问题-批量删除")
 | 
	
		
			
				|  |  |     public ObjEnvelop delSurveyQuestion(@ApiParam(name = "ids", value = "问题实体ID,逗号分割")
 | 
	
		
			
				|  |  |                                         @RequestParam(value = "ids",required = true)String ids) throws Exception {
 | 
	
		
			
				|  |  |         return success(surveyService.delSurveyQuestion(ids));
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @GetMapping(value = BaseHospitalRequestMapping.WlyySurvey.findSurveyTemplate)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "模板-查询模板列表")
 | 
	
		
			
				|  |  |     public MixEnvelop findSurveyTemplate(@ApiParam(name = "title", value = "标题")
 | 
	
		
			
				|  |  |                                               @RequestParam(value = "title",required = false) String title,
 | 
	
		
			
				|  |  |                                           @ApiParam(name = "label", value = "标签code")
 | 
	
		
			
				|  |  |                                               @RequestParam(value = "label",required = false)String label,
 | 
	
		
			
				|  |  |                                           @ApiParam(name = "page", value = "第几页,1开始")
 | 
	
		
			
				|  |  |                                               @RequestParam(value = "page",required = true)Integer page,
 | 
	
		
			
				|  |  |                                           @ApiParam(name = "size", value = "每页大小")
 | 
	
		
			
				|  |  |                                               @RequestParam(value = "size",required = true)Integer size) throws Exception {
 | 
	
		
			
				|  |  |         return surveyService.findSurveyTemplate( title, label, page, size);
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @GetMapping(value = BaseHospitalRequestMapping.WlyySurvey.findSurveyTemplateById)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "模板-获取模板详情(单条)")
 | 
	
		
			
				|  |  |     public ObjEnvelop findSurveyTemplateById(@ApiParam(name = "tempId", value = "模板ID")
 | 
	
		
			
				|  |  |                                              @RequestParam(value = "tempId",required = true) String tempId) throws Exception {
 | 
	
		
			
				|  |  |         return success(surveyService.findSurveyTemplateById(tempId));
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @PostMapping(value = BaseHospitalRequestMapping.WlyySurvey.saveSurveyTemplate)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "问题-批量保存问卷问题")
 | 
	
		
			
				|  |  |     public ObjEnvelop saveSurveyTemplate(@ApiParam(name = "tempJson", value = "模板实体json")
 | 
	
		
			
				|  |  |                                          @RequestParam(value = "tempJson",required = true)String tempJson,
 | 
	
		
			
				|  |  |                                          @ApiParam(name = "tempQJson", value = "模板问题列表json")
 | 
	
		
			
				|  |  |                                          @RequestParam(value = "tempQJson",required = false)String tempQJson,
 | 
	
		
			
				|  |  |                                          @ApiParam(name = "tempOpJson", value = "模板问题选项列表json")
 | 
	
		
			
				|  |  |                                          @RequestParam(value = "tempOpJson",required = false)String tempOpJson,
 | 
	
		
			
				|  |  |                                          @ApiParam(name = "labelJson", value = "模板标签json")
 | 
	
		
			
				|  |  |                                          @RequestParam(value = "labelJson",required = false)String labelJson,
 | 
	
		
			
				|  |  |                                          @ApiParam(name = "labelInspJson", value = "模板筛查标签json")
 | 
	
		
			
				|  |  |                                          @RequestParam(value = "labelInspJson",required = false)String labelInspJson) throws Exception {
 | 
	
		
			
				|  |  |         return success(surveyService.saveSurveyTemplate(tempJson,tempQJson,tempOpJson,labelJson,labelInspJson));
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @PostMapping(value = BaseHospitalRequestMapping.WlyySurvey.delSurveyTemplate)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "模板-批量删除")
 | 
	
		
			
				|  |  |     public ObjEnvelop delSurveyTemplate(@ApiParam(name = "tempId", value = "模板实体json")
 | 
	
		
			
				|  |  |                                         @RequestParam(value = "tempId",required = true)String tempId) throws Exception {
 | 
	
		
			
				|  |  |         return success(surveyService.delSurveyTemplate(tempId));
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | }
 |