ソースを参照

居民端保存筛查结果等

zd_123 7 年 前
コミット
f38718bc49

+ 5 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/survey/SurveyScreenResultService.java

@ -250,7 +250,7 @@ public class SurveyScreenResultService extends BaseService {
        //来自医生发放和自我评估不一样来源
        if (source==1){
            surveyScreenResult.setDoctor(doctor);
        }else {
        }/*else {
            SignFamily signFamily = signFamilyDao.findByPatient(patientCode);
            if (signFamily!=null && StringUtils.isNotEmpty(signFamily.getDoctor())){
                surveyScreenResult.setDoctor(signFamily.getDoctor());
@ -259,7 +259,7 @@ public class SurveyScreenResultService extends BaseService {
                surveyScreenResult.setDoctor(signFamily.getDoctorHealth());
            }
        }
        }*/
        surveyScreenResult.setPatientCode(patientCode);
        if (patient!=null){
            surveyScreenResult.setPatientName(patient.getName());
@ -765,9 +765,9 @@ public class SurveyScreenResultService extends BaseService {
                            openId = p.getOpenid();
                            json.put("keyword1", keyword1);
                            json.put("keyword2", sdf.format(new Date()));
                            json.put("survey", wxTemplateCode);
                            json.put("survey", wxTemplateCode+"_"+doctor);
                            json.put("toUser", c);
                            json.put("url","html/jkpg/html/start-survey.html?survey="+wxTemplateCode);
                            json.put("url","jkpg/html/start-survey.html?survey="+wxTemplateCode+"_"+doctor);
//                          String first = name + ",您好!为了给您提供更好的家庭医生健康服务,现有一份问卷需要您填写。";
                            first = templateConfig.getFirst();
                            first = first.replace("key1",(name==null?"":name));
@ -792,7 +792,7 @@ public class SurveyScreenResultService extends BaseService {
                                    if (StringUtils.isNotBlank(member.getOpenid())) {
                                        json.remove("toUser");
                                        json.put("toUser", member.getCode());
                                        json.put("url","html/jkpg/html/start-survey.html?survey="+wxTemplateCode);
                                        json.put("url","jkpg/html/start-survey.html?survey="+wxTemplateCode+"_"+doctor);
                                        json.remove("first");
                                        try {
                                            json.put("keyword1", keyword1);

+ 3 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/survey/DoctorSurveyScreenResultController.java

@ -142,6 +142,9 @@ public class DoctorSurveyScreenResultController extends WeixinBaseController {
                                    @ApiParam(value = "建议code,多个逗号隔开")@RequestParam(value = "adviceCodes") String advicCcodes,
                                    @ApiParam(value = "其他建议")@RequestParam(value = "otherAdvice",required = false) String otherAdvice) {
        try {
            if (otherAdvice.length()>200){
                return write(-1,"其他建议的字数不得超过200字");
            }
            surveyScreenResultService.updateAfterFollowing(code,advicCcodes,otherAdvice);
            return write(200, "跟踪成功!");
        } catch (Exception e) {

+ 7 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/survey/PatientQuestionnaireController.java

@ -2,7 +2,9 @@ package com.yihu.wlyy.web.patient.survey;
import com.google.gson.JsonObject;
import com.yihu.es.entity.QuestionnaireWinningESDO;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.entity.questionnaire.QuestionnaireUsers;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.repository.questionnaire.QuestionnaireUsersDao;
import com.yihu.wlyy.rest.model.common.SimpleResult;
import com.yihu.wlyy.service.app.survey.SurveyScreenResultService;
@ -47,6 +49,8 @@ public class    PatientQuestionnaireController extends BaseController {
    private SurveyScreenResultService surveyScreenResultService;
    @Autowired
    private ManagerQuestionnaireService managerQuestionnaireService;
    @Autowired
    private SignFamilyDao signFamilyDao;
    @RequestMapping(value = "getSurveySummary", method = RequestMethod.GET)
    @ApiOperation(value = "居民端获取问卷概述")
@ -171,7 +175,7 @@ public class    PatientQuestionnaireController extends BaseController {
    @ApiOperation(value = "保存用户答案")
    @ResponseBody
    public String saveAnswer( @RequestParam String jsonData,
                              @ApiParam(value = "居民code")@RequestParam(value = "patientCode")String patientCode,
                              @ApiParam(value = "医生code")@RequestParam(value = "doctorCode",required = false)String doctorCode,
                              @ApiParam(value = "问卷标签")@RequestParam(value = "labelType")int labelType,
                              @ApiParam(value = "筛查入口(labelType=5时要填),0是第一次筛查 1是再次评估")@RequestParam(value = "isAgain")int isAgain,
                              @ApiParam(value = "来源(1医生发放 2居民自我评估)")@RequestParam(value = "source")int source) {
@ -180,9 +184,9 @@ public class    PatientQuestionnaireController extends BaseController {
            JSONObject json = new JSONObject(jsonData);
            //如果是评分筛查还要保存最后记录
            if (labelType==5){
                return  write(200, "保存成功!","data",surveyScreenResultService.saveScreenResultAndAnswer(patientCode,getUID(),isAgain,source,json));
                return  write(200, "保存成功!","data",surveyScreenResultService.saveScreenResultAndAnswer(getRepUID(),doctorCode,isAgain,source,json));
            }else {
                managerQuestionnaireService.saveAnswer(patientCode, "",json);
                managerQuestionnaireService.saveAnswer(getRepUID(), "",json);
                return write(200, "保存成功!");
            }
        } catch (Exception e) {