Parcourir la source

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

chenweida il y a 8 ans
Parent
commit
dadab02fb0

+ 6 - 7
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/survey/ManagerQuestionnaireService.java

@ -108,7 +108,7 @@ public class ManagerQuestionnaireService extends BaseService {
        String str = "SELECT DISTINCT t.patient AS patient,p.name,p.openid " +
                " FROM `wlyy_sign_patient_label_info` t,wlyy_patient p " +
                " WHERE t.`patient` =  p.`code` " +
                " AND p.`openid` IS NOT NULL ";
                " AND p.`openid` IS NOT NULL  AND p.`openid`!=''  ";
        //      保存到维度详情表(不限不保存)  维度表(1性别 2疾病类型 3服务类型 4健康状况)
        if (sex != 0) {
            str += "AND(p.sex=" + sex + ")";
@ -247,7 +247,6 @@ public class ManagerQuestionnaireService extends BaseService {
        List<Map<String, Object>> patients = jdbcTemplate.queryForList(str);
        int amount = patients.size();
//        int amount = 1234;
        for (Map<String, Object> patient : patients) {
            String code = patient.get("patient").toString();
            SurveyUser user = new SurveyUser(surveyCode, code, 0, 1, new Date(), new Date());
@ -682,8 +681,8 @@ public class ManagerQuestionnaireService extends BaseService {
            int type = question.getQuestionType();
            int amount = 0;
            int[] sum = surveyStatisticsDao.findByIdAndQstId(id, qstcode);
            for (int count :sum) {
                amount+=count;
            for (int count : sum) {
                amount += count;
            }
            qst.put("amount", amount);
            qst.put("qstcode", qstcode);
@ -713,7 +712,7 @@ public class ManagerQuestionnaireService extends BaseService {
        return jsonObject;
    }
    public JSONObject getOptionsComment(String id, String questionId, String optionId,int pageNo,int pageSize) throws Exception {
    public JSONObject getOptionsComment(String id, String questionId, String optionId, int pageNo, int pageSize) throws Exception {
        JSONObject jsonObject = new JSONObject();
        SurveyQuestionnaire question = surveyQuestionnaireDao.findByIdAndQstId(id, questionId);
        Sort sort = new Sort(Sort.Direction.ASC, "createTime");
@ -725,13 +724,13 @@ public class ManagerQuestionnaireService extends BaseService {
            String option = opt.getContent();
            jsonObject.put("option", option);
//        获取同一个选项的所有回答的说明(分页?)
            Page<String> optionComment = surveyOptionAnswersDao.findByRelationCode(id, questionId, optionId,request);
            Page<String> optionComment = surveyOptionAnswersDao.findByRelationCode(id, questionId, optionId, request);
            jsonObject.put("content", optionComment.getContent());
            int amount = surveyOptionAnswersDao.findByRelationCode(id, questionId, optionId);
            jsonObject.put("amount", amount);
        } else {
//            查看问答题答案(分页?)
            Page<String> answer = surveyAnswersDao.findByRelationCode(id, questionId,request);
            Page<String> answer = surveyAnswersDao.findByRelationCode(id, questionId, request);
            jsonObject.put("content", answer.getContent());
            int amount = surveyAnswersDao.findByRelationCode(id, questionId);
            jsonObject.put("amount", amount);

+ 2 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/task/PushMsgTask.java

@ -442,7 +442,8 @@ public class PushMsgTask {
                temp.setTemplate_id(SystemConf.getInstance().getSystemProperties()
                        .getProperty("template_doctor_survey"));
//                temp.setTemplate_id("fgYiMntj1amEkE8_GLUPmAIyssUAroJrNSHqvydt-PQ");
                System.out.println("templateID=====>"+SystemConf.getInstance().getSystemProperties()
                        .getProperty("template_doctor_survey"));
                WechatTemplateData keyword1 = new WechatTemplateData();
                keyword1.setColor("#000000");
                keyword1.setValue(json.getString("keyword1"));

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

@ -180,7 +180,7 @@ public class ManagerQuestionnaireController extends WeixinBaseController {
            @ApiParam(value = "选项id")
            @RequestParam(required = false) String optionId) {
        try {
            JSONObject jsonObject = managerQuestionnaireService.getOptionsComment(id, questionId, optionId,pageNo,pageSize);
            JSONObject jsonObject = managerQuestionnaireService.getOptionsComment(id, questionId, optionId, pageNo, pageSize);
            return write(200, "查询成功!", "data", jsonObject);
        } catch (Exception e) {
            e.printStackTrace();
@ -411,28 +411,19 @@ public class ManagerQuestionnaireController extends WeixinBaseController {
            sdf.format(new Date());
            String str = "{\"remark\":\"我们将按调查最终结果,优化健康服务。\",\"keyword1\":\"调查问卷\"}";
            String accessToken = getAccessToken();
            System.out.println("accessToken=====>" + accessToken);
            JSONObject json = new JSONObject(str);
            List<String> codes = surveyUserDao.findBySurveyCodeAndStatus(code);
            for (String cod : codes) {
                Patient p = patientDao.findByCode(cod);
                String name = p.getName();
                String openId = p.getOpenid();
                System.out.println("controller=====>cod " + cod + " name " + name + " openId " + openId);
                json.put("keyword2", sdf.format(new Date()));
                json.put("toUser", cod);
                json.put("first", name + ",您好!为了给您提供更好的家庭医生健康服务,现有一份问卷需要您填写。");
                pushMsgTask.sendWeixinMessage(accessToken, 11, openId, name, json);
            }
           /* String openId = "orrOgwATDaljVunlAq_Tdx3imhYg";
            pushMsgTask.sendWeixinMessage(accessToken, 11, openId, name, json);*/
           /* String cod = "d6b8b1ebe59a4559b587326a97d9b299";
            String name = "曾国桂";
//            String openId = "o7NFZw30tpj626TGdYxzB-0RUpW8";
            String openId = "orrOgwATDaljVunlAq_Tdx3imhYg";
            System.out.println("controller=====>cod " + cod + " name " + name + " openId " + openId);
            json.put("keyword2", sdf.format(new Date()));
            json.put("toUser", cod);
            json.put("first", name + ",您好!为了给您提供更好的家庭医生健康服务,现有一份问卷需要您填写。");
            pushMsgTask.sendWeixinMessage(accessToken, 11, openId, name, json);*/
            return write(200, "发送成功!");
        } catch (Exception e) {
            e.printStackTrace();