|
@ -5,10 +5,13 @@ package com.yihu.wlyy.web.third.synergy;/**
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.yihu.wlyy.aop.ObserverRequired;
|
|
import com.yihu.wlyy.aop.ObserverRequired;
|
|
import com.yihu.wlyy.service.app.followup.FollowUpService;
|
|
import com.yihu.wlyy.service.app.followup.FollowUpService;
|
|
|
|
import com.yihu.wlyy.service.app.survey.SurveyScreenResultService;
|
|
|
|
import com.yihu.wlyy.service.survey.ManagerQuestionnaireService;
|
|
import com.yihu.wlyy.web.BaseController;
|
|
import com.yihu.wlyy.web.BaseController;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiParam;
|
|
import io.swagger.annotations.ApiParam;
|
|
|
|
import org.json.JSONObject;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.http.MediaType;
|
|
import org.springframework.http.MediaType;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
@ -28,6 +31,10 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|
public class SynergyManagerController extends BaseController{
|
|
public class SynergyManagerController extends BaseController{
|
|
@Autowired
|
|
@Autowired
|
|
private FollowUpService followUpService;
|
|
private FollowUpService followUpService;
|
|
|
|
@Autowired
|
|
|
|
private ManagerQuestionnaireService managerQuestionnaireService;
|
|
|
|
@Autowired
|
|
|
|
private SurveyScreenResultService surveyScreenResultService;
|
|
|
|
|
|
@ApiOperation("新增临时随访记录(返回ID)")
|
|
@ApiOperation("新增临时随访记录(返回ID)")
|
|
@RequestMapping(value = "/addFollowup", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/addFollowup", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
|
|
@ -101,4 +108,95 @@ public class SynergyManagerController extends BaseController{
|
|
}
|
|
}
|
|
}*/
|
|
}*/
|
|
|
|
|
|
|
|
@RequestMapping(value = "/questionnaire/saveResultAndAnswer", method = RequestMethod.POST)
|
|
|
|
@ApiOperation(value = "保存用户问卷答案")
|
|
|
|
public String saveResultAndAnswer( @ApiParam(name = "jsonData", value = "问题和答案字符串")@RequestParam(value = "jsonData") String jsonData,
|
|
|
|
@ApiParam(name = "patientCode", value = "居民code")@RequestParam(value = "patientCode")String patientCode,
|
|
|
|
@ApiParam(name = "customerCode", value = "客服code")@RequestParam(value = "customerCode")String customerCode,
|
|
|
|
@ApiParam(name = "labelType", value = "问卷标签")@RequestParam(value = "labelType")Integer labelType,
|
|
|
|
@ApiParam(name = "isAgain", value = "筛查入口(labelType=5时要填),0是第一次筛查 1是再次评估")@RequestParam(value = "isAgain", required = false)int isAgain,
|
|
|
|
@ApiParam(name = "source", value = "来源(1医生发放 2居民自我评估)")@RequestParam(value = "source")int source) {
|
|
|
|
try {
|
|
|
|
|
|
|
|
JSONObject json = new JSONObject(jsonData);
|
|
|
|
if (labelType == 5){
|
|
|
|
return write(200, "保存成功!","data",surveyScreenResultService.saveScreenResultAndAnswer(patientCode, customerCode, isAgain, source, json));
|
|
|
|
}else {
|
|
|
|
return write(200, "保存成功!", "data", managerQuestionnaireService.saveQuestionResultAndAnswer(json, patientCode, customerCode));
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
return write(-1, "保存失败!");
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 查看调查结果
|
|
|
|
*
|
|
|
|
* @param id
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
@RequestMapping(value = "/questionnaire/getAnswers", method = RequestMethod.GET)
|
|
|
|
@ApiOperation(value = "查看调查问卷结果")
|
|
|
|
@ResponseBody
|
|
|
|
public String getAnswers(
|
|
|
|
@ApiParam(value = "问卷id")
|
|
|
|
@RequestParam String id) {
|
|
|
|
try {
|
|
|
|
JSONObject jsonObject = managerQuestionnaireService.getAnswers(id);
|
|
|
|
return write(200, "查询成功!", "data", jsonObject);
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
return write(-1, "查询失败!");
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 查看问卷内容
|
|
|
|
*
|
|
|
|
* @param id
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
@RequestMapping(value = "/questionnaire/getQuestionnaireDetail", method = RequestMethod.GET)
|
|
|
|
@ApiOperation(value = "查看问卷内容")
|
|
|
|
@ResponseBody
|
|
|
|
public String getQuestionnaireDetail(
|
|
|
|
@ApiParam(value = "问卷id")
|
|
|
|
@RequestParam String id) {
|
|
|
|
try {
|
|
|
|
JSONObject jsonObject = managerQuestionnaireService.getQuestionnaireDetail(id);
|
|
|
|
return write(200, "查询成功", "data", jsonObject);
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
return write(-1, "查询失败!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@RequestMapping(value = "/questionnaire/getAllQuestions",method = RequestMethod.GET)
|
|
|
|
@ApiOperation(value = "获取所有问卷题目")
|
|
|
|
@ResponseBody
|
|
|
|
public String getAllQuestions(@ApiParam(name = "surveyTemplateCode",value = "问卷模板code")@RequestParam(value = "surveyTemplateCode",required = true)String surveyTemplateCode){
|
|
|
|
try {
|
|
|
|
JSONObject jsonObject = managerQuestionnaireService.getAllQuestions(surveyTemplateCode);
|
|
|
|
return write(200, "查询成功!", "data", jsonObject);
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
return write(-1, "查询失败!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@RequestMapping(value = "/screen/getScreenResultDetail", method = RequestMethod.GET)
|
|
|
|
@ApiOperation(value = "查看筛查结果记录详情")
|
|
|
|
@ResponseBody
|
|
|
|
public String getScreenResultDetail(@ApiParam(value = "筛查结果唯一code")@RequestParam(value = "code") String code) {
|
|
|
|
try {
|
|
|
|
return write(200, "获取成功!", "data", surveyScreenResultService.getScreenResultDetail(code));
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
return write(-1, "获取失败!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
}
|
|
}
|