zd_123 il y a 7 ans
Parent
commit
cc3d2d56a6

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

@ -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("toUser", c);
                            json.put("url","html/jkpg/html/start-survey.html?survey="+wxTemplateCode);
//                          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","html/jkpg/html/start-survey.html?survey="+wxTemplateCode);
                                        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) {