LAPTOP-KB9HII50\70708 3 år sedan
förälder
incheckning
912f3cc97a

+ 6 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/consult/DoctorConsultEndpoint.java

@ -127,12 +127,16 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
                                          @ApiParam(name = "reciver_id", value = "接收人")
                                          @RequestParam(value = "reciver_id",required = true) String reciver_id,
                                          @ApiParam(name = "reciver_type", value = "接收人类型1居民 2医生")
                                          @RequestParam(value = "reciver_name",required = true) String reciver_type,
                                          @RequestParam(value = "reciver_type",required = false) String reciver_type,
                                          @ApiParam(name = "token", value = "token")
                                          @RequestParam(value = "token",required = false) String token,
                                          @ApiParam(name = "channelName", value = "房间号")
                                          @RequestParam(value = "channelName",required = false) String channelName,
                                          @ApiParam(name = "session_id", value = "会话ID",required = false)
                                          @RequestParam(value = "session_id",required = false) String session_id
    ){
        try{
            consultService.sendWeTempMesMiniProgram(sender_id,reciver_id,session_id);
            consultService.sendWeTempMesMiniProgram(sender_id,reciver_id,session_id,token,channelName);
            return success("操作成功");
        }catch (Exception e){
            return failedException2(e);

+ 5 - 3
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/consult/ConsultService.java

@ -98,19 +98,21 @@ public class ConsultService {
     * @param reciver_id 接收者ID
     * @param session_id 会话ID
     */
    public String sendWeTempMesMiniProgram(String sender_id, String reciver_id, String session_id)throws Exception {
    public String sendWeTempMesMiniProgram(String sender_id, String reciver_id, String session_id,String token,String channelName)throws Exception {
        BasePatientDO patient = basePatientDao.findById(reciver_id);
        if(patient!=null){
            BaseDoctorDO doctorDO = baseDoctorDao.findById(sender_id);
            JSONObject json = new JSONObject();
            json.put("id", reciver_id);
            json.put("nickName", patient.getName());
            json.put("token", token);
            json.put("channelName", channelName);
            String first = "【key1】您好!【key2】向您发起了视频请求";
            first = first.replace("key1",patient.getName());
            first = first.replace("key2", doctorDO.getName());
            List<BasePatientWechatDo> basePatientWechatDos = basePatientWechatDao.findByWechatIdAndPatientId(wechatId,patient.getId());
            if (basePatientWechatDos.size()>0){
                String openId = basePatientWechatDos.get(0).getOpenid();
                messageUtil.putTemplateWxMessage(wechatId,"template_consult_notice","spthtx",openId,first,null,null,2,json, DateUtil.dateToChineseDate(new Date()),"视频请求","点击接收");
                messageUtil.putTemplateWxMessage(wechatId,"template_consult_notice","spthtx",openId,first,null,null,28,json, DateUtil.dateToChineseDate(new Date()),"视频请求","点击接收");
            }
        }else{
            throw new Exception("接收者ID错误,无法找到该账号");

+ 5 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/util/MessageUtil.java

@ -243,6 +243,11 @@ public class MessageUtil {
            case 26://生日祝福
                wxTemplateConfigDO.setUrl(wxTemplateConfigDO.getUrl()+"?openid=" + openid + "&id=" + json.getString("id"));
                break;
            case 28://视频请求
                //?channelName="'&nickName=''&token=' '
                wxTemplateConfigDO.setUrl(wxTemplateConfigDO.getUrl()+"?openid=" + openid + "&channelName=" + json.getString("channelName")
                        + "&nickName=" + json.getString("nickName")+ "&token=" + json.getString("token"));
                break;
            case 30:
                //反馈通知 测试 TPbq9m0SAiVfRhXtXq17SDmYIfrJ8Whp2NpSrq9wlfI
                if(json.containsKey("consult")) {