Procházet zdrojové kódy

Merge branch 'dev' of zd_123/patient-co-management into dev

trick9191 před 7 roky
rodič
revize
50e70bdda8

+ 17 - 7
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());
@ -763,14 +763,16 @@ public class SurveyScreenResultService extends BaseService {
                            p = patientDao.findByCode(c);
                            name = p.getName();
                            openId = p.getOpenid();
                            json.put("keyword1", keyword1);
                            json.put("keyword2", sdf.format(new Date()));
                            json.put("survey", wxTemplateCode);
//                        String first = name + ",您好!为了给您提供更好的家庭医生健康服务,现有一份问卷需要您填写。";
                            json.put("survey", wxTemplateCode+"_"+doctor);
                            json.put("toUser", c);
                            json.put("url","jkpg/html/start-survey.html?survey="+wxTemplateCode+"_"+doctor);
//                          String first = name + ",您好!为了给您提供更好的家庭医生健康服务,现有一份问卷需要您填写。";
                            first = templateConfig.getFirst();
                            first = first.replace("key1",(name==null?"":name));
                            json.put("first", first);
                            json.put("remark", remark);
                            json.put("keyword1", keyword1);
                        } catch (JSONException e) {
                            continue;
                        }
@ -790,8 +792,10 @@ public class SurveyScreenResultService extends BaseService {
                                    if (StringUtils.isNotBlank(member.getOpenid())) {
                                        json.remove("toUser");
                                        json.put("toUser", member.getCode());
                                        json.put("url","jkpg/html/start-survey.html?survey="+wxTemplateCode+"_"+doctor);
                                        json.remove("first");
                                        try {
                                            json.put("keyword1", keyword1);
                                            json.put("first", weiXinOpenIdUtils.getTitleMes(p, j.getInt("relation"), p.getName()) + first);
                                        } catch (Exception e) {
                                            e.printStackTrace();
@ -807,7 +811,13 @@ public class SurveyScreenResultService extends BaseService {
        }
//       =====================================================
//     获取标签数组
        JSONArray lables = jsonStr.getJSONArray("label");
        SurveyLabelInfo surveyLabelInfo = new SurveyLabelInfo();
        surveyLabelInfo.setCode(getCode());
        surveyLabelInfo.setRelationCode(surveyCode);
        surveyLabelInfo.setUseType(useType);
        surveyLabelInfo.setLabel(Integer.parseInt(templateLabel));
        SurveyLabelInfo ss = surveyLabelInfoDao.save(surveyLabelInfo);
       /* JSONArray lables = jsonStr.getJSONArray("label");
//        标签保存到wlyy_survey_label_info
        for (Object label : lables) {
            SurveyLabelInfo surveyLabelInfo = new SurveyLabelInfo();
@ -816,7 +826,7 @@ public class SurveyScreenResultService extends BaseService {
            surveyLabelInfo.setUseType(useType);
            surveyLabelInfo.setLabel(Integer.parseInt(label.toString()));
            SurveyLabelInfo ss = surveyLabelInfoDao.save(surveyLabelInfo);
        }
        }*/
//        获取问题数组
        JSONArray questions = jsonStr.getJSONArray("questions");
        for (Object question : questions) {

+ 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) {