Browse Source

讨论组修改

lyr 8 years ago
parent
commit
18381f55d4

+ 19 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/discussion/DoctorDiscussionGroupController.java

@ -365,6 +365,25 @@ public class DoctorDiscussionGroupController extends BaseController {
        }
    }
    /**
     * 获取查询对应的求助
     *
     * @param cosnult
     * @return
     */
    @RequestMapping(value = "/group/patient_consult", method = {RequestMethod.GET, RequestMethod.POST})
    @ResponseBody
    public String getPatientConsultTalkGroup(@RequestParam(required = true) String cosnult) {
        try {
            JSONObject group = talkGroupService.findConsultTalkGroup(cosnult);
            return write(200, "查询成功", "data", group);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取常用医生
     *

+ 40 - 40
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/ConsultController.java

@ -835,50 +835,50 @@ public class ConsultController extends WeixinBaseController {
            if (consultModel == null) {
                return error(-1, "咨询记录不存在!");
            }
            // 查询日志列表
            JSONObject json = new JSONObject();
            ConsultTeamLog log = consultTeamService.oneLog(logId);
            if (log != null) {
                json.put("id", log.getId());
                // 设置回复医生姓名
                json.put("doctorName", log.getDoctorName());
                // 设置回复内容
                json.put("content", log.getContent());
                // 设置咨询或回复时间
                json.put("time", DateUtil.dateToStr(log.getCzrq(), DateUtil.YYYY_MM_DD_HH_MM_SS));
                // 设置记录类型:1文字,2图片,3语音
                json.put("msgType", log.getChatType());
                // 设置类型:0患者问,1医生回复,2患者追问,3患者评价
                json.put("type", log.getType());
            }
//            JSONObject obj = new JSONObject();
//
//            // 查询日志列表
//            JSONObject json = new JSONObject();
//            json.put("id", obj.getInt("id"));
//            if (!obj.getString("from").equals(getUID())) {
//                Doctor doc = doctorService.findDoctorByCode(obj.getString("from"));
//                // 设置回复医生姓名
//                json.put("doctorName", doc.getName());
//            } else {
//                Patient p = patientDao.findByCode(obj.getString("from"));
//            ConsultTeamLog log = consultTeamService.oneLog(logId);
//            if (log != null) {
//                json.put("id", log.getId());
//                // 设置回复医生姓名
//                json.put("doctorName", p.getName());
//            }
//
//            // 设置回复内容
//            json.put("content", obj.getString("content"));
//            // 设置咨询或回复时间
//            json.put("time", DateUtil.dateToStr(new Date(obj.getLong("timestamp")), DateUtil.YYYY_MM_DD_HH_MM_SS));
//            // 设置记录类型:1文字,2图片,3语音
//            json.put("msgType", obj.getInt("contentType") == 2 ? 2 : 1);
//            // 设置类型:0患者问,1医生回复,2患者追问,3患者评价
//            if (!obj.getString("from").equals(getUID())) {
//                json.put("type", 1);
//            } else {
//                json.put("type", obj.getInt("contentType") == 6 ? 0 : 2);
//                json.put("doctorName", log.getDoctorName());
//                // 设置回复内容
//                json.put("content", log.getContent());
//                // 设置咨询或回复时间
//                json.put("time", DateUtil.dateToStr(log.getCzrq(), DateUtil.YYYY_MM_DD_HH_MM_SS));
//                // 设置记录类型:1文字,2图片,3语音
//                json.put("msgType", log.getChatType());
//                // 设置类型:0患者问,1医生回复,2患者追问,3患者评价
//                json.put("type", log.getType());
//            }
            JSONObject obj = new JSONObject();
            JSONObject json = new JSONObject();
            json.put("id", obj.getInt("id"));
            if (!obj.getString("from").equals(getUID())) {
                Doctor doc = doctorService.findDoctorByCode(obj.getString("from"));
                // 设置回复医生姓名
                json.put("doctorName", doc.getName());
            } else {
                Patient p = patientDao.findByCode(obj.getString("from"));
                // 设置回复医生姓名
                json.put("doctorName", p.getName());
            }
            // 设置回复内容
            json.put("content", obj.getString("content"));
            // 设置咨询或回复时间
            json.put("time", DateUtil.dateToStr(new Date(obj.getLong("timestamp")), DateUtil.YYYY_MM_DD_HH_MM_SS));
            // 设置记录类型:1文字,2图片,3语音
            json.put("msgType", obj.getInt("contentType") == 2 ? 2 : 1);
            // 设置类型:0患者问,1医生回复,2患者追问,3患者评价
            if (!obj.getString("from").equals(getUID())) {
                json.put("type", 1);
            } else {
                json.put("type", obj.getInt("contentType") == 6 ? 0 : 2);
            }
            // 返回结果
            return write(200, "查询成功", "consult", json);
        } catch (Exception e) {