humingfen пре 6 година
родитељ
комит
03479e94e2

+ 3 - 3
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/QuestionnaireManageService.java

@ -98,7 +98,7 @@ public class QuestionnaireManageService extends BaseJpaService {
     * @param serviceCode
     */
    public String saveResultAndAnswer(String patientCode, Integer labelType, String customerCode, Integer source, String jsonData, String serviceCode) {
        String url = wlyyUrl + "doctor/questionnaire/saveResultAndAnswer";
        String url = wlyyUrl + "synergy/questionnaire/saveResultAndAnswer";
        String response = "";
        Map<String, Object> params = new HashMap<>();
        params.put("labelType", labelType);
@ -125,7 +125,7 @@ public class QuestionnaireManageService extends BaseJpaService {
     * @return
     */
    public JSONObject getAnswers(String templateCode) {
        String url = wlyyUrl + "doctor/questionnaire/getAnswers?id=" + templateCode;
        String url = wlyyUrl + "synergy/questionnaire/getAnswers?id=" + templateCode;
        String  response = httpClientUtil.get(url, "UTF-8");
        JSONObject jsonObject = JSONObject.parseObject(response);
        if(jsonObject.getString("msg").equals("查询成功!")){
@ -167,7 +167,7 @@ public class QuestionnaireManageService extends BaseJpaService {
    }
    public JSONObject getQuestionnaireDetail(String surveyCode) {
        String url = wlyyUrl + "doctor/questionnaire/getQuestionnaireDetail?id=" + surveyCode;
        String url = wlyyUrl + "synergy/questionnaire/getQuestionnaireDetail?id=" + surveyCode;
        String response = httpClientUtil.get(url, "UTF-8");
        JSONObject jsonObject = JSONObject.parseObject(response);
        if(jsonObject.getString("msg").equals("查询成功")){

+ 2 - 2
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/ScreenResultManageService.java

@ -25,7 +25,7 @@ public class ScreenResultManageService {
     * @return
     */
    public JSONObject getScreenResultDetail(String code) {
        String url = wlyyUrl + "doctor/screen/getScreenResultDetail?code=" + code;
        String url = wlyyUrl + "synergy/screen/getScreenResultDetail?code=" + code;
        String response = httpClientUtil.get(url, "UTF-8");
        JSONObject jsonObject = JSONObject.parseObject(response);
        if(jsonObject.getString("msg").equals("查询成功")){
@ -40,7 +40,7 @@ public class ScreenResultManageService {
     * @return
     */
    public JSONObject getScreenDetail(String templateCode) {
        String url = wlyyUrl + "/doctor/questionnaire/getAllQuestions?surveyTemplateCode=" + templateCode;
        String url = wlyyUrl + "synergy/questionnaire/getAllQuestions?surveyTemplateCode=" + templateCode;
        String response = httpClientUtil.get(url, "UTF-8");
        JSONObject jsonObject = JSONObject.parseObject(response);
        if(jsonObject.getString("msg").equals("查询成功")){

+ 98 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/synergy/SynergyManagerController.java

@ -5,10 +5,13 @@ package com.yihu.wlyy.web.third.synergy;/**
import com.alibaba.fastjson.JSONArray;
import com.yihu.wlyy.aop.ObserverRequired;
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 io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
@ -28,6 +31,10 @@ import org.springframework.web.bind.annotation.ResponseBody;
public class SynergyManagerController extends BaseController{
    @Autowired
    private FollowUpService followUpService;
    @Autowired
    private ManagerQuestionnaireService managerQuestionnaireService;
    @Autowired
    private SurveyScreenResultService surveyScreenResultService;
    @ApiOperation("新增临时随访记录(返回ID)")
    @RequestMapping(value = "/addFollowup", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
@ -84,4 +91,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, "获取失败!");
        }
    }
}