Browse Source

IM追问类型区分

wujunjie 7 years ago
parent
commit
bd3bf2c308

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

@ -21,6 +21,7 @@ import com.yihu.wlyy.service.app.scheduling.DoctorWorkTimeService;
import com.yihu.wlyy.service.app.statistics.DoctorStatisticsService;
import com.yihu.wlyy.service.app.talk.TalkGroupService;
import com.yihu.wlyy.service.common.account.DoctorService;
import com.yihu.wlyy.service.template.DoctorFeldsherTemplateService;
import com.yihu.wlyy.task.DoctorStatisticsTask;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.*;
@ -33,6 +34,8 @@ import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
@ -719,7 +722,7 @@ public class ConsultController extends WeixinBaseController {
     *
     * @param consult 咨询标识
     * @param content 追问内容
     * @param type    追问内容类型:1文字,2图片,3语音
     * @param type    追问内容类型:1文字,2图片,3语音  ... (im消息类型)
     * @return
     */
    @RequestMapping(value = "append")
@ -809,7 +812,6 @@ public class ConsultController extends WeixinBaseController {
                        String doctorOpenID = doctor.getOpenid();
                        if (StringUtils.isNotEmpty(doctorOpenID)) {
                                String title = "";
                                String repContent = "";
                                Consult consultSingle = consultDao.findByCode(log.getConsult());
                                if (consultSingle!=null){
                                    Integer singleType = consultSingle .getType();
@ -818,13 +820,7 @@ public class ConsultController extends WeixinBaseController {
                                    }else if(singleType != null && singleType !=8 ){
                                        title = consultSingle.getSymptoms();
                                    }
                                    if (type == 3){
                                        repContent = "语音消息";
                                    }else if (type == 2){
                                        repContent = "图片消息";
                                    }else {
                                        repContent = content;
                                    }
                                    String repContent = parseContentType(type+"",content);
                                    String first = "居民" +patient.getName()+"的健康咨询有新的回复。";
                                    String url = doctorAssistant + "/wlyy/feldsher/sendDoctorTemplates";
                                    List<NameValuePair> params = new ArrayList<>();
@ -1211,4 +1207,81 @@ public class ConsultController extends WeixinBaseController {
        }
    }
    /**
     * 解析contentType
     *   PlainText: 1,   // 信息
     Image: 2,       // 图片信息
     Audio: 3,       // 语音信息
     Article: 4,     // 文章信息
     GoTo: 5,        // 跳转信息,求组其他医生或者邀请其他医生发送的推送消息
     TopicBegin: 6,  // 议题开始
     TopicEnd: 7,    // 议题结束 10 11 系统发送的会话消息
     TopicInto: 14,    // 进入议题 系统发送的会话消息
     Video:12,//视频
     System:13,//系统消息
     PrescriptionCheck:15,//续方审核消息消息
     PrescriptionBloodStatus:16,//续方咨询血糖血压咨询消息
     PrescriptionFollowupContent:17,//续方咨询随访问卷消息
     * @param contentType 消息类型
     * @return
     */
    private String parseContentType(String contentType,String content) {
        String responseContent = "";
        try {
            switch (contentType) {
                case "1":
                    responseContent = content;
                    break;
                case "2":
                    responseContent = "[图片消息]";
                    break;
                case "3":
                    responseContent = "[语音消息]";
                    break;
                case "4":
                    responseContent = "[文章消息]";
                    break;
                case "5":
                    responseContent = "[跳转链接消息]";
                    break;
                case "6":
                    responseContent = content;
                    break;
                case "7":
                    responseContent = content;
                    break;
                case "10":
                    responseContent = content;
                    break;
                case "11":
                    responseContent = content;
                    break;
                case "12":
                    responseContent = "[视频消息]";
                    break;
                case "13":
                    responseContent = content;
                    break;
                case "14":
                    responseContent = content;
                    break;
                case "15":
                    responseContent = "[续方审核消息]";
                    break;
                case "16":
                    responseContent = "[体征记录咨询消息]";
                    break;
                case "17":
                    responseContent = "[随访问卷咨询消息]";
                    break;
                default:
                    responseContent = "[咨询消息]";
                    break;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return responseContent;
    }
}